]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSPID.cxx
Implementation of copy constructor and assignement operators (Marian)
[u/mrichter/AliRoot.git] / PHOS / AliPHOSPID.cxx
index 870471a085b5ec8fc79f1ba77b2e711a4d8e766e..d1bf115ed8ccec7d0897a564b7d60c7c8ae565d2 100644 (file)
 #include "AliConfig.h"
 #include "AliPHOSPID.h"
 #include "AliPHOSGetter.h"
-#include "AliPHOSQualAssDataMaker.h" 
 
 ClassImp(AliPHOSPID)
 
 //____________________________________________________________________________
 AliPHOSPID::AliPHOSPID():
-  TTask("",""),
-  fEventFolderName(""),
-  fFirstEvent(0),
-  fLastEvent(-1),
-  fESD(0x0), 
-  fQADM(0x0)
+  TObject(),
+  fGeom(NULL),
+  fESD(0x0),
+  fEMCRecPoints(NULL),
+  fCPVRecPoints(NULL),
+  fTrackSegments(NULL),
+  fRecParticles(NULL)
 {
   // ctor
 }
 
 
 //____________________________________________________________________________
-AliPHOSPID::AliPHOSPID(const TString alirunFileName, const TString eventFolderName):
-  TTask("PHOS"+AliConfig::Instance()->GetPIDTaskName(), alirunFileName), 
-  fEventFolderName(eventFolderName),
-  fFirstEvent(0),
-  fLastEvent(-1), 
-  fESD(0x0), 
-  fQADM(0x0)
+AliPHOSPID::AliPHOSPID(AliPHOSGeometry *geom):
+  TObject(),
+  fGeom(geom),
+  fESD(0x0),
+  fEMCRecPoints(NULL),
+  fCPVRecPoints(NULL),
+  fTrackSegments(NULL),
+  fRecParticles(NULL)
 {
   // ctor
-  fQADM = new  AliPHOSQualAssDataMaker() ; //!Quality Assurance Data Maker
-  GetQualAssDataMaker()->Init(AliQualAss::kRECPARTICLES) ;    
+  fRecParticles = new TClonesArray("AliPHOSRecParticle",100) ;
+  fRecParticles->SetName("RECPARTICLES");
+
 }
 
 //____________________________________________________________________________
 AliPHOSPID::AliPHOSPID(const AliPHOSPID & pid) :
-  TTask(pid),fEventFolderName(pid.GetEventFolderName()),
-  fFirstEvent(pid.GetFirstEvent()),fLastEvent(pid.GetLastEvent()), 
+  TObject(pid),
+  fGeom(pid.fGeom),
   fESD(pid.fESD), 
-  fQADM(pid.fQADM)
+  fEMCRecPoints(pid.fEMCRecPoints),
+  fCPVRecPoints(pid.fCPVRecPoints),
+  fTrackSegments(pid.fTrackSegments),
+  fRecParticles(pid.fRecParticles)
 {
   // Copy constructor
 }
+
 //____________________________________________________________________________
 AliPHOSPID::~AliPHOSPID()
 {
   // dtor
- //Remove this from the parental task before destroying
-  if(AliPHOSGetter::Instance()->PhosLoader())
-    AliPHOSGetter::Instance()->PhosLoader()->CleanPIDTask();
-  delete fQADM ; 
+  if (fEMCRecPoints) {
+    fEMCRecPoints->Delete();
+    delete fEMCRecPoints;
+  }
+  if (fCPVRecPoints) {
+    fCPVRecPoints->Delete();
+    delete fCPVRecPoints;
+  }
 }
 
+//____________________________________________________________________________
+void AliPHOSPID::SetInput(TTree *clustersTree, TClonesArray *trackSegments)
+{
+  // Read the clusters tree and creates the
+  // arrays with the EMC and CPV
+  // clusters.
+  // and set the corresponding branch addresses
+
+  fTrackSegments = trackSegments;
+
+  TBranch *emcbranch = clustersTree->GetBranch("PHOSEmcRP");
+  if (!emcbranch) { 
+    AliError("can't get the branch with the PHOS EMC clusters !");
+    return;
+  }
+  fEMCRecPoints = new TObjArray(100) ;
+  emcbranch->SetAddress(&fEMCRecPoints);
+  emcbranch->GetEntry(0);
+
+  TBranch *cpvbranch = clustersTree->GetBranch("PHOSCpvRP");
+  if (!cpvbranch) { 
+    AliError("can't get the branch with the PHOS CPV clusters !");
+    return;
+  }
+  fCPVRecPoints = new TObjArray(100) ;
+  cpvbranch->SetAddress(&fCPVRecPoints);
+  cpvbranch->GetEntry(0);
+}