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

Diff of /PadmeAmidala/src/RunGlue.cpp

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

revision 1.5 by mocchiut, Tue Jan 9 10:19:54 2007 UTC revision 1.9 by mocchiut, Fri May 4 10:05:38 2007 UTC
# Line 382  Bool_t RunGlue::OpenFile(){ Line 382  Bool_t RunGlue::OpenFile(){
382    //    //
383    fOpen = false;    fOpen = false;
384    printf(" Check if output file already exists \n");    printf(" Check if output file already exists \n");
385    Target = TFile::Open((this->GetFilename()).Data(), "READ" );    ifstream myfile;
386    //    myfile.open((this->GetFilename()).Data());
387    if ( Target ){    if ( myfile ){
388      Target->Close();      //  Target = TFile::Open((this->GetFilename()).Data(), "READ" );
389        //
390        //  if ( Target ){
391        //    Target->Close();
392        myfile.close();
393      printf("Error opening target file, %s  already exist!\n",(this->GetFilename()).Data());      printf("Error opening target file, %s  already exist!\n",(this->GetFilename()).Data());
394      return(false);      return(false);
395    } else {    } else {
# Line 467  void RunGlue::UpdateDB(TList *dlist){ Line 471  void RunGlue::UpdateDB(TList *dlist){
471    };    };
472    //    //
473    myquery.str("");    myquery.str("");
474    myquery << "insert into GL_ROOT (ID_RAW,PATH,NAME) values (" << idr << ",'" << outdir.Data() << "','" << ((TString)gSystem->BaseName(this->GetFilename())).Data() << "');";    //  myquery << "insert into GL_ROOT (ID_RAW,PATH,NAME) values (" << idr << ",'" << outdir.Data() << "','" << ((TString)gSystem->BaseName(this->GetFilename())).Data() << "');";
475      myquery << "insert into GL_ROOT (ID_RAW,PATH,NAME) values (" << idr << ",'$PAM_L2','" << ((TString)gSystem->BaseName(this->GetFilename())).Data() << "');";
476    if ( DebugMode() ) printf(" query is %s \n",myquery.str().c_str());    if ( DebugMode() ) printf(" query is %s \n",myquery.str().c_str());
477    //    //
478    pResult = dbc->Query(myquery.str().c_str());    pResult = dbc->Query(myquery.str().c_str());
# Line 546  void RunGlue::MergeRootfile(TList *sourc Line 551  void RunGlue::MergeRootfile(TList *sourc
551      //      //
552      // loop over all keys in this directory      // loop over all keys in this directory
553      //      //
554      TChain *globChain = 0;      TChain *globChain = 0;    
555      TIter nextkey( current_sourcedir->GetListOfKeys() );      TIter nextkey( current_sourcedir->GetListOfKeys() );
556      TKey *key = 0;      TKey *key = 0;
557      TKey *oldkey = 0;      TKey *oldkey = 0;
# Line 567  void RunGlue::MergeRootfile(TList *sourc Line 572  void RunGlue::MergeRootfile(TList *sourc
572        //        //
573        //        //
574        //        //
575        if ( !strcmp(key->GetName(),"Tracker") && !li->TRK2 && !li->TRK1 && !li->TRKh ) continue;        if ( !strcmp(key->GetName(),"Tracker") && !li->IsTRK2() && !li->IsTRK1() && !li->IsTRKh() ) continue;
576        //        //
577        if ( !strcmp(key->GetName(),"Calorimeter") && !li->CAL2 && !li->CAL1 ) continue;        if ( !strcmp(key->GetName(),"Calorimeter") && !li->IsCAL2() && !li->IsCAL1() ) continue;
578        //        //
579        if ( !strcmp(key->GetName(),"ToF") && !li->TOF ) continue;        if ( !strcmp(key->GetName(),"ToF") && !li->IsTOF() ) continue;
580        //        //
581        if ( !strcmp(key->GetName(),"Trigger") && !li->TRG ) continue;        if ( !strcmp(key->GetName(),"Trigger") && !li->IsTRG() ) continue;
582        //        //
583        if ( !strcmp(key->GetName(),"Anticounter") && !li->AC ) continue;        if ( !strcmp(key->GetName(),"Anticounter") && !li->IsAC() ) continue;
584        //        //
585        if ( !strcmp(key->GetName(),"S4") && !li->S4 ) continue;        if ( !strcmp(key->GetName(),"S4") && !li->IsS4() ) continue;
586        //        //
587        if ( !strcmp(key->GetName(),"NeutronD") && !li->ND ) continue;        if ( !strcmp(key->GetName(),"NeutronD") && !li->IsND() ) continue;
588        //        //
589        if ( !strcmp(key->GetName(),"OrbitalInfo") && !li->ORB ) continue;        if ( !strcmp(key->GetName(),"OrbitalInfo") && !li->IsORB() ) continue;
590        //        //
591        if ( !strcmp(key->GetName(),"Run") && !RUN ) continue;        if ( !strcmp(key->GetName(),"Run") && !li->IsRUN() ) continue;
592        //        //
593        if ( strcmp(key->GetName(),"Calorimeter") && strcmp(key->GetName(),"Tracker") && strcmp(key->GetName(),"ToF") && strcmp(key->GetName(),"Trigger") && strcmp(key->GetName(),"Anticounter") && strcmp(key->GetName(),"S4") && strcmp(key->GetName(),"NeutronD") && strcmp(key->GetName(),"OrbitalInfo") && strcmp(key->GetName(),"Run") && strcmp(key->GetName(),"ProcessID0") ){        if ( strcmp(key->GetName(),"Calorimeter") && strcmp(key->GetName(),"Tracker") && strcmp(key->GetName(),"ToF") && strcmp(key->GetName(),"Trigger") && strcmp(key->GetName(),"Anticounter") && strcmp(key->GetName(),"S4") && strcmp(key->GetName(),"NeutronD") && strcmp(key->GetName(),"OrbitalInfo") && strcmp(key->GetName(),"Run") && strcmp(key->GetName(),"ProcessID0") ){
594          if ( DebugMode() ) printf(" ERROR UNKNOWN KEY %s !\n",key->GetName());          if ( DebugMode() ) printf(" ERROR UNKNOWN KEY %s !\n",key->GetName());
# Line 611  void RunGlue::MergeRootfile(TList *sourc Line 616  void RunGlue::MergeRootfile(TList *sourc
616          //          //
617          globChain = new TChain(obj_name);          globChain = new TChain(obj_name);
618          //          //
619            globChain->SetCacheSize(0);
620            //
621          globChain->Add(first_source->GetName());          globChain->Add(first_source->GetName());
622          //          //
623          TFile *nextsource = (TFile*)sourcelist->After( first_source );          TFile *nextsource = (TFile*)sourcelist->After( first_source );

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.23