| 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 = true; |
Bool_t beverbose = true; |
| 127 |
const char *pamdbhost=gSystem->Getenv("PAM_DBHOST"); |
const char *pamdbhost=gSystem->Getenv("PAM_DBHOST"); |
| 128 |
const char *pamdbuser=gSystem->Getenv("PAM_DBUSER"); |
const char *pamdbuser=gSystem->Getenv("PAM_DBUSER"); |
| 129 |
const char *pamdbpsw=gSystem->Getenv("PAM_DBPSW"); |
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; |
if ( strcmp(pamdbhost,"") ) host = pamdbhost; |
| 134 |
if ( strcmp(pamdbuser,"") ) user = pamdbuser; |
if ( strcmp(pamdbuser,"") ) user = pamdbuser; |
| 135 |
if ( strcmp(pamdbpsw,"") ) psw = pamdbpsw; |
if ( strcmp(pamdbpsw,"") ) psw = pamdbpsw; |
| 493 |
// |
// |
| 494 |
if ( debug ) printf("...connected! \n\n"); |
if ( debug ) printf("...connected! \n\n"); |
| 495 |
// |
// |
| 496 |
|
stringstream myquery; |
| 497 |
|
myquery.str(""); |
| 498 |
|
myquery << "SET time_zone='+0:00'"; |
| 499 |
|
dbc->Query(myquery.str().c_str()); |
| 500 |
|
// |
| 501 |
|
// |
| 502 |
// Create LEVEL2 filename and open it in update mode |
// Create LEVEL2 filename and open it in update mode |
| 503 |
// |
// |
| 504 |
if ( filename.IsNull() ){ |
if ( filename.IsNull() ){ |
| 528 |
ItoRunInfo *runinfo = new ItoRunInfo(processFile); |
ItoRunInfo *runinfo = new ItoRunInfo(processFile); |
| 529 |
runinfo->Read(run); |
runinfo->Read(run); |
| 530 |
printf(" => ACQ_VAR_INFO = %i \n",runinfo->ACQ_VAR_INFO); |
printf(" => ACQ_VAR_INFO = %i \n",runinfo->ACQ_VAR_INFO); |
| 531 |
if ( TRK && !(runinfo->ACQ_VAR_INFO & (1 << 4)) ) throw -16; |
if ( TRK && !(runinfo->ACQ_VAR_INFO & (1 << 4)) ) DVSGN = 16; |
| 532 |
if ( TOF && !(runinfo->ACQ_VAR_INFO & (1 << 0)) ) throw -17; |
if ( TOF && !(runinfo->ACQ_VAR_INFO & (1 << 0)) ) DVSGN = 17; |
| 533 |
if ( CAL && !(runinfo->ACQ_VAR_INFO & (1 << 3)) ) throw -18; |
if ( CAL && !(runinfo->ACQ_VAR_INFO & (1 << 3)) ) DVSGN = 18; |
| 534 |
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; |
| 535 |
if ( S4 && !(runinfo->ACQ_VAR_INFO & (1 << 5)) ) throw -20; |
if ( S4 && !(runinfo->ACQ_VAR_INFO & (1 << 5)) ) DVSGN = 20; |
| 536 |
if ( ND && !(runinfo->ACQ_VAR_INFO & (1 << 9)) ) throw -21; |
if ( ND && !(runinfo->ACQ_VAR_INFO & (1 << 9)) ) DVSGN = 21; |
| 537 |
printf(" OK! start processing detector's data. \n"); |
printf(" OK! start processing detector's data. \n"); |
| 538 |
// |
// |
| 539 |
if ( TRK ) { |
if ( TRK ) { |
| 595 |
case -13: message += " Cannot create processFolder directory"; break; |
case -13: message += " Cannot create processFolder directory"; break; |
| 596 |
case -14: message += " Error querying the DB"; break; |
case -14: message += " Error querying the DB"; break; |
| 597 |
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; |
|
| 598 |
case -22: message += " Unknown input or wrong syntax in input paramters!"; break; |
case -22: message += " Unknown input or wrong syntax in input paramters!"; break; |
| 599 |
// |
// |
| 600 |
case -50: message += " GLTABLES - No entries matching GL_RUN query"; break; |
case -50: message += " GLTABLES - No entries matching GL_RUN query"; break; |
| 669 |
printf("\n"); |
printf("\n"); |
| 670 |
if ( signal < 0 ) cout << " ERROR ("<< signal << ") "<< message <<endl; |
if ( signal < 0 ) cout << " ERROR ("<< signal << ") "<< message <<endl; |
| 671 |
} |
} |
| 672 |
|
// |
| 673 |
|
switch(DVSGN){ // change message with printf!! |
| 674 |
|
case 16: printf(" No tracker in the acquisition\n"); |
| 675 |
|
case 17: printf(" No ToF in the acquisition\n"); |
| 676 |
|
case 18: printf(" No calorimeter in the acquisition\n"); |
| 677 |
|
case 19: printf(" No anticounters in the acquisition\n"); |
| 678 |
|
case 20: printf(" No S4 in the acquisition\n"); |
| 679 |
|
case 21: printf(" No neutron detector in the acquisition\n"); |
| 680 |
|
}; |
| 681 |
|
// |
| 682 |
// switch(RUNSGN){ |
// switch(RUNSGN){ |
| 683 |
// }; |
// }; |
| 684 |
switch(CALSGN){ |
switch(CALSGN){ |
| 685 |
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"); |
| 686 |
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"); |
| 687 |
}; |
}; |
| 688 |
// |
// |
| 689 |
// Close the DB connection |
// Close the DB connection |