43 |
printf("\n -c | --clean remove file if exiting with errors\n"); |
printf("\n -c | --clean remove file if exiting with errors\n"); |
44 |
printf("\n -idRun ID_RUN: ID number of the run to be processed \n"); |
printf("\n -idRun ID_RUN: ID number of the run to be processed \n"); |
45 |
printf("\n -processFile output filename [default ID_RUN.Level2.root]\n"); |
printf("\n -processFile output filename [default ID_RUN.Level2.root]\n"); |
46 |
|
printf("\n -auto | -AUTO exclude from processing detector which are NOT in the acquisition [default]\n"); |
47 |
|
printf("\n -zerofill if a detector is not in the acquisition the routine is called anyway \n"); |
48 |
|
printf("\n but all detector's data will be marked as bad\n"); |
49 |
|
printf("\n -tedious exit with error if a detector is not in the acquisition and \n"); |
50 |
|
printf("\n it has not been excluded from processing\n"); |
51 |
printf("\n -host name for the host [default = $PAM_DBHOST or mysql://localhost/pamelaprod]\n"); |
printf("\n -host name for the host [default = $PAM_DBHOST or mysql://localhost/pamelaprod]\n"); |
52 |
printf("\n -user username for the DB [default = $PAM_DBUSER or \"anonymous\"] \n"); |
printf("\n -user username for the DB [default = $PAM_DBUSER or \"anonymous\"] \n"); |
53 |
printf("\n -psw password for the DB [default = $PAM_DBPSW or \"\"]\n"); |
printf("\n -psw password for the DB [default = $PAM_DBPSW or \"\"]\n"); |
56 |
printf("\n +detector process detector; detector can be: TOF,TRK,CAL,TRG,ORB,S4,ND,AC,RUN\n"); |
printf("\n +detector process detector; detector can be: TOF,TRK,CAL,TRG,ORB,S4,ND,AC,RUN\n"); |
57 |
printf("\n -detector do not process detector (as above)\n"); |
printf("\n -detector do not process detector (as above)\n"); |
58 |
printf("\n detector options must be included in square parenthesis with spaces, for example:\n"); |
printf("\n detector options must be included in square parenthesis with spaces, for example:\n"); |
59 |
printf("\n +CAL [ --verbose -g ] +TRK [ -v --level1 ] \n"); |
printf("\n +CAL [ --verbose -g ] +TRK [ -v --level1 ] \n"); |
|
|
|
60 |
printf("\nExamples: \n"); |
printf("\nExamples: \n"); |
61 |
printf("\nStandard call: DarthVader -idRun 1085 \n"); |
printf("\nStandard call: DarthVader -idRun 1085 \n"); |
62 |
printf("\nProcess only RunInfo and Tracker (be verbose for tracker): DarthVader -idRun 1085 -all +RUN +TRK [ --verbose ] \n"); |
printf("\nProcess only RunInfo and Tracker (be verbose for tracker): DarthVader -idRun 1085 -all +RUN +TRK [ --verbose ] \n"); |
84 |
Int_t NDSGN = 0; |
Int_t NDSGN = 0; |
85 |
Int_t DVSGN = 0; |
Int_t DVSGN = 0; |
86 |
// |
// |
87 |
|
Bool_t autom = true; |
88 |
|
Bool_t zerofill = false; |
89 |
|
Bool_t tedious = false; |
90 |
Bool_t remfile = false; |
Bool_t remfile = false; |
91 |
Bool_t debug = false; |
Bool_t debug = false; |
92 |
Bool_t beverbose = true; |
Bool_t beverbose = true; |
228 |
found = true; |
found = true; |
229 |
beverbose = false; |
beverbose = false; |
230 |
}; |
}; |
|
// |
|
231 |
if ( !strcmp(inps[i],"-g") || !strcmp(inps[i],"--debug") ){ |
if ( !strcmp(inps[i],"-g") || !strcmp(inps[i],"--debug") ){ |
232 |
debug = true; |
debug = true; |
233 |
found = true; |
found = true; |
234 |
}; |
}; |
235 |
|
if ( !strcmp(inps[i],"-auto") || !strcmp(inps[i],"-AUTO") ){ |
236 |
|
autom = true; |
237 |
|
tedious = false; |
238 |
|
zerofill = false; |
239 |
|
found = true; |
240 |
|
}; |
241 |
|
if ( !strcmp(inps[i],"-zerofill") ){ |
242 |
|
tedious = false; |
243 |
|
autom = false; |
244 |
|
zerofill = true; |
245 |
|
found = true; |
246 |
|
}; |
247 |
|
if ( !strcmp(inps[i],"-tedious") ){ |
248 |
|
tedious = true; |
249 |
|
zerofill = false; |
250 |
|
autom = false; |
251 |
|
found = true; |
252 |
|
}; |
253 |
// |
// |
254 |
if ( !strcmp(inps[i],"-CAL") ) { |
if ( !strcmp(inps[i],"-CAL") ) { |
255 |
found = true; |
found = true; |
517 |
dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
518 |
if( !dbc ) throw -2; |
if( !dbc ) throw -2; |
519 |
// |
// |
520 |
bool connect = dbc->IsConnected(); |
Bool_t connect = dbc->IsConnected(); |
521 |
// |
// |
522 |
if( !connect ) throw -2; |
if( !connect ) throw -2; |
523 |
// |
// |
565 |
Int_t sgnl = runinfo->Read(run); |
Int_t sgnl = runinfo->Read(run); |
566 |
if ( sgnl != 0 ) throw -17; |
if ( sgnl != 0 ) throw -17; |
567 |
printf(" => ACQ_VAR_INFO = %i \n",runinfo->ACQ_VAR_INFO); |
printf(" => ACQ_VAR_INFO = %i \n",runinfo->ACQ_VAR_INFO); |
568 |
if ( TRK && !(runinfo->ACQ_VAR_INFO & (1 << 4)) ) DVSGN += 1; |
if ( TRK && !(runinfo->ACQ_VAR_INFO & (1 << 4)) ){ |
569 |
if ( TOF && !(runinfo->ACQ_VAR_INFO & (1 << 0)) ) DVSGN += 2; |
DVSGN += 1; |
570 |
if ( CAL && !(runinfo->ACQ_VAR_INFO & (1 << 3)) ) DVSGN += 4; |
if ( tedious ) throw -30; |
571 |
if ( AC && (!(runinfo->ACQ_VAR_INFO & (1 << 1)) || !(runinfo->ACQ_VAR_INFO & (1 << 2))) ) DVSGN += 8; |
if ( autom ){ |
572 |
if ( S4 && !(runinfo->ACQ_VAR_INFO & (1 << 5)) ) DVSGN += 16; |
TRK = 0; |
573 |
if ( ND && !(runinfo->ACQ_VAR_INFO & (1 << 9)) ) DVSGN += 32; |
printf(" TRK excluded from processing \n"); |
574 |
|
}; |
575 |
|
if ( zerofill ) printf(" TRK is not in the acquisition! \n"); |
576 |
|
}; |
577 |
|
if ( TOF && !(runinfo->ACQ_VAR_INFO & (1 << 0)) ){ |
578 |
|
DVSGN += 2; |
579 |
|
if ( tedious ) throw -31; |
580 |
|
if ( autom ){ |
581 |
|
TOF = 0; |
582 |
|
printf(" TOF excluded from processing \n"); |
583 |
|
}; |
584 |
|
if ( zerofill ) printf(" TOF is not in the acquisition! \n"); |
585 |
|
}; |
586 |
|
if ( CAL && !(runinfo->ACQ_VAR_INFO & (1 << 3)) ){ |
587 |
|
DVSGN += 4; |
588 |
|
if ( tedious ) throw -32; |
589 |
|
if ( autom ){ |
590 |
|
CAL = 0; |
591 |
|
printf(" CAL excluded from processing \n"); |
592 |
|
}; |
593 |
|
if ( zerofill ) printf(" CAL is not in the acquisition! \n"); |
594 |
|
}; |
595 |
|
if ( AC && (!(runinfo->ACQ_VAR_INFO & (1 << 1)) || !(runinfo->ACQ_VAR_INFO & (1 << 2))) ){ |
596 |
|
DVSGN += 8; |
597 |
|
if ( tedious ) throw -33; |
598 |
|
if ( autom ){ |
599 |
|
AC = 0; |
600 |
|
printf(" AC excluded from processing \n"); |
601 |
|
}; |
602 |
|
if ( zerofill ) printf(" AC is not in the acquisition! \n"); |
603 |
|
}; |
604 |
|
if ( S4 && !(runinfo->ACQ_VAR_INFO & (1 << 5)) ){ |
605 |
|
DVSGN += 16; |
606 |
|
if ( tedious ) throw -34; |
607 |
|
if ( autom ){ |
608 |
|
S4 = 0; |
609 |
|
printf(" S4 excluded from processing \n"); |
610 |
|
}; |
611 |
|
if ( zerofill ) printf(" S4 is not in the acquisition! \n"); |
612 |
|
}; |
613 |
|
if ( ND && !(runinfo->ACQ_VAR_INFO & (1 << 9)) ){ |
614 |
|
DVSGN += 32; |
615 |
|
if ( tedious ) throw -35; |
616 |
|
if ( autom ){ |
617 |
|
ND = 0; |
618 |
|
printf(" ND excluded from processing \n"); |
619 |
|
}; |
620 |
|
if ( zerofill ) printf(" ND is not in the acquisition! \n"); |
621 |
|
}; |
622 |
// |
// |
623 |
if ( !DVSGN ){ |
if ( !DVSGN ){ |
624 |
printf(" OK! Start processing detector's data. \n"); |
printf(" OK! Start processing detector's data. \n"); |
696 |
case -15: message += " Cannot open file for writing"; break; |
case -15: message += " Cannot open file for writing"; break; |
697 |
case -17: message += " Error during pre-processing"; break; |
case -17: message += " Error during pre-processing"; break; |
698 |
case -22: message += " Unknown input or wrong syntax in input paramters!"; break; |
case -22: message += " Unknown input or wrong syntax in input paramters!"; break; |
699 |
|
case -30: message += " No TRK in the acquisition"; break; |
700 |
|
case -31: message += " No TOF in the acquisition"; break; |
701 |
|
case -32: message += " No CAL in the acquisition"; break; |
702 |
|
case -33: message += " No AC in the acquisition"; break; |
703 |
|
case -34: message += " No S4 in the acquisition"; break; |
704 |
|
case -35: message += " No ND in the acquisition"; break; |
705 |
// |
// |
706 |
case -50: message += " GLTABLES - No entries matching GL_RUN query"; break; |
case -50: message += " GLTABLES - No entries matching GL_RUN query"; break; |
707 |
case -51: message += " GLTABLES - No entries matching GL_ROOT query"; break; |
case -51: message += " GLTABLES - No entries matching GL_ROOT query"; break; |
724 |
case -111: message += " CALORIMETERLEVEL2 - Corrupted calibration"; break; |
case -111: message += " CALORIMETERLEVEL2 - Corrupted calibration"; break; |
725 |
case -112: message += " CALORIMETERLEVEL2 - No physics event related to registry entry in Level0 file"; break; |
case -112: message += " CALORIMETERLEVEL2 - No physics event related to registry entry in Level0 file"; break; |
726 |
case -113: message += " CALORIMETERLEVEL2 - No tracker event related to registry entry in Level2 file"; break; |
case -113: message += " CALORIMETERLEVEL2 - No tracker event related to registry entry in Level2 file"; break; |
727 |
|
case -114: message += " CALORIMETERLEVEL2 - Help called"; break; |
728 |
|
case -115: message += " CALORIMETERLEVEL2 - No Calorimeter bad strip offline mask file"; break; |
729 |
|
case -116: message += " CALORIMETERLEVEL2 - DB connection problems"; break; |
730 |
// |
// |
731 |
case -200: message += " TRACKERLEVEL2 - LEVEL1 framework unknown (HBOOK/ROOT)"; break; |
case -200: message += " TRACKERLEVEL2 - LEVEL1 framework unknown (HBOOK/ROOT)"; break; |
732 |
case -201: message += " TRACKERLEVEL2 - LEVEL2 framework unknown (HBOOK/ROOT)"; break; |
case -201: message += " TRACKERLEVEL2 - LEVEL2 framework unknown (HBOOK/ROOT)"; break; |
749 |
case -302: message += " TOFLEVEL2 - No tracker tree in Level2 file"; break; |
case -302: message += " TOFLEVEL2 - No tracker tree in Level2 file"; break; |
750 |
case -303: message += " TOFLEVEL2 - No Tof branch in Level0 file"; break; |
case -303: message += " TOFLEVEL2 - No Tof branch in Level0 file"; break; |
751 |
case -313: message += " TOFLEVEL2 - No more tracker events in Level2 file"; break; |
case -313: message += " TOFLEVEL2 - No more tracker events in Level2 file"; break; |
752 |
|
case -314: message += " TOFLEVEL2 - DB connection problems"; break; |
753 |
// |
// |
754 |
case -401: message += " TRIGGERLEVEL2 - Cannot open file for writing"; break; |
case -401: message += " TRIGGERLEVEL2 - Cannot open file for writing"; break; |
755 |
case -402: message += " TRIGGERLEVEL2 - No Trigger branch in Level0 tree"; break; |
case -402: message += " TRIGGERLEVEL2 - No Trigger branch in Level0 tree"; break; |
756 |
|
case -403: message += " TRIGGERLEVEL2 - DB connection problems"; break; |
757 |
// |
// |
758 |
case -500: message += " S4LEVEL2 - No level2 file"; break; |
case -500: message += " S4LEVEL2 - No level2 file"; break; |
759 |
case -501: message += " S4LEVEL2 - Cannot open file for writing"; break; |
case -501: message += " S4LEVEL2 - Cannot open file for writing"; break; |
760 |
case -502: message += " S4LEVEL2 - No result from GL_S4_CALIB"; break; |
case -502: message += " S4LEVEL2 - No result from GL_S4_CALIB"; break; |
761 |
case -503: message += " S4LEVEL2 - No S4 branch in Level0 tree"; break; |
case -503: message += " S4LEVEL2 - No S4 branch in Level0 tree"; break; |
762 |
|
case -504: message += " S4LEVEL2 - DB connection problems"; break; |
763 |
// |
// |
764 |
case -600: message += " NDLEVEL2 - No level2 file"; break; |
case -600: message += " NDLEVEL2 - No level2 file"; break; |
765 |
case -601: message += " NDLEVEL2 - Cannot open file for writing"; break; |
case -601: message += " NDLEVEL2 - Cannot open file for writing"; break; |
766 |
case -603: message += " NDLEVEL2 - No S4Level2 branch in Level0 tree"; break; |
case -603: message += " NDLEVEL2 - No S4Level2 branch in Level0 tree"; break; |
767 |
|
case -604: message += " NDLEVEL2 - DB connection problems"; break; |
768 |
// |
// |
769 |
case -701: message += " NDLEVEL2 - Cannot open file for writing"; break; |
case -701: message += " ACLEVEL2 - Cannot open file for writing"; break; |
770 |
case -704: message += " NDLEVEL2 - No Anticounter branch in Level0 tree"; break; |
case -704: message += " ACLEVEL2 - No Anticounter branch in Level0 tree"; break; |
771 |
|
case -705: message += " ACLEVEL2 - DB connection problems"; break; |
772 |
// |
// |
773 |
case -800: message += " RUNINFO - No such run in the RunInfo list"; break; |
case -800: message += " RUNINFO - No such run in the RunInfo list"; break; |
774 |
case -801: message += " RUNINFO - No RunInfo tree in Level2 file"; break; |
case -801: message += " RUNINFO - No RunInfo tree in Level2 file"; break; |
777 |
case -804: message += " RUNINFO - Unknown detector"; break; |
case -804: message += " RUNINFO - Unknown detector"; break; |
778 |
case -805: message += " RUNINFO - Reprocessing data but no RunInfo tree in Level2 file"; break; |
case -805: message += " RUNINFO - Reprocessing data but no RunInfo tree in Level2 file"; break; |
779 |
case -806: message += " RUNINFO - Can not handle more than 500 runs"; break; |
case -806: message += " RUNINFO - Can not handle more than 500 runs"; break; |
780 |
// |
case -807: message += " RUNINFO - DB connection problems"; break; |
781 |
|
// |
782 |
default: message += "Unidentified error or warning"; break; |
default: message += "Unidentified error or warning"; break; |
783 |
}; |
}; |
784 |
printf("\n"); |
printf("\n"); |