+//_____________________________________________________________________
+void AliEMCALDigitizer::Decalibrate(AliEMCALDigit *digit)
+{
+ // Load Geometry
+ const AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
+
+ if (!geom) {
+ AliFatal("Did not get geometry from EMCALLoader");
+ return;
+ }
+
+ 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("Decalibrate","Wrong cell id number : absId %i ", absId) ;
+ geom->GetCellPhiEtaIndexInSModule(iSupMod,nModule,nIphi, nIeta,iphi,ieta);
+
+ if (fCalibData) {
+ fADCchannelEC = fCalibData->GetADCchannel(iSupMod,ieta,iphi);
+ float factor = 1./(fADCchannelEC/0.0162);
+
+ *digit = *digit * factor;
+ }
+}
+
+//_____________________________________________________________________
+void AliEMCALDigitizer::CalibrateADCTime(Float_t & adc, Float_t & time, const Int_t absId)
+{
+ // Returns the energy in a cell absId with a given adc value
+ // using the calibration constants stored in the OCDB. Time also corrected from parameter in OCDB
+ // Used in case of embedding, transform ADC counts from real event into energy
+ // so that we can add the energy of the simulated sdigits which are in energy
+ // units.
+ // Same as in AliEMCALClusterizer::Calibrate() but here we do not reject channels being marked as hot
+ // or with time out of window
+
+ // Load Geometry
+ const AliEMCALGeometry * geom = AliEMCALGeometry::GetInstance();
+
+ if (!geom){
+ AliFatal("Did not get geometry from EMCALLoader");
+ return;
+ }
+
+ 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("CalibrateADCTime","Wrong cell id number : absId %i ", absId) ;
+ geom->GetCellPhiEtaIndexInSModule(iSupMod,nModule,nIphi, nIeta,iphi,ieta);
+
+ if(fCalibData) {
+ fADCpedestalEC = fCalibData->GetADCpedestal(iSupMod,ieta,iphi);
+ fADCchannelEC = fCalibData->GetADCchannel (iSupMod,ieta,iphi);
+ fTimeChannel = fCalibData->GetTimeChannel(iSupMod,ieta,iphi,0);// Assign bunch crossing number equal to 0 (has simulation different bunch crossings?)
+ }
+
+ adc = adc * fADCchannelEC - fADCpedestalEC;
+ time -= fTimeChannel;