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"),
121 struct PrintOptions_t {
122 bool hexFloats =
false;
128 SeedDumper(std::vector<recob::Seed>
const& seed_list)
129 : SeedDumper(seed_list, {})
134 (std::vector<recob::Seed>
const& seed_list, PrintOptions_t print_options)
136 , options(print_options)
142 {
hits = hit_query; }
146 template <
typename Stream>
147 void DumpSeed(Stream&& out,
size_t iSeed)
const 150 std::string
const& indentstr = options.indent;
156 out <<
"\n" << indentstr
157 <<
"[#" << iSeed <<
"]";
158 if (!seed.
IsValid()) out <<
" invalid!";
160 std::array<double, 3> start,
dir;
162 seed.
GetPoint(start.data(),
nullptr);
164 <<
" starts at (" << hexfloat(start[0])
165 <<
"," << hexfloat(start[1]) <<
"," << hexfloat(start[2])
166 <<
") toward (" << hexfloat(dir[0]) <<
"," << hexfloat(dir[1])
167 <<
"," << hexfloat(dir[2])
168 <<
"); length: " << hexfloat(seed.
GetLength()) <<
" cm" 176 std::vector<recob::Hit const*> myHits =
hits->at(iSeed);
177 if (!myHits.empty()) {
183 <<
"; " << myHits.size() <<
" hits:";
185 out <<
"\n" << indentstr
186 <<
" on " <<
hit->WireID()
187 <<
", peak at tick " <<
hit->PeakTime()
188 <<
", " <<
hit->PeakAmplitude()
189 <<
" ADC, RMS: " <<
hit->RMS()
190 <<
" (channel: " <<
hit->Channel() <<
")";
203 template <
typename Stream>
204 void DumpAllSeeds(Stream&& out)
const 206 size_t const nSeeds =
seeds.size();
207 for (
size_t iSeed = 0; iSeed < nSeeds; ++iSeed)
208 DumpSeed(out, iSeed);
214 std::vector<recob::Seed>
const&
seeds;
216 PrintOptions_t options;
253 size_t const nSeeds = Seeds->size();
255 <<
" contains " << nSeeds <<
" seeds from '" 259 SeedDumper::PrintOptions_t options;
261 options.indent =
" ";
262 SeedDumper dumper(*Seeds, options);
264 if (SeedHits.isValid()) dumper.SetHits(&SeedHits);
265 else mf::LogWarning(
"DumpSeeds") <<
"hit information not avaialble";
fhicl::Atom< std::string > OutputCategory
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
Reconstruction base classes.
Declaration of signal hit object.
void GetPoint(double *Pt, double *Err) const
art::InputTag fInputTag
input tag of the Seed product
Prints the content of all the seeds on screen.
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
std::string indent(std::size_t const i)
EDAnalyzer(Table< Config > const &config)
Helper for formatting floats in base 16.
Detector simulation of raw signals on wires.
std::vector< TrajPoint > seeds
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
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
void GetDirection(double *Dir, double *Err) const