| 22 |
#include <S4Core.h> |
#include <S4Core.h> |
| 23 |
#include <NDCore.h> |
#include <NDCore.h> |
| 24 |
#include <OrbitalInfoCore.h> |
#include <OrbitalInfoCore.h> |
| 25 |
|
#include <RunInfo.h> |
| 26 |
// |
// |
| 27 |
using namespace std; |
using namespace std; |
| 28 |
// |
// |
| 435 |
stringstream strun; |
stringstream strun; |
| 436 |
strun.str(""); |
strun.str(""); |
| 437 |
strun << run; |
strun << run; |
| 438 |
|
filename += outDir; |
| 439 |
|
filename += "/"; |
| 440 |
filename += strun.str(); |
filename += strun.str(); |
| 441 |
filename += ".Level2.root"; |
filename += ".Level2.root"; |
| 442 |
}; |
}; |
| 443 |
filename = outDir + "/" + filename; |
// filename = outDir + "/" + filename; |
| 444 |
processFile = new TFile(filename.Data(),"UPDATE"); |
processFile = new TFile(filename.Data(),"UPDATE"); |
| 445 |
if ( !processFile->IsOpen() ) throw -15; |
if ( !processFile->IsOpen() ) throw -15; |
| 446 |
// |
// |
| 451 |
RUNSGN = RunInfoCore(run,processFile,dbc,runargc,runargv); |
RUNSGN = RunInfoCore(run,processFile,dbc,runargc,runargv); |
| 452 |
printf("done\n"); |
printf("done\n"); |
| 453 |
}; |
}; |
| 454 |
|
// |
| 455 |
|
// From the Run Infos extract acq_var_info to determine if detectors are in the acquisition or not |
| 456 |
|
// |
| 457 |
|
printf(" Checking if requested detectors are in the acquisition\n"); |
| 458 |
|
ItoRunInfo *runinfo = new ItoRunInfo(processFile); |
| 459 |
|
runinfo->Read(run); |
| 460 |
|
printf(" => ACQ_VAR_INFO = %i \n",runinfo->ACQ_VAR_INFO); |
| 461 |
|
if ( TRK && !(runinfo->ACQ_VAR_INFO & (1 << 4)) ) throw -16; |
| 462 |
|
if ( TOF && !(runinfo->ACQ_VAR_INFO & (1 << 0)) ) throw -17; |
| 463 |
|
if ( CAL && !(runinfo->ACQ_VAR_INFO & (1 << 3)) ) throw -18; |
| 464 |
|
if ( AC && !(runinfo->ACQ_VAR_INFO & (1 << 1)) && !(runinfo->ACQ_VAR_INFO & (1 << 2)) ) throw -19; |
| 465 |
|
if ( S4 && !(runinfo->ACQ_VAR_INFO & (1 << 5)) ) throw -20; |
| 466 |
|
if ( ND && !(runinfo->ACQ_VAR_INFO & (1 << 9)) ) throw -21; |
| 467 |
|
printf(" OK! start processing detector's data. \n"); |
| 468 |
|
// |
| 469 |
if ( TRK ) { |
if ( TRK ) { |
| 470 |
printf(" Calling TrackerLevel2... "); |
printf(" Calling TrackerLevel2... "); |
| 471 |
TRKSGN = TrkCore(run,processFile,dbc,trkargc,trkargv); |
TRKSGN = TrkCore(run,processFile,dbc,trkargc,trkargv); |
| 520 |
case -8: message += " No Header branch in LEVEL0 Physics tree"; break; |
case -8: message += " No Header branch in LEVEL0 Physics tree"; break; |
| 521 |
case -9: message += " No Registry branch in LEVEL0 Physics tree"; break; |
case -9: message += " No Registry branch in LEVEL0 Physics tree"; break; |
| 522 |
case -11: message += " LEVEL0 Physics tree is empty"; break; |
case -11: message += " LEVEL0 Physics tree is empty"; break; |
| 523 |
case -12: message += " LEVEL2 output directory does not exists"; break; |
case -12: message += " Too few entries in the registry tree"; break; |
| 524 |
case -13: message += " Cannot create processFolder directory"; break; |
case -13: message += " Cannot create processFolder directory"; break; |
| 525 |
case -14: message += " Error querying the DB"; break; |
case -14: message += " Error querying the DB"; break; |
| 526 |
case -15: message += " Cannot open file for writing"; break; |
case -15: message += " Cannot open file for writing"; break; |
| 527 |
|
case -16: message += " No tracker in the acquisition (use -TRK to process anyway)"; break; |
| 528 |
|
case -17: message += " No ToF in the acquisition (use -TOF to process anyway)"; break; |
| 529 |
|
case -18: message += " No calorimeter in the acquisition (use -CAL to process anyway)"; break; |
| 530 |
|
case -19: message += " No anticounters in the acquisition (use -AC to process anyway)"; break; |
| 531 |
|
case -20: message += " No S4 in the acquisition (use -S4 to process anyway)"; break; |
| 532 |
|
case -21: message += " No neutron detector in the acquisition (use -ND to process anyway)"; break; |
| 533 |
// |
// |
| 534 |
case -50: message += " GLTABLES - No entries matching GL_RUN query"; break; |
case -50: message += " GLTABLES - No entries matching GL_RUN query"; break; |
| 535 |
case -51: message += " GLTABLES - No entries matching GL_ROOT query"; break; |
case -51: message += " GLTABLES - No entries matching GL_ROOT query"; break; |
| 595 |
case -802: message += " RUNINFO - Cannot open file for writing"; break; |
case -802: message += " RUNINFO - Cannot open file for writing"; break; |
| 596 |
case -803: message += " RUNINFO - Updating but no RunInfo tree in Level2 file"; break; |
case -803: message += " RUNINFO - Updating but no RunInfo tree in Level2 file"; break; |
| 597 |
case -804: message += " RUNINFO - Unknown detector"; break; |
case -804: message += " RUNINFO - Unknown detector"; break; |
| 598 |
|
case -805: message += " RUNINFO - Reprocessing data but no RunInfo tree in Level2 file"; break; |
| 599 |
// |
// |
| 600 |
default: message += "Unidentified error or warning"; break; |
default: message += "Unidentified error or warning"; break; |
| 601 |
}; |
}; |