+ AliPMDddldata *pmdddl = (AliPMDddldata*)pmdddlcont.UncheckedAt(ient);
+
+ Int_t det = pmdddl->GetDetector();
+ Int_t smn = pmdddl->GetSMN();
+ //Int_t mcm = pmdddl->GetMCM();
+ //Int_t chno = pmdddl->GetChannel();
+ Int_t row = pmdddl->GetRow();
+ Int_t col = pmdddl->GetColumn();
+ Int_t sig = pmdddl->GetSignal();
+
+ // Pedestal Subtraction
+ Int_t pedmeanrms = fCalibPed->GetPedMeanRms(det,smn,row,col);
+ Int_t pedrms1 = (Int_t) pedmeanrms%1000;
+ Float_t pedrms = (Float_t)pedrms1/10.;
+ Float_t pedmean = (Float_t) (pedmeanrms - pedrms1)/1000.0;
+
+ //printf("%f %f\n",pedmean, pedrms);
+
+ // Float_t sig1 = (Float_t) sig;
+ Float_t sig1 = (Float_t) sig - (pedmean + 3.0*pedrms);
+
+ // CALIBRATION
+ Float_t gain = fCalibGain->GetGainFact(det,smn,row,col);
+ //printf("sig = %d gain = %f\n",sig,gain);
+ sig = (Int_t) (sig1*gain);
+
+ if (indexDDL < 4)
+ {
+ if (det != 0)
+ AliError(Form("*DDL %d and Detector NUMBER %d NOT MATCHING *",
+ indexDDL, det));
+ indexsmn = smn - indexDDL * 6;
+ }
+ else if (indexDDL == 4)
+ {
+ if (det != 1)
+ AliError(Form("*DDL %d and Detector NUMBER %d NOT MATCHING *",
+ indexDDL, det));
+ if (smn < 6)
+ {
+ indexsmn = smn;
+ }
+ else if (smn >= 18 && smn < 24)
+ {
+ indexsmn = smn - 12;
+ }
+ }
+ else if (indexDDL == 5)
+ {
+ if (det != 1)
+ AliError(Form("*DDL %d and Detector NUMBER %d NOT MATCHING *",
+ indexDDL, det));
+ if (smn >= 6 && smn < 12)
+ {
+ indexsmn = smn - 6;
+ }
+ else if (smn >= 12 && smn < 18)
+ {
+ indexsmn = smn - 6;
+ }
+ }
+ precpvADC[indexsmn][row][col] = sig;