19 string boolToString(
bool val) {
20 return val ?
"true" :
"false";
30 : m_LogLevel(ps.
get<
int>(
"LogLevel")),
32 m_BinsBefore(ps.
get<unsigned
int>(
"BinsBefore")),
33 m_BinsAfter(ps.
get<unsigned
int>(
"BinsAfter")),
34 m_FlagPositive(ps.
get<
bool>(
"FlagPositive")),
35 m_FlagNegative(ps.
get<
bool>(
"FlagNegative")),
37 const string myname =
"AdcThresholdSignalFinder::ctor: ";
39 if ( pdtm ==
nullptr ) {
40 cout << myname <<
"ERROR: Unable to retrieve tool manager." <<
endl;
42 string stnam =
"runDataTool";
46 cout << myname <<
"ERROR: RunDataTool " << stnam
47 <<
" not found. Scale factor formula will not be evaluated." <<
endl;
49 cout << myname <<
"RunDataTool retrieved." <<
endl;
54 cout << myname <<
"Configuration parameters:" <<
endl;
67 const string myname =
"AdcThresholdSignalFinder::update: ";
71 cout << myname <<
"ERROR: No samples found in channel " << acd.
channel() <<
endl;
78 if ( ! rdat.
isValid() ) cout << myname <<
"WARNING: RunData not found." <<
endl;
89 acd.
signal.resize(nsam,
false);
92 for (
AdcIndex isam=0; isam<nsam; ++isam ) {
98 AdcIndex jsam1 = isam > nsamlo ? isam - nsamlo : 0;
99 if ( jsam1 < isamUnknown ) jsam1 = isamUnknown;
101 if ( jsam2 > nsam ) jsam2 = nsam;
102 if (
m_LogLevel >= 4 ) cout << myname <<
"Trigger: sample[" << isam
103 <<
"] = " << val <<
" ==> range: [" 104 << jsam1 <<
", " << jsam2 <<
")" <<
endl;
105 for (
AdcIndex jsam=jsam1; jsam<jsam2; ++jsam ) acd.
signal[jsam] =
true;
111 cout << myname <<
" # ticks above threshold: " << nbinAbove <<
endl;
112 cout << myname <<
" # ROI: " << acd.
rois.size() <<
endl;
115 ret.
setInt(
"nThresholdBins", nbinAbove);
void setFloat(Name name, float val)
DataMap update(AdcChannelData &acd) const override
DataMap & setStatus(int stat)
unsigned int m_BinsBefore
void setInt(Name name, int val)
static constexpr double ps
DataMap view(const AdcChannelData &acd) const override
AdcThresholdSignalFinder(fhicl::ParameterSet const &ps)
auto const & get(AssnsNode< L, R, D > const &r)
SetStat setFormulaPars(TFormula *form)
QTextStream & endl(QTextStream &s)