]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSPID.cxx
Updates.
[u/mrichter/AliRoot.git] / PHOS / AliPHOSPID.cxx
index 95aa0728807b34174af24ace286050f8ee3fbf01..8f403718e023dc8169fe91da11499296b86546e4 100644 (file)
@@ -48,7 +48,8 @@ AliPHOSPID::AliPHOSPID():
   fEMCRecPoints(NULL),
   fCPVRecPoints(NULL),
   fTrackSegments(NULL),
-  fRecParticles(NULL)
+  fRecParticles(NULL),
+  fEnergyCorrectionOn(kTRUE)
 {
   // ctor
 }
@@ -62,9 +63,12 @@ AliPHOSPID::AliPHOSPID(AliPHOSGeometry *geom):
   fEMCRecPoints(NULL),
   fCPVRecPoints(NULL),
   fTrackSegments(NULL),
-  fRecParticles(NULL)
+  fRecParticles(NULL),
+  fEnergyCorrectionOn(kTRUE)
 {
   // ctor
+  fEMCRecPoints = new TObjArray(100) ;
+  fCPVRecPoints = new TObjArray(100) ;
   fRecParticles = new TClonesArray("AliPHOSRecParticle",100) ;
   fRecParticles->SetName("RECPARTICLES");
 
@@ -78,7 +82,8 @@ AliPHOSPID::AliPHOSPID(const AliPHOSPID & pid) :
   fEMCRecPoints(pid.fEMCRecPoints),
   fCPVRecPoints(pid.fCPVRecPoints),
   fTrackSegments(pid.fTrackSegments),
-  fRecParticles(pid.fRecParticles)
+  fRecParticles(pid.fRecParticles),
+  fEnergyCorrectionOn(pid.fEnergyCorrectionOn)
 {
   // Copy constructor
 }
@@ -95,6 +100,10 @@ AliPHOSPID::~AliPHOSPID()
     fCPVRecPoints->Delete();
     delete fCPVRecPoints;
   }
+  if (fRecParticles) {
+    fRecParticles->Delete();
+    delete fRecParticles;
+  }
 }
 
 //____________________________________________________________________________
@@ -112,8 +121,8 @@ void AliPHOSPID::SetInput(TTree *clustersTree, TClonesArray *trackSegments)
     AliError("can't get the branch with the PHOS EMC clusters !");
     return;
   }
-  fEMCRecPoints = new TObjArray(100) ;
   emcbranch->SetAddress(&fEMCRecPoints);
+  fEMCRecPoints->Delete();
   emcbranch->GetEntry(0);
 
   TBranch *cpvbranch = clustersTree->GetBranch("PHOSCpvRP");
@@ -121,7 +130,7 @@ void AliPHOSPID::SetInput(TTree *clustersTree, TClonesArray *trackSegments)
     AliError("can't get the branch with the PHOS CPV clusters !");
     return;
   }
-  fCPVRecPoints = new TObjArray(100) ;
   cpvbranch->SetAddress(&fCPVRecPoints);
+  fCPVRecPoints->Delete();
   cpvbranch->GetEntry(0);
 }