- AliEMCALDigit *digit = (AliEMCALDigit*) fDigitsArr->New(idigit);
- digit->SetId(id);
- digit->SetAmplitude(amp);
- digit->SetTime(time);
- digit->SetTimeR(time);
- digit->SetIndexInList(idigit);
- digit->SetType(AliEMCALDigit::kHG);
- //if(Entry()==0) printf("Digit: Id %d, amp %f, time %e, index %d\n",id, amp,time,idigit);
+ Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
+ fGeom->GetCellIndex(id,imod,iTower,iIphi,iIeta);
+ fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
+
+ //Do not include bad channels found in analysis?
+ if( fRecoUtils->IsBadChannelsRemovalSwitchedOn() &&
+ fRecoUtils->GetEMCALChannelStatus(imod, ieta, iphi)){
+ fCellLabels[id]=-1; //reset the entry in the array for next event
+ //printf("Remove channel %d\n",id);
+ continue;
+ }
+
+ //Recalibrate?
+ if(fRecoUtils->IsRecalibrationOn()){
+ //printf("CalibFactor %f times %f for id %d\n",fRecoUtils->GetEMCALChannelRecalibrationFactor(imod,ieta,iphi),amp,id);
+ amp *=fRecoUtils->GetEMCALChannelRecalibrationFactor(imod,ieta,iphi);
+ }
+
+ //Create the digit, put a fake primary deposited energy to trick the clusterizer when checking the most likely primary
+ new((*fDigitsArr)[idigit]) AliEMCALDigit( fCellLabels[id], fCellLabels[id],id, amp, time,AliEMCALDigit::kHG,idigit, 0, 0, 1);
+ //if(fCellLabels[id]>=0)printf("2) Digit cell %d, label %d\n",id,fCellLabels[id]) ;
+ //else printf("2) Digit cell %d, no label, amp %f \n",id,amp) ;
+ fCellLabels[id]=-1; //reset the entry in the array for next event
+
+ //AliEMCALDigit *digit = (AliEMCALDigit*) fDigitsArr->New(idigit);
+ //digit->SetId(id);
+ //digit->SetAmplitude(amp);
+ //digit->SetTime(time);
+ //digit->SetTimeR(time);
+ //digit->SetIndexInList(idigit);
+ //digit->SetType(AliEMCALDigit::kHG);
+
+ //printf("Digit: Id %d, amp %f, time %e, index %d\n",id, amp,time,idigit);