55 Name(
"SeedModuleLabel"),
56 Comment(
"tag of the recob::Seed collection data product to be dumped")};
59 Name(
"OutputCategory"),
60 Comment(
"name of the message facility category to be used for output"),
64 Comment(
"print all the floating point numbers in base 16"),
111 struct PrintOptions_t {
112 bool hexFloats =
false;
117 SeedDumper(std::vector<recob::Seed>
const& seed_list) : SeedDumper(seed_list, {}) {}
120 SeedDumper(std::vector<recob::Seed>
const& seed_list, PrintOptions_t print_options)
121 :
seeds(seed_list), options(print_options)
128 template <
typename Stream>
129 void DumpSeed(Stream&& out,
size_t iSeed)
const 132 std::string
const& indentstr = options.indent;
138 out <<
"\n" << indentstr <<
"[#" << iSeed <<
"]";
142 std::array<double, 3> start,
dir;
144 seed.
GetPoint(start.data(),
nullptr);
145 out <<
" starts at (" << hexfloat(start[0]) <<
"," << hexfloat(start[1]) <<
"," 146 << hexfloat(start[2]) <<
") toward (" << hexfloat(dir[0]) <<
"," << hexfloat(dir[1])
147 <<
"," << hexfloat(dir[2]) <<
"); length: " << hexfloat(seed.
GetLength()) <<
" cm";
154 std::vector<recob::Hit const*> myHits =
hits->at(iSeed);
155 if (!myHits.empty()) {
160 out <<
"; " << myHits.size() <<
" hits:";
163 << indentstr <<
" on " <<
hit->WireID() <<
", peak at tick " <<
hit->PeakTime()
164 <<
", " <<
hit->PeakAmplitude() <<
" ADC, RMS: " <<
hit->RMS()
165 <<
" (channel: " <<
hit->Channel() <<
")";
177 template <
typename Stream>
178 void DumpAllSeeds(Stream&& out)
const 180 size_t const nSeeds =
seeds.size();
181 for (
size_t iSeed = 0; iSeed < nSeeds; ++iSeed)
182 DumpSeed(out, iSeed);
186 std::vector<recob::Seed>
const&
seeds;
188 PrintOptions_t options;
221 size_t const nSeeds = Seeds->size();
226 SeedDumper::PrintOptions_t options;
228 options.indent =
" ";
229 SeedDumper dumper(*Seeds, options);
231 if (SeedHits.isValid())
232 dumper.SetHits(&SeedHits);
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.
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
std::string indent(std::size_t const i)
Helper for formatting floats in base 16.
Detector simulation of raw signals on wires.
std::vector< TrajPoint > seeds
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
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