/[PAMELA software]/YodaProfiler/src/YodaProfiler.cpp
ViewVC logotype

Diff of /YodaProfiler/src/YodaProfiler.cpp

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

revision 1.21 by mocchiut, Mon Apr 30 08:52:19 2007 UTC revision 1.26 by mocchiut, Thu Oct 25 13:23:37 2007 UTC
# Line 32  void usage(){ Line 32  void usage(){
32    printf(" -obt0 number    obt at timesync (ms) [default = taken from data]\n");    printf(" -obt0 number    obt at timesync (ms) [default = taken from data]\n");
33    printf(" -dworbit number number is the downlink orbit number (to be used with non-standard names)\n");    printf(" -dworbit number number is the downlink orbit number (to be used with non-standard names)\n");
34    printf(" -static         use static path inside the DB instead of symbolic names\n");    printf(" -static         use static path inside the DB instead of symbolic names\n");
35    printf(" -gpamela        shortcut to \"-clean 0 -obt0 1 -tsync 1 -no-autoboot -boot 1 -dworbit 1 -static\"\n");    //  printf(" -gpamela        shortcut to \"-clean 0 -obt0 1 -tsync 1 -no-autoboot -boot 1 -dworbit 1 -static\"\n");
36      printf(" -gpamela        shortcut to \"-clean 0 -obt0 1 -no-autoboot -dworbit 1 -static\"\n");
37    printf(" -clean number   number in seconds after which the fragment table\n");    printf(" -clean number   number in seconds after which the fragment table\n");
38    printf("                 can be cleaned and runs validated [default = -1 do not clean],\n");    printf("                 can be cleaned and runs validated [default = -1 do not clean],\n");
39    printf("                 if 0 force cleaning immediatly, if negative do not clean\n");    printf("                 if 0 force cleaning immediatly, if negative do not clean\n");
# Line 296  int main(int numinp, char *inps[]){ Line 297  int main(int numinp, char *inps[]){
297      remfile = fcleanfile;      remfile = fcleanfile;
298      validfile = fcleanfile;      validfile = fcleanfile;
299    };    };
300      //
301    const char *paml0 = gSystem->Getenv("PAM_L0");    const char *paml0 = gSystem->Getenv("PAM_L0");
302    const char *paml2 = gSystem->Getenv("PAM_L2");    const char *paml2 = gSystem->Getenv("PAM_L2");
303    const char *pamraw = gSystem->Getenv("PAM_RAW");    const char *pamraw = gSystem->Getenv("PAM_RAW");
# Line 304  int main(int numinp, char *inps[]){ Line 305  int main(int numinp, char *inps[]){
305      printf(" WARNING: to use symbolic paths in DB you must set up PAM_L0, PAM_L2 and PAM_RAW env var!\n Using static paths\n");      printf(" WARNING: to use symbolic paths in DB you must set up PAM_L0, PAM_L2 and PAM_RAW env var!\n Using static paths\n");
306      staticp = true;      staticp = true;
307    };    };
308      //
309      //
310      GL_TABLES *glt = new GL_TABLES(host,user,password);
311      //
312    if ( gpamela ){    if ( gpamela ){
313      //    -clean 0 -obt0 1 -tsync 1 -boot 1 -dworbit 1      //    //    -clean 0 -obt0 1 -tsync 1 -boot 1 -dworbit 1
314        //    -clean 0 -obt0 1 -dworbit 1
315      if ( olderthan < 0LL ) olderthan = 0LL;      if ( olderthan < 0LL ) olderthan = 0LL;
316      if ( !obt0 ) obt0 = 1;      if ( !obt0 ) obt0 = 1;
317      if ( !tsync ) tsync = 1;      //    if ( !tsync ) tsync = 1;    
318      if ( !boot ) boot = 1;      //    if ( !boot ) boot = 1;
319      if ( !dwinput ) dwinput = 1;      if ( !dwinput ) dwinput = 1;
320      staticp = true;      staticp = true;
321      autoboot = false;      autoboot = false;
# Line 322  int main(int numinp, char *inps[]){ Line 328  int main(int numinp, char *inps[]){
328    };    };
329    //    //
330    // Start:    // Start:
   //  
   GL_TABLES *glt = new GL_TABLES(host,user,password);  
   //  
331    TString message;    TString message;
332    char *version = YodaProfilerInfo(false);    char *version = YodaProfilerInfo(false);
333    PamelaDBOperations *pamDB = 0;    PamelaDBOperations *pamDB = 0;
# Line 339  int main(int numinp, char *inps[]){ Line 342  int main(int numinp, char *inps[]){
342      // Create pamDB object and open SQL connection      // Create pamDB object and open SQL connection
343      //-------------------------------------------------------------------------------------------      //-------------------------------------------------------------------------------------------
344      if ( beverbose ) printf(" 1 => Initialize and open SQL connection \n");      if ( beverbose ) printf(" 1 => Initialize and open SQL connection \n");
345      pamDB = new PamelaDBOperations(host,user,password,filerawname,filerootname,boot,tsync,obt0,debug,tlefilename,dwinput,staticp);      pamDB = new PamelaDBOperations(host,user,password,filerawname,filerootname,boot,tsync,obt0,debug,tlefilename,dwinput,staticp,gpamela);
346      pamDB->CheckConnection();      pamDB->CheckConnection();
347      //-------------------------------------------------------------------------------------------      //-------------------------------------------------------------------------------------------
348      //      //
# Line 404  int main(int numinp, char *inps[]){ Line 407  int main(int numinp, char *inps[]){
407        if ( beverbose ) printf(" 7 => Insert calorimeter calibrations in the GL_CALO_CALIB table\n");        if ( beverbose ) printf(" 7 => Insert calorimeter calibrations in the GL_CALO_CALIB table\n");
408        WAR[5] = pamDB->insertCALO_CALIB();        WAR[5] = pamDB->insertCALO_CALIB();
409        //-------------------------------------------------------------------------------------------            //-------------------------------------------------------------------------------------------    
410            
411          if ( !gpamela ){
412            //---------------------------------------------------------------------------------------------------------------------
413            //Insert in GL_CALOPULSE_CALIB calibration PULSE information records relative to a single unpack (only for real data!)
414            //---------------------------------------------------------------------------------------------------------------------
415            if ( beverbose ) printf(" 7b => Insert calorimeter pulse calibrations in the GL_CALOPULSE_CALIB table\n");
416            WAR[5] += pamDB->insertCALOPULSE_CALIB();
417            //-------------------------------------------------------------------------------------------    
418          };
419    
420        //-------------------------------------------------------------------------------------------        //-------------------------------------------------------------------------------------------
421        //Insert in GL_TRK_CALIB calibration information records relative to a single unpack        //Insert in GL_TRK_CALIB calibration information records relative to a single unpack
422        //-------------------------------------------------------------------------------------------        //-------------------------------------------------------------------------------------------
# Line 508  int main(int numinp, char *inps[]){ Line 520  int main(int numinp, char *inps[]){
520      case -27: message += " Cannot determine downlink orbit, wrong filename format?"; break;      case -27: message += " Cannot determine downlink orbit, wrong filename format?"; break;
521      case -28: message += " Cannot assign a RUN ID unique number!"; break;      case -28: message += " Cannot assign a RUN ID unique number!"; break;
522      case -29: message += " No VarDump and impossible to find a consistent BOOT number, use the -boot option to override"; break;      case -29: message += " No VarDump and impossible to find a consistent BOOT number, use the -boot option to override"; break;
523        case -30: message += " Old database selected, no GL_CALOPULSE_CALIB table in the DB!"; break;
524        case -31: message += " No CalibCalPulse1 tree in Level0 file"; break;
525        case -32: message += " No CalibCalPulse2 tree in Level0 file"; break;
526      default: message += " Unidentified error"; break;      default: message += " Unidentified error"; break;
527      };      };
528      printf("\n");      printf("\n");
# Line 576  int main(int numinp, char *inps[]){ Line 591  int main(int numinp, char *inps[]){
591              if      ( bit == 0 ) message += "=> Inconsistent PKT/OBT sequence\n";              if      ( bit == 0 ) message += "=> Inconsistent PKT/OBT sequence\n";
592              else if ( bit == 1 ) message += "=> No physics events in the file\n";              else if ( bit == 1 ) message += "=> No physics events in the file\n";
593              else if ( bit == 2 ) message += "=> Less than 2 physics events in the file\n";              else if ( bit == 2 ) message += "=> Less than 2 physics events in the file\n";
594                else if ( bit == 3 ) message += "=> Not supported yet: run with no events, no runtrailer, no runheader\n";
595                else if ( bit == 4 ) message += "=> File with no events, no runtrailers, no runheaders\n";
596              else  message += "=> Unidentified insertPamelaRun warning\n";              else  message += "=> Unidentified insertPamelaRun warning\n";
597            };            };
598          };          };

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

  ViewVC Help
Powered by ViewVC 1.1.23