+//____________________________________________________________________
+Bool_t
+AliFMDDisplay::ProcessRawCalibDigit(AliFMDDigit* digit)
+{
+ // Process a digit
+ // Parameters:
+ // digit Digit information
+ static const Float_t rMin = fgkMultRange.fLow;
+ static const Float_t rMax = fgkMultRange.fHigh;
+ static const Float_t aMin = fgkAdcRange.fLow;
+ static const Float_t aMax = fgkAdcRange.fHigh;
+
+ if (!digit) { AliError("No digit"); return kFALSE; }
+
+ AliFMDParameters* parm = AliFMDParameters::Instance();
+ UShort_t det = digit->Detector();
+ Char_t ring = digit->Ring();
+ UShort_t sec = digit->Sector();
+ UShort_t str = digit->Strip();
+ Double_t gain = parm->GetPulseGain(det, ring, sec, str);
+ Double_t ped = parm->GetPedestal(det, ring, sec, str);
+ Double_t threshold = GetADCThreshold(det, ring, sec, str);
+ Float_t counts = digit->Counts();
+ if (threshold < 0) { counts += -threshold; threshold = 0; ped = 0; }
+
+ // Double_t edep = ((counts * parm->GetEdepMip() /
+ // (gain * parm->GetDACPerMIP()));
+ Double_t mult = (counts-ped) / (gain * parm->GetDACPerMIP());
+ if (gain < 0.1 || gain > 10) mult = 0;
+
+
+ AliFMDDebug(10, ("FMD%d%c[%02d,%03d] adc %4d "
+ "(threshold %4d, gain %6.3f) -> mult %7.4f",
+ det, ring, sec, str, int(counts), int(threshold),
+ gain, mult));
+ if (fHits) fHits->Add(digit);
+ if (fSpec) fSpec->Fill(mult);
+ if (!InsideCut(counts-threshold, aMin, aMax)) return kTRUE;
+ if (fSpecCut) fSpecCut->Fill(mult);
+
+ if (mult >= 0)
+ AddMarker(det, ring, sec, str, digit, mult, rMin, rMax);
+ return kTRUE;
+}
+