/[PAMELA software]/chewbacca/PamOffLineSW/PacketUser.cpp
ViewVC logotype

Diff of /chewbacca/PamOffLineSW/PacketUser.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by mocchiut, Thu Feb 11 09:02:09 2010 UTC revision 1.21 by mocchiut, Tue May 15 14:04:36 2012 UTC
# Line 1  Line 1 
1  //============================================================================  //============================================================================
2  // $Id: PacketUser.cpp,v 1.17 2010/02/03 14:11:38 mocchiut Exp $  // $Id: PacketUser.cpp,v 1.20 2012/03/27 09:50:34 mocchiut Exp $
3  // Description :  // Description :
4  //============================================================================  //============================================================================
5  #include "PacketUser.h"  #include "PacketUser.h"
# Line 445  void PacketUser::setTimeSync(char* packe Line 445  void PacketUser::setTimeSync(char* packe
445      //    printf(" Pointer to Mcmd obj is %p \n",reader->GetPtr("Mcmd"));      //    printf(" Pointer to Mcmd obj is %p \n",reader->GetPtr("Mcmd"));
446    
447      UInt_t recEntries = 0;      UInt_t recEntries = 0;
448      Double_t minimum = 0.;      //    Double_t minimum = 0.;
449      Double_t maximum = 0.;      //    Double_t maximum = 0.;
450      Double_t minimum2 = 0.;      //    Double_t minimum2 = 0.;
451      Double_t maximum2 = 0.;      Double_t maximum2 = 0.;
452      UInt_t TSYNC = 0;      UInt_t TSYNC = 0;
453      UInt_t OBT = 0;      UInt_t OBT = 0;
# Line 457  void PacketUser::setTimeSync(char* packe Line 457  void PacketUser::setTimeSync(char* packe
457      pamela::McmdRecord *mcrc = 0;      pamela::McmdRecord *mcrc = 0;
458      TArrayC *mcmddata = 0;      TArrayC *mcmddata = 0;
459      //      //
460      minimum = numeric_limits<Double_t>::max();      //    minimum = numeric_limits<Double_t>::max();
461      maximum = numeric_limits<Double_t>::min();      //    maximum = numeric_limits<Double_t>::min();
462      minimum2 = numeric_limits<Double_t>::max();      //    minimum2 = numeric_limits<Double_t>::max();
463      maximum2 = numeric_limits<Double_t>::min();      maximum2 = numeric_limits<Double_t>::min();
464      //      //
465      recEntries = mc->Records->GetEntries();      recEntries = mc->Records->GetEntries();
# Line 490  void PacketUser::setTimeSync(char* packe Line 490  void PacketUser::setTimeSync(char* packe
490        };        };
491      };      };
492      //      //
493      if ( !existsts ){ // try with inclination mcmd      if ( !existsts && !obt_time_sync && !last_time_sync_info ){ // try with inclination mcmd but only if everything else fails and check that the result is good
494        //        //
495        Double_t timesync = 0.;        Double_t timesync = 0.;
496        //        //
# Line 520  void PacketUser::setTimeSync(char* packe Line 520  void PacketUser::setTimeSync(char* packe
520            mainLogUtil->logAll(msg);            mainLogUtil->logAll(msg);
521          };          };
522        };        };
523          if ( labs(labs(last_time_sync_info_prevvalue-obt_time_sync_prevvalue)-labs(TSYNC-int(OBT/1000))) > 10 ) return;
524      };      };
525      if ( !existsts ) return;      if ( !existsts ) return;
   
526      //    printf(" TIMESYNC FROM MCMD FOUND: TSYNC = %i OBT = %i \n",TSYNC,OBT);          //    printf(" TIMESYNC FROM MCMD FOUND: TSYNC = %i OBT = %i \n",TSYNC,OBT);    
527      obt_time_sync = int(OBT/1000);      obt_time_sync = int(OBT/1000);
528      last_time_sync_info = TSYNC;      last_time_sync_info = TSYNC;
# Line 812  void PacketUser::FinishGroup(char * file Line 812  void PacketUser::FinishGroup(char * file
812            mainLogUtil->logInfo(msg);            mainLogUtil->logInfo(msg);
813                        
814            //      TString qu = Form("select ID_N from ROOT_TABLE_BAD order by INSERT_TIME desc limit 1;"); //  <=========================            //      TString qu = Form("select ID_N from ROOT_TABLE_BAD order by INSERT_TIME desc limit 1;"); //  <=========================
815            TString qu = Form("select ID_N from ROOT_TABLE_BAD where FILE_NAME='%s' and PKT_NUMBER_INIT=%i and INSERTED_BY='%s';",filename,pkt_number_init,tag_value); //  <=========================            TString qu = Form("select ID_N from ROOT_TABLE_BAD where FILE_NAME='%s' and PKT_NUMBER_INIT=%lu and INSERTED_BY='%s';",filename,pkt_number_init,tag_value); //  <=========================
816            TSQLResult *result = sqlServer->Query(qu.Data());            TSQLResult *result = sqlServer->Query(qu.Data());
817            TSQLRow    *row = result->Next();            TSQLRow    *row = result->Next();
818            Int_t eid = -1;            Int_t eid = -1;

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.23