]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALClusterizer.cxx
Digit header added
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALClusterizer.cxx
index 325aef62c2b7d6848b49f0f6c773ab4004f3f20d..c36b80125d682a572d6356d9082c46522ddd6c70 100644 (file)
 //  Base class for the clusterization algorithm (pure abstract)
 //*--
 //*-- Author: Yves Schutz  SUBATECH 
+// Modif: 
+//  August 2002 Yves Schutz: clone PHOS as closely as possible and intoduction
+//                           of new  IO (à la PHOS)
 //////////////////////////////////////////////////////////////////////////////
 
 // --- ROOT system ---
-
+#include "TClonesArray.h"
+#include "TTree.h"
 
 // --- Standard library ---
 
 
-
 // --- AliRoot header files ---
-
 #include "AliEMCALClusterizer.h"
+#include "AliLog.h"
 
 ClassImp(AliEMCALClusterizer)
 
 //____________________________________________________________________________
-  AliEMCALClusterizer::AliEMCALClusterizer():TTask("","")
+AliEMCALClusterizer::AliEMCALClusterizer():
+  fDigitsArr(NULL),
+  fTreeR(NULL),
+  fRecPoints(NULL)
 {
   // ctor
 }
+
 //____________________________________________________________________________
-AliEMCALClusterizer::AliEMCALClusterizer(const char* headerFile, const char* name):
-TTask(name, headerFile)
+AliEMCALClusterizer::~AliEMCALClusterizer()
 {
-  // ctor
+  // dtor
+  if (fDigitsArr) {
+    fDigitsArr->Delete();
+    delete fDigitsArr;
+  }
+  if (fRecPoints) {
+    fRecPoints->Delete();
+    delete fRecPoints;
+  }
 }
 
 //____________________________________________________________________________
-AliEMCALClusterizer::~AliEMCALClusterizer()
+void AliEMCALClusterizer::SetInput(TTree *digitsTree)
 {
-  // dtor
+  // Read the digits from the input tree
+  TBranch *branch = digitsTree->GetBranch("EMCAL");
+  if (!branch) { 
+    AliError("can't get the branch with the EMCAL digits !");
+    return;
+  }
+  fDigitsArr = new TClonesArray("AliEMCALDigit",100);
+  branch->SetAddress(&fDigitsArr);
+  branch->GetEntry(0);
+}
+
+//____________________________________________________________________________
+void AliEMCALClusterizer::SetOutput(TTree *clustersTree)
+{
+  // Read the digits from the input tree
+  fTreeR = clustersTree;
+  
+  AliDebug(9, "Making array for EMCAL clusters");
+  fRecPoints = new TObjArray(100) ;
+  Int_t split = 0;
+  Int_t bufsize = 32000;
+  fTreeR->Branch("EMCALECARP", "TObjArray", &fRecPoints, bufsize, split);
 }