80 Name(
"CalWireModuleLabel"),
81 Comment(
"tag of producer used to create the recob::Wire collection"),
86 Name(
"OutputCategory"),
87 Comment(
"the messagefacility category used for the output"),
92 Name(
"DigitsPerLine"),
93 Comment(
"number of digits printed per line (0: don't print digits)"),
115 template <
typename Stream>
118 std::string
indent =
" ", std::string firstIndent =
" " 157 template <
typename Stream>
160 std::string
indent , std::string firstIndent
165 RegionsOfInterest_t
const & RoIs = wire.
SignalROI();
170 out << firstIndent <<
"channel #" << wire.
Channel() <<
" on view " 171 << ViewName(wire.
View()) <<
"; " << wire.
NSignal() <<
" time ticks";
172 if (wire.
NSignal() != RoIs.size())
173 out <<
" [!!! EXPECTED " << RoIs.size() <<
"]";
174 if (RoIs.n_ranges() == 0) {
175 out <<
" with nothing in them";
178 out <<
" with " << RoIs.n_ranges() <<
" regions of interest:";
183 for (RegionsOfInterest_t::datarange_t
const& RoI: RoIs.get_ranges()) {
184 out <<
"\n" << indent
185 <<
" from " << RoI.offset <<
" for " << RoI.size() <<
" ticks";
193 std::vector<RegionsOfInterest_t::value_type> DigitBuffer(
fDigitsPerLine),
196 unsigned int repeat_count = 0;
197 unsigned int index = 0;
199 out <<
"\n" << indent
200 <<
" content of the wire (" <<
fDigitsPerLine <<
" ticks per line):";
201 auto iTick = RoIs.cbegin(), tend = RoIs.cend();
202 while (iTick != tend) {
204 unsigned int line_size
205 =
std::min(fDigitsPerLine, (
unsigned int) RoIs.size() - index);
206 if (line_size == 0)
break;
209 DigitBuffer.resize(line_size);
210 auto iBuf = DigitBuffer.begin(), bend = DigitBuffer.end();
211 while ((iBuf != bend) && (iTick != tend))
212 Extrema.
add(*(iBuf++) = *(iTick++));
216 if (DigitBuffer == LastBuffer) {
223 if (repeat_count > 0) {
224 out <<
"\n" << indent
225 <<
" [ ... repeated " << repeat_count <<
" more times, " 226 << (repeat_count * LastBuffer.size()) <<
" ticks ]";
231 out <<
"\n" << indent
232 <<
" " << std::fixed << std::setprecision(3);
233 for (
auto digit: DigitBuffer) out << std::setw(8) << digit;
237 std::swap(LastBuffer, DigitBuffer);
240 if (repeat_count > 0) {
241 out <<
"\n" << indent
242 <<
" [ ... repeated " << repeat_count <<
" more times to the end ]";
244 if (Extrema.
min() < Extrema.
max()) {
245 out <<
"\n" << indent
246 <<
" range of " << index
247 <<
" samples: [" << Extrema.
min() <<
";" << Extrema.
max() <<
"]";
Data_t max() const
Returns the accumulated maximum, or a very small number if no values.
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
This_t & add(Data_t value)
Include a single value in the statistics.
Prints the content of all the wires on screen.
size_t NSignal() const
Returns the number of time ticks, or samples, in the channel.
fhicl::Atom< std::string > OutputCategory
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
art::InputTag fCalWireModuleLabel
Input tag for wires.
Planes which measure Z direction.
lar::sparse_vector< float > RegionsOfInterest_t
a region of interest is a pair (TDC offset, readings)
creation of calibrated signals on wires
Classes gathering simple statistics.
3-dimensional objects, potentially hits, clusters, prongs, etc.
geo::View_t View() const
Returns the view the channel belongs to.
Keeps track of the minimum and maximum value we observed.
Data_t min() const
Returns the accumulated minimum, or a very large number if no values.
fhicl::Atom< art::InputTag > CalWireModuleLabel
#define DEFINE_ART_MODULE(klass)
std::string fOutputCategory
Category for LogVerbatim output.
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
std::string indent(std::size_t const i)
void PrintWire(Stream &&out, recob::Wire const &wire, std::string indent=" ", std::string firstIndent=" ") const
Dumps a single recob:Wire to the specified output stream.
unsigned int fDigitsPerLine
Ticks/digits per line in the output.
const RegionsOfInterest_t & SignalROI() const
Returns the list of regions of interest.
EDAnalyzer(Table< Config > const &config)
Definition of data types for geometry description.
DumpWires(Parameters const &config)
Constructor.
std::string to_string(Flag_t< Storage > const flag)
Convert a flag into a stream (shows its index).
Encapsulate the construction of a single detector plane.
Class holding the deconvoluted signals from a channel.
virtual void analyze(art::Event const &evt) override
Does the printing.
Declaration of basic channel signal object.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
fhicl::Atom< unsigned int > DigitsPerLine