#include "AliCDBStorage.h"
#include "AliCDBManager.h"
#include "AliCDBEntry.h"
-#include "AliEMCALHit.h"
ClassImp(AliEMCALLoader)
const TString AliEMCALLoader::fgkECARecPointsBranchName("EMCALECARP");//Name for branch with ECA Reconstructed Points
const TString AliEMCALLoader::fgkECADigitsBranchName("DIGITS");//Name for branch with ECA Digits
const TString AliEMCALLoader::fgkECASDigitsBranchName("SDIGITS");//Name for branch with ECA SDigits
-const TString AliEMCALLoader::fgkECAHitsBranchName("HITS");//Name for branch with ECA Hits
AliEMCALCalibData* AliEMCALLoader::fgCalibData = 0; //calibration data
//AliCaloCalibPedestal* AliEMCALLoader::fgCaloPed = 0; //dead map data
//____________________________________________________________________________
AliEMCALLoader::AliEMCALLoader()
- : fDebug(0)
+: fDebug(0)
{
//Default constructor for EMCAL Loader Class
-
+
}
//____________________________________________________________________________
: AliLoader(detname,eventfoldername), fDebug(0)
{
//Specific constructor for EMCAL Loader class
+
}
//____________________________________________________________________________
: AliLoader(name,topfolder), fDebug(0)
{
//Specific constructor for EMCAL Loader class
+
}
//____________________________________________________________________________
// Disconnect trees and remove arrays
if (TreeH())
TreeH()->SetBranchAddress(fDetectorName,0);
- if (TreeD())
- TreeD()->SetBranchAddress(fDetectorName,0);
- if (TreeS())
- TreeS()->SetBranchAddress(fDetectorName,0);
- if (TreeR())
- TreeR()->SetBranchAddress(fgkECARecPointsBranchName,0);
+// if (TreeD())
+// TreeD()->SetBranchAddress(fDetectorName,0);
+// if (TreeS())
+// TreeS()->SetBranchAddress(fDetectorName,0);
+// if (TreeR())
+// TreeR()->SetBranchAddress(fgkECARecPointsBranchName,0);
+
+ Clean(fgkECASDigitsBranchName);
+ Clean(fgkECADigitsBranchName);
+ Clean(fgkECARecPointsBranchName);
+
+ AliLoader::CleanFolders();
+
}
//____________________________________________________________________________
AliLoader::GetEvent(); // First call AliLoader to do all the groundwork
// *** Hits ***
- // Initialize the Hits TClonesArray, only if it did not existed before
- MakeHitsArray();
-
- TTree *treeH = TreeH();
- if (treeH) {
- Int_t nEnt = treeH->GetEntries(); // TreeH has array of hits for every primary
- Int_t index = 0;
- TClonesArray *tempArr = 0x0;
- TBranch * branchH = treeH->GetBranch(fDetectorName);
- branchH->SetAddress(&tempArr);
- TClonesArray* hits = const_cast<AliEMCALLoader *>(this)->Hits();
- if (hits) hits->Clear();
- for (Int_t iEnt = 0; iEnt < nEnt; iEnt++) {
- branchH->GetEntry(iEnt);
- Int_t nHit = tempArr->GetEntriesFast();
- for (Int_t iHit = 0; iHit < nHit; iHit++) {
- new ((*hits)[index]) AliEMCALHit(*((AliEMCALHit*)tempArr->At(iHit)));
- index++;
- }
- }
- branchH->ResetAddress();
- if (tempArr) {
- tempArr->Delete();
- delete tempArr;
- }
- }
-
+ // Hits are now handled directly on the AliEMCALSDigitizer, the only place it is requested.
+ // together with AliEveEMCALData
+
// *** SDigits ***
// Initialize the SDigits TClonesArray, only if it did not existed before
MakeSDigitsArray();
// Reset SDigits array and branch
branchS->ResetAddress();
TClonesArray* sdigits = const_cast<AliEMCALLoader *>(this)->SDigits();
- if (sdigits) sdigits->Clear();
+ if (sdigits) sdigits->Clear("C");
branchS->SetAddress(&sdigits);
branchS->GetEntry(0);
// Reset Digits array and branch
branchD->ResetAddress();
TClonesArray* digits = const_cast<AliEMCALLoader *>(this)->Digits();
- if (digits) digits->Clear();
+ if (digits) digits->Clear("C");
branchD->SetAddress(&digits);
branchD->GetEntry(0);
return 0;
}
-//____________________________________________________________________________
-void AliEMCALLoader::MakeHitsArray(){
- // Add Hits array to the data folder
- if (Hits()) return;
- TClonesArray* hits = new TClonesArray("AliEMCALHit",0);
- hits->SetName(fgkECAHitsBranchName);
- GetDetectorDataFolder()->Add(hits);
-}
-
//____________________________________________________________________________
void AliEMCALLoader::MakeSDigitsArray(){
// Add SDigits array to the data folder