/[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.8 by mocchiut, Wed Sep 6 11:03:34 2006 UTC revision 1.14 by mocchiut, Tue Nov 7 17:12:51 2006 UTC
# Line 38  void usage(){ Line 38  void usage(){
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");
# Line 76  int main(int numinp, char *inps[]){ Line 77  int main(int numinp, char *inps[]){
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;
# Line 121  int main(int numinp, char *inps[]){ Line 123  int main(int numinp, char *inps[]){
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
# Line 197  int main(int numinp, char *inps[]){ Line 211  int main(int numinp, char *inps[]){
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;
# Line 475  int main(int numinp, char *inps[]){ Line 493  int main(int numinp, char *inps[]){
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() ){
# Line 504  int main(int numinp, char *inps[]){ Line 528  int main(int numinp, char *inps[]){
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 ) {
540        printf(" Calling TrackerLevel2... ");        printf(" Calling TrackerLevel2... ");
541        TRKSGN = TrkCore(run,processFile,dbc,trkargc,trkargv);        TRKSGN = TrkCore(run,processFile,dbc,trkargc,trkargv);
542          gSystem->Unlink("TrackerFolder"); //patch
543        printf("done\n");        printf("done\n");
544      };      };
545      if ( TOF ) {      if ( TOF ) {
# Line 566  int main(int numinp, char *inps[]){ Line 591  int main(int numinp, char *inps[]){
591      case -8:   message += " No Header branch in LEVEL0 Physics tree"; break;      case -8:   message += " No Header branch in LEVEL0 Physics tree"; break;
592      case -9:   message += " No Registry branch in LEVEL0 Physics tree"; break;      case -9:   message += " No Registry branch in LEVEL0 Physics tree"; break;
593      case -11:  message += " LEVEL0 Physics tree is empty"; break;      case -11:  message += " LEVEL0 Physics tree is empty"; break;
594      case -12:  message += " Too few entries in the registry tree"; break;      case -12:  message += " Too few entries in the tree"; break;
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;
# Line 650  int main(int numinp, char *inps[]){ Line 669  int main(int numinp, char *inps[]){
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

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.23