54 Name (
"SpacePointModuleLabel"),
55 Comment(
"label of the producer used to create the recob::SpacePoint collection to be dumped")
58 Name (
"OutputCategory"),
59 Comment(
"the category used for the output (useful for filtering) [\"DumpSpacePoints\"]"),
63 Name (
"PrintHexFloats"),
64 Comment(
"print floating point numbers in base 16 [false]"),
99 #include "canvas/Persistency/Common/FindMany.h" 111 class SpacePointDumper {
118 std::vector<recob::SpacePoint>
const& point_list,
119 PrintOptions_t
const& printOptions = {}
127 void SetHits(art::FindMany<recob::Hit>
const* hit_query)
128 { hits = hit_query; }
132 template <
typename Stream>
137 template <
typename Stream>
139 (Stream&& out,
size_t iPoint,
std::string indentstr)
const 141 PrintOptions_t localOptions(
options);
142 localOptions.indent.indent = indentstr;
147 template <
typename Stream>
149 (Stream&& out,
size_t iPoint, PrintOptions_t
const& localOptions)
const 158 <<
"[#" << iPoint <<
"] ";
160 PrintOptions_t indentedOptions(localOptions);
161 indentedOptions.indent.appendIndentation(
" ");
163 (std::forward<Stream>(out), point, indentedOptions);
169 std::vector<recob::Hit const*> myHits = hits->at(iPoint);
170 if (myHits.empty()) {
171 out <<
"; no associated hits";
176 <<
"; " << myHits.size() <<
" hits:";
179 <<
" on " <<
hit->WireID()
180 <<
", peak at tick " <<
hit->PeakTime() <<
", " 181 <<
hit->PeakAmplitude() <<
" ADC, RMS: " <<
hit->RMS()
183 <<
hit->Channel() <<
")";
196 template <
typename Stream>
197 void DumpAllSpacePoints(Stream&& out,
std::string indentstr =
"")
const 200 localOptions.indent.appendIndentation(indentstr);
201 size_t const nPoints = points.size();
202 for (
size_t iPoint = 0; iPoint < nPoints; ++iPoint)
209 std::vector<recob::SpacePoint>
const& points;
213 art::FindMany<recob::Hit>
const* hits =
nullptr;
246 art::FindMany<recob::Hit>
const PointHits(SpacePoints, evt,
fInputTag);
248 size_t const nPoints = SpacePoints->size();
250 <<
"The event contains " << nPoints <<
" space points from '" 254 SpacePointDumper dumper(*SpacePoints);
255 if (PointHits.isValid()) dumper.SetHits(&PointHits);
256 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
Prints the content of all the space points on screen.
ChannelGroupService::Name Name
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)
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.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Configuration parameters.
Detector simulation of raw signals on wires.
fhicl::Atom< art::InputTag > SpacePointModuleLabel
Declaration of signal hit object.
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)
Collection of available printing style options.