cleaning before reading new data added in ReadTreeR
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Dec 2002 16:58:58 +0000 (16:58 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Dec 2002 16:58:58 +0000 (16:58 +0000)
PHOS/AliPHOSGetter.cxx

index 61a2aeb3e32448d818877d320aa91e77bc352780..7ed5a920fea19e4961b78722b4cadeb80c5165ea 100644 (file)
@@ -1647,6 +1647,8 @@ Int_t AliPHOSGetter::ReadTreeD(const Int_t event)
   //read digits
   if(!Digits(fDigitsTitle) ) 
     PostDigits(fDigitsTitle);
+  else
+    Digits(fDigitsTitle)->Clear() ;
   digitsbranch->SetAddress(DigitsRef(fDigitsTitle)) ;
   digitsbranch->GetEntry(0) ;
   
@@ -1837,6 +1839,17 @@ Int_t AliPHOSGetter::ReadTreeR(const Int_t event)
   // any migh have become obsolete : to be checked
   // See AliPHOSPIDv1    
 
+  //first - clean if necessary
+  if(EmcRecPoints(fRecPointsTitle)){
+    EmcRecPoints(fRecPointsTitle)->Delete() ;
+    CpvRecPoints(fRecPointsTitle)->Delete() ;
+  }
+  //clear TrackSegments
+  if(TrackSegments(fTrackSegmentsTitle))
+    TrackSegments(fTrackSegmentsTitle)->Clear() ;
+  if(RecParticles(fRecParticlesTitle))
+    RecParticles(fRecParticlesTitle)->Clear() ;
+       
   TTree * treeR ;
   if(fToSplit){
     TFile * file = static_cast<TFile*>(gROOT->GetFile(fRecPointsFileName)); 
@@ -1889,7 +1902,6 @@ Int_t AliPHOSGetter::ReadTreeR(const Int_t event)
   } else { 
     if(!EmcRecPoints(fRecPointsTitle) ) 
       PostRecPoints(fRecPointsTitle) ;
-    
     emcbranch->SetAddress(EmcRecPointsRef(fRecPointsTitle)) ;
     emcbranch->GetEntry(0) ;