ClassImp(AliEMCALLoader)
-const TString AliEMCALLoader::fgkECARecPointsBranchName("EMCALECARP");//Name for branch with ECA Reconstructed Points
-AliEMCALCalibData* AliEMCALLoader::fgCalibData = 0; //calibation data
+const TString AliEMCALLoader::fgkECARecPointsBranchName("EMCALECARP");//Name for branch with ECA Reconstructed Points
+AliEMCALCalibData* AliEMCALLoader::fgCalibData = 0; //calibration data
+AliCaloCalibPedestal* AliEMCALLoader::fgCaloPed = 0; //dead map data
+AliEMCALSimParam* AliEMCALLoader::fgSimParam = 0; //simulation parameters
//____________________________________________________________________________
AliEMCALLoader::AliEMCALLoader()
AliEMCALLoader::AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername)
: AliLoader(detname,eventfoldername),
fDebug(0),
- fHits(0),
- fDigits(0),
- fSDigits(0),
- fRecPoints(0)
+ fHits(new TClonesArray("AliEMCALHit")),
+ fDigits(new TClonesArray("AliEMCALDigit")),
+ fSDigits(new TClonesArray("AliEMCALDigit")),
+ fRecPoints(new TObjArray())
{
//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),
- fDebug(obj.fDebug),
- fHits(obj.fHits),
- fDigits(obj.fDigits),
- fSDigits(obj.fSDigits),
- fRecPoints(obj.fRecPoints)
+AliEMCALLoader::AliEMCALLoader(const Char_t *name, TFolder *topfolder)
+ : AliLoader(name,topfolder),
+ fDebug(0),
+ fHits(new TClonesArray("AliEMCALHit")),
+ fDigits(new TClonesArray("AliEMCALDigit")),
+ fSDigits(new TClonesArray("AliEMCALDigit")),
+ fRecPoints(new TObjArray())
{
- //copy ctor
+ //Specific constructor for EMCAL Loader class
}
//____________________________________________________________________________
}
+//____________________________________________________________________________
+AliCaloCalibPedestal* AliEMCALLoader::PedestalData()
+{
+ // Check if the instance of AliCaloCalibPedestal exists, if not, create it if
+ // the OCDB is available, and finally return it.
+
+ if(!fgCaloPed && (AliCDBManager::Instance()->IsDefaultStorageSet()))
+ {
+ AliCDBEntry *entry = (AliCDBEntry*)
+ AliCDBManager::Instance()->Get("EMCAL/Calib/Pedestals");
+ if (entry) fgCaloPed = (AliCaloCalibPedestal*) entry->GetObject();
+ }
+
+ if(!fgCaloPed)
+ AliFatal("Pedestal info not found in CDB!");
+
+ return fgCaloPed;
+
+}
+
+//____________________________________________________________________________
+AliEMCALSimParam* AliEMCALLoader::SimulationParameters()
+{
+ // Check if the instance of AliEMCALSimParam exists, if not, create it if
+ // the OCDB is available, and finally return it.
+
+ if(!fgSimParam && (AliCDBManager::Instance()->IsDefaultStorageSet()))
+ {
+ AliCDBEntry *entry = (AliCDBEntry*)
+ AliCDBManager::Instance()->Get("EMCAL/Calib/SimParam");
+ if (entry) fgSimParam = (AliEMCALSimParam*) entry->GetObject();
+
+ }
+
+ if(!fgSimParam)
+ AliFatal("Simulations parameters not found in CDB!");
+
+ return fgSimParam;
+
+}
+
//____________________________________________________________________________
Int_t AliEMCALLoader::CalibrateRaw(Double_t energy, Int_t module,
Int_t column, Int_t row)
TBranch * branchH = treeH->GetBranch(fDetectorName);
branchH->SetAddress(&tempArr);
for (Int_t iEnt = 0; iEnt < nEnt; iEnt++) {
- treeH->GetEntry(iEnt);
+ //treeH->GetEntry(iEnt);
+ branchH->GetEntry(iEnt);
Int_t nHit = tempArr->GetEntriesFast();
for (Int_t iHit = 0; iHit < nHit; iHit++) {
new ((*fHits)[index]) AliEMCALHit(*((AliEMCALHit*)tempArr->At(iHit)));
TBranch * branchS = treeS->GetBranch(fDetectorName);
branchS->ResetAddress();
if (fSDigits) {
- fSDigits->Delete();
- delete fSDigits;
- fSDigits = 0x0;
+ fSDigits->Clear();
}
branchS->SetAddress(&fSDigits);
- treeS->GetEvent(0);
+ branchS->GetEntry(0);
+ //treeS->GetEvent(0);
}
// Digits
TBranch * branchD = treeD->GetBranch(fDetectorName);
branchD->ResetAddress();
if (fDigits) {
- fDigits->Delete();
- delete fDigits;
- fDigits = 0x0;
+ fDigits->Clear();
}
branchD->SetAddress(&fDigits);
- treeD->GetEvent(0);
+ branchD->GetEntry(0);
+ //treeD->GetEvent(0);
}
// RecPoints
TBranch * branchR = treeR->GetBranch(fgkECARecPointsBranchName);
branchR->ResetAddress();
if (fRecPoints) {
- fRecPoints->Delete();
- delete fRecPoints;
- fRecPoints = 0x0;
+ fRecPoints->Clear();
}
branchR->SetAddress(&fRecPoints);
- treeR->GetEvent(0);
+ //treeR->GetEvent(0);
+ branchR->GetEntry(0);
}
return 0;