45 default:
return "<UNSUPPORTED (" +
std::to_string((
int)view) +
")>";
76 Name(
"CalWireModuleLabel"),
77 Comment(
"tag of producer used to create the recob::Wire collection"),
82 Name(
"OutputCategory"),
83 Comment(
"the messagefacility category used for the output"),
88 Name(
"DigitsPerLine"),
89 Comment(
"number of digits printed per line (0: don't print digits)"),
109 template <
typename Stream>
113 std::string firstIndent =
" ")
const;
147 template <
typename Stream>
151 std::string firstIndent
157 RegionsOfInterest_t
const& RoIs = wire.
SignalROI();
162 out << firstIndent <<
"channel #" << wire.
Channel() <<
" on view " << ViewName(wire.
View())
163 <<
"; " << wire.
NSignal() <<
" time ticks";
164 if (wire.
NSignal() != RoIs.size()) out <<
" [!!! EXPECTED " << RoIs.size() <<
"]";
165 if (RoIs.n_ranges() == 0) {
166 out <<
" with nothing in them";
169 out <<
" with " << RoIs.n_ranges() <<
" regions of interest:";
174 for (RegionsOfInterest_t::datarange_t
const& RoI : RoIs.get_ranges()) {
175 out <<
"\n" << indent <<
" from " << RoI.offset <<
" for " << RoI.size() <<
" ticks";
183 std::vector<RegionsOfInterest_t::value_type> DigitBuffer(
fDigitsPerLine), LastBuffer;
185 unsigned int repeat_count = 0;
186 unsigned int index = 0;
188 out <<
"\n" << indent <<
" content of the wire (" <<
fDigitsPerLine <<
" ticks per line):";
189 auto iTick = RoIs.cbegin(), tend = RoIs.cend();
190 while (iTick != tend) {
192 unsigned int line_size = std::min(fDigitsPerLine, (
unsigned int)RoIs.size() - index);
193 if (line_size == 0)
break;
196 DigitBuffer.resize(line_size);
197 auto iBuf = DigitBuffer.begin(), bend = DigitBuffer.end();
198 while ((iBuf != bend) && (iTick != tend))
199 Extrema.
add(*(iBuf++) = *(iTick++));
203 if (DigitBuffer == LastBuffer) {
210 if (repeat_count > 0) {
212 << indent <<
" [ ... repeated " << repeat_count <<
" more times, " 213 << (repeat_count * LastBuffer.size()) <<
" ticks ]";
218 out <<
"\n" << indent <<
" " << std::fixed << std::setprecision(3);
219 for (
auto digit : DigitBuffer)
220 out << std::setw(8) << digit;
224 std::swap(LastBuffer, DigitBuffer);
227 if (repeat_count > 0) {
228 out <<
"\n" << indent <<
" [ ... repeated " << repeat_count <<
" more times to the end ]";
230 if (Extrema.
min() < Extrema.
max()) {
232 << indent <<
" range of " << index <<
" samples: [" << Extrema.
min() <<
";" 233 << 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.
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)
EDAnalyzer(fhicl::ParameterSet const &pset)
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)
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
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.
Definition of data types for geometry description.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
DumpWires(Parameters const &config)
Constructor.
Class holding the regions of interest of signal from a channel.
virtual void analyze(art::Event const &evt) override
Does the printing.
Declaration of basic channel signal object.
fhicl::Atom< unsigned int > DigitsPerLine
std::size_t NSignal() const
Returns the number of time ticks, or samples, in the channel.