+//____________________________________________________________________
+AliFMDCalibDeadMap*
+AliFMDPreprocessor::GetDeadChannelMap(AliFMDCalibPedestal* pedcalib,
+ AliFMDCalibGain* gaincalib) {
+ //creating dead channel map. '0' means 51200 entries
+ AliFMDCalibDeadMap* deadmap = new AliFMDCalibDeadMap(0);
+ //deadmap->Reset(kTRUE);
+ Float_t noise = 0;
+ Float_t gain = 0;
+
+ AliFMDParameters* pars = AliFMDParameters::Instance();
+ //Looping over the channels.
+ for(UShort_t det=1;det<=3;det++) {
+ Int_t nRings = (det==1 ? 1 : 2);
+ for (UShort_t ir = 0; ir < nRings; ir++) {
+ Char_t ring = (ir == 0 ? 'I' : 'O');
+ UShort_t nsec = (ir == 0 ? 20 : 40);
+ UShort_t nstr = (ir == 0 ? 512 : 256);
+
+ for(UShort_t sec =0; sec < nsec; sec++) {
+
+ for(UShort_t strip = 0; strip < nstr; strip++) {
+
+ Bool_t isDead = kFALSE;
+ if(pedcalib)
+ noise = pedcalib->Width(det, ring, sec, strip);
+ else
+ noise = pars->GetPedestalWidth(det, ring, sec, strip);
+
+ if(gaincalib)
+ gain = gaincalib->Value(det, ring, sec, strip);
+ else
+ gain = pars->GetPulseGain(det, ring, sec, strip);
+
+ //marking these channels dead.
+ if (gain < 0.5 || gain > 5 || noise > 10 || noise == 0) isDead = kTRUE;
+
+ deadmap->operator()(det, ring, sec, strip) = isDead;
+ }
+ }
+ }
+ }