56 Name(
"SeedModuleLabel"),
57 Comment(
"tag of the recob::Seed collection data product to be dumped")
61 Name(
"OutputCategory"),
62 Comment(
"name of the message facility category to be used for output"),
67 Name(
"PrintHexFloats"),
68 Comment(
"print all the floating point numbers in base 16"),
103 #include "canvas/Persistency/Common/FindMany.h" 120 struct PrintOptions_t {
121 bool hexFloats =
false;
127 SeedDumper(std::vector<recob::Seed>
const& seed_list)
128 : SeedDumper(seed_list, {})
133 (std::vector<recob::Seed>
const& seed_list, PrintOptions_t print_options)
140 void SetHits(art::FindMany<recob::Hit>
const* hit_query)
141 { hits = hit_query; }
145 template <
typename Stream>
146 void DumpSeed(Stream&& out,
size_t iSeed)
const 155 out <<
"\n" << indentstr
156 <<
"[#" << iSeed <<
"]";
157 if (!seed.
IsValid()) out <<
" invalid!";
159 std::array<double, 3> start,
dir;
161 seed.
GetPoint(start.data(),
nullptr);
163 <<
" starts at (" << hexfloat(start[0])
164 <<
"," << hexfloat(start[1]) <<
"," << hexfloat(start[2])
165 <<
") toward (" << hexfloat(dir[0]) <<
"," << hexfloat(dir[1])
166 <<
"," << hexfloat(dir[2])
167 <<
"); length: " << hexfloat(seed.
GetLength()) <<
" cm" 175 std::vector<recob::Hit const*> myHits = hits->at(iSeed);
176 if (!myHits.empty()) {
182 <<
"; " << myHits.size() <<
" hits:";
184 out <<
"\n" << indentstr
185 <<
" on " <<
hit->WireID()
186 <<
", peak at tick " <<
hit->PeakTime()
187 <<
", " <<
hit->PeakAmplitude()
188 <<
" ADC, RMS: " <<
hit->RMS()
189 <<
" (channel: " <<
hit->Channel() <<
")";
202 template <
typename Stream>
203 void DumpAllSeeds(Stream&& out)
const 205 size_t const nSeeds =
seeds.size();
206 for (
size_t iSeed = 0; iSeed < nSeeds; ++iSeed)
207 DumpSeed(out, iSeed);
213 std::vector<recob::Seed>
const&
seeds;
218 art::FindMany<recob::Hit>
const* hits =
nullptr;
250 art::FindMany<recob::Hit>
const SeedHits(Seeds, evt,
fInputTag);
252 size_t const nSeeds = Seeds->size();
254 <<
" contains " << nSeeds <<
" seeds from '" 258 SeedDumper::PrintOptions_t
options;
260 options.indent =
" ";
261 SeedDumper dumper(*Seeds, options);
263 if (SeedHits.isValid()) dumper.SetHits(&SeedHits);
264 else mf::LogWarning(
"DumpSeeds") <<
"hit information not avaialble";
fhicl::Atom< std::string > OutputCategory
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
Reconstruction base classes.
void GetPoint(double *Pt, double *Err) const
ChannelGroupService::Name Name
art::InputTag fInputTag
input tag of the Seed product
Prints the content of all the seeds on screen.
EDAnalyzer(fhicl::ParameterSet const &pset)
virtual void analyze(const art::Event &evt) override
Does the printing.
fhicl::Atom< bool > PrintHexFloats
DumpSeeds(Parameters const &config)
Default constructor.
fhicl::Atom< art::InputTag > SeedModuleLabel
#define DEFINE_ART_MODULE(klass)
std::string fOutputCategory
category for LogInfo output
bool fPrintHexFloats
whether to print floats in base 16
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Helper for formatting floats in base 16.
Detector simulation of raw signals on wires.
std::vector< TrajPoint > seeds
Declaration of signal hit object.
Helper to support output of real numbers in base 16.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
2D representation of charge deposited in the TDC/wire plane
void GetDirection(double *Dir, double *Err) const