10 |
#include <TSQLServer.h> |
#include <TSQLServer.h> |
11 |
#include <TFile.h> |
#include <TFile.h> |
12 |
#include <TSystem.h> |
#include <TSystem.h> |
13 |
|
#include <TStopwatch.h> |
14 |
// |
// |
15 |
// Detector's package headers |
// Detector's package headers |
16 |
// |
// |
35 |
// |
// |
36 |
void usage(){ |
void usage(){ |
37 |
printf("\nUsage:\n"); |
printf("\nUsage:\n"); |
38 |
printf("\n DarthVader [-v | --verbose] [-h | --help] [--version] -idRun ID_RUN [-processFile filename]\n"); |
printf("\n DarthVader [ options ] -idRun ID_RUN [+-all] [+-detector [ detector options ] ] \n"); |
39 |
printf("\n [-host host] [-user username] [-psw password] [+-all] [+-detector [ detector options ] ]\n"); |
printf("\n Options are: \n"); |
40 |
printf("\n --version print informations about compilation and exit\n"); |
printf("\n --version print informations about compilation and exit\n"); |
41 |
printf("\n -h | --help print this help and exit \n"); |
printf("\n -h | --help print this help and exit \n"); |
42 |
printf("\n -v | --verbose be verbose [default]\n"); |
printf("\n -v | --verbose be verbose [default]\n"); |
43 |
printf("\n -s | --silent print nothing on STDOUT\n"); |
printf("\n -s | --silent print nothing on STDOUT\n"); |
44 |
printf("\n -c | --clean remove file if exiting with errors\n"); |
printf("\n -c | --clean remove file if exiting with errors\n"); |
45 |
printf("\n -idRun ID_RUN: ID number of the run to be processed \n"); |
printf("\n -b | --benchmark perform and print benchmark test\n"); |
46 |
printf("\n -processFile output filename [default ID_RUN.Level2.root]\n"); |
printf("\n -auto | -AUTO exclude from processing detector which are NOT in the acquisition [default]\n"); |
47 |
printf("\n -auto | -AUTO exclude from processing detector which are NOT in the acquisition [default]\n"); |
printf("\n -zerofill if a detector is not in the acquisition the routine is called anyway \n"); |
48 |
printf("\n -zerofill if a detector is not in the acquisition the routine is called anyway \n"); |
printf("\n but all detector's data will be marked as bad\n"); |
49 |
printf("\n but all detector's data will be marked as bad\n"); |
printf("\n -tedious exit with error if a detector is not in the acquisition and \n"); |
50 |
printf("\n -tedious exit with error if a detector is not in the acquisition and \n"); |
printf("\n it has not been excluded from processing\n"); |
51 |
printf("\n it has not been excluded from processing\n"); |
printf("\n -host name for the host [default = $PAM_DBHOST or mysql://localhost/pamelaprod]\n"); |
52 |
printf("\n -host name for the host [default = $PAM_DBHOST or mysql://localhost/pamelaprod]\n"); |
printf("\n -user username for the DB [default = $PAM_DBUSER or \"anonymous\"] \n"); |
53 |
printf("\n -user username for the DB [default = $PAM_DBUSER or \"anonymous\"] \n"); |
printf("\n -psw password for the DB [default = $PAM_DBPSW or \"\"]\n"); |
54 |
printf("\n -psw password for the DB [default = $PAM_DBPSW or \"\"]\n"); |
printf("\n -processFile file output filename [default ID_RUN.Level2.root]\n"); |
55 |
printf("\n +all | +ALL call all detectors software [default]\n"); |
printf("\n -idRun ID_RUN: ID number of the run to be processed \n"); |
56 |
printf("\n -all | -ALL call nothing\n"); |
printf("\n +all | +ALL call all detectors software [default]\n"); |
57 |
printf("\n +detector process detector; detector can be: TOF,TRK,CAL,TRG,ORB,S4,ND,AC,RUN\n"); |
printf("\n -all | -ALL call nothing\n"); |
58 |
printf("\n -detector do not process detector (as above)\n"); |
printf("\n +detector process detector; detector can be: TOF,TRK,CAL,TRG,ORB,S4,ND,AC,RUN\n"); |
59 |
printf("\n detector options must be included in square parenthesis with spaces, for example:\n"); |
printf("\n -detector do not process detector (as above)\n"); |
60 |
printf("\n +CAL [ --verbose -g ] +TRK [ -v --level1 ] \n"); |
printf("\n detector options must be included in square parenthesis with spaces, for example:\n"); |
61 |
|
printf("\n +CAL [ --verbose -g ] +TRK [ -v --level1 ] \n"); |
62 |
printf("\nExamples: \n"); |
printf("\nExamples: \n"); |
63 |
printf("\nStandard call: DarthVader -idRun 1085 \n"); |
printf("\nStandard call: DarthVader -idRun 1085 \n"); |
64 |
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"); |
71 |
// |
// |
72 |
// Variables booking |
// Variables booking |
73 |
// |
// |
74 |
|
// |
75 |
|
// benchmarck variables |
76 |
|
// |
77 |
|
TStopwatch timer; |
78 |
|
TStopwatch dvtimer; |
79 |
|
dvtimer.Start(kTRUE); |
80 |
|
UInt_t nevents = 0; |
81 |
|
UInt_t nruns = 0; |
82 |
|
Double_t runtime = 0.; |
83 |
|
Double_t cruntime = 0.; |
84 |
|
Double_t trktime = 0.; |
85 |
|
Double_t ctrktime = 0.; |
86 |
|
Double_t caltime = 0.; |
87 |
|
Double_t ccaltime = 0.; |
88 |
|
Double_t toftime = 0.; |
89 |
|
Double_t ctoftime = 0.; |
90 |
|
Double_t trgtime = 0.; |
91 |
|
Double_t ctrgtime = 0.; |
92 |
|
Double_t actime = 0.; |
93 |
|
Double_t cactime = 0.; |
94 |
|
Double_t s4time = 0.; |
95 |
|
Double_t cs4time = 0.; |
96 |
|
Double_t ndtime = 0.; |
97 |
|
Double_t cndtime = 0.; |
98 |
|
Double_t orbtime = 0.; |
99 |
|
Double_t corbtime = 0.; |
100 |
|
Double_t dvtime = 0.; |
101 |
|
Double_t cdvtime = 0.; |
102 |
|
// |
103 |
TString message; |
TString message; |
104 |
int nul = 0; |
int nul = 0; |
105 |
Int_t error = 0; |
Int_t error = 0; |
122 |
Bool_t debug = false; |
Bool_t debug = false; |
123 |
Bool_t beverbose = true; |
Bool_t beverbose = true; |
124 |
Bool_t givenid = false; |
Bool_t givenid = false; |
125 |
|
Bool_t bench = false; |
126 |
Bool_t CAL = true; |
Bool_t CAL = true; |
127 |
Bool_t TRK = true; |
Bool_t TRK = true; |
128 |
Bool_t TRG = true; |
Bool_t TRG = true; |
131 |
Bool_t ND = true; |
Bool_t ND = true; |
132 |
Bool_t AC = true; |
Bool_t AC = true; |
133 |
Bool_t ORB = true; |
Bool_t ORB = true; |
134 |
Bool_t RUN = true; |
Bool_t RUN = true; |
135 |
// |
// |
136 |
Int_t calargc = 0; |
Int_t calargc = 0; |
137 |
char *calargv[50]; |
char *calargv[50]; |
264 |
debug = true; |
debug = true; |
265 |
found = true; |
found = true; |
266 |
}; |
}; |
267 |
|
if ( !strcmp(inps[i],"-b") || !strcmp(inps[i],"--benchmark") ){ |
268 |
|
bench = true; |
269 |
|
found = true; |
270 |
|
}; |
271 |
if ( !strcmp(inps[i],"-auto") || !strcmp(inps[i],"-AUTO") ){ |
if ( !strcmp(inps[i],"-auto") || !strcmp(inps[i],"-AUTO") ){ |
272 |
autom = true; |
autom = true; |
273 |
tedious = false; |
tedious = false; |
553 |
dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
554 |
if( !dbc ) throw -2; |
if( !dbc ) throw -2; |
555 |
// |
// |
556 |
bool connect = dbc->IsConnected(); |
Bool_t connect = dbc->IsConnected(); |
557 |
// |
// |
558 |
if( !connect ) throw -2; |
if( !connect ) throw -2; |
559 |
// |
// |
560 |
if ( debug ) printf("...connected! \n\n"); |
if ( debug ) printf("...connected! \n\n"); |
561 |
// |
// |
562 |
|
if ( debug ) printf("\n DB INFORMATIONS:\n SQL: %s Version: %s Host %s Port %i \n\n",dbc->GetDBMS(),dbc->ServerInfo(),dbc->GetHost(),dbc->GetPort()); |
563 |
|
// |
564 |
// Use UTC in the DB |
// Use UTC in the DB |
565 |
// |
// |
566 |
stringstream myquery; |
stringstream myquery; |
585 |
// |
// |
586 |
// Run the core program, put any output error in the "error" variable |
// Run the core program, put any output error in the "error" variable |
587 |
// |
// |
588 |
printf("\n\n Pre-processing:\n\n"); |
if ( debug ) printf("\n\n Pre-processing:\n\n"); |
589 |
// |
// |
590 |
|
timer.Start(kTRUE); |
591 |
if ( RUN ) { |
if ( RUN ) { |
592 |
printf(" Retrieve, if the case, the RUN informations from the DB...\n"); |
if ( debug ) printf(" Retrieve, if the case, the RUN informations from the DB...\n"); |
593 |
printf(" RunInfo called\n"); |
printf(" RunInfo called\n"); |
594 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start RunInfoCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start RunInfoCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
595 |
RUNSGN = RunInfoCore(run,processFile,dbc,version,runargc,runargv); |
RUNSGN = RunInfoCore(run,processFile,dbc,version,runargc,runargv); |
596 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end RunInfoCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end RunInfoCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
597 |
printf(" ...done\n"); |
if ( debug ) printf(" ...done\n"); |
598 |
}; |
}; |
599 |
|
timer.Stop(); |
600 |
|
runtime = timer.RealTime(); |
601 |
|
cruntime = timer.CpuTime(); |
602 |
// |
// |
603 |
// From the Run Infos extract acq_var_info to determine if detectors are in the acquisition or not |
// From the Run Infos extract acq_var_info to determine if detectors are in the acquisition or not |
604 |
// |
// |
605 |
printf(" Checking if requested detectors are in the acquisition\n"); |
if ( debug ) printf(" Checking if requested detectors are in the acquisition\n"); |
606 |
ItoRunInfo *runinfo = new ItoRunInfo(processFile); |
ItoRunInfo *runinfo = new ItoRunInfo(processFile); |
607 |
Int_t sgnl = runinfo->Read(run); |
Int_t sgnl = runinfo->Read(run); |
608 |
if ( sgnl != 0 ) throw -17; |
if ( sgnl != 0 ) throw -17; |
609 |
printf(" => ACQ_VAR_INFO = %i \n",runinfo->ACQ_VAR_INFO); |
nevents = runinfo->GetEntries(); |
610 |
|
nruns = runinfo->GetNoRun(); |
611 |
|
if ( debug ) printf(" => ACQ_VAR_INFO = %i \n",runinfo->ACQ_VAR_INFO); |
612 |
if ( TRK && !(runinfo->ACQ_VAR_INFO & (1 << 4)) ){ |
if ( TRK && !(runinfo->ACQ_VAR_INFO & (1 << 4)) ){ |
613 |
DVSGN += 1; |
DVSGN += 1; |
614 |
if ( tedious ) throw -30; |
if ( tedious ) throw -30; |
615 |
if ( autom ){ |
if ( autom ){ |
616 |
TRK = 0; |
TRK = 0; |
617 |
printf(" TRK excluded from processing \n"); |
if ( debug ) printf(" TRK excluded from processing \n"); |
618 |
}; |
}; |
619 |
if ( zerofill ) printf(" TRK is not in the acquisition! \n"); |
if ( zerofill && debug ) printf(" TRK is not in the acquisition! \n"); |
620 |
}; |
}; |
621 |
if ( TOF && !(runinfo->ACQ_VAR_INFO & (1 << 0)) ){ |
if ( TOF && !(runinfo->ACQ_VAR_INFO & (1 << 0)) ){ |
622 |
DVSGN += 2; |
DVSGN += 2; |
623 |
if ( tedious ) throw -31; |
if ( tedious ) throw -31; |
624 |
if ( autom ){ |
if ( autom ){ |
625 |
TOF = 0; |
TOF = 0; |
626 |
printf(" TOF excluded from processing \n"); |
if ( debug ) printf(" TOF excluded from processing \n"); |
627 |
}; |
}; |
628 |
if ( zerofill ) printf(" TOF is not in the acquisition! \n"); |
if ( zerofill && debug ) printf(" TOF is not in the acquisition! \n"); |
629 |
}; |
}; |
630 |
if ( CAL && !(runinfo->ACQ_VAR_INFO & (1 << 3)) ){ |
if ( CAL && !(runinfo->ACQ_VAR_INFO & (1 << 3)) ){ |
631 |
DVSGN += 4; |
DVSGN += 4; |
632 |
if ( tedious ) throw -32; |
if ( tedious ) throw -32; |
633 |
if ( autom ){ |
if ( autom ){ |
634 |
CAL = 0; |
CAL = 0; |
635 |
printf(" CAL excluded from processing \n"); |
if ( debug ) printf(" CAL excluded from processing \n"); |
636 |
}; |
}; |
637 |
if ( zerofill ) printf(" CAL is not in the acquisition! \n"); |
if ( zerofill && debug ) printf(" CAL is not in the acquisition! \n"); |
638 |
}; |
}; |
639 |
if ( AC && (!(runinfo->ACQ_VAR_INFO & (1 << 1)) || !(runinfo->ACQ_VAR_INFO & (1 << 2))) ){ |
if ( AC && (!(runinfo->ACQ_VAR_INFO & (1 << 1)) || !(runinfo->ACQ_VAR_INFO & (1 << 2))) ){ |
640 |
DVSGN += 8; |
DVSGN += 8; |
641 |
if ( tedious ) throw -33; |
if ( tedious ) throw -33; |
642 |
if ( autom ){ |
if ( autom ){ |
643 |
AC = 0; |
AC = 0; |
644 |
printf(" AC excluded from processing \n"); |
if ( debug ) printf(" AC excluded from processing \n"); |
645 |
}; |
}; |
646 |
if ( zerofill ) printf(" AC is not in the acquisition! \n"); |
if ( zerofill && debug ) printf(" AC is not in the acquisition! \n"); |
647 |
}; |
}; |
648 |
if ( S4 && !(runinfo->ACQ_VAR_INFO & (1 << 5)) ){ |
if ( S4 && !(runinfo->ACQ_VAR_INFO & (1 << 5)) ){ |
649 |
DVSGN += 16; |
DVSGN += 16; |
650 |
if ( tedious ) throw -34; |
if ( tedious ) throw -34; |
651 |
if ( autom ){ |
if ( autom ){ |
652 |
S4 = 0; |
S4 = 0; |
653 |
printf(" S4 excluded from processing \n"); |
if ( debug ) printf(" S4 excluded from processing \n"); |
654 |
}; |
}; |
655 |
if ( zerofill ) printf(" S4 is not in the acquisition! \n"); |
if ( zerofill && debug ) printf(" S4 is not in the acquisition! \n"); |
656 |
}; |
}; |
657 |
if ( ND && !(runinfo->ACQ_VAR_INFO & (1 << 9)) ){ |
if ( ND && !(runinfo->ACQ_VAR_INFO & (1 << 9)) ){ |
658 |
DVSGN += 32; |
DVSGN += 32; |
659 |
if ( tedious ) throw -35; |
if ( tedious ) throw -35; |
660 |
if ( autom ){ |
if ( autom ){ |
661 |
ND = 0; |
ND = 0; |
662 |
printf(" ND excluded from processing \n"); |
if ( debug ) printf(" ND excluded from processing \n"); |
663 |
}; |
}; |
664 |
if ( zerofill ) printf(" ND is not in the acquisition! \n"); |
if ( zerofill && debug ) printf(" ND is not in the acquisition! \n"); |
665 |
}; |
}; |
666 |
// |
// |
667 |
if ( !DVSGN ){ |
if ( !DVSGN ){ |
668 |
printf(" OK! Start processing detector's data. \n"); |
if ( debug ) printf(" OK! Start processing detector's data. \n"); |
669 |
} else { |
} else { |
670 |
printf(" WARNING! missing detector(s)! Start anyway processing detector's data. \n"); |
if ( debug ) printf(" WARNING! missing detector(s)! Start anyway processing detector's data. \n"); |
671 |
}; |
}; |
672 |
printf("\n End pre-processing \n\n"); |
if ( debug ) printf("\n End pre-processing \n\n"); |
673 |
// |
// |
674 |
|
timer.Start(kTRUE); |
675 |
if ( TRK ) { |
if ( TRK ) { |
676 |
printf(" TrackerLevel2 called\n"); |
printf(" TrackerLevel2 called\n"); |
677 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start TrkCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start TrkCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
679 |
gSystem->Unlink("TrackerFolder"); //patch |
gSystem->Unlink("TrackerFolder"); //patch |
680 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end TrkCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end TrkCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
681 |
}; |
}; |
682 |
|
timer.Stop(); |
683 |
|
trktime = timer.RealTime(); |
684 |
|
ctrktime = timer.CpuTime(); |
685 |
|
// |
686 |
|
timer.Start(kTRUE); |
687 |
if ( TOF ) { |
if ( TOF ) { |
688 |
printf(" ToFLevel2 called\n"); |
printf(" ToFLevel2 called\n"); |
689 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start ToFCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start ToFCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
690 |
TOFSGN = ToFCore(run,processFile,dbc,tofargc,tofargv); |
TOFSGN = ToFCore(run,processFile,dbc,tofargc,tofargv); |
691 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end ToFCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end ToFCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
692 |
}; |
}; |
693 |
|
timer.Stop(); |
694 |
|
toftime = timer.RealTime(); |
695 |
|
ctoftime = timer.CpuTime(); |
696 |
|
// |
697 |
|
timer.Start(kTRUE); |
698 |
if ( CAL ) { |
if ( CAL ) { |
699 |
printf(" CalorimeterLevel2 called\n"); |
printf(" CalorimeterLevel2 called\n"); |
700 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start CaloCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start CaloCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
701 |
CALSGN = CaloCore(run,processFile,dbc,calargc,calargv); |
CALSGN = CaloCore(run,processFile,dbc,calargc,calargv); |
702 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end CaloCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end CaloCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
703 |
}; |
}; |
704 |
|
timer.Stop(); |
705 |
|
caltime = timer.RealTime(); |
706 |
|
ccaltime = timer.CpuTime(); |
707 |
|
// |
708 |
|
timer.Start(kTRUE); |
709 |
if ( TRG ) { |
if ( TRG ) { |
710 |
printf(" TriggerLevel2 called\n"); |
printf(" TriggerLevel2 called\n"); |
711 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start TrigCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start TrigCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
712 |
TRGSGN = TrigCore(run,processFile,dbc,trgargc,trgargv); |
TRGSGN = TrigCore(run,processFile,dbc,trgargc,trgargv); |
713 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end TrigCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end TrigCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
714 |
}; |
}; |
715 |
|
timer.Stop(); |
716 |
|
trgtime = timer.RealTime(); |
717 |
|
ctrgtime = timer.CpuTime(); |
718 |
|
// |
719 |
|
timer.Start(kTRUE); |
720 |
if ( AC ) { |
if ( AC ) { |
721 |
printf(" AnticounterLevel2 called\n"); |
printf(" AnticounterLevel2 called\n"); |
722 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start AcCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start AcCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
723 |
ACSGN = AcCore(run,processFile,dbc,acargc,acargv); |
ACSGN = AcCore(run,processFile,dbc,acargc,acargv); |
724 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end AcCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end AcCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
725 |
}; |
}; |
726 |
|
timer.Stop(); |
727 |
|
actime = timer.RealTime(); |
728 |
|
cactime = timer.CpuTime(); |
729 |
|
// |
730 |
|
timer.Start(kTRUE); |
731 |
if ( S4 ) { |
if ( S4 ) { |
732 |
printf(" S4Level2 called\n"); |
printf(" S4Level2 called\n"); |
733 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start S4Core STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start S4Core STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
734 |
S4SGN = S4Core(run,processFile,dbc,s4argc,s4argv); |
S4SGN = S4Core(run,processFile,dbc,s4argc,s4argv); |
735 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end S4Core STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end S4Core STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
736 |
}; |
}; |
737 |
|
timer.Stop(); |
738 |
|
s4time = timer.RealTime(); |
739 |
|
cs4time = timer.CpuTime(); |
740 |
|
// |
741 |
|
timer.Start(kTRUE); |
742 |
if ( ND ) { |
if ( ND ) { |
743 |
printf(" NDLevel2 called\n"); |
printf(" NDLevel2 called\n"); |
744 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start NDCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start NDCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
745 |
NDSGN = NDCore(run,processFile,dbc,ndargc,ndargv); |
NDSGN = NDCore(run,processFile,dbc,ndargc,ndargv); |
746 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end NDCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end NDCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
747 |
}; |
}; |
748 |
|
timer.Stop(); |
749 |
|
ndtime = timer.RealTime(); |
750 |
|
cndtime = timer.CpuTime(); |
751 |
|
// |
752 |
|
timer.Start(kTRUE); |
753 |
if ( ORB ) { |
if ( ORB ) { |
754 |
printf(" OrbitalInfo called\n"); |
printf(" OrbitalInfo called\n"); |
755 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start OrbitalInfoCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| start OrbitalInfoCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
756 |
ORBSGN = OrbitalInfoCore(run,processFile,dbc,orbargc,orbargv); |
ORBSGN = OrbitalInfoCore(run,processFile,dbc,orbargc,orbargv); |
757 |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end OrbitalInfoCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
if ( debug ) printf(" >>>>>>>>>>>>>>>>>>>| end OrbitalInfoCore STDOUT |<<<<<<<<<<<<<<<<<<<\n"); |
758 |
}; |
}; |
759 |
|
timer.Stop(); |
760 |
|
orbtime = timer.RealTime(); |
761 |
|
corbtime = timer.CpuTime(); |
762 |
// |
// |
763 |
} catch(Int_t signal) { |
} catch(Int_t signal) { |
764 |
error = signal; |
error = signal; |
809 |
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; |
810 |
case -114: message += " CALORIMETERLEVEL2 - Help called"; break; |
case -114: message += " CALORIMETERLEVEL2 - Help called"; break; |
811 |
case -115: message += " CALORIMETERLEVEL2 - No Calorimeter bad strip offline mask file"; break; |
case -115: message += " CALORIMETERLEVEL2 - No Calorimeter bad strip offline mask file"; break; |
812 |
|
case -116: message += " CALORIMETERLEVEL2 - DB connection problems"; break; |
813 |
|
case -117: message += " CALORIMETERLEVEL2 - Cannot reprocess file with Level1 data without calling Level1 routine"; break; |
814 |
|
case -118: message += " CALORIMETERLEVEL2 - Cannot reprocess file without Level1 data calling Level1 routine"; break; |
815 |
// |
// |
816 |
case -200: message += " TRACKERLEVEL2 - LEVEL1 framework unknown (HBOOK/ROOT)"; break; |
case -200: message += " TRACKERLEVEL2 - LEVEL1 framework unknown (HBOOK/ROOT)"; break; |
817 |
case -201: message += " TRACKERLEVEL2 - LEVEL2 framework unknown (HBOOK/ROOT)"; break; |
case -201: message += " TRACKERLEVEL2 - LEVEL2 framework unknown (HBOOK/ROOT)"; break; |
834 |
case -302: message += " TOFLEVEL2 - No tracker tree in Level2 file"; break; |
case -302: message += " TOFLEVEL2 - No tracker tree in Level2 file"; break; |
835 |
case -303: message += " TOFLEVEL2 - No Tof branch in Level0 file"; break; |
case -303: message += " TOFLEVEL2 - No Tof branch in Level0 file"; break; |
836 |
case -313: message += " TOFLEVEL2 - No more tracker events in Level2 file"; break; |
case -313: message += " TOFLEVEL2 - No more tracker events in Level2 file"; break; |
837 |
|
case -314: message += " TOFLEVEL2 - DB connection problems"; break; |
838 |
// |
// |
839 |
case -401: message += " TRIGGERLEVEL2 - Cannot open file for writing"; break; |
case -401: message += " TRIGGERLEVEL2 - Cannot open file for writing"; break; |
840 |
case -402: message += " TRIGGERLEVEL2 - No Trigger branch in Level0 tree"; break; |
case -402: message += " TRIGGERLEVEL2 - No Trigger branch in Level0 tree"; break; |
841 |
|
case -403: message += " TRIGGERLEVEL2 - DB connection problems"; break; |
842 |
// |
// |
843 |
case -500: message += " S4LEVEL2 - No level2 file"; break; |
case -500: message += " S4LEVEL2 - No level2 file"; break; |
844 |
case -501: message += " S4LEVEL2 - Cannot open file for writing"; break; |
case -501: message += " S4LEVEL2 - Cannot open file for writing"; break; |
845 |
case -502: message += " S4LEVEL2 - No result from GL_S4_CALIB"; break; |
case -502: message += " S4LEVEL2 - No result from GL_S4_CALIB"; break; |
846 |
case -503: message += " S4LEVEL2 - No S4 branch in Level0 tree"; break; |
case -503: message += " S4LEVEL2 - No S4 branch in Level0 tree"; break; |
847 |
|
case -504: message += " S4LEVEL2 - DB connection problems"; break; |
848 |
// |
// |
849 |
case -600: message += " NDLEVEL2 - No level2 file"; break; |
case -600: message += " NDLEVEL2 - No level2 file"; break; |
850 |
case -601: message += " NDLEVEL2 - Cannot open file for writing"; break; |
case -601: message += " NDLEVEL2 - Cannot open file for writing"; break; |
851 |
case -603: message += " NDLEVEL2 - No S4Level2 branch in Level0 tree"; break; |
case -603: message += " NDLEVEL2 - No S4Level2 branch in Level0 tree"; break; |
852 |
|
case -604: message += " NDLEVEL2 - DB connection problems"; break; |
853 |
// |
// |
854 |
case -701: message += " ACLEVEL2 - Cannot open file for writing"; break; |
case -701: message += " ACLEVEL2 - Cannot open file for writing"; break; |
855 |
case -704: message += " ACLEVEL2 - No Anticounter branch in Level0 tree"; break; |
case -704: message += " ACLEVEL2 - No Anticounter branch in Level0 tree"; break; |
856 |
|
case -705: message += " ACLEVEL2 - DB connection problems"; break; |
857 |
// |
// |
858 |
case -800: message += " RUNINFO - No such run in the RunInfo list"; break; |
case -800: message += " RUNINFO - No such run in the RunInfo list"; break; |
859 |
case -801: message += " RUNINFO - No RunInfo tree in Level2 file"; break; |
case -801: message += " RUNINFO - No RunInfo tree in Level2 file"; break; |
862 |
case -804: message += " RUNINFO - Unknown detector"; break; |
case -804: message += " RUNINFO - Unknown detector"; break; |
863 |
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; |
864 |
case -806: message += " RUNINFO - Can not handle more than 500 runs"; break; |
case -806: message += " RUNINFO - Can not handle more than 500 runs"; break; |
865 |
// |
case -807: message += " RUNINFO - DB connection problems"; break; |
866 |
|
// |
867 |
default: message += "Unidentified error or warning"; break; |
default: message += "Unidentified error or warning"; break; |
868 |
}; |
}; |
869 |
printf("\n"); |
printf("\n"); |
903 |
processFile->Close(); |
processFile->Close(); |
904 |
}; |
}; |
905 |
// |
// |
906 |
|
// print benchmark results (if the case) |
907 |
|
// |
908 |
|
dvtimer.Stop(); |
909 |
|
dvtime = dvtimer.RealTime(); |
910 |
|
cdvtime = dvtimer.CpuTime(); |
911 |
|
if ( bench ){ |
912 |
|
Float_t runrt = 0.; |
913 |
|
Float_t trkrt = 0.; |
914 |
|
Float_t calrt = 0.; |
915 |
|
Float_t tofrt = 0.; |
916 |
|
Float_t trgrt = 0.; |
917 |
|
Float_t acrt = 0.; |
918 |
|
Float_t s4rt = 0.; |
919 |
|
Float_t ndrt = 0.; |
920 |
|
Float_t orbrt = 0.; |
921 |
|
Float_t dvrt = nevents/dvtime; |
922 |
|
if ( RUN ) runrt = nruns/runtime; |
923 |
|
if ( TRK ) trkrt = nevents/trktime; |
924 |
|
if ( CAL ) calrt = nevents/caltime; |
925 |
|
if ( TOF ) tofrt = nevents/toftime; |
926 |
|
if ( TRG ) trgrt = nevents/trgtime; |
927 |
|
if ( AC ) acrt = nevents/actime; |
928 |
|
if ( S4 ) s4rt = nevents/s4time; |
929 |
|
if ( ND ) ndrt = nevents/ndtime; |
930 |
|
if ( ORB ) orbrt = nevents/orbtime; |
931 |
|
// |
932 |
|
printf("\n\n################################################################################\n"); |
933 |
|
printf("# Benchmark results: nevents = %10u runs = %3u #\n",nevents,nruns); |
934 |
|
printf("################################################################################\n"); |
935 |
|
printf("# Detector # Core routine called # Real Time # CPU time # Events/s #\n"); |
936 |
|
printf("################################################################################\n"); |
937 |
|
printf("# RUN # %i # %8.2f # %8.2f # %8.2f #\n",RUN,fabs(runtime),fabs(cruntime),runrt); |
938 |
|
printf("# TRK # %i # %8.2f # %8.2f # %8.2f #\n",TRK,fabs(trktime),fabs(ctrktime),trkrt); |
939 |
|
printf("# CAL # %i # %8.2f # %8.2f # %8.2f #\n",CAL,fabs(caltime),fabs(ccaltime),calrt); |
940 |
|
printf("# TOF # %i # %8.2f # %8.2f # %8.2f #\n",TOF,fabs(toftime),fabs(ctoftime),tofrt); |
941 |
|
printf("# TRG # %i # %8.2f # %8.2f # %8.2f #\n",TRG,fabs(trgtime),fabs(ctrgtime),trgrt); |
942 |
|
printf("# AC # %i # %8.2f # %8.2f # %8.2f #\n",AC,fabs(actime),fabs(cactime),acrt); |
943 |
|
printf("# S4 # %i # %8.2f # %8.2f # %8.2f #\n",S4,fabs(s4time),fabs(cs4time),s4rt); |
944 |
|
printf("# ND # %i # %8.2f # %8.2f # %8.2f #\n",ND,fabs(ndtime),fabs(cndtime),ndrt); |
945 |
|
printf("# ORB # %i # %8.2f # %8.2f # %8.2f #\n",ORB,fabs(orbtime),fabs(corbtime),orbrt); |
946 |
|
printf("################################################################################\n"); |
947 |
|
printf("# Total # # %8.2f # %8.2f # %8.2f #\n",fabs(dvtime),fabs(cdvtime),dvrt); |
948 |
|
printf("################################################################################\n"); |
949 |
|
}; |
950 |
|
// |
951 |
|
// |
952 |
if ( error != 0 ) printf("\n\n WARNING: exiting with signal %i \n\n",error); |
if ( error != 0 ) printf("\n\n WARNING: exiting with signal %i \n\n",error); |
953 |
// |
// |
954 |
// |
// |