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; |
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){ |
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 |
|
|
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 ; |
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(); |
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 |
// |
// |
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 |
}; |
}; |
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; |
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){ |