[ROOT] Deleting trees.

From: Martin Turner (martin@hep.ph.liv.ac.uk)
Date: Tue May 21 2002 - 01:21:50 MEST


What is wrong with the folowing piece of code in a compiled make selector?

fLambdaBfile = new TFile(output_filename,"update");
if(fLambdaBfile)  fLambdaB_tree=(TTree*)fLambdaBfile->Get("Jpsi selection");
if(!fLambdaBfile)  fLambdaBfile = new TFile(output_filename,"recreate");
if(fLambdaB_tree)  fLambdaB_tree->Delete("all");

fLambdaB_tree = new TTree("Jpsi selection","jpsi selection tree");

//fLambdaBfile and fLambdaB_tree are defined in the header file of make
selector

It is random wether the script will crash eventually or not. If it will
crash it will give the following warning:

R__unzip: error in header
after the update line.
Are these four lines carelessly coded? Anyone any suspicions? Is the
problems elsewhere?

The goal is to have 3 Tselectors, that make a Lambda Selection, Jpsi
selection and Kshort selection on a single file. These 3 selections are 3
trees which are read in to a final LambdaB selector to give a LB or B0
peak. If I want to update a particular selection then I don't want to
build all the others, so that's my motivation.

Thanks in advance,
Martin



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:53 MET