X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSPID.cxx;h=f9e1843cbcc75d46a4d8de45e9c23b20b1c033e5;hb=9a2cdbdf2db07cb8b641793ae824535214a120e1;hp=3101f1a13510a895023606a211073262a7c862f8;hpb=a2088a90937a4767c5db84a501ca95b05e4acb24;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSPID.cxx b/PHOS/AliPHOSPID.cxx index 3101f1a1351..f9e1843cbcc 100644 --- a/PHOS/AliPHOSPID.cxx +++ b/PHOS/AliPHOSPID.cxx @@ -33,31 +33,99 @@ // --- AliRoot header files --- #include "AliConfig.h" #include "AliPHOSPID.h" +#include "AliPHOSGetter.h" +#include "AliPHOSQualAssDataMaker.h" ClassImp(AliPHOSPID) //____________________________________________________________________________ - AliPHOSPID::AliPHOSPID():TTask("","") +AliPHOSPID::AliPHOSPID(): + TObject(), + fGeom(NULL), + fESD(0x0), + fEMCRecPoints(NULL), + fCPVRecPoints(NULL), + fTrackSegments(NULL), + fRecParticles(NULL), + fQADM(0x0) { // ctor - fEventFolderName = "" ; - fFirstEvent = 0 ; - fLastEvent = -1 ; } //____________________________________________________________________________ -AliPHOSPID::AliPHOSPID(const TString alirunFileName, const TString eventFolderName) -:TTask("PHOS"+AliConfig::fgkPIDTaskName, alirunFileName), fEventFolderName(eventFolderName) +AliPHOSPID::AliPHOSPID(AliPHOSGeometry *geom): + TObject(), + fGeom(geom), + fESD(0x0), + fEMCRecPoints(NULL), + fCPVRecPoints(NULL), + fTrackSegments(NULL), + fRecParticles(NULL), + fQADM(0x0) { // ctor - fFirstEvent = 0 ; - fLastEvent = -1 ; + fRecParticles = new TClonesArray("AliPHOSRecParticle",100) ; + fRecParticles->SetName("RECPARTICLES"); + + fQADM = new AliPHOSQualAssDataMaker() ; //!Quality Assurance Data Maker + GetQualAssDataMaker()->Init(AliQualAss::kRECPARTICLES) ; +} + +//____________________________________________________________________________ +AliPHOSPID::AliPHOSPID(const AliPHOSPID & pid) : + TObject(pid), + fGeom(pid.fGeom), + fESD(pid.fESD), + fEMCRecPoints(pid.fEMCRecPoints), + fCPVRecPoints(pid.fCPVRecPoints), + fTrackSegments(pid.fTrackSegments), + fRecParticles(pid.fRecParticles), + fQADM(pid.fQADM) +{ + // Copy constructor } //____________________________________________________________________________ AliPHOSPID::~AliPHOSPID() { // dtor + if (fEMCRecPoints) { + fEMCRecPoints->Delete(); + delete fEMCRecPoints; + } + if (fCPVRecPoints) { + fCPVRecPoints->Delete(); + delete fCPVRecPoints; + } + delete fQADM ; } +//____________________________________________________________________________ +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); +}