fRecParticles(NULL)
{
// ctor
+ fEMCRecPoints = new TObjArray(100) ;
+ fCPVRecPoints = new TObjArray(100) ;
fRecParticles = new TClonesArray("AliPHOSRecParticle",100) ;
fRecParticles->SetName("RECPARTICLES");
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");
AliError("can't get the branch with the PHOS CPV clusters !");
return;
}
- fCPVRecPoints = new TObjArray(100) ;
cpvbranch->SetAddress(&fCPVRecPoints);
+ fCPVRecPoints->Delete();
cpvbranch->GetEntry(0);
}
//____________________________________________________________________________
AliPHOSReconstructor::AliPHOSReconstructor() :
- fGeom(NULL),fClusterizer(NULL)
+ fGeom(NULL),fClusterizer(NULL),fTSM(NULL),fPID(NULL)
{
// ctor
}
fGeom = AliPHOSGeometry::GetInstance("IHEP","");
- fClusterizer = new AliPHOSClusterizerv1(fGeom);
+ fClusterizer = new AliPHOSClusterizerv1 (fGeom);
+ fTSM = new AliPHOSTrackSegmentMakerv1(fGeom);
+ fPID = new AliPHOSPIDv1 (fGeom);
}
//____________________________________________________________________________
// dtor
delete fGeom;
delete fClusterizer;
+ delete fTSM;
+ delete fPID;
}
//____________________________________________________________________________
// then it creates AliESDtracks out of them and
// write tracks to the ESD
- AliPHOSTrackSegmentMaker *tsm = new AliPHOSTrackSegmentMakerv1(fGeom);
- AliPHOSPID *pid = new AliPHOSPIDv1 (fGeom);
// do current event; the loop over events is done by AliReconstruction::Run()
- tsm->SetESD(esd) ;
- tsm->SetInput(clustersTree);
+ fTSM->SetESD(esd) ;
+ fTSM->SetInput(clustersTree);
if ( Debug() )
- tsm->Clusters2TrackSegments("deb all") ;
+ fTSM->Clusters2TrackSegments("deb all") ;
else
- tsm->Clusters2TrackSegments("") ;
+ fTSM->Clusters2TrackSegments("") ;
- pid->SetInput(clustersTree, tsm->GetTrackSegments()) ;
- pid->SetESD(esd) ;
+ fPID->SetInput(clustersTree, fTSM->GetTrackSegments()) ;
+ fPID->SetESD(esd) ;
if ( Debug() )
- pid->TrackSegments2RecParticles("deb all") ;
+ fPID->TrackSegments2RecParticles("deb all") ;
else
- pid->TrackSegments2RecParticles("") ;
+ fPID->TrackSegments2RecParticles("") ;
// This function creates AliESDtracks from AliPHOSRecParticles
// and
// writes them to the ESD
- TClonesArray *recParticles = pid->GetRecParticles();
- Int_t nOfRecParticles = recParticles->GetEntries();
+ TClonesArray *recParticles = fPID->GetRecParticles();
+ Int_t nOfRecParticles = recParticles->GetEntriesFast();
esd->SetNumberOfPHOSClusters(nOfRecParticles) ;
esd->SetFirstPHOSCluster(esd->GetNumberOfCaloClusters()) ;
if (Debug())
rp->Print();
// Get track segment and EMC rec.point associated with this rec.particle
- AliPHOSTrackSegment *ts = static_cast<AliPHOSTrackSegment *>(tsm->GetTrackSegments()
+ AliPHOSTrackSegment *ts = static_cast<AliPHOSTrackSegment *>(fTSM->GetTrackSegments()
->At(rp->GetPHOSTSIndex()));
AliPHOSEmcRecPoint *emcRP = static_cast<AliPHOSEmcRecPoint *>(emcRecPoints->At(ts->GetEmcIndex()));
delete digitsArray;
emcRecPoints->Delete();
delete emcRecPoints;
- delete tsm;
- delete pid;
+ recParticles->Delete();
}
//____________________________________________________________________________
private:
static Bool_t fgDebug ; //! verbosity controller
- static AliPHOSRecoParam *fgkRecoParamEmc; // reconstruction parameters for EMC
- static AliPHOSRecoParam *fgkRecoParamCpv; // reconstruction parameters for EMC
- AliPHOSGeometry *fGeom; // pointer to the PHOS geometry
- AliPHOSClusterizerv1 *fClusterizer; //! PHOS clusterizer
-
- ClassDef(AliPHOSReconstructor,5) // PHOS Reconstruction class
+ static AliPHOSRecoParam *fgkRecoParamEmc; // reconstruction parameters for EMC
+ static AliPHOSRecoParam *fgkRecoParamCpv; // reconstruction parameters for EMC
+ AliPHOSGeometry *fGeom; // pointer to the PHOS geometry
+ AliPHOSClusterizerv1 *fClusterizer; //! PHOS clusterizer
+ AliPHOSTrackSegmentMaker *fTSM; //! PHOS TrackSegmentMaker
+ AliPHOSPID *fPID; //! PHOS PID maker
+
+ ClassDef(AliPHOSReconstructor,6) // PHOS Reconstruction class
};
fCPVRecPoints(0)
{
// ctor
+ fEMCRecPoints = new TObjArray(100) ;
+ fCPVRecPoints = new TObjArray(100) ;
}
//____________________________________________________________________________
fCPVRecPoints(0)
{
// ctor
+ fEMCRecPoints = new TObjArray(100) ;
+ fCPVRecPoints = new TObjArray(100) ;
}
//____________________________________________________________________________
//____________________________________________________________________________
void AliPHOSTrackSegmentMaker::SetInput(TTree *clustersTree)
{
- // Read the clusters tree and creates the
- // arrays with the EMC and CPV
- // clusters.
- // and set the corresponding branch addresses
+ // Read the clusters tree and set addresses to the
+ // arrays with the EMC and CPV clusters
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);
+ fEMCRecPoints->Delete();
emcbranch->GetEntry(0);
TBranch *cpvbranch = clustersTree->GetBranch("PHOSCpvRP");
AliError("can't get the branch with the PHOS CPV clusters !");
return;
}
- fCPVRecPoints = new TObjArray(100) ;
cpvbranch->SetAddress(&fCPVRecPoints);
+ fCPVRecPoints->Delete();
cpvbranch->GetEntry(0);
}