]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALClusterizer.cxx
- removing obsolote classes
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALClusterizer.cxx
index 7a6a4b3fa74d65e526f3f7d8888f7e2f1f32f674..bf4bda5648369090518f53ab930ed20479673daf 100644 (file)
 //////////////////////////////////////////////////////////////////////////////
 
 // --- ROOT system ---
+#include "TClonesArray.h"
+#include "TTree.h"
 
 // --- Standard library ---
 
 
 // --- AliRoot header files ---
-#include "AliRun.h" 
 #include "AliEMCALClusterizer.h"
+#include "AliLog.h"
 
 ClassImp(AliEMCALClusterizer)
 
 //____________________________________________________________________________
-  AliEMCALClusterizer::AliEMCALClusterizer():TTask("","")
+AliEMCALClusterizer::AliEMCALClusterizer():
+  fDigitsArr(NULL),
+  fTreeR(NULL),
+  fRecPoints(NULL)
 {
   // ctor
-  fEventFolderName = "" ;  
-  fFirstEvent = 0 ; 
-  fLastEvent  = -1 ; 
 }
 
 //____________________________________________________________________________
-AliEMCALClusterizer::AliEMCALClusterizer(const TString alirunFileName, const TString eventFolderName):
-  TTask("EMCAL"+AliConfig::fgkReconstructionerTaskName, alirunFileName), fEventFolderName(eventFolderName)
+AliEMCALClusterizer::~AliEMCALClusterizer()
 {
-  // ctor
-  fFirstEvent = 0 ; 
-  fLastEvent  = -1 ;   
+  // 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;
+  }
+  if (!fDigitsArr)
+    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);
+}