/[PAMELA software]/DarthVader/src/DarthVader.cpp
ViewVC logotype

Diff of /DarthVader/src/DarthVader.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by mocchiut, Fri Nov 17 10:08:13 2006 UTC revision 1.26 by mocchiut, Sat Jan 27 06:22:24 2007 UTC
# Line 10  Line 10 
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  //  //
# Line 34  using namespace std; Line 35  using namespace std;
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\n");
40    printf("\n --version       print informations about compilation and exit\n");    printf(" --version         print informations about compilation and exit\n");
41    printf("\n -h | --help     print this help and exit \n");    printf(" -h | --help       print this help and exit \n");
42    printf("\n -v | --verbose  be verbose [default]\n");    printf(" -v | --verbose    be verbose [default]\n");
43    printf("\n -s | --silent   print nothing on STDOUT\n");    printf(" -s | --silent     print nothing on STDOUT\n");
44    printf("\n -c | --clean    remove file if exiting with errors\n");    printf(" -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(" -b | --benchmark  perform and print a benchmark test\n");
46    printf("\n -processFile    output filename [default ID_RUN.Level2.root]\n");    printf(" -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(" -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("                   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(" -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("                   it has not been excluded from processing\n");
51    printf("\n                 it has not been excluded from processing\n");    printf(" -host             name of the DB 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(" -user             username for the DB connection [default = $PAM_DBUSER or \"anonymous\"] \n");
53    printf("\n -user           username for the DB [default = $PAM_DBUSER or \"anonymous\"] \n");    printf(" -psw              password for the DB connection [default = $PAM_DBPSW or \"\"]\n");
54    printf("\n -psw            password for the DB [default = $PAM_DBPSW or \"\"]\n");    printf(" -idRun ID_RUN     ID number (from the DB) of the run to be processed \n");
55    printf("\n +all | +ALL     call all detectors software [default]\n");    printf(" -processFile file output filename [default ID_RUN.Level2.root]\n");
56    printf("\n -all | -ALL     call nothing\n");    printf(" +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(" -all | -ALL       call nothing\n");
58    printf("\n -detector       do not process detector (as above)\n");    printf(" +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(" -detector         do not process detector (as above)\n");
60    printf("\n                 +CAL [ --verbose -g ] +TRK [ -v --level1 ] \n");      printf("                   detector options must be included in square parenthesis with spaces, for example:\n");
61    printf("\nExamples: \n");    printf("                   +CAL [ --verbose -g ] +TRK [ -v --level1 ] \n");  
62    printf("\nStandard call: DarthVader -idRun 1085 \n");    printf("\n Examples: \n");
63    printf("\nProcess only RunInfo and Tracker (be verbose for tracker): DarthVader -idRun 1085 -all +RUN +TRK [ --verbose ] \n");    printf(" Standard call:\n            DarthVader -idRun 1085 \n");
64    printf("\nProcess all and be verbose for calorimeter: DarthVader -idRun 1085 +CAL [ --verbose ] \n\n");    printf(" Process only RunInfo and Tracker (be verbose for tracker):\n            DarthVader -idRun 1085 -all +RUN +TRK [ --verbose ] \n");
65      printf(" Process all and be verbose for calorimeter:\n            DarthVader -idRun 1085 +CAL [ --verbose ] \n\n");
66    };
67    
68    Bool_t CheckDBC(TSQLServer *dbc, TString host, TString user, TString psw){
69        //
70        Bool_t connect = dbc->IsConnected();
71        //
72        if( !dbc || !connect ){
73            dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data());
74        };
75        //
76        connect = dbc->IsConnected();
77        //
78        return(connect);
79        //
80  };  };
81  //  //
82  // Here the main  // Here the main
# Line 69  int main(int numinp, char *inps[]){ Line 85  int main(int numinp, char *inps[]){
85    //    //
86    // Variables booking    // Variables booking
87    //    //
88      //
89      // benchmarck variables
90      //
91      TStopwatch timer;
92      TStopwatch dvtimer;
93      dvtimer.Start(kTRUE);
94      UInt_t nevents = 0;
95      UInt_t nruns = 0;
96      Double_t runtime = 0.;
97      Double_t cruntime = 0.;
98      Double_t trktime = 0.;
99      Double_t ctrktime = 0.;
100      Double_t caltime = 0.;
101      Double_t ccaltime = 0.;
102      Double_t toftime = 0.;
103      Double_t ctoftime = 0.;
104      Double_t trgtime = 0.;
105      Double_t ctrgtime = 0.;
106      Double_t actime = 0.;
107      Double_t cactime = 0.;
108      Double_t s4time = 0.;
109      Double_t cs4time = 0.;
110      Double_t ndtime = 0.;
111      Double_t cndtime = 0.;
112      Double_t orbtime = 0.;
113      Double_t corbtime = 0.;
114      Double_t dvtime = 0.;
115      Double_t cdvtime = 0.;
116      //
117    TString message;    TString message;
118    int nul = 0;    int nul = 0;
119    Int_t error = 0;    Int_t error = 0;
# Line 91  int main(int numinp, char *inps[]){ Line 136  int main(int numinp, char *inps[]){
136    Bool_t debug = false;    Bool_t debug = false;
137    Bool_t beverbose = true;    Bool_t beverbose = true;
138    Bool_t givenid = false;    Bool_t givenid = false;
139      Bool_t bench = false;
140    Bool_t CAL = true;    Bool_t CAL = true;
141    Bool_t TRK = true;    Bool_t TRK = true;
142    Bool_t TRG = true;    Bool_t TRG = true;
# Line 99  int main(int numinp, char *inps[]){ Line 145  int main(int numinp, char *inps[]){
145    Bool_t ND = true;    Bool_t ND = true;
146    Bool_t AC = true;    Bool_t AC = true;
147    Bool_t ORB = true;    Bool_t ORB = true;
148    Bool_t RUN = true;    Bool_t RUN = true;  
149    //    //
150    Int_t calargc = 0;    Int_t calargc = 0;
151    char *calargv[50];    char *calargv[50];
# Line 232  int main(int numinp, char *inps[]){ Line 278  int main(int numinp, char *inps[]){
278            debug = true;            debug = true;
279            found = true;            found = true;
280          };          };
281            if ( !strcmp(inps[i],"-b") || !strcmp(inps[i],"--benchmark") ){
282              bench = true;
283              found = true;
284            };
285          if ( !strcmp(inps[i],"-auto") || !strcmp(inps[i],"-AUTO") ){          if ( !strcmp(inps[i],"-auto") || !strcmp(inps[i],"-AUTO") ){
286            autom = true;            autom = true;
287            tedious = false;            tedious = false;
# Line 509  int main(int numinp, char *inps[]){ Line 559  int main(int numinp, char *inps[]){
559      // Start:      // Start:
560      //      //
561      printf("\n Welcome to the PAMELA LEVEL2 flight software, version %s \n\n",version.Data());      printf("\n Welcome to the PAMELA LEVEL2 flight software, version %s \n\n",version.Data());
562        if ( run )  printf("\n Processing run number %u \n\n",run);
563      //      //
564      // Connect to the DB      // Connect to the DB
565      //      //
# Line 523  int main(int numinp, char *inps[]){ Line 574  int main(int numinp, char *inps[]){
574      //      //
575      if ( debug ) printf("...connected! \n\n");      if ( debug ) printf("...connected! \n\n");
576      //      //
577        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());
578        //
579      // Use UTC in the DB      // Use UTC in the DB
580      //      //
581      stringstream myquery;      stringstream myquery;
# Line 545  int main(int numinp, char *inps[]){ Line 598  int main(int numinp, char *inps[]){
598      processFile = new TFile(filename.Data(),"UPDATE");      processFile = new TFile(filename.Data(),"UPDATE");
599      if ( !processFile->IsOpen() ) throw -15;          if ( !processFile->IsOpen() ) throw -15;    
600      //      //
601        Long64_t maxsize = 10000000000LL;  
602        TTree::SetMaxTreeSize(maxsize);
603        processFile->SetCompressionLevel(1);
604        //
605        //
606      // Run the core program, put any output error in the "error" variable      // Run the core program, put any output error in the "error" variable
607      //      //
608      printf("\n\n Pre-processing:\n\n");      if ( debug ) printf("\n\n Pre-processing:\n\n");
609      //      //
610        timer.Start(kTRUE);
611      if ( RUN ) {      if ( RUN ) {
612        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");
613        printf(" RunInfo called\n");        printf(" RunInfo called\n");
614        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start RunInfoCore STDOUT |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start RunInfoCore STDOUT |<<<<<<<<<<<<<<<<<<<\n");
615        RUNSGN = RunInfoCore(run,processFile,dbc,version,runargc,runargv);        RUNSGN = RunInfoCore(run,processFile,dbc,version,runargc,runargv);
616        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end RunInfoCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end RunInfoCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");
617        printf(" ...done\n");        if ( debug ) printf(" ...done\n");
618      };      };
619        timer.Stop();
620        runtime = timer.RealTime();
621        cruntime = timer.CpuTime();
622      //      //
623      // 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
624      //      //
625      printf(" Checking if requested detectors are in the acquisition\n");      if ( debug ) printf(" Checking if requested detectors are in the acquisition\n");
626      ItoRunInfo *runinfo = new ItoRunInfo(processFile);      ItoRunInfo *runinfo = new ItoRunInfo(processFile);
627      Int_t sgnl = runinfo->Read(run);      Int_t sgnl = runinfo->Read(run);
628      if ( sgnl != 0 ) throw -17;      if ( sgnl != 0 ) throw -17;
629      printf(" => ACQ_VAR_INFO = %i \n",runinfo->ACQ_VAR_INFO);      nevents = runinfo->GetEntries();
630        nruns = runinfo->GetNoRun();
631        if ( debug ) printf(" => ACQ_VAR_INFO = %i \n",runinfo->ACQ_VAR_INFO);
632      if ( TRK && !(runinfo->ACQ_VAR_INFO & (1 << 4)) ){      if ( TRK && !(runinfo->ACQ_VAR_INFO & (1 << 4)) ){
633        DVSGN += 1;        DVSGN += 1;
634        if ( tedious ) throw -30;        if ( tedious ) throw -30;
635        if ( autom ){        if ( autom ){
636          TRK = 0;          TRK = 0;
637          printf(" TRK excluded from processing \n");          if ( debug ) printf(" TRK excluded from processing \n");
638        };        };
639        if ( zerofill ) printf(" TRK is not in the acquisition! \n");        if ( zerofill && debug ) printf(" TRK is not in the acquisition! \n");
640      };      };
641      if ( TOF && !(runinfo->ACQ_VAR_INFO & (1 << 0)) ){      if ( TOF && !(runinfo->ACQ_VAR_INFO & (1 << 0)) ){
642        DVSGN += 2;        DVSGN += 2;
643        if ( tedious ) throw -31;        if ( tedious ) throw -31;
644        if ( autom ){        if ( autom ){
645          TOF = 0;          TOF = 0;
646          printf(" TOF excluded from processing \n");          if ( debug ) printf(" TOF excluded from processing \n");
647        };              };      
648        if ( zerofill ) printf(" TOF is not in the acquisition! \n");        if ( zerofill && debug ) printf(" TOF is not in the acquisition! \n");
649      };      };
650      if ( CAL && !(runinfo->ACQ_VAR_INFO & (1 << 3)) ){      if ( CAL && !(runinfo->ACQ_VAR_INFO & (1 << 3)) ){
651        DVSGN += 4;        DVSGN += 4;
652        if ( tedious ) throw -32;        if ( tedious ) throw -32;
653        if ( autom ){        if ( autom ){
654          CAL = 0;          CAL = 0;
655          printf(" CAL excluded from processing \n");          if ( debug ) printf(" CAL excluded from processing \n");
656        };        };
657        if ( zerofill ) printf(" CAL is not in the acquisition! \n");        if ( zerofill && debug ) printf(" CAL is not in the acquisition! \n");
658      };      };
659      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))) ){
660        DVSGN += 8;        DVSGN += 8;
661        if ( tedious ) throw -33;        if ( tedious ) throw -33;
662        if ( autom ){        if ( autom ){
663          AC = 0;          AC = 0;
664          printf(" AC excluded from processing \n");          if ( debug ) printf(" AC excluded from processing \n");
665        };        };
666        if ( zerofill ) printf(" AC is not in the acquisition! \n");        if ( zerofill && debug ) printf(" AC is not in the acquisition! \n");
667      };      };
668      if ( S4  && !(runinfo->ACQ_VAR_INFO & (1 << 5)) ){      if ( S4  && !(runinfo->ACQ_VAR_INFO & (1 << 5)) ){
669        DVSGN += 16;        DVSGN += 16;
670        if ( tedious ) throw -34;        if ( tedious ) throw -34;
671        if ( autom ){        if ( autom ){
672          S4 = 0;          S4 = 0;
673          printf(" S4 excluded from processing \n");          if ( debug ) printf(" S4 excluded from processing \n");
674        };        };
675        if ( zerofill ) printf(" S4 is not in the acquisition! \n");        if ( zerofill && debug ) printf(" S4 is not in the acquisition! \n");
676      };      };
677      if ( ND  && !(runinfo->ACQ_VAR_INFO & (1 << 9)) ){      if ( ND  && !(runinfo->ACQ_VAR_INFO & (1 << 9)) ){
678        DVSGN += 32;        DVSGN += 32;
679        if ( tedious ) throw -35;        if ( tedious ) throw -35;
680        if ( autom ){        if ( autom ){
681          ND = 0;          ND = 0;
682          printf(" ND excluded from processing \n");          if ( debug ) printf(" ND excluded from processing \n");
683        };        };
684        if ( zerofill ) printf(" ND is not in the acquisition! \n");        if ( zerofill && debug ) printf(" ND is not in the acquisition! \n");
685      };      };
686      //      //
687      if ( !DVSGN ){      if ( !DVSGN ){
688        printf(" OK! Start processing detector's data. \n");        if ( debug ) printf(" OK! Start processing detector's data. \n");
689      } else {      } else {
690        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");
691      };      };
692      printf("\n End pre-processing \n\n");      if ( debug ) printf("\n End pre-processing \n\n");
693      //      //
694        timer.Start(kTRUE);
695      if ( TRK ) {      if ( TRK ) {
696          CheckDBC(dbc,host,user,psw);
697        printf(" TrackerLevel2 called\n");                        printf(" TrackerLevel2 called\n");                
698        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start TrkCore STDOUT |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start TrkCore STDOUT |<<<<<<<<<<<<<<<<<<<\n");
699        TRKSGN = TrkCore(run,processFile,dbc,trkargc,trkargv);        TRKSGN = TrkCore(run,processFile,dbc,trkargc,trkargv);
700        gSystem->Unlink("TrackerFolder"); //patch        gSystem->Unlink("TrackerFolder"); //patch
701        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end TrkCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end TrkCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");
702      };      };
703        timer.Stop();
704        trktime = timer.RealTime();
705        ctrktime = timer.CpuTime();
706        //
707        timer.Start(kTRUE);
708      if ( TOF ) {      if ( TOF ) {
709          CheckDBC(dbc,host,user,psw);
710        printf(" ToFLevel2 called\n");        printf(" ToFLevel2 called\n");
711        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start ToFCore STDOUT |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start ToFCore STDOUT |<<<<<<<<<<<<<<<<<<<\n");
712        TOFSGN = ToFCore(run,processFile,dbc,tofargc,tofargv);        TOFSGN = ToFCore(run,processFile,dbc,tofargc,tofargv);
713        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end ToFCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end ToFCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");
714      };      };
715        timer.Stop();
716        toftime = timer.RealTime();
717        ctoftime = timer.CpuTime();
718        //
719        timer.Start(kTRUE);
720      if ( CAL ) {      if ( CAL ) {
721          CheckDBC(dbc,host,user,psw);
722        printf(" CalorimeterLevel2 called\n");        printf(" CalorimeterLevel2 called\n");
723        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start CaloCore STDOUT |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start CaloCore STDOUT |<<<<<<<<<<<<<<<<<<<\n");
724        CALSGN = CaloCore(run,processFile,dbc,calargc,calargv);        CALSGN = CaloCore(run,processFile,dbc,calargc,calargv);
725        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end CaloCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end CaloCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");
726      };      };
727        timer.Stop();
728        caltime = timer.RealTime();
729        ccaltime = timer.CpuTime();
730        //
731        timer.Start(kTRUE);
732      if ( TRG ) {      if ( TRG ) {
733          CheckDBC(dbc,host,user,psw);
734        printf(" TriggerLevel2 called\n");        printf(" TriggerLevel2 called\n");
735        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start TrigCore STDOUT |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start TrigCore STDOUT |<<<<<<<<<<<<<<<<<<<\n");
736        TRGSGN = TrigCore(run,processFile,dbc,trgargc,trgargv);        TRGSGN = TrigCore(run,processFile,dbc,trgargc,trgargv);
737        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end TrigCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end TrigCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");
738      };      };
739        timer.Stop();
740        trgtime = timer.RealTime();
741        ctrgtime = timer.CpuTime();
742        //
743        timer.Start(kTRUE);
744      if ( AC ) {      if ( AC ) {
745          CheckDBC(dbc,host,user,psw);
746        printf(" AnticounterLevel2 called\n");        printf(" AnticounterLevel2 called\n");
747        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start AcCore STDOUT |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start AcCore STDOUT |<<<<<<<<<<<<<<<<<<<\n");
748        ACSGN = AcCore(run,processFile,dbc,acargc,acargv);        ACSGN = AcCore(run,processFile,dbc,acargc,acargv);
749        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end AcCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end AcCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");
750      };      };
751        timer.Stop();
752        actime = timer.RealTime();
753        cactime = timer.CpuTime();
754        //
755        timer.Start(kTRUE);
756      if ( S4 ) {      if ( S4 ) {
757          CheckDBC(dbc,host,user,psw);
758        printf(" S4Level2 called\n");        printf(" S4Level2 called\n");
759        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start S4Core STDOUT  |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start S4Core STDOUT  |<<<<<<<<<<<<<<<<<<<\n");
760        S4SGN = S4Core(run,processFile,dbc,s4argc,s4argv);        S4SGN = S4Core(run,processFile,dbc,s4argc,s4argv);
761        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end S4Core STDOUT   |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end S4Core STDOUT   |<<<<<<<<<<<<<<<<<<<\n");
762      };      };
763        timer.Stop();
764        s4time = timer.RealTime();
765        cs4time = timer.CpuTime();
766        //
767        timer.Start(kTRUE);
768      if ( ND ) {      if ( ND ) {
769          CheckDBC(dbc,host,user,psw);
770        printf(" NDLevel2 called\n");        printf(" NDLevel2 called\n");
771        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start NDCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start NDCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");
772        NDSGN = NDCore(run,processFile,dbc,ndargc,ndargv);        NDSGN = NDCore(run,processFile,dbc,ndargc,ndargv);
773        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end NDCore STDOUT   |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end NDCore STDOUT   |<<<<<<<<<<<<<<<<<<<\n");
774      };      };
775        timer.Stop();
776        ndtime = timer.RealTime();
777        cndtime = timer.CpuTime();
778        //
779        timer.Start(kTRUE);
780      if ( ORB ) {      if ( ORB ) {
781          CheckDBC(dbc,host,user,psw);
782        printf(" OrbitalInfo called\n");        printf(" OrbitalInfo called\n");
783        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start OrbitalInfoCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>| start OrbitalInfoCore STDOUT  |<<<<<<<<<<<<<<<<<<<\n");
784        ORBSGN = OrbitalInfoCore(run,processFile,dbc,orbargc,orbargv);        ORBSGN = OrbitalInfoCore(run,processFile,dbc,orbargc,orbargv);
785        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end OrbitalInfoCore STDOUT   |<<<<<<<<<<<<<<<<<<<\n");        if ( debug ) printf("                      >>>>>>>>>>>>>>>>>>>|  end OrbitalInfoCore STDOUT   |<<<<<<<<<<<<<<<<<<<\n");
786      };          };    
787        timer.Stop();
788        orbtime = timer.RealTime();
789        corbtime = timer.CpuTime();
790      //      //
791    } catch(Int_t signal) {        } catch(Int_t signal) {    
792      error = signal;      error = signal;
# Line 709  int main(int numinp, char *inps[]){ Line 820  int main(int numinp, char *inps[]){
820      case -53:  message += " GLTABLES - No entries matching GL_TRK_CALIB query"; break;      case -53:  message += " GLTABLES - No entries matching GL_TRK_CALIB query"; break;
821      case -54:  message += " GLTABLES - No entries matching GL_CALO_CALIB query"; break;      case -54:  message += " GLTABLES - No entries matching GL_CALO_CALIB query"; break;
822      case -55:  message += " GLTABLES - No entries matching GL_CALO_CALIB query"; break;      case -55:  message += " GLTABLES - No entries matching GL_CALO_CALIB query"; break;
823        case -56:  message += " GLTABLES - No entries matching GL_TLE query"; break;
824        //              //      
825      case -100: message += " CALORIMETERLEVEL2 - No Level2 input file"; break;      case -100: message += " CALORIMETERLEVEL2 - No Level2 input file"; break;
826      case -101: message += " CALORIMETERLEVEL2 -  Cannot open Level2 file"; break;      case -101: message += " CALORIMETERLEVEL2 -  Cannot open Level2 file"; break;
# Line 727  int main(int numinp, char *inps[]){ Line 839  int main(int numinp, char *inps[]){
839      case -114: message += " CALORIMETERLEVEL2 -  Help called"; break;      case -114: message += " CALORIMETERLEVEL2 -  Help called"; break;
840      case -115: message += " CALORIMETERLEVEL2 -  No Calorimeter bad strip offline mask file"; break;      case -115: message += " CALORIMETERLEVEL2 -  No Calorimeter bad strip offline mask file"; break;
841      case -116: message += " CALORIMETERLEVEL2 -  DB connection problems"; break;      case -116: message += " CALORIMETERLEVEL2 -  DB connection problems"; break;
842        case -117: message += " CALORIMETERLEVEL2 -  Cannot reprocess file with Level1 data without calling Level1 routine"; break;
843        case -118: message += " CALORIMETERLEVEL2 -  Cannot reprocess file without Level1 data calling Level1 routine"; break;
844        //        //
845      case -200: message += " TRACKERLEVEL2 - LEVEL1 framework unknown (HBOOK/ROOT)"; break;      case -200: message += " TRACKERLEVEL2 - LEVEL1 framework unknown (HBOOK/ROOT)"; break;
846      case -201: message += " TRACKERLEVEL2 - LEVEL2 framework unknown (HBOOK/ROOT)"; break;      case -201: message += " TRACKERLEVEL2 - LEVEL2 framework unknown (HBOOK/ROOT)"; break;
# Line 815  int main(int numinp, char *inps[]){ Line 929  int main(int numinp, char *inps[]){
929    };    };
930    if ( processFile ){    if ( processFile ){
931      processFile->cd();      processFile->cd();
932        processFile->WriteStreamerInfo();
933      processFile->Close();      processFile->Close();
934    };    };
935    //    //
936      // print benchmark results (if the case)
937      //
938      dvtimer.Stop();
939      dvtime = dvtimer.RealTime();
940      cdvtime = dvtimer.CpuTime();
941      if ( bench ){
942        Float_t runrt = 0.;
943        Float_t trkrt = 0.;
944        Float_t calrt = 0.;
945        Float_t tofrt = 0.;
946        Float_t trgrt = 0.;
947        Float_t acrt = 0.;
948        Float_t s4rt = 0.;
949        Float_t ndrt = 0.;
950        Float_t orbrt = 0.;
951        Float_t dvrt = nevents/dvtime;
952        if ( RUN ) runrt = nruns/runtime;
953        if ( TRK ) trkrt = nevents/trktime;
954        if ( CAL ) calrt = nevents/caltime;
955        if ( TOF ) tofrt = nevents/toftime;
956        if ( TRG ) trgrt = nevents/trgtime;
957        if ( AC ) acrt = nevents/actime;
958        if ( S4 ) s4rt = nevents/s4time;
959        if ( ND ) ndrt = nevents/ndtime;
960        if ( ORB ) orbrt = nevents/orbtime;
961        //
962        printf("\n\n################################################################################\n");
963        printf("#              Benchmark results: nevents = %10u runs = %3u              #\n",nevents,nruns);
964        printf("################################################################################\n");
965        printf("# Detector # Core routine called #     Real Time   #   CPU time   #  Events/s  #\n");
966        printf("################################################################################\n");
967        printf("# RUN      #         %i           #      %8.2f   #    %8.2f  #  %8.2f  #\n",RUN,fabs(runtime),fabs(cruntime),runrt);
968        printf("# TRK      #         %i           #      %8.2f   #    %8.2f  #  %8.2f  #\n",TRK,fabs(trktime),fabs(ctrktime),trkrt);
969        printf("# CAL      #         %i           #      %8.2f   #    %8.2f  #  %8.2f  #\n",CAL,fabs(caltime),fabs(ccaltime),calrt);
970        printf("# TOF      #         %i           #      %8.2f   #    %8.2f  #  %8.2f  #\n",TOF,fabs(toftime),fabs(ctoftime),tofrt);
971        printf("# TRG      #         %i           #      %8.2f   #    %8.2f  #  %8.2f  #\n",TRG,fabs(trgtime),fabs(ctrgtime),trgrt);
972        printf("# AC       #         %i           #      %8.2f   #    %8.2f  #  %8.2f  #\n",AC,fabs(actime),fabs(cactime),acrt);
973        printf("# S4       #         %i           #      %8.2f   #    %8.2f  #  %8.2f  #\n",S4,fabs(s4time),fabs(cs4time),s4rt);
974        printf("# ND       #         %i           #      %8.2f   #    %8.2f  #  %8.2f  #\n",ND,fabs(ndtime),fabs(cndtime),ndrt);
975        printf("# ORB      #         %i           #      %8.2f   #    %8.2f  #  %8.2f  #\n",ORB,fabs(orbtime),fabs(corbtime),orbrt);
976        printf("################################################################################\n");
977        printf("# Total    #                     #      %8.2f   #    %8.2f  #  %8.2f  #\n",fabs(dvtime),fabs(cdvtime),dvrt);
978        printf("################################################################################\n");
979      };
980      //
981      //
982    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);
983    //    //
984    //    //

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.23