[G14_run] Rootbeer system bug
daoh at andrew.cmu.edu
daoh at andrew.cmu.edu
Fri Aug 23 18:13:49 EDT 2013
For who using Rootbeer to do analysis,
Maybe you are all aware of the problem that when an input DST root file
does not exist in your list of root files your main rootbeer analysis
program will then terminate in an horrific way (break segmentation
violation) and all the previous computations would all be lost. It is
annoying to submit a job on the farm just to find out the next day that
you will have to redo all the work because of one input file got deleted
somewhere.
To fix this bug, you need to add some lines of code to the main Rootbeer
classes, but right now I just found a band-aid solution.
In you main rootbeer (.C) file that you do your analysis (rtest.C for
example), add three lines to guard against non-existent input files, then
you won't have the nightmare anymore.
You can find out these below lines at the beginning of your code. Just add
the relevant lines.
// ******* End of User
initialisation
********************************//
// ********************** main file loop
**********************************************************
class TFile *infile=NULL;
//------------------------------------------------------------->>>>>>>>>>>>>>>add
this line
while((fileNo=getNextFile(inFile,file))!=-1){ // loop while files are
still avialable
// Start of user stuff to do before sorting each file ---------------
infile = new TFile(inFile);
//-------------------------------------------------------------------->>>>>>add
this line
if(infile->IsZombie()){std::cout<<"BAD input file, skip
it"<<std::endl; continue;} //---------------->>>>>>add this line
fprintf(stderr,"Sorting file - %s\n",inFile);
// End of user stuff to do before sorting each file ---------------
if((rootbeer=createBeerObject(inFile))==NULL) return; // create
rootbeer object
Sincerely,
Dao Ho
More information about the G14_run
mailing list