12 #include "canvas/Utilities/InputTag.h"
13 #include "art/Framework/Core/EDAnalyzer.h"
14 #include "art/Framework/Principal/Event.h"
17 #include "fhiclcpp/ParameterSet.h"
50 virtual void analyze (
const art::Event&
evt)
override;
72 #include "art/Framework/Core/ModuleMacros.h"
73 #include "art/Framework/Principal/Handle.h"
76 #include "messagefacility/MessageLogger/MessageLogger.h"
88 struct PrintOptions_t {
89 bool hexFloats =
false;
94 VertexDumper(std::vector<recob::Vertex>
const& vertex_list)
95 : VertexDumper(vertex_list, {})
100 std::vector<recob::Vertex>
const& vertex_list,
101 PrintOptions_t print_options
103 : vertices(vertex_list)
109 template <
typename Stream>
111 (
Stream&& out,
size_t iVertex, std::string indentstr =
"")
const
120 out <<
"\n" << indentstr
121 <<
"[#" << iVertex <<
"]";
123 std::array<double, 3> vtx_pos;
124 vertex.
XYZ(vtx_pos.data());
125 out <<
" ID=" << vertex.
ID() <<
" at ("
126 << hexfloat(vtx_pos[0]) <<
"," << hexfloat(vtx_pos[1])
127 <<
"," << hexfloat(vtx_pos[2])
138 template <
typename Stream>
139 void DumpAllVertices(
Stream&& out, std::string indentstr =
"")
const
142 size_t const nVertices = vertices.size();
143 for (
size_t iVertex = 0; iVertex < nVertices; ++iVertex)
144 DumpVertex(out, iVertex, indentstr);
150 std::vector<recob::Vertex>
const& vertices;
169 , fInputTag (pset.
get<art::InputTag>(
"VertexModuleLabel"))
170 , fOutputCategory(pset.
get<
std::string> (
"OutputCategory",
"DumpVertices"))
171 , fPrintHexFloats(pset.
get<
bool> (
"PrintHexFloats",
false))
182 auto Vertices = evt.getValidHandle<std::vector<recob::Vertex>>(
fInputTag);
184 size_t const nVertices = Vertices->size();
186 <<
" contains " << nVertices <<
" vertices from '"
190 VertexDumper::PrintOptions_t
options;
192 VertexDumper dumper(*Vertices, options);
void XYZ(double *xyz) const
Legacy method to access vertex position, preserved to avoid breaking code. Please try to use Vertex::...
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
DumpVertices(fhicl::ParameterSet const &pset)
Default constructor.
Definition of vertex object for LArSoft.
std::string fOutputCategory
category for LogInfo output
art::InputTag fInputTag
input tag of the Vertex product
Prints the content of all the vertices on screen.
Helper for formatting floats in base 16.
bool fPrintHexFloats
whether to print floats in base 16
Helper to support output of real numbers in base 16.
int ID() const
Return vertex id.
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
virtual void analyze(const art::Event &evt) override
Does the printing.