--- YodaProfiler/src/YodaProfiler.cpp 2007/04/30 15:57:07 1.24 +++ YodaProfiler/src/YodaProfiler.cpp 2008/02/06 12:22:02 1.27 @@ -24,6 +24,7 @@ printf(" -v | --verbose be verbose [default]\n"); printf(" -s | --silent print nothing on STDOUT\n"); printf(" -g | --debug be very verbose [default: no]\n"); + printf(" -p | --pedantic be strict in checks, exit with error if any problem is found [default: no]\n"); printf(" -boot number CPU boot number [default = taken from VarDump]\n"); printf(" -autoboot if no VarDump found try to determine the BOOT number\n"); printf(" looking at timesync [default]\n"); @@ -32,7 +33,8 @@ printf(" -obt0 number obt at timesync (ms) [default = taken from data]\n"); printf(" -dworbit number number is the downlink orbit number (to be used with non-standard names)\n"); printf(" -static use static path inside the DB instead of symbolic names\n"); - 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"); + printf(" -gpamela shortcut to \"-clean 0 -obt0 1 -no-autoboot -dworbit 1 -static\"\n"); printf(" -clean number number in seconds after which the fragment table\n"); printf(" can be cleaned and runs validated [default = -1 do not clean],\n"); printf(" if 0 force cleaning immediatly, if negative do not clean\n"); @@ -47,7 +49,7 @@ printf(" 'same' can be used if in conjuction with -yodaFile\n"); printf(" -nofrag do not leave runs in the fragment table and look for fragments\n"); printf(" in the GL_RUN table.\n"); - printf(" -force to be used to reprocess a file or to process a file\n"); + printf(" -f | -force to be used to reprocess a file or to process a file\n"); printf(" when already validated the surroundings, it is equivalent to:\n"); printf(" -remove same -validate same -cleanfrag same -nofrag\n"); printf(" -check performs some test on the GL_RUN table to check its consistency\n"); @@ -114,6 +116,8 @@ // Bool_t check = false; // + Bool_t pedantic = false; + // Int_t i = 0; // if ( numinp > 1 ){ @@ -249,6 +253,8 @@ // if ( !strcmp(inps[i],"-f") || !strcmp(inps[i],"-force") ) force = true; // + if ( !strcmp(inps[i],"-p") || !strcmp(inps[i],"--pedantic") ) pedantic = true; + // if ( !strcmp(inps[i],"-nofrag") ) nofrag = true; // if ( !strcmp(inps[i],"-check") ) check = true; @@ -296,7 +302,7 @@ remfile = fcleanfile; validfile = fcleanfile; }; - + // const char *paml0 = gSystem->Getenv("PAM_L0"); const char *paml2 = gSystem->Getenv("PAM_L2"); const char *pamraw = gSystem->Getenv("PAM_RAW"); @@ -304,12 +310,17 @@ 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"); staticp = true; }; + // + // + GL_TABLES *glt = new GL_TABLES(host,user,password); + // if ( gpamela ){ - // -clean 0 -obt0 1 -tsync 1 -boot 1 -dworbit 1 + // // -clean 0 -obt0 1 -tsync 1 -boot 1 -dworbit 1 + // -clean 0 -obt0 1 -dworbit 1 if ( olderthan < 0LL ) olderthan = 0LL; if ( !obt0 ) obt0 = 1; - if ( !tsync ) tsync = 1; - if ( !boot ) boot = 1; + // if ( !tsync ) tsync = 1; + // if ( !boot ) boot = 1; if ( !dwinput ) dwinput = 1; staticp = true; autoboot = false; @@ -322,9 +333,6 @@ }; // // Start: - // - GL_TABLES *glt = new GL_TABLES(host,user,password); - // TString message; char *version = YodaProfilerInfo(false); PamelaDBOperations *pamDB = 0; @@ -339,12 +347,13 @@ // Create pamDB object and open SQL connection //------------------------------------------------------------------------------------------- if ( beverbose ) printf(" 1 => Initialize and open SQL connection \n"); - 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); pamDB->CheckConnection(); //------------------------------------------------------------------------------------------- // pamDB->SetNoFrag(nofrag); pamDB->SetAutoBoot(autoboot); + pamDB->SetPedantic(pedantic); // if ( remove ){ //------------------------------------------------------------------------------------------- @@ -404,7 +413,16 @@ if ( beverbose ) printf(" 7 => Insert calorimeter calibrations in the GL_CALO_CALIB table\n"); WAR[5] = pamDB->insertCALO_CALIB(); //------------------------------------------------------------------------------------------- - + + if ( !gpamela ){ + //--------------------------------------------------------------------------------------------------------------------- + //Insert in GL_CALOPULSE_CALIB calibration PULSE information records relative to a single unpack (only for real data!) + //--------------------------------------------------------------------------------------------------------------------- + if ( beverbose ) printf(" 7b => Insert calorimeter pulse calibrations in the GL_CALOPULSE_CALIB table\n"); + WAR[5] += pamDB->insertCALOPULSE_CALIB(); + //------------------------------------------------------------------------------------------- + }; + //------------------------------------------------------------------------------------------- //Insert in GL_TRK_CALIB calibration information records relative to a single unpack //------------------------------------------------------------------------------------------- @@ -508,6 +526,27 @@ case -27: message += " Cannot determine downlink orbit, wrong filename format?"; break; case -28: message += " Cannot assign a RUN ID unique number!"; break; case -29: message += " No VarDump and impossible to find a consistent BOOT number, use the -boot option to override"; break; + case -30: message += " Old database selected, no GL_CALOPULSE_CALIB table in the DB!"; break; + case -31: message += " No CalibCalPulse1 tree in Level0 file"; break; + case -32: message += " No CalibCalPulse2 tree in Level0 file"; break; + case -66: message += " PEDANTIC: REPETITION"; break; + case -67: message += " PEDANTIC: TIMESYNC ALREADY INSERTED"; break; + case -68: message += " PEDANTIC: NO TIMESYNC IN THE FILE"; break; + case -69: message += " PEDANTIC: RUN FRAGMENT ALREADY INSERTED"; break; + case -70: message += " PEDANTIC: RUN ALREADY INSERTED"; break; + case -71: message += " PEDANTIC: OVERLAPPING RUNS (FIRST)"; break; + case -72: message += " PEDANTIC: OVERLAPPING RUNS (LAST)"; break; + case -73: message += " PEDANTIC: CALO CALIB ALREADY INSERTED"; break; + case -74: message += " PEDANTIC: CALO CALIB REPEATED"; break; + case -75: message += " PEDANTIC: CALOPULSE1 CALIB ALREADY INSERTED"; break; + case -76: message += " PEDANTIC: CALOPULSE1 CALIB REPEATED"; break; + case -77: message += " PEDANTIC: CALOPULSE2 CALIB ALREADY INSERTED"; break; + case -78: message += " PEDANTIC: CALOPULSE2 CALIB REPEATED"; break; + case -79: message += " PEDANTIC: TRK1 CALIB REPEATED"; break; + case -80: message += " PEDANTIC: TRK CALIB ALREADY INSERTED"; break; + case -81: message += " PEDANTIC: S4 CALIB ALREADY INSERTED"; break; + case -82: message += " PEDANTIC: S4 CALIB REPEATED"; break; + case -83: message += " PEDANTIC: CLEANING ERROR, RUN ALREADY INSERTED IN THE GL_RUN TABLE"; break; default: message += " Unidentified error"; break; }; printf("\n");