- ped->SetValueAsDouble(channelId, 1, TMath::Sqrt(TMath::Abs(pedSigma/(Double_t)eventCounter - pedMean*pedMean)));
- if(manuId == 0)
- {
- ped->SetValueAsDouble(channelId, 0, ADCMax());
+ ped->SetValueAsDouble(channelId, 1, TMath::Sqrt(TMath::Abs(pedSigma/(Double_t)eventCounter - pedMean*pedMean)));
+
+ if(eventCounter < fNEvthreshold )
+ { nADCmax++; ped->SetValueAsDouble(channelId, 0, ADCMax());
+ ped->SetValueAsDouble(channelId, 1, ADCMax());}
+ if( ped->ValueAsDouble(channelId, 1) < pedSigmalimit )
+ { nADC4090++; ped->SetValueAsDouble(channelId, 0, ADCMax()-5);
+ ped->SetValueAsDouble(channelId, 1, ADCMax()-5);}
+ if(manuId == 0 || occupancy>1)
+ { nADCmax++; ped->SetValueAsDouble(channelId, 0, ADCMax());