53 Name(
"SpacePointModuleLabel"),
55 "label of the producer used to create the recob::SpacePoint collection to be dumped")};
57 Name(
"OutputCategory"),
58 Comment(
"the category used for the output (useful for filtering) [\"DumpSpacePoints\"]"),
62 Name(
"PrintHexFloats"),
63 Comment(
"print floating point numbers in base 16 [false]"),
107 class SpacePointDumper {
112 SpacePointDumper(std::vector<recob::SpacePoint>
const& point_list,
113 PrintOptions_t
const& printOptions = {})
114 : points(point_list), options(printOptions)
121 template <
typename Stream>
128 template <
typename Stream>
129 void DumpSpacePoint(Stream&& out,
size_t iPoint, std::string indentstr)
const 131 PrintOptions_t localOptions(options);
132 localOptions.indent.indent = indentstr;
137 template <
typename Stream>
138 void DumpSpacePoint(Stream&& out,
size_t iPoint, PrintOptions_t
const& localOptions)
const 146 first_nl() <<
"[#" << iPoint <<
"] ";
148 PrintOptions_t indentedOptions(localOptions);
149 indentedOptions.indent.appendIndentation(
" ");
156 std::vector<recob::Hit const*> myHits =
hits->at(iPoint);
157 if (myHits.empty()) { out <<
"; no associated hits"; }
160 out <<
"; " << myHits.size() <<
" hits:";
162 nl() <<
" on " <<
hit->WireID() <<
", peak at tick " <<
hit->PeakTime() <<
", " 163 <<
hit->PeakAmplitude() <<
" ADC, RMS: " <<
hit->RMS()
164 <<
" (channel: " <<
hit->Channel() <<
")";
176 template <
typename Stream>
177 void DumpAllSpacePoints(Stream&& out, std::string indentstr =
"")
const 179 auto localOptions = options;
180 localOptions.indent.appendIndentation(indentstr);
181 size_t const nPoints = points.size();
182 for (
size_t iPoint = 0; iPoint < nPoints; ++iPoint)
187 std::vector<recob::SpacePoint>
const& points;
188 PrintOptions_t options;
221 size_t const nPoints = SpacePoints->size();
226 SpacePointDumper dumper(*SpacePoints);
227 if (PointHits.isValid())
228 dumper.SetHits(&PointHits);
230 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.
EDAnalyzer(fhicl::ParameterSet const &pset)
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)
Simple class managing a repetitive output task.
Configuration parameters.
Detector simulation of raw signals on wires.
fhicl::Atom< art::InputTag > SpacePointModuleLabel
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
art::InputTag fInputTag
input tag of the SpacePoint product
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
std::string nl(std::size_t i=1)
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.
Collection of available printing style options.