+ if (fDigitsArr) {
+ fDigitsArr->Delete();
+ delete fDigitsArr;
+ }
+ if (fEMCRecPoints) {
+ fEMCRecPoints->Delete();
+ delete fEMCRecPoints;
+ }
+ if (fCPVRecPoints) {
+ fCPVRecPoints->Delete();
+ delete fCPVRecPoints;
+ }
+}
+
+//____________________________________________________________________________
+void AliPHOSClusterizer::SetInput(TTree * digitsTree)
+{
+ // Get the tree with digits and sets
+ // the input array with digits for PHOS
+ TBranch *branch = digitsTree->GetBranch("PHOS");
+ if (!branch) {
+ AliError("can't get the branch with the PHOS digits !");
+ return;
+ }
+ fDigitsArr->Clear("C");
+ branch->SetAddress(&fDigitsArr);
+ branch->GetEntry(0);
+}
+
+//____________________________________________________________________________
+void AliPHOSClusterizer::SetOutput(TTree * clustersTree)
+{
+ // Set the output clusters tree,
+ // creates the arrays for EMC and CPV,
+ // and set the corresponding branch addresses
+ fTreeR = clustersTree;
+
+ AliDebug(9, "Making array for EMC clusters");
+ Int_t split = 0;
+ Int_t bufsize = 32000;
+ fTreeR->Branch("PHOSEmcRP", "TObjArray", &fEMCRecPoints, bufsize, split);
+
+ AliDebug(9, "Making array for CPV clusters");
+ fTreeR->Branch("PHOSCpvRP", "TObjArray", &fCPVRecPoints, bufsize, split);