+ cout<< "\n" << fPrefixLDC.Data() << " : See list of Buspatches with lower statistics (due to parity errors) in .log or .ped file "<<endl;
+ (*fFilcout)<<"\nWarning: Buspatches with less statistics (due to parity errors)"<<endl;
+ TIter nextParityError(fErrorBuspatchTable->CreateIterator());
+ AliMUONErrorCounter* parityerror;
+ while((parityerror = static_cast<AliMUONErrorCounter*>(nextParityError())))
+ {
+ // cout<<" bp "<<parityerror->BusPatch()<<": used events = "<<fNEvents-parityerror->Events()<<endl;
+ (*fFilcout)<<" bp "<<parityerror->BusPatch()<<": used events = "<<fNEvents-parityerror->Events()<<endl;
+ }
+ }
+
+ Int_t nADC4090=0;
+ Int_t nADCmax=0;
+ // iterator over pedestal
+ TIter next(fPedestalStore ->CreateIterator());
+ AliMUONVCalibParam* ped;
+
+ while ( ( ped = dynamic_cast<AliMUONVCalibParam*>(next() ) ) )
+ {
+ busPatchId = ped->ID0();
+ manuId = ped->ID1();
+ if(manuId==0)
+ {
+ cout << fPrefixLDC.Data() << " : Warning: ManuId = " << manuId << " !!! in BP = " << busPatchId << endl;
+ (*fFilcout) << "Warning: ManuId = " << manuId << " !!! in BP = " << busPatchId << endl;
+ }
+ Int_t eventCounter;
+ // Correct the number of events for buspatch with errors
+ AliMUONErrorCounter* errorCounter;
+ if ((errorCounter = (AliMUONErrorCounter*)fErrorBuspatchTable->FindObject(busPatchId)))
+ {
+ eventCounter = fNEvents - errorCounter->Events();
+ }
+ else
+ {
+ eventCounter = fNEvents;
+ }
+ Int_t occupancy=0; // channel missing in raw data or read but rejected (case of parity error)
+ // value of (buspatch, manu) occupancy
+ AliMUONErrorCounter* manuCounter;
+ manuCounter = static_cast<AliMUONErrorCounter*>(fManuBuspatchTable->FindObject(busPatchId,manuId));
+ if(eventCounter>0)occupancy = manuCounter->Events()/64/eventCounter;
+ if(occupancy>1)
+ {
+ cout << fPrefixLDC.Data() << " : Warning: ManuId = " << manuId << " !!! in BP = " << busPatchId << " occupancy (>1) = " << occupancy << endl;
+ (*fFilcout) << "Warning: ManuId = " << manuId << " !!! in BP = " << busPatchId << " occupancy (>1) = " << occupancy <<endl;
+ }
+
+ for (channelId = 0; channelId < ped->Size() ; ++channelId)
+ {
+ pedMean = ped->ValueAsDouble(channelId, 0);
+
+ if (pedMean >= 0) // connected channels
+ {
+ ped->SetValueAsDouble(channelId, 0, pedMean/(Double_t)eventCounter);
+ pedMean = ped->ValueAsDouble(channelId, 0);
+ pedSigma = ped->ValueAsDouble(channelId, 1);
+ 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());
+ ped->SetValueAsDouble(channelId, 1, ADCMax());
+ if(occupancy>1 && channelId==0)ped->SetValueAsDouble(channelId, 0, ADCMax()+occupancy);}
+ }
+ else
+ { nADCmax++; ped->SetValueAsDouble(channelId, 0, ADCMax());
+ ped->SetValueAsDouble(channelId, 1, ADCMax());}
+ }