]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALLoader.cxx
standardizing access to AliEMCALRecParams through AliEMCALReconstructor
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALLoader.cxx
index d3f3e94ccdee9329799a6ddbb89f89c0bd572d63..2d28dbc553db8ef5d0a90301328f18cea60018e8 100644 (file)
@@ -94,6 +94,24 @@ AliEMCALLoader::AliEMCALLoader(const Char_t *detname,const Char_t *eventfolderna
   fRecPoints = new TObjArray();
 }
 
+//____________________________________________________________________________
+AliEMCALLoader::AliEMCALLoader(const Char_t *name, TFolder *topfolder)
+  : AliLoader(name,topfolder),
+    fDebug(0),
+    fHits(0),
+    fDigits(0),
+    fSDigits(0),
+    fRecPoints(0)
+{
+  //Specific constructor for EMCAL Loader class
+
+  fDebug=0;
+  fHits = new TClonesArray("AliEMCALHit");
+  fDigits = new TClonesArray("AliEMCALDigit");
+  fSDigits = new TClonesArray("AliEMCALDigit");
+  fRecPoints = new TObjArray();
+}
+
 //____________________________________________________________________________
 AliEMCALLoader::AliEMCALLoader(const AliEMCALLoader & obj)
   : AliLoader(obj),
@@ -147,6 +165,7 @@ AliEMCALCalibData* AliEMCALLoader::CalibData()
   
 }
 
+
 //____________________________________________________________________________ 
 Int_t AliEMCALLoader::CalibrateRaw(Double_t energy, Int_t module, 
                                   Int_t column, Int_t row)
@@ -218,9 +237,7 @@ Int_t AliEMCALLoader::GetEvent()
      TBranch * branchS = treeS->GetBranch(fDetectorName);
      branchS->ResetAddress();
      if (fSDigits) {
-       fSDigits->Delete();
-       delete fSDigits;
-       fSDigits = 0x0;
+       fSDigits->Clear();
      }
      branchS->SetAddress(&fSDigits);
      treeS->GetEvent(0);
@@ -232,9 +249,7 @@ Int_t AliEMCALLoader::GetEvent()
      TBranch * branchD = treeD->GetBranch(fDetectorName);
      branchD->ResetAddress();
      if (fDigits) {
-       fDigits->Delete();
-       delete fDigits;
-       fDigits = 0x0;
+       fDigits->Clear();
      }
      branchD->SetAddress(&fDigits);
      treeD->GetEvent(0);
@@ -246,9 +261,7 @@ Int_t AliEMCALLoader::GetEvent()
      TBranch * branchR = treeR->GetBranch(fgkECARecPointsBranchName);
      branchR->ResetAddress();
      if (fRecPoints) {
-       fRecPoints->Delete();
-       delete fRecPoints;
-       fRecPoints = 0x0;
+       fRecPoints->Clear();
      }
      branchR->SetAddress(&fRecPoints);
      treeR->GetEvent(0);