+//____________________________________________________________________________
+AliPHOSTrackSegmentMaker::~AliPHOSTrackSegmentMaker()
+{
+ //Remove this from the parental task before destroying
+ if (fEMCRecPoints) {
+ fEMCRecPoints->Delete();
+ delete fEMCRecPoints;
+ }
+ if (fCPVRecPoints) {
+ fCPVRecPoints->Delete();
+ delete fCPVRecPoints;
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSTrackSegmentMaker::SetInput(TTree *clustersTree)
+{
+ // 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;
+ }
+ emcbranch->SetAddress(&fEMCRecPoints);
+ fEMCRecPoints->Delete();
+ emcbranch->GetEntry(0);
+
+ TBranch *cpvbranch = clustersTree->GetBranch("PHOSCpvRP");
+ if (!cpvbranch) {
+ AliError("can't get the branch with the PHOS CPV clusters !");
+ return;
+ }
+ cpvbranch->SetAddress(&fCPVRecPoints);
+ fCPVRecPoints->Delete();
+ cpvbranch->GetEntry(0);
+}