49 const string myname =
"test_AcdWireReader: ";
51 cout << myname <<
"NDEBUG must be off." <<
endl;
54 string line =
"-----------------------------";
56 cout << myname << line <<
endl;
57 string fclfile =
"test_AcdWireReader.fcl";
59 cout << myname <<
"Using existing top-level FCL." <<
endl;
62 cout << myname <<
"Creating top-level FCL." <<
endl;
66 std::ofstream
config{fclfile};
67 config <<
"#include \"services_dune.fcl\"" <<
endl;
68 config <<
"services: @local::dune35tdata_reco_services" <<
endl;
69 config <<
"services.RawDigitPrepService.DoNoiseRemoval: false" <<
endl;
70 config <<
"services.RawDigitPrepService.DoDeconvolution: false" <<
endl;
71 config <<
"services.RawDigitPrepService.DoIntermediateStates: true" <<
endl;
72 config <<
"services.AdcChannelDataCopyService.CopyFlags: true" <<
endl;
74 config <<
"#include \"dataprep_tools.fcl\"" <<
endl;
86 cout << myname << line <<
endl;
87 cout << myname <<
"Fetching tool manager." <<
endl;
91 assert ( ptm !=
nullptr );
96 cout << myname << line <<
endl;
97 cout << myname <<
"Fetch services." <<
endl;
100 cout << myname << line <<
endl;
101 cout << myname <<
"Construct test digit." <<
endl;
106 cout << myname << line <<
endl;
107 cout << myname <<
"Create channel dat map and set digits." <<
endl;
111 assert( acd.
raw.size() == 0 );
113 cout << myname << line <<
endl;
114 cout << myname <<
"Construct test wire." <<
endl;
115 std::vector<recob::Wire> wires;
116 wires.reserve(acds.size());
117 assert( acd.
samples.size() == 0 );
119 assert( hrdp->
prepare(clockData, acds, &wires) == 0 );
120 assert( acd.
raw.size() == nsig );
121 assert( acd.
samples.size() == nsig );
123 cout << myname << line <<
endl;
124 cout << myname <<
"Fetch wire read tool." <<
endl;
126 assert( prdr !=
nullptr );
128 cout << myname << line <<
endl;
129 cout << myname <<
"Read wire into channel data." <<
endl;
131 newacd.
wire = &wires[0];
132 assert( newacd.
samples.size() == 0 );
133 assert( prdr->update(newacd) == 0 );
134 assert( newacd.
samples.size() == nsig );
136 cout << myname << line <<
endl;
137 cout << myname <<
"Check samples." <<
endl;
139 for (
unsigned int isig=0; isig<nsig; ++isig ) {
140 if ( dbg ) cout << myname << isig <<
": " << acd.
samples[isig]
141 <<
" ?= " << newacd.
samples[isig]
142 <<
" (" << acd.
signal[isig] <<
" " 146 cout << myname <<
"NROI: " << wires[0].SignalROI().size() <<
" " 147 << acd.
rois.size() <<
" " << newacd.
rois.size() <<
endl;
148 assert( newacd.
rois.size() == acd.
rois.size() );
150 cout << myname << line <<
endl;
151 cout << myname <<
"Done." <<
endl;
Collection of charge vs time digitized from a single readout channel.
static constexpr FileOnPath_t FileOnPath
const raw::RawDigit * digit
virtual int prepare(detinfo::DetectorClocksData const &clockData, AdcChannelDataMap &prepdigs, std::vector< recob::Wire > *pwires=nullptr, WiredAdcChannelDataMap *pwiredData=nullptr) const =0
static void load_services(std::string const &config)
bool sigequal(AdcSignal sig1, AdcSignal sig2)
void line(double t, double *p, double &x, double &y, double &z)
std::map< AdcChannel, AdcChannelData > AdcChannelDataMap
QTextStream & endl(QTextStream &s)