56 Name (
"SpacePointModuleLabel"),
57 Comment(
"label of the producer used to create the recob::SpacePoint collection to be dumped")
60 Name (
"OutputCategory"),
61 Comment(
"the category used for the output (useful for filtering) [\"DumpSpacePoints\"]"),
65 Name (
"PrintHexFloats"),
66 Comment(
"print floating point numbers in base 16 [false]"),
115 class SpacePointDumper {
122 std::vector<recob::SpacePoint>
const& point_list,
123 PrintOptions_t
const& printOptions = {}
126 , options(printOptions)
132 {
hits = hit_query; }
136 template <
typename Stream>
141 template <
typename Stream>
143 (Stream&& out,
size_t iPoint, std::string indentstr)
const 145 PrintOptions_t localOptions(options);
146 localOptions.indent.indent = indentstr;
151 template <
typename Stream>
153 (Stream&& out,
size_t iPoint, PrintOptions_t
const& localOptions)
const 162 <<
"[#" << iPoint <<
"] ";
164 PrintOptions_t indentedOptions(localOptions);
165 indentedOptions.indent.appendIndentation(
" ");
167 (std::forward<Stream>(out), point, indentedOptions);
173 std::vector<recob::Hit const*> myHits =
hits->at(iPoint);
174 if (myHits.empty()) {
175 out <<
"; no associated hits";
180 <<
"; " << myHits.size() <<
" hits:";
183 <<
" on " <<
hit->WireID()
184 <<
", peak at tick " <<
hit->PeakTime() <<
", " 185 <<
hit->PeakAmplitude() <<
" ADC, RMS: " <<
hit->RMS()
187 <<
hit->Channel() <<
")";
200 template <
typename Stream>
201 void DumpAllSpacePoints(Stream&& out, std::string indentstr =
"")
const 203 auto localOptions = options;
204 localOptions.indent.appendIndentation(indentstr);
205 size_t const nPoints = points.size();
206 for (
size_t iPoint = 0; iPoint < nPoints; ++iPoint)
213 std::vector<recob::SpacePoint>
const& points;
214 PrintOptions_t options;
252 size_t const nPoints = SpacePoints->size();
254 <<
"The event contains " << nPoints <<
" space points from '" 258 SpacePointDumper dumper(*SpacePoints);
259 if (PointHits.isValid()) dumper.SetHits(&PointHits);
260 else mf::LogWarning(
"DumpSpacePoints") <<
"hit information not avaialble";
DumpSpacePoints(Parameters const &config)
Default constructor.
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
bool fPrintHexFloats
whether to print floats in base 16
Reconstruction base classes.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Declaration of signal hit object.
Prints the content of all the space points on screen.
Functions dumping space points.
std::string fOutputCategory
category for LogInfo output
fhicl::Atom< std::string > OutputCategory
virtual void analyze(const art::Event &evt) override
Does the printing.
fhicl::Atom< bool > PrintHexFloats
#define DEFINE_ART_MODULE(klass)
auto DumpSpacePoint(Stream &&out, recob::SpacePoint const &sp, SpacePointPrintOptions_t const &options={}) -> std::enable_if_t < std::is_same< NewLine< std::decay_t< Stream >>, std::decay_t< NewLineRef >>::value >
Dumps the content of the specified space point into a stream.
Simple class managing a repetitive output task.
Configuration parameters.
EDAnalyzer(Table< Config > const &config)
Detector simulation of raw signals on wires.
fhicl::Atom< art::InputTag > SpacePointModuleLabel
art::InputTag fInputTag
input tag of the SpacePoint product
Helper to support output of real numbers in base 16.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
NewLine< Stream > makeNewLine(Stream &stream, std::string indent, bool followLine=false)
Convenience function to create a temporary NewLine.
2D representation of charge deposited in the TDC/wire plane
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
std::string nl(std::size_t i=1)
Collection of available printing style options.