83 struct PrintOptions_t {
84 bool hexFloats =
false;
88 VertexDumper(std::vector<recob::Vertex>
const& vertex_list) : VertexDumper(vertex_list, {}) {}
91 VertexDumper(std::vector<recob::Vertex>
const& vertex_list, PrintOptions_t print_options)
92 : vertices(vertex_list), options(print_options)
96 template <
typename Stream>
97 void DumpVertex(Stream&& out,
size_t iVertex, std::string indentstr =
"")
const 106 out <<
"\n" << indentstr <<
"[#" << iVertex <<
"]";
108 std::array<double, 3> vtx_pos;
109 vertex.
XYZ(vtx_pos.data());
110 out <<
" ID=" << vertex.
ID() <<
" at (" << hexfloat(vtx_pos[0]) <<
"," << hexfloat(vtx_pos[1])
111 <<
"," << hexfloat(vtx_pos[2]) <<
")";
120 template <
typename Stream>
121 void DumpAllVertices(Stream&& out, std::string indentstr =
"")
const 124 size_t const nVertices = vertices.size();
125 for (
size_t iVertex = 0; iVertex < nVertices; ++iVertex)
126 DumpVertex(out, iVertex, indentstr);
130 std::vector<recob::Vertex>
const& vertices;
132 PrintOptions_t options;
160 size_t const nVertices = Vertices->size();
165 VertexDumper::PrintOptions_t options;
167 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::...
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
Reconstruction base classes.
DumpVertices(fhicl::ParameterSet const &pset)
Default constructor.
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition of vertex object for LArSoft.
std::string fOutputCategory
category for LogInfo output
art::InputTag fInputTag
input tag of the Vertex product
#define DEFINE_ART_MODULE(klass)
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
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
Helper to support output of real numbers in base 16.
int ID() const
Return vertex id.
virtual void analyze(const art::Event &evt) override
Does the printing.