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

Diff of /DarthVader/RunInfo/src/RunInfo.cpp

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

revision 1.19 by mocchiut, Fri Jan 29 05:49:27 2010 UTC revision 1.20 by mocchiut, Tue May 15 14:31:22 2012 UTC
# Line 88  void SoftInfo::GetLevel2Struct(cSoftInfo Line 88  void SoftInfo::GetLevel2Struct(cSoftInfo
88  }  }
89  /***********************/  /***********************/
90    
91    ItoRunInfo::~ItoRunInfo() {
92      this->GL_RUN::Clear();
93    }
94    
95  ItoRunInfo::ItoRunInfo() {  ItoRunInfo::ItoRunInfo() {
96    reprocessing = false;    reprocessing = false;
97    updating = false;    updating = false;
# Line 101  ItoRunInfo::ItoRunInfo() { Line 105  ItoRunInfo::ItoRunInfo() {
105    norun = 0;    norun = 0;
106    runlist = new TArrayI(500);    runlist = new TArrayI(500);
107    file = NULL;    file = NULL;
108    newtree = new TTree();    newtree = NULL;//new TTree();
109  }  }
110    
111  ItoRunInfo::ItoRunInfo(TFile *processFl){  ItoRunInfo::ItoRunInfo(TFile *processFl){
# Line 122  ItoRunInfo::ItoRunInfo(TFile *processFl) Line 126  ItoRunInfo::ItoRunInfo(TFile *processFl)
126    norun = 0;    norun = 0;
127    totnorun = 0;    totnorun = 0;
128    runlist = new TArrayI(500);    runlist = new TArrayI(500);
129      newtree = NULL;
130    //    //
131  }  }
132    
# Line 169  void ItoRunInfo::CopyFromTo(GL_RUN *glru Line 174  void ItoRunInfo::CopyFromTo(GL_RUN *glru
174    //    //
175    if ( glrun && newrun ){    if ( glrun && newrun ){
176      //      //
177      //    printf("copy \n");      printf("copy \n");
178      //      //
179      newrun->ID = glrun->ID                         ;      newrun->ID = glrun->ID                         ;
180      newrun->ID_RUN_FRAG = glrun-> ID_RUN_FRAG                ;      newrun->ID_RUN_FRAG = glrun-> ID_RUN_FRAG                ;
# Line 227  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 232  Int_t ItoRunInfo::Update(UInt_t run, TSt
232    isreadonly = false;    isreadonly = false;
233    idRun = run;    idRun = run;
234    //    //
235    Bool_t debug = false;    Bool_t debug = true;
236    //    //
237    Bool_t ismydir = false;    //  Bool_t ismydir = false;
238    //    //
239    if ( !strcmp(processFolder.Data(),"") ){    if ( !strcmp(processFolder.Data(),"") ){
240      processFolder = "runinfoFolder";      processFolder = "runinfoFolder";
241      ismydir = true;      //    ismydir = true;
242    };    };
243    //    //
244    GL_RUN *oldrun = new GL_RUN();    GL_RUN *oldrun = new GL_RUN();
# Line 372  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 377  Int_t ItoRunInfo::Update(UInt_t run, TSt
377        //        //
378        if ( idRun == 0 || idRun == newrun->ID ) {        if ( idRun == 0 || idRun == newrun->ID ) {
379          //          //
380          if ( debug ) printf(" Updating run number %u \n",idRun);          if ( debug ) printf(" Updating run number %u newrun->ID %i \n",idRun,(int)newrun->ID);
381          //          //
382          found = true;          found = true;
383          //          //
# Line 511  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 516  Int_t ItoRunInfo::Update(UInt_t run, TSt
516        };        };
517        //        //
518        file->cd();        file->cd();
519          if ( debug ) printf("filling: totnorun %i idRun %i newrun->ID %i \n",(int)totnorun,(int)idRun,(int)newrun->ID);
520        newtree->Fill();        newtree->Fill();
521        //        //
522      };      };
# Line 529  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 535  Int_t ItoRunInfo::Update(UInt_t run, TSt
535        return(-5);        return(-5);
536      };      };
537      //      //
538        this->Write();
539      //    newtree->Write();      //    newtree->Write();
540    };    };
541    //  if ( oldtree ) oldtree->Delete(); // crasha qua in queste righe e se non le metti...
542    //  if ( newver ) delete newver;
543    //  if ( newrun ) delete newrun;
544    //  if ( oldver ) delete oldver;
545    //  if ( oldrun ) delete oldrun;
546    return(0);    return(0);
547  }  }
548    
549    void ItoRunInfo::Write(){
550      file->cd();
551      newtree->Write("Run",TObject::kOverwrite);
552    }
553    
554  Int_t ItoRunInfo::Read(UInt_t idRun){  Int_t ItoRunInfo::Read(UInt_t idRun){
555    //    //
556    isreadonly = true;    isreadonly = true;
# Line 603  void ItoRunInfo::Close(){ Line 620  void ItoRunInfo::Close(){
620    delete runlist;    delete runlist;
621    //  file = new TFile();      //  file = new TFile();  
622    file = 0;      file = 0;  
623    if ( isreadonly ) newtree->Delete();    //  if ( isreadonly ) newtree->Delete();
624  }  }
625    
626  void ItoRunInfo::Clear(Option_t *t){  void ItoRunInfo::Clear(Option_t *t){

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.23