Hi,
i’m using this program to write some data into a TTree:
void writeDataROOT(int nrunr, int nsegm, int nstream, int ID_riv,
Int_t nfoundb, Float_t xpb_time_vect[], Float_t ypb_sub_vect[], int
idelev, Float_t
meanback_peak[], Float_t peak_integral[], Float_t time_start, Float_t
beaminfo, char MyDetName[])
{
sprintf(outnameb,"/castor/cern.ch/user/c/calviani/DST/%s/data_run%d_%d_s%d_IDriv%d.root",MyDetName,nrunr,nsegm,nstream,ID_riv);
TRFIOFile *f = new TRFIOFile(outnameb,"UPDATE");
e' come TFile.....
Int_t jj=0;
while(f->IsZombie())
{
if(jj==0) cout << "WAITING....." <<endl>Branch("riv",&data_tree.idelev,"idelev/I");
t->Branch("xpb_time_vect",&data_tree.xpb_time_vect,"xpb_time_vect");
t->Branch("ypb_sub_vect",&data_tree.ypb_sub_vect,"ypb_sub_vect");
t->Branch("meanback_peak",&data_tree.meanback_peak,"meanback_peak");
t->Branch("peak_integral",&data_tree.peak_integral,"peak_integral");
t->Branch("time_start",&data_tree.time_start,"time_start");
t->Branch("beaminfo",&data_tree.beaminfo,"beaminfo");
for(int i=0; i<nfoundb>Fill();
}
t->Write();
f->Close();
}
The problem is that it creates different trees every time it enters this loop (well this is expected i think even if they are not Autosave), for example:
KEY: TTree t;9 DST DATA
KEY: TTree t;8 DST DATA
KEY: TTree t;7 DST DATA
KEY: TTree t;6 DST DATA
KEY: TTree t;5 DST DATA
KEY: TTree t;4 DST DATA
KEY: TTree t;3 DST DATA
KEY: TTree t;2 DST DATA
KEY: TTree t;1 DST DATA
How is it possible to append data on the same TTree?
Regards,
Marco