AliRunLoader *rl = AliRunLoader::Instance();
AliEMCALLoader *emcalLoader = dynamic_cast<AliEMCALLoader*>(rl->GetDetectorLoader("EMCAL"));
Int_t nEvents = 0;
- if(!emcalLoader){
+ if(!emcalLoader)
+ {
AliFatal("Did not get the Loader");
}
- else{
-
- if (fLastEvent == -1) {
+ else
+ {
+ if (fLastEvent == -1)
fLastEvent = rl->GetNumberOfEvents() - 1 ;
- }
- else if (fDigInput)
+ else if (fDigInput)
fLastEvent = fFirstEvent ; // what is this ??
nEvents = fLastEvent - fFirstEvent + 1;
Int_t ievent = -1;
AliEMCALGeometry *geom = dynamic_cast<AliEMCAL*>(rl->GetAliRun()->GetDetector("EMCAL"))->GetGeometry();
+ if(!geom)
+ {
+ AliFatal("Geometry pointer null");
+ return; // fix for coverity
+ }
+
const Int_t nTRU = geom->GetNTotalTRU();
TClonesArray* digitsTMP = new TClonesArray("AliEMCALDigit", nTRU*96);
TClonesArray* digitsTRG = new TClonesArray("AliEMCALRawDigit", nTRU*96);
if (!emcalLoader) AliFatal("Did not get the Loader");
const AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance();
+ if(!geom)
+ {
+ AliFatal("Geometry pointer null");
+ return; // fix for coverity
+ }
// build FOR from simulated digits
// and xfer to the corresponding TRU input (mapping)
Int_t id = digit->GetId();
Int_t trgid;
- if (geom && geom->GetFastORIndexFromCellIndex(id , trgid))
+ if (geom->GetFastORIndexFromCellIndex(id , trgid))
{
AliDebug(1,Form("trigger digit id: %d from cell id: %d\n",trgid,id));
//__________________________________________________________________
void AliEMCALDigitizer::WriteDigits(TClonesArray* digits, const char* branchName)
-{ // overloaded method
+{
+ // overloaded method
AliEMCALLoader *emcalLoader = dynamic_cast<AliEMCALLoader*>(AliRunLoader::Instance()->GetDetectorLoader("EMCAL"));
if(emcalLoader){
//__________________________________________________________________
Bool_t AliEMCALDigitizer::IsDead(AliEMCALDigit *digit)
{
- AliRunLoader *runLoader = AliRunLoader::Instance();
- AliEMCALLoader *emcalLoader = dynamic_cast<AliEMCALLoader*>(runLoader->GetDetectorLoader("EMCAL"));
- if (!emcalLoader) AliFatal("Did not get the Loader");
-
- AliCaloCalibPedestal *caloPed = emcalLoader->PedestalData();
- if (!caloPed) {
- AliWarning("Could not access pedestal data! No dead channel removal applied");
- return kFALSE;
- }
-
- // Load Geometry
- const AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
- if (!geom) AliFatal("Did not get geometry from EMCALLoader");
-
+ // Check if cell is defined as dead, so that it is not included
+ // input is digit
Int_t absId = digit->GetId();
- Int_t iSupMod = -1;
- Int_t nModule = -1;
- Int_t nIphi = -1;
- Int_t nIeta = -1;
- Int_t iphi = -1;
- Int_t ieta = -1;
-
- Bool_t bCell = geom->GetCellIndex(absId, iSupMod, nModule, nIphi, nIeta) ;
-
- if (!bCell) Error("IsDead","Wrong cell id number : absId %i ", absId) ;
- geom->GetCellPhiEtaIndexInSModule(iSupMod,nModule,nIphi, nIeta,iphi,ieta);
- Int_t channelStatus = (Int_t)(caloPed->GetDeadMap(iSupMod))->GetBinContent(ieta,iphi);
-
- if (channelStatus == AliCaloCalibPedestal::kDead)
- return kTRUE;
- else
- return kFALSE;
+ return IsDead(absId);
+
}
//__________________________________________________________________
Bool_t AliEMCALDigitizer::IsDead(Int_t absId)
{
+ // Check if cell absID is defined as dead, so that it is not included
+
AliRunLoader *runLoader = AliRunLoader::Instance();
AliEMCALLoader *emcalLoader = dynamic_cast<AliEMCALLoader*>(runLoader->GetDetectorLoader("EMCAL"));
- if (!emcalLoader) AliFatal("Did not get the Loader");
-
+ if (!emcalLoader)
+ {
+ AliFatal("Did not get the Loader");
+ return kTRUE;
+ }
+
AliCaloCalibPedestal *caloPed = emcalLoader->PedestalData();
- if (!caloPed) {
+ if (!caloPed)
+ {
AliWarning("Could not access pedestal data! No dead channel removal applied");
return kFALSE;
}
// Load Geometry
const AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
- if (!geom) AliFatal("Did not get geometry from EMCALLoader");
-
+ if (!geom)
+ {
+ AliFatal("Did not get geometry from EMCALLoader");
+ return kTRUE; //coverity
+ }
+
Int_t iSupMod = -1;
Int_t nModule = -1;
Int_t nIphi = -1;