12 #include "valgrind/callgrind.h" 18 using std::ostringstream;
30 : m_LogLevel(pset.
get<
int>(
"LogLevel")),
31 m_DoWires(pset.
get<
bool>(
"DoWires")),
34 m_pWireBuildingService(nullptr),
35 m_cgset(m_CallgrindToolNames.
begin(), m_CallgrindToolNames.
end()),
37 const string myname =
"ToolBasedRawDigitPrepService::ctor: ";
42 if ( ptm ==
nullptr ) {
43 cout << myname <<
"ERROR: Unable to retrieve tool manaager." <<
endl;
50 if (
m_LogLevel ) cout << myname <<
" Found tool " << tname <<
" @ " << nt.
tool <<
endl;
54 cout << myname <<
"ERROR: Unable to retrieve display tool " << tname <<
endl;
61 if (
m_LogLevel ) cout << myname <<
"Fetching wire building service." <<
endl;
71 const string myname =
"ToolBasedRawDigitPrepService:dtor: ";
73 cout << myname <<
"WARNING: Event counts are inconsistent: " <<
state().
nevtBegin 79 cout << myname <<
"Event count: " << nevt <<
endl;
81 cout << myname <<
"Time report for " << ntoo <<
" tools." <<
endl;
82 string sunit =
"sec/event";
83 float xnevt =
float(nevt);
88 for (
Index itoo=0; itoo<ntoo; ++itoo ) {
91 cout << myname <<
setw(30) << name <<
":" 93 << time/xnevt <<
" " << sunit <<
endl;
101 const string myname =
"ToolBasedRawDigitPrepService:beginEvent: ";
103 cout << myname <<
"Begin processing run " << devt.
runString();
104 cout <<
" event " << devt.
event;
108 cout << myname <<
"WARNING: Event counts are inconsistent: " <<
state().
nevtBegin 115 DataMap ret = nt.tool->beginEvent(devt);
118 cout << myname <<
"WARNING: Iniitalization for tool " << nt.name
119 <<
" failed for event " << devt.
event <<
" with status code " << ret.
status() <<
endl;
129 const string myname =
"ToolBasedRawDigitPrepService:endEvent: ";
131 cout << myname <<
"End processing run " << devt.
runString();
132 cout <<
" event " << devt.
event;
138 cout << myname <<
"WARNING: Event counts are inconsistent: " <<
state().
nevtBegin 143 DataMap ret = nt.tool->endEvent(devt);
146 cout << myname <<
"WARNING: Event finalization for tool " << nt.name
147 <<
" failed for event " << devt.
event <<
" with status code " << ret.
status() <<
endl;
160 const string myname =
"ToolBasedRawDigitPrepService:prepare: ";
163 if (
m_LogLevel >= 2 ) cout << myname <<
"Processing " << datamap.size() <<
" channels with " 168 if (
m_LogLevel >= 3 ) cout << myname <<
" Running tool " << nt.name <<
endl;
169 bool useCallgrind =
m_cgset.count(nt.name);
170 if ( useCallgrind ) {
171 CALLGRIND_START_INSTRUMENTATION;
172 CALLGRIND_TOGGLE_COLLECT;
175 DataMap ret = nt.tool->updateMap(datamap);
177 if ( useCallgrind ) {
178 CALLGRIND_TOGGLE_COLLECT;
179 CALLGRIND_STOP_INSTRUMENTATION;
184 cout << myname <<
"WARNING: Tool " << nt.name <<
" failed";
187 cout <<
" for " << ncha <<
" channel" << (ncha == 1 ?
"" :
"s");
189 cout <<
" with error " << ret.
status();
192 if ( ncod > 1 ) cout <<
" and " << ncod - 1 <<
" other errors";
197 cout << myname <<
"----------------------------" <<
endl;
199 cout << myname <<
"----------------------------" <<
endl;
205 for (
auto& chdata : datamap ) {
217 out << prefix <<
"ToolBasedRawDigitPrepService:" <<
endl;
221 cout << prefix <<
" ADC channel tools:";
223 out <<
"\n" << prefix <<
" " <<
nm.name;
224 if (
m_cgset.count(
nm.name) ) cout <<
" (callgrind enabled)";
228 out << prefix <<
" No ADC channel tools." <<
endl;
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
Collection of charge vs time digitized from a single readout channel.
const IntVector & getIntVector(Name name) const
void print(std::ostream *pout) const
Q_EXPORT QTSManip setprecision(int p)
virtual int build(AdcChannelData &data, WireVector *wires) const =0
std::string runString(Index opt=2) const
Q_EXPORT QTSManip setw(int w)
Contains all timing reference information for the detector.
std::optional< T > get_if_present(std::string const &key) const
std::map< AdcChannel, AdcChannelData > AdcChannelDataMap
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
auto const & get(AssnsNode< L, R, D > const &r)
bool haveIntVector(Name name) const
QTextStream & endl(QTextStream &s)
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)