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

Diff of /PadmeAmidala/src/PadmeAmidala.cpp

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

revision 1.1 by mocchiut, Tue Dec 5 12:31:00 2006 UTC revision 1.12 by mocchiut, Fri Oct 17 09:39:41 2014 UTC
# Line 46  void amidalausage(){ Line 46  void amidalausage(){
46    printf(" -outdir dir      output directory \"dir\"\n");    printf(" -outdir dir      output directory \"dir\"\n");
47    printf(" -dir dir         merge all runs in the directory \"dir\"\n");    printf(" -dir dir         merge all runs in the directory \"dir\"\n");
48    printf(" -d | -delete     delete original DarthVader runs once merged\n");    printf(" -d | -delete     delete original DarthVader runs once merged\n");
49      printf(" -no-DBupdate     do not update the DB\n");
50    printf(" -host            name of the DB host [default = $PAM_DBHOST or mysql://localhost/pamelaprod]\n");    printf(" -host            name of the DB host [default = $PAM_DBHOST or mysql://localhost/pamelaprod]\n");
51    printf(" -user            username for the DB connection [default = $PAM_DBUSER or \"anonymous\"] \n");    printf(" -user            username for the DB connection [default = $PAM_DBUSER or \"anonymous\"] \n");
52    printf(" -psw             password for the DB connection [default = $PAM_DBPSW or \"\"]\n");    printf(" -psw             password for the DB connection [default = $PAM_DBPSW or \"\"]\n");
# Line 74  int main(int numinp, char *inps[]){ Line 75  int main(int numinp, char *inps[]){
75    TString psw = "";    TString psw = "";
76    Bool_t debug = false;    Bool_t debug = false;
77    Bool_t delop = false;    Bool_t delop = false;
78      Bool_t dbup = true;
79    //    //
80    const char *pamdbhost=gSystem->Getenv("PAM_DBHOST");    const char *pamdbhost=gSystem->Getenv("PAM_DBHOST");
81    const char *pamdbuser=gSystem->Getenv("PAM_DBUSER");    const char *pamdbuser=gSystem->Getenv("PAM_DBUSER");
# Line 106  int main(int numinp, char *inps[]){ Line 108  int main(int numinp, char *inps[]){
108        if ( !strcmp(inps[i],"-d") || !strcmp(inps[i],"-delete") ){        if ( !strcmp(inps[i],"-d") || !strcmp(inps[i],"-delete") ){
109          delop = true;          delop = true;
110        };        };
111          if ( !strcmp(inps[i],"-no-DBupdate") ){
112            dbup = false;
113          };
114        if ( !strcmp(inps[i],"-idRun") ) {        if ( !strcmp(inps[i],"-idRun") ) {
115          if ( numinp-1 < i+1 ) {          if ( numinp-1 < i+1 ) {
116            amidalausage();            amidalausage();
# Line 193  int main(int numinp, char *inps[]){ Line 198  int main(int numinp, char *inps[]){
198        if ( !strcmp(inps[i],"+all") || !strcmp(inps[i],"+ALL") ) {        if ( !strcmp(inps[i],"+all") || !strcmp(inps[i],"+ALL") ) {
199          dectlist +=" +ALL";                dectlist +=" +ALL";      
200        };        };
201          if ( !strcmp(inps[i],"+auto") || !strcmp(inps[i],"+AUTO") ) {
202            dectlist +=" +AUTO";      
203          };
204        if ( !strcmp(inps[i],"+CAL") ) {        if ( !strcmp(inps[i],"+CAL") ) {
205          dectlist +=" +CAL";          dectlist +=" +CAL";
206        };        };
# Line 265  int main(int numinp, char *inps[]){ Line 273  int main(int numinp, char *inps[]){
273    };        };    
274    //    //
275    myquery.str("");    myquery.str("");
276    myquery << "SET time_zone='+0:00'";    myquery << "SET time_zone='+0:00';";
277    dbc->Query(myquery.str().c_str());    delete dbc->Query(myquery.str().c_str());
278      delete dbc->Query("SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';");
279    //    //
280    RunGlue *rg = new RunGlue(dbc,run,dir,outdir);    RunGlue *rg = new RunGlue(dbc,run,dir,outdir);
281    //    //
282    if ( debug ) rg->SetDebug(true);    if ( debug ) rg->SetDebug(true);
283      if ( !dbup ) rg->SetUpgrade(false);
284    rg->SetDList(dectlist);    rg->SetDList(dectlist);
285    //    //
286    TList *l = 0;    TList *l = 0;
287    //    //
288    TString treelist="+ALL";    Int_t RET=0;
289      //
290      //  TString treelist="+AUTO";
291    //    //
292    while ( !rg->End() ){    while ( !rg->End() ){
293      //      //
# Line 283  int main(int numinp, char *inps[]){ Line 295  int main(int numinp, char *inps[]){
295      //      //
296      if ( l ){      if ( l ){
297        //        //
298        if ( rg->OpenFile() ){  //      if ( rg->OpenFile() ){
299          if ( rg->FileIsOpen() ){
300          //          //
301          rg->MergeRootfile(l);          rg->MergeRootfile(l);
302          //          //
303          rg->UpdateDB(l);          if ( dbup ) rg->UpdateDB(l);
304          //          //
305          if ( delop ) rg->DeleteRunFiles(l);          if ( delop ) rg->DeleteRunFiles(l);
306          //          //
307          rg->Clean();          rg->Clean();
308          //          //
309          } else {
310            RET = 255;
311        };        };
312        } else {
313          RET = 255;
314      };      };
315      delete l;      delete l;
316      //      //
# Line 305  int main(int numinp, char *inps[]){ Line 322  int main(int numinp, char *inps[]){
322    //    //
323    if ( dbc ) dbc->Close();    if ( dbc ) dbc->Close();
324    //    //
325      if ( debug ) printf(" exit with error code %i \n",RET);
326      //
327    printf("\n");    printf("\n");
328    //    //
329    exit(0);    exit(RET);
330  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.23