28 const string myname =
"StuckBitAdcDistortionService::ctor: ";
33 bool haveSeed = pset.get_if_present<
int>(
"RandomSeed",
m_RandomSeed);
34 pset.get_if_present<
int>(
"LogLevel",
m_LogLevel);
38 if (
m_LogLevel > 0 ) cout << myname <<
"WARNING: Using hardwired seed." <<
endl;
41 string rname =
"StuckBitAdcDistortionService";
42 if (
m_LogLevel > 0 ) cout << myname <<
"Using NuRandomService." <<
endl;
44 m_pran =
new HepJamesRandom;
46 seedSvc->registerEngine(NuRandomService::CLHEPengineSeeder(
m_pran), rname);
50 mf::LogInfo(
"SimWireDUNE") <<
" using ADC stuck code probabilities from .root file " ;
54 std::unique_ptr<TFile> fin(
new TFile(fname.c_str(),
"READ"));
57 <<
"Could not find the ADC stuck code probabilities file " <<
fname;
58 TString iOverflowHistoName = Form(
"%s", fStuckBitsOverflowProbHistoName.c_str());
59 TProfile *overflowtemp = (TProfile*) fin->Get( iOverflowHistoName );
62 <<
"Could not find the ADC code overflow probabilities histogram " 64 if ( overflowtemp->GetNbinsX() != 64 )
66 <<
"Overflow ADC stuck code probability histograms must have 64 bins.";
67 TString iUnderflowHistoName = Form(
"%s", fStuckBitsUnderflowProbHistoName.c_str());
68 TProfile *underflowtemp = (TProfile*) fin->Get(iUnderflowHistoName);
71 <<
"Could not find the ADC code underflow probabilities histogram " 73 if ( underflowtemp->GetNbinsX() != 64 )
75 <<
"Underflow ADC stuck code probability histograms must have 64 bins.";
76 for (
unsigned int cellnumber=0; cellnumber < 64; ++cellnumber ) {
77 fOverflowProbs[cellnumber] = overflowtemp->GetBinContent(cellnumber+1);
78 fUnderflowProbs[cellnumber] = underflowtemp->GetBinContent(cellnumber+1);
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
double fOverflowProbs[64]
array of probs for LSF bits getting stuck at 000000
CLHEP::HepRandomEngine * m_pran
std::string fStuckBitsOverflowProbHistoName
Name of hist with ADC stuck code overflow probs.
double fUnderflowProbs[64]
array of probs for LSF bits getting stuck at 111111
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::string fStuckBitsProbabilitiesFname
file holding ADC stuck code probabilities
std::string fStuckBitsUnderflowProbHistoName
Name of hist with ADC stuck code underflow probs.
QTextStream & endl(QTextStream &s)