38 |
printf("\n [-host host] [-user username] [-psw password] [+-all] [+-detector [ detector options ] ]\n"); |
printf("\n [-host host] [-user username] [-psw password] [+-all] [+-detector [ detector options ] ]\n"); |
39 |
printf("\n --version print informations about compilation and exit\n"); |
printf("\n --version print informations about compilation and exit\n"); |
40 |
printf("\n -h | --help print this help and exit \n"); |
printf("\n -h | --help print this help and exit \n"); |
41 |
printf("\n -v | --verbose be verbose [default: print nothing on STDOUT]\n"); |
printf("\n -v | --verbose be verbose [default]\n"); |
42 |
|
printf("\n -s | --silent print nothing on STDOUT]\n"); |
43 |
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"); |
44 |
printf("\n -processFile output filename [default ID_RUN.Level2.root]\n"); |
printf("\n -processFile output filename [default ID_RUN.Level2.root]\n"); |
45 |
printf("\n -host name for the host [default = mysql://localhost/pamelaprod]\n"); |
printf("\n -host name for the host [default = $PAM_DBHOST or mysql://localhost/pamelaprod]\n"); |
46 |
printf("\n -user username for the DB [default = anonymous] \n"); |
printf("\n -user username for the DB [default = $PAM_DBUSER or \"anonymous\"] \n"); |
47 |
printf("\n -psw password for the DB [default = \"\"]\n"); |
printf("\n -psw password for the DB [default = $PAM_DBPSW or \"\"]\n"); |
48 |
printf("\n +all | +ALL call all detectors software [default]\n"); |
printf("\n +all | +ALL call all detectors software [default]\n"); |
49 |
printf("\n -all | -ALL call nothing\n"); |
printf("\n -all | -ALL call nothing\n"); |
50 |
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"); |
77 |
Int_t ACSGN = 0; |
Int_t ACSGN = 0; |
78 |
Int_t S4SGN = 0; |
Int_t S4SGN = 0; |
79 |
Int_t NDSGN = 0; |
Int_t NDSGN = 0; |
80 |
|
Int_t DVSGN = 0; |
81 |
// |
// |
82 |
Bool_t debug = false; |
Bool_t debug = false; |
83 |
Bool_t beverbose = false; |
Bool_t beverbose = true; |
84 |
Bool_t givenid = false; |
Bool_t givenid = false; |
85 |
Bool_t CAL = true; |
Bool_t CAL = true; |
86 |
Bool_t TRK = true; |
Bool_t TRK = true; |
123 |
TString user = "anonymous"; |
TString user = "anonymous"; |
124 |
TString psw = ""; |
TString psw = ""; |
125 |
// |
// |
126 |
|
// |
127 |
|
const char *pamdbhost=gSystem->Getenv("PAM_DBHOST"); |
128 |
|
const char *pamdbuser=gSystem->Getenv("PAM_DBUSER"); |
129 |
|
const char *pamdbpsw=gSystem->Getenv("PAM_DBPSW"); |
130 |
|
if ( !pamdbhost ) pamdbhost = ""; |
131 |
|
if ( !pamdbuser ) pamdbuser = ""; |
132 |
|
if ( !pamdbpsw ) pamdbpsw = ""; |
133 |
|
if ( strcmp(pamdbhost,"") ) host = pamdbhost; |
134 |
|
if ( strcmp(pamdbuser,"") ) user = pamdbuser; |
135 |
|
if ( strcmp(pamdbpsw,"") ) psw = pamdbpsw; |
136 |
|
// |
137 |
|
// |
138 |
TFile *processFile = 0; |
TFile *processFile = 0; |
139 |
// |
// |
140 |
// Checking input parameters |
// Checking input parameters |
211 |
found = true; |
found = true; |
212 |
beverbose = true; |
beverbose = true; |
213 |
}; |
}; |
214 |
|
if ( !strcmp(inps[i],"-s") || !strcmp(inps[i],"--silent") ){ |
215 |
|
found = true; |
216 |
|
beverbose = false; |
217 |
|
}; |
218 |
// |
// |
219 |
if ( !strcmp(inps[i],"-g") || !strcmp(inps[i],"--debug") ){ |
if ( !strcmp(inps[i],"-g") || !strcmp(inps[i],"--debug") ){ |
220 |
debug = true; |
debug = true; |
522 |
ItoRunInfo *runinfo = new ItoRunInfo(processFile); |
ItoRunInfo *runinfo = new ItoRunInfo(processFile); |
523 |
runinfo->Read(run); |
runinfo->Read(run); |
524 |
printf(" => ACQ_VAR_INFO = %i \n",runinfo->ACQ_VAR_INFO); |
printf(" => ACQ_VAR_INFO = %i \n",runinfo->ACQ_VAR_INFO); |
525 |
if ( TRK && !(runinfo->ACQ_VAR_INFO & (1 << 4)) ) throw -16; |
if ( TRK && !(runinfo->ACQ_VAR_INFO & (1 << 4)) ) DVSGN = 16; |
526 |
if ( TOF && !(runinfo->ACQ_VAR_INFO & (1 << 0)) ) throw -17; |
if ( TOF && !(runinfo->ACQ_VAR_INFO & (1 << 0)) ) DVSGN = 17; |
527 |
if ( CAL && !(runinfo->ACQ_VAR_INFO & (1 << 3)) ) throw -18; |
if ( CAL && !(runinfo->ACQ_VAR_INFO & (1 << 3)) ) DVSGN = 18; |
528 |
if ( AC && !(runinfo->ACQ_VAR_INFO & (1 << 1)) && !(runinfo->ACQ_VAR_INFO & (1 << 2)) ) throw -19; |
if ( AC && !(runinfo->ACQ_VAR_INFO & (1 << 1)) && !(runinfo->ACQ_VAR_INFO & (1 << 2)) ) DVSGN = 19; |
529 |
if ( S4 && !(runinfo->ACQ_VAR_INFO & (1 << 5)) ) throw -20; |
if ( S4 && !(runinfo->ACQ_VAR_INFO & (1 << 5)) ) DVSGN = 20; |
530 |
if ( ND && !(runinfo->ACQ_VAR_INFO & (1 << 9)) ) throw -21; |
if ( ND && !(runinfo->ACQ_VAR_INFO & (1 << 9)) ) DVSGN = 21; |
531 |
printf(" OK! start processing detector's data. \n"); |
printf(" OK! start processing detector's data. \n"); |
532 |
// |
// |
533 |
if ( TRK ) { |
if ( TRK ) { |
534 |
printf(" Calling TrackerLevel2... "); |
printf(" Calling TrackerLevel2... "); |
535 |
TRKSGN = TrkCore(run,processFile,dbc,trkargc,trkargv); |
TRKSGN = TrkCore(run,processFile,dbc,trkargc,trkargv); |
536 |
|
gSystem->Unlink("TrackerFolder"); //patch |
537 |
printf("done\n"); |
printf("done\n"); |
538 |
}; |
}; |
539 |
if ( TOF ) { |
if ( TOF ) { |
589 |
case -13: message += " Cannot create processFolder directory"; break; |
case -13: message += " Cannot create processFolder directory"; break; |
590 |
case -14: message += " Error querying the DB"; break; |
case -14: message += " Error querying the DB"; break; |
591 |
case -15: message += " Cannot open file for writing"; break; |
case -15: message += " Cannot open file for writing"; break; |
|
case -16: message += " No tracker in the acquisition (use -TRK to process anyway)"; break; |
|
|
case -17: message += " No ToF in the acquisition (use -TOF to process anyway)"; break; |
|
|
case -18: message += " No calorimeter in the acquisition (use -CAL to process anyway)"; break; |
|
|
case -19: message += " No anticounters in the acquisition (use -AC to process anyway)"; break; |
|
|
case -20: message += " No S4 in the acquisition (use -S4 to process anyway)"; break; |
|
|
case -21: message += " No neutron detector in the acquisition (use -ND to process anyway)"; break; |
|
592 |
case -22: message += " Unknown input or wrong syntax in input paramters!"; break; |
case -22: message += " Unknown input or wrong syntax in input paramters!"; break; |
593 |
// |
// |
594 |
case -50: message += " GLTABLES - No entries matching GL_RUN query"; break; |
case -50: message += " GLTABLES - No entries matching GL_RUN query"; break; |
663 |
printf("\n"); |
printf("\n"); |
664 |
if ( signal < 0 ) cout << " ERROR ("<< signal << ") "<< message <<endl; |
if ( signal < 0 ) cout << " ERROR ("<< signal << ") "<< message <<endl; |
665 |
} |
} |
666 |
|
// |
667 |
|
switch(DVSGN){ // change message with printf!! |
668 |
|
case 16: printf(" No tracker in the acquisition\n"); |
669 |
|
case 17: printf(" No ToF in the acquisition\n"); |
670 |
|
case 18: printf(" No calorimeter in the acquisition\n"); |
671 |
|
case 19: printf(" No anticounters in the acquisition\n"); |
672 |
|
case 20: printf(" No S4 in the acquisition\n"); |
673 |
|
case 21: printf(" No neutron detector in the acquisition\n"); |
674 |
|
}; |
675 |
|
// |
676 |
// switch(RUNSGN){ |
// switch(RUNSGN){ |
677 |
// }; |
// }; |
678 |
switch(CALSGN){ |
switch(CALSGN){ |
679 |
case 100: printf("\n WARNING CALORIMETER - Data with no associated calibration\n"); break; |
case 100: printf("\n WARNING CALORIMETER - Data with no associated calibration\n"); |
680 |
case 101: printf("\n WARNING CALORIMETER - No tracks or good events in this run\n"); break; |
case 101: printf("\n WARNING CALORIMETER - No tracks or good events in this run\n"); |
681 |
}; |
}; |
682 |
// |
// |
683 |
// Close the DB connection |
// Close the DB connection |