11 #include "canvas/Utilities/InputTag.h"
12 #include "art/Framework/Core/EDAnalyzer.h"
13 #include "art/Framework/Principal/Event.h"
16 #include "fhiclcpp/types/Atom.h"
17 #include "fhiclcpp/types/Comment.h"
18 #include "fhiclcpp/types/Name.h"
19 #include "fhiclcpp/types/Table.h"
54 Name (
"PCAxisModuleLabel"),
55 Comment(
"label of the producer used to create the recob::PCAxis collection to be dumped")
58 Name (
"OutputCategory"),
59 Comment(
"the category used for the output (useful for filtering) [\"DumpPCAxes\"]"),
63 Name (
"PrintHexFloats"),
64 Comment(
"print floating point numbers in base 16 [false]"),
76 virtual void analyze (
const art::Event&
evt)
override;
99 #include "art/Framework/Core/ModuleMacros.h"
100 #include "art/Framework/Principal/Handle.h"
103 #include "messagefacility/MessageLogger/MessageLogger.h"
115 struct PrintOptions_t {
116 bool hexFloats =
false;
121 PCAxisDumper(std::vector<recob::PCAxis>
const& pca_list)
122 : PCAxisDumper(pca_list, {})
127 (std::vector<recob::PCAxis>
const& pca_list, PrintOptions_t print_options)
134 template <
typename Stream>
136 (
Stream&& out,
size_t iPCA, std::string indentstr =
"")
const
145 <<
"[#" << iPCA <<
"] ";
148 (out, indentstr +
" ",
true );
159 template <
typename Stream>
160 void DumpAllPCAxes(
Stream&& out, std::string indentstr =
"")
const
163 size_t const nPCAs = pcas.size();
164 for (
size_t iPCA = 0; iPCA < nPCAs; ++iPCA)
165 DumpPCAxis(std::forward<Stream>(out), iPCA, indentstr);
171 std::vector<recob::PCAxis>
const& pcas;
190 , fInputTag(config().PCAxisModuleLabel())
191 , fOutputCategory(config().OutputCategory())
192 , fPrintHexFloats(config().PrintHexFloats())
203 auto PCAxes = evt.getValidHandle<std::vector<recob::PCAxis>>(
fInputTag);
205 size_t const nPCAs = PCAxes->size();
207 <<
"The event contains " << nPCAs <<
" PC axes from '"
211 PCAxisDumper::PrintOptions_t
options;
213 PCAxisDumper dumper(*PCAxes, options);
DumpPCAxes(Parameters const &config)
Default constructor.
std::enable_if_t< std::is_same< recob::dumper::NewLine< std::decay_t< Stream > >, std::decay_t< NewLineRef > >::value > DumpPCAxis(Stream &&out, recob::PCAxis const &pca, NewLineRef &&nl)
bool fPrintHexFloats
whether to print floats in base 16
art::EDAnalyzer::Table< Config > Parameters
Configuration parameters.
fhicl::Atom< bool > PrintHexFloats
fhicl::Atom< std::string > OutputCategory
virtual void analyze(const art::Event &evt) override
Does the printing.
Simple class managing a repetitive output task.
art::InputTag fInputTag
input tag of the PCAxis product
BEGIN_PROLOG vertical distance to the surface Name
Prints the content of all the PCA axis object on screen.
fhicl::Atom< art::InputTag > PCAxisModuleLabel
Functions dumping principal component axis objects.
then echo echo For and will not be changed by echo further linking echo echo B echo The symbol is in the uninitialized data multiple common symbols may appear with the echo same name If the symbol is defined the common echo symbols are treated as undefined references For more echo details on common see the discussion of warn common echo in *Note Linker options
NewLine< Stream > makeNewLine(Stream &stream, std::string indent, bool followLine=false)
Convenience function to create a temporary NewLine.
std::string fOutputCategory
category for LogInfo output