/[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.9 by mocchiut, Tue Sep 5 13:21:10 2006 UTC revision 1.22 by mocchiut, Wed Aug 27 14:44:35 2014 UTC
# Line 15  Line 15 
15  //  //
16  #include <GLTables.h>  #include <GLTables.h>
17  #include <RunInfo.h>  #include <RunInfo.h>
18    ClassImp(ProcInfo);
19  ClassImp(SoftInfo);  ClassImp(SoftInfo);
20  ClassImp(ItoRunInfo);  ClassImp(ItoRunInfo);
21  //  //
22  using namespace std;  using namespace std;
23  //  //
24    
25    ProcInfo::ProcInfo() {
26      Clear();
27    }
28    
29    void ProcInfo::Clear(Option_t *t){
30      runID = 0;
31      date = "";
32      commandLine = "";
33      outputFilename = "";
34      localDir = "";
35      uname = "";
36      DB = "";
37    }
38    
39  SoftInfo::SoftInfo() {  SoftInfo::SoftInfo() {
40    TRIG_ver = "";    Clear();
   TOF_ver = "";  
   AC_ver = "";  
   TRK_ver = "";  
   ORB_ver = "";  
   CAL_ver = "";  
   ND_ver = "";  
   S4_ver = "";    
41  }  }
42    
43  void SoftInfo::Clear(){  void SoftInfo::Clear(Option_t *t){
44    TRIG_ver = "";    TRIG_ver = "";
45    TOF_ver = "";    TOF_ver = "";
46    AC_ver = "";    AC_ver = "";
# Line 41  void SoftInfo::Clear(){ Line 49  void SoftInfo::Clear(){
49    CAL_ver = "";    CAL_ver = "";
50    ND_ver = "";    ND_ver = "";
51    S4_ver = "";      S4_ver = "";  
52      DV_ver = "";
53  }  }
54    
55    UInt_t SoftInfo::GetSWinfo(TString Detector){
56      TString sver;
57      UInt_t version = 0;
58      if ( !strcmp(Detector.Data(),"TRIG") ){
59        sver = TRIG_ver;
60      };
61      if ( !strcmp(Detector.Data(),"TOF") ){
62        sver = TOF_ver;
63      };
64      if ( !strcmp(Detector.Data(),"AC") ){
65        sver = AC_ver;
66      };
67      if ( !strcmp(Detector.Data(),"TRK") ){
68        sver = TRK_ver;
69      };
70      if ( !strcmp(Detector.Data(),"CALO") ){
71        sver = CAL_ver;
72      };
73      if ( !strcmp(Detector.Data(),"S4") ){
74        sver = S4_ver;
75      };
76      if ( !strcmp(Detector.Data(),"DV") ){
77        sver = DV_ver;
78      };
79      if ( !strcmp(Detector.Data(),"ND") ){
80        sver = ND_ver;
81      };
82      if ( !strcmp(Detector.Data(),"ORB") ){
83        sver = ORB_ver;
84      };
85      sver.ReplaceAll("v",1," ",1);
86      sver.ReplaceAll("r",1," ",1);
87      version = (UInt_t)sver.Atoi();
88      return(version);
89    };
90    
91  /**  /**
92   * Fills a struct cSoftInfo with values from a SoftInfo object (to put data into a F77 common).   * Fills a struct cSoftInfo with values from a SoftInfo object (to put data into a F77 common).
# Line 59  void SoftInfo::GetLevel2Struct(cSoftInfo Line 103  void SoftInfo::GetLevel2Struct(cSoftInfo
103  }  }
104  /***********************/  /***********************/
105    
106    ItoRunInfo::~ItoRunInfo() {
107      this->GL_RUN::Clear();
108    }
109    
110  ItoRunInfo::ItoRunInfo() {  ItoRunInfo::ItoRunInfo() {
111    reprocessing = false;    reprocessing = false;
112    updating = false;    updating = false;
# Line 72  ItoRunInfo::ItoRunInfo() { Line 120  ItoRunInfo::ItoRunInfo() {
120    norun = 0;    norun = 0;
121    runlist = new TArrayI(500);    runlist = new TArrayI(500);
122    file = NULL;    file = NULL;
123    newtree = new TTree();    newtree = NULL;//new TTree();
124  }  }
125    
126  ItoRunInfo::ItoRunInfo(TFile *processFl){  ItoRunInfo::ItoRunInfo(TFile *processFl){
# Line 89  ItoRunInfo::ItoRunInfo(TFile *processFl) Line 137  ItoRunInfo::ItoRunInfo(TFile *processFl)
137    last_file_entry = 0;    last_file_entry = 0;
138    file_entries = 0;    file_entries = 0;
139    version = new SoftInfo();    version = new SoftInfo();
140      //  glrun = new GL_RUN();
141    norun = 0;    norun = 0;
142    totnorun = 0;    totnorun = 0;
143    runlist = new TArrayI(500);    runlist = new TArrayI(500);
144      newtree = NULL;
145    //    //
146  }  }
147    
148    
149    
150  TChain *ItoRunInfo::LoadRunInfoTree(TList *fl){  TChain *ItoRunInfo::GetRunTree(TList *fl){
151    //    //
152    TChain *Tout=0;    TChain *Tout = new TChain("Run");    
   //  
   TChain *RI = 0;        
   TChain *SI = 0;        
   RI = new TChain("RunInfo");    
   SI = new TChain("SoftInfo");            
153    // loop over files and create chains      // loop over files and create chains  
154    TIter next(fl);    TIter next(fl);
155    TSystemFile *questo = 0;    TSystemFile *questo = 0;
156    while ( (questo = (TSystemFile*) next()) ) {    while ( (questo = (TSystemFile*) next()) ) {
157      TString name =  questo->GetName();      TString name =  questo->GetName();
158      RI->Add(name);      Tout->Add(name);
     SI->Add(name);  
159    };    };
160    //    //
161    RI->SetBranchAddress("RunInfo", GetPointerToRI());    Tout->SetBranchAddress("RunInfo", GetPointerToRI());
162    Tout = RI;    printf("Run          : set branch address RunInfo\n");
163    SI->SetBranchAddress("SoftInfo", GetPointerToSI());    Tout->SetBranchAddress("SoftInfo", GetPointerToSI());
164    Tout->AddFriend("SoftInfo");    printf("Software     : set branch address SoftInfo\n");
165    //    //
166    return Tout;                      return Tout;                  
167    //    //
# Line 145  void ItoRunInfo::CopyFromTo(GL_RUN *glru Line 189  void ItoRunInfo::CopyFromTo(GL_RUN *glru
189    //    //
190    if ( glrun && newrun ){    if ( glrun && newrun ){
191      //      //
192      //    printf("copy \n");  //    printf("copy \n");
193      //      //
194      newrun->ID = glrun->ID                         ;      newrun->ID = glrun->ID                         ;
195      newrun->ID_RUN_FRAG = glrun-> ID_RUN_FRAG                ;      newrun->ID_RUN_FRAG = glrun-> ID_RUN_FRAG                ;
# Line 177  void ItoRunInfo::CopyFromTo(GL_RUN *glru Line 221  void ItoRunInfo::CopyFromTo(GL_RUN *glru
221      newrun->TRK_CALIB_USED = glrun->TRK_CALIB_USED             ;      newrun->TRK_CALIB_USED = glrun->TRK_CALIB_USED             ;
222      newrun->CAL_DSP_MASK  = glrun->CAL_DSP_MASK               ;      newrun->CAL_DSP_MASK  = glrun->CAL_DSP_MASK               ;
223      newrun->BOOT_NUMBER  = glrun->BOOT_NUMBER                ;      newrun->BOOT_NUMBER  = glrun->BOOT_NUMBER                ;
224        newrun->PHYSENDRUN_MASK_S3S2S12  = glrun->PHYSENDRUN_MASK_S3S2S12                 ;
225        newrun->PHYSENDRUN_MASK_S11CRC  = glrun->PHYSENDRUN_MASK_S11CRC                 ;
226      newrun->VALIDATION  = glrun->VALIDATION                 ;      newrun->VALIDATION  = glrun->VALIDATION                 ;
227      //      //
228    };    };
# Line 190  void ItoRunInfo::CopyFromTo(GL_RUN *glru Line 236  void ItoRunInfo::CopyFromTo(GL_RUN *glru
236      newver->ORB_ver = sinfo->ORB_ver;      newver->ORB_ver = sinfo->ORB_ver;
237      newver->CAL_ver = sinfo->CAL_ver;      newver->CAL_ver = sinfo->CAL_ver;
238      newver->S4_ver = sinfo->S4_ver;      newver->S4_ver = sinfo->S4_ver;
239        newver->DV_ver = sinfo->DV_ver;
240      newver->ND_ver = sinfo->ND_ver;      newver->ND_ver = sinfo->ND_ver;
241      //      //
242    };    };
# Line 200  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 247  Int_t ItoRunInfo::Update(UInt_t run, TSt
247    isreadonly = false;    isreadonly = false;
248    idRun = run;    idRun = run;
249    //    //
250    Bool_t debug = true;    Bool_t debug = false;
251    //    //
252    Bool_t ismydir = false;    //  Bool_t ismydir = false;
253    //    //
254    if ( !strcmp(processFolder.Data(),"") ){    if ( !strcmp(processFolder.Data(),"") ){
255      processFolder = "runinfoFolder";      processFolder = "runinfoFolder";
256      ismydir = true;      //    ismydir = true;
257    };    };
258    //    //
259    GL_RUN *oldrun = new GL_RUN();    GL_RUN *oldrun = new GL_RUN();
# Line 239  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 286  Int_t ItoRunInfo::Update(UInt_t run, TSt
286      version->ORB_ver = Version;      version->ORB_ver = Version;
287      version->CAL_ver = Version;          version->CAL_ver = Version;    
288      version->S4_ver = Version;      version->S4_ver = Version;
289        version->DV_ver = Version;
290      version->ND_ver = Version;      version->ND_ver = Version;
291    } else {    } else {
292      if ( !strcmp(Detector.Data(),"TRIG") ) version->TRIG_ver = Version;      if ( !strcmp(Detector.Data(),"TRIG") ) version->TRIG_ver = Version;
# Line 247  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 295  Int_t ItoRunInfo::Update(UInt_t run, TSt
295      if ( !strcmp(Detector.Data(),"TRK") ) version->TRK_ver = Version;      if ( !strcmp(Detector.Data(),"TRK") ) version->TRK_ver = Version;
296      if ( !strcmp(Detector.Data(),"CALO") ) version->CAL_ver = Version;      if ( !strcmp(Detector.Data(),"CALO") ) version->CAL_ver = Version;
297      if ( !strcmp(Detector.Data(),"S4") ) version->S4_ver = Version;      if ( !strcmp(Detector.Data(),"S4") ) version->S4_ver = Version;
298        if ( !strcmp(Detector.Data(),"DV") ) version->DV_ver = Version;
299      if ( !strcmp(Detector.Data(),"ND") ) version->ND_ver = Version;      if ( !strcmp(Detector.Data(),"ND") ) version->ND_ver = Version;
300      if ( !strcmp(Detector.Data(),"ORB") ) version->ORB_ver = Version;      if ( !strcmp(Detector.Data(),"ORB") ) version->ORB_ver = Version;
301      if ( strcmp(Detector.Data(),"TRIG") && strcmp(Detector.Data(),"TOF") &&  strcmp(Detector.Data(),"AC") && strcmp(Detector.Data(),"TRK") &&  strcmp(Detector.Data(),"CALO") && strcmp(Detector.Data(),"S4") && strcmp(Detector.Data(),"ND") && strcmp(Detector.Data(),"ORB") ) return(-804);      if ( strcmp(Detector.Data(),"TRIG") && strcmp(Detector.Data(),"TOF") &&  strcmp(Detector.Data(),"AC") && strcmp(Detector.Data(),"TRK") &&  strcmp(Detector.Data(),"CALO") && strcmp(Detector.Data(),"S4") && strcmp(Detector.Data(),"ND") && strcmp(Detector.Data(),"ORB") && strcmp(Detector.Data(),"DV") ) return(-804);
302    };    };
303    //    //
304    if ( !oldtree ) {    if ( !oldtree ) {
# Line 301  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 350  Int_t ItoRunInfo::Update(UInt_t run, TSt
350      totnorun = 1;      totnorun = 1;
351      reprocessing = false;      reprocessing = false;
352      first_file_entry = 0;      first_file_entry = 0;
353      last_file_entry = (UInt_t)(EV_TO - EV_FROM);      if ( EV_TO >= EV_FROM ) last_file_entry = (UInt_t)(EV_TO - EV_FROM);
354      norun = 1;      norun = 1;
355      runlist->AddAt((Int_t)ID,0);      runlist->AddAt((Int_t)ID,0);
356      //      //
# Line 333  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 382  Int_t ItoRunInfo::Update(UInt_t run, TSt
382      //      //
383      for ( UInt_t run = 0; run < totnorun; run++){      for ( UInt_t run = 0; run < totnorun; run++){
384        //        //
385        oldtree->GetEntry(run);        if ( oldtree->GetEntry(run) <= 0 ) throw -36;
386        //        //
387        CopyFromTo(oldrun,newrun,oldver,newver);        CopyFromTo(oldrun,newrun,oldver,newver);
388        //        //
# Line 343  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 392  Int_t ItoRunInfo::Update(UInt_t run, TSt
392        //        //
393        if ( idRun == 0 || idRun == newrun->ID ) {        if ( idRun == 0 || idRun == newrun->ID ) {
394          //          //
395          if ( debug ) printf(" Updating run number %u \n",idRun);          if ( debug ) printf(" Updating run number %u newrun->ID %i \n",idRun,(int)newrun->ID);
396          //          //
397          found = true;          found = true;
398          //          //
# Line 373  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 422  Int_t ItoRunInfo::Update(UInt_t run, TSt
422              newver->ORB_ver = oldver->ORB_ver;              newver->ORB_ver = oldver->ORB_ver;
423              newver->CAL_ver = oldver->CAL_ver;              newver->CAL_ver = oldver->CAL_ver;
424              newver->S4_ver = oldver->S4_ver;              newver->S4_ver = oldver->S4_ver;
425                newver->DV_ver = oldver->DV_ver;
426              newver->ND_ver = oldver->ND_ver;              newver->ND_ver = oldver->ND_ver;
427              if ( strcmp(oldver->TRIG_ver.Data(),"") ) reprocessing = true;              if ( strcmp(oldver->TRIG_ver.Data(),"") ) reprocessing = true;
428            };            };
# Line 383  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 433  Int_t ItoRunInfo::Update(UInt_t run, TSt
433              newver->TRK_ver = oldver->TRK_ver;              newver->TRK_ver = oldver->TRK_ver;
434              newver->ORB_ver = oldver->ORB_ver;              newver->ORB_ver = oldver->ORB_ver;
435              newver->CAL_ver = oldver->CAL_ver;              newver->CAL_ver = oldver->CAL_ver;
436                newver->DV_ver = oldver->DV_ver;
437              newver->S4_ver = oldver->S4_ver;              newver->S4_ver = oldver->S4_ver;
438              newver->ND_ver = oldver->ND_ver;              newver->ND_ver = oldver->ND_ver;
439              if ( strcmp(oldver->TOF_ver.Data(),"") ) reprocessing = true;              if ( strcmp(oldver->TOF_ver.Data(),"") ) reprocessing = true;
# Line 393  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 444  Int_t ItoRunInfo::Update(UInt_t run, TSt
444              newver->TRK_ver = oldver->TRK_ver;              newver->TRK_ver = oldver->TRK_ver;
445              newver->ORB_ver = oldver->ORB_ver;              newver->ORB_ver = oldver->ORB_ver;
446              newver->CAL_ver = oldver->CAL_ver;              newver->CAL_ver = oldver->CAL_ver;
447                newver->DV_ver = oldver->DV_ver;
448              newver->S4_ver = oldver->S4_ver;              newver->S4_ver = oldver->S4_ver;
449              newver->ND_ver = oldver->ND_ver;              newver->ND_ver = oldver->ND_ver;
450              newver->AC_ver = version->AC_ver;              newver->AC_ver = version->AC_ver;
# Line 403  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 455  Int_t ItoRunInfo::Update(UInt_t run, TSt
455              newver->TOF_ver = oldver->TOF_ver;              newver->TOF_ver = oldver->TOF_ver;
456              newver->CAL_ver = oldver->CAL_ver;              newver->CAL_ver = oldver->CAL_ver;
457              newver->ORB_ver = oldver->ORB_ver;              newver->ORB_ver = oldver->ORB_ver;
458                newver->DV_ver = oldver->DV_ver;
459              newver->S4_ver = oldver->S4_ver;              newver->S4_ver = oldver->S4_ver;
460              newver->ND_ver = oldver->ND_ver;              newver->ND_ver = oldver->ND_ver;
461              newver->AC_ver = oldver->AC_ver;              newver->AC_ver = oldver->AC_ver;
# Line 414  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 467  Int_t ItoRunInfo::Update(UInt_t run, TSt
467              newver->TOF_ver = oldver->TOF_ver;              newver->TOF_ver = oldver->TOF_ver;
468              newver->CAL_ver = oldver->CAL_ver;              newver->CAL_ver = oldver->CAL_ver;
469              newver->TRK_ver = oldver->TRK_ver;              newver->TRK_ver = oldver->TRK_ver;
470                newver->DV_ver = oldver->DV_ver;
471              newver->S4_ver = oldver->S4_ver;              newver->S4_ver = oldver->S4_ver;
472              newver->ND_ver = oldver->ND_ver;              newver->ND_ver = oldver->ND_ver;
473              newver->AC_ver = oldver->AC_ver;              newver->AC_ver = oldver->AC_ver;
# Line 423  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 477  Int_t ItoRunInfo::Update(UInt_t run, TSt
477            if ( !strcmp(Detector.Data(),"CALO") ){            if ( !strcmp(Detector.Data(),"CALO") ){
478              newver->TRIG_ver = oldver->TRIG_ver;              newver->TRIG_ver = oldver->TRIG_ver;
479              newver->TOF_ver = oldver->TOF_ver;              newver->TOF_ver = oldver->TOF_ver;
480                newver->DV_ver = oldver->DV_ver;
481              newver->S4_ver = oldver->S4_ver;              newver->S4_ver = oldver->S4_ver;
482              newver->ORB_ver = oldver->ORB_ver;              newver->ORB_ver = oldver->ORB_ver;
483              newver->ND_ver = oldver->ND_ver;              newver->ND_ver = oldver->ND_ver;
# Line 439  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 494  Int_t ItoRunInfo::Update(UInt_t run, TSt
494              newver->TRK_ver = oldver->TRK_ver;              newver->TRK_ver = oldver->TRK_ver;
495              newver->ORB_ver = oldver->ORB_ver;              newver->ORB_ver = oldver->ORB_ver;
496              newver->CAL_ver = oldver->CAL_ver;              newver->CAL_ver = oldver->CAL_ver;
497                newver->DV_ver = oldver->DV_ver;
498              newver->S4_ver = version->S4_ver;              newver->S4_ver = version->S4_ver;
499              if ( strcmp(oldver->S4_ver.Data(),"") ) reprocessing = true;              if ( strcmp(oldver->S4_ver.Data(),"") ) reprocessing = true;
500            };            };
501              if ( !strcmp(Detector.Data(),"DV") ){
502                newver->TRIG_ver = oldver->TRIG_ver;
503                newver->TOF_ver = oldver->TOF_ver;
504                newver->ND_ver = oldver->ND_ver;
505                newver->AC_ver = oldver->AC_ver;
506                newver->TRK_ver = oldver->TRK_ver;
507                newver->ORB_ver = oldver->ORB_ver;
508                newver->CAL_ver = oldver->CAL_ver;
509                newver->S4_ver = oldver->S4_ver;
510                newver->DV_ver = version->DV_ver;
511                if ( strcmp(oldver->DV_ver.Data(),"") ) reprocessing = true;
512              };
513            if ( !strcmp(Detector.Data(),"ND") ){            if ( !strcmp(Detector.Data(),"ND") ){
514              newver->TRIG_ver = oldver->TRIG_ver;              newver->TRIG_ver = oldver->TRIG_ver;
515              newver->TOF_ver = oldver->TOF_ver;              newver->TOF_ver = oldver->TOF_ver;
516                newver->DV_ver = oldver->DV_ver;
517              newver->S4_ver = oldver->S4_ver;              newver->S4_ver = oldver->S4_ver;
518              newver->AC_ver = oldver->AC_ver;              newver->AC_ver = oldver->AC_ver;
519              newver->ORB_ver = oldver->ORB_ver;              newver->ORB_ver = oldver->ORB_ver;
# Line 455  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 524  Int_t ItoRunInfo::Update(UInt_t run, TSt
524            };            };
525          };          };
526          //          //
527          last_file_entry = first_file_entry + (oldrun->EV_TO - oldrun->EV_FROM + 1);          if ( oldrun->EV_TO >= oldrun->EV_FROM ) last_file_entry = first_file_entry + (oldrun->EV_TO - oldrun->EV_FROM + 1);
528          //          //
529        } else {        } else {
530          if ( !found ) first_file_entry += (oldrun->EV_TO - oldrun->EV_FROM + 1);          if ( !found ) first_file_entry += (oldrun->EV_TO - oldrun->EV_FROM + 1);
531        };        };
532        //        //
533        file->cd();        file->cd();
534          if ( debug ) printf("filling: totnorun %i idRun %i newrun->ID %i \n",(int)totnorun,(int)idRun,(int)newrun->ID);
535        newtree->Fill();        newtree->Fill();
536        //        //
537      };      };
# Line 480  Int_t ItoRunInfo::Update(UInt_t run, TSt Line 550  Int_t ItoRunInfo::Update(UInt_t run, TSt
550        return(-5);        return(-5);
551      };      };
552      //      //
553        this->Write();
554      //    newtree->Write();      //    newtree->Write();
555    };    };
556    //  if ( oldtree ) oldtree->Delete(); // crasha qua in queste righe e se non le metti...
557    //  if ( newver ) delete newver;
558    //  if ( newrun ) delete newrun;
559    //  if ( oldver ) delete oldver;
560    //  if ( oldrun ) delete oldrun;
561    return(0);    return(0);
562  }  }
563    
564    void ItoRunInfo::Write(){
565      file->cd();
566      newtree->Write("Run",TObject::kOverwrite);
567    }
568    
569  Int_t ItoRunInfo::Read(UInt_t idRun){  Int_t ItoRunInfo::Read(UInt_t idRun){
570    //    //
571    isreadonly = true;    isreadonly = true;
# Line 521  Int_t ItoRunInfo::Read(UInt_t idRun){ Line 602  Int_t ItoRunInfo::Read(UInt_t idRun){
602      //      //
603      for ( UInt_t run = 0; run < totnorun; run++){      for ( UInt_t run = 0; run < totnorun; run++){
604        //        //
605        newtree->GetEntry(run);        if ( newtree->GetEntry(run) <= 0 ) throw -36;
606        //        //
607        file_entries += (newrun->EV_TO - newrun->EV_FROM + 1);        file_entries += (newrun->EV_TO - newrun->EV_FROM + 1);
608        //        //
# Line 532  Int_t ItoRunInfo::Read(UInt_t idRun){ Line 613  Int_t ItoRunInfo::Read(UInt_t idRun){
613          runlist->AddAt(newrun->ID,norun);          runlist->AddAt(newrun->ID,norun);
614          norun++;          norun++;
615        };        };
616        last_file_entry = first_file_entry + (newrun->EV_TO - newrun->EV_FROM + 1);        if ( newrun->EV_TO >= newrun->EV_FROM ) last_file_entry = first_file_entry + (newrun->EV_TO - newrun->EV_FROM + 1);
617      };      };
618    };    };
619    if ( debug ) printf("norun %i \n",(int)norun);    if ( debug ) printf("norun %i \n",(int)norun);
# Line 552  void ItoRunInfo::Close(){ Line 633  void ItoRunInfo::Close(){
633    file_entries = 0;    file_entries = 0;
634    norun = 0;    norun = 0;
635    delete runlist;    delete runlist;
636    file = new TFile();      //  file = new TFile();  
637    if ( isreadonly ) newtree->Delete();    file = 0;  
638      //  if ( isreadonly ) newtree->Delete();
639  }  }
640    
641  void ItoRunInfo::Clear(){  void ItoRunInfo::Clear(Option_t *t){
642    if ( newtree ) newtree->Delete();    if ( newtree ) newtree->Delete();
643  }  }
644    
# Line 609  Int_t ItoRunInfo::GetRunInfo(UInt_t run) Line 691  Int_t ItoRunInfo::GetRunInfo(UInt_t run)
691    totnorun = newtree->GetEntries();    totnorun = newtree->GetEntries();
692    //    //
693    for ( UInt_t nrun = 0; nrun < totnorun; nrun++){      for ( UInt_t nrun = 0; nrun < totnorun; nrun++){  
694      newtree->GetEntry(nrun);      if ( newtree->GetEntry(nrun) <= 0 ) throw -36;
695      //      //
696      if ( nwrun->ID == run || run == 0 ){      if ( nwrun->ID == run || run == 0 ){
697        CopyFromTo(nwrun,(GL_RUN*)this,nwver,version);        CopyFromTo(nwrun,(GL_RUN*)this,nwver,version);
698        found = true;        found = true;
699        last_file_entry = first_file_entry + (nwrun->EV_TO - nwrun->EV_FROM + 1);        if ( nwrun->EV_TO >= nwrun->EV_FROM ) last_file_entry = first_file_entry + (nwrun->EV_TO - nwrun->EV_FROM + 1);
700      };      };
701      if ( !found ) first_file_entry += (nwrun->EV_TO - nwrun->EV_FROM + 1);      if ( !found ) first_file_entry += (nwrun->EV_TO - nwrun->EV_FROM + 1);
702    };    };

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

  ViewVC Help
Powered by ViewVC 1.1.23