15 #include "art/Framework/Core/EDAnalyzer.h"
16 #include "art/Framework/Core/ModuleMacros.h"
17 #include "art/Framework/Principal/Run.h"
18 #include "messagefacility/MessageLogger/MessageLogger.h"
19 #include "canvas/Persistency/Provenance/RunID.h"
20 #include "fhiclcpp/types/Atom.h"
21 #include "fhiclcpp/types/Comment.h"
22 #include "fhiclcpp/types/Name.h"
52 Name(
"outputCategory"),
54 (
"name of message facility output category to stream the information into (INFO level)"),
71 virtual void analyze(art::Event
const&)
override {}
77 virtual void beginRun(art::Run
const& run)
override;
85 template <
typename Stream>
89 template <
typename Stream>
105 , fOutputCategory(config().outputCategory())
112 auto const& geom = *(lar::providerFrom<geo::Geometry>());
113 dump(mf::LogVerbatim(fOutputCategory), geom);
121 auto const& geom = *(lar::providerFrom<geo::Geometry>());
122 if (shouldDumpGeometry(geom)) {
123 mf::LogVerbatim log(fOutputCategory);
124 log <<
"\nGeometry used in " << run.id() <<
":\n";
132 template <
typename Stream>
137 out <<
"Detector description: '" << geom.
ROOTFile() <<
"'\n";
138 geom.
Print(std::forward<Stream>(out));
144 template <
typename Stream>
148 dumpGeometryCore(std::forward<Stream>(out), geom);
Utilities related to art service access.
void dumpGeometryCore(Stream &&out, geo::GeometryCore const &geom) const
Dumps the specified geometry into the specified output stream.
void Print(Stream &&out, std::string indent=" ") const
Prints geometry information with maximum verbosity.
DumpGeometry(Parameters const &config)
std::string fLastDetectorName
Name of the last geometry dumped.
Describes on screen the current geometry.
std::string ROOTFile() const
Returns the full directory path to the geometry file source.
void dump(Stream &&out, geo::GeometryCore const &geom)
Dumps the geometry and records it.
Access the description of detector geometry.
virtual void beginRun(art::Run const &run) override
Dumps the geometry if changed from the previous run.
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
DumpGeometry & operator=(DumpGeometry const &)=delete
BEGIN_PROLOG vertical distance to the surface Name
Description of geometry of one entire detector.
fhicl::Atom< std::string > outputCategory
std::string fOutputCategory
Name of the category for output.
virtual void beginJob() override
Dumps the geometry at once.
virtual void analyze(art::Event const &) override
bool shouldDumpGeometry(geo::GeometryCore const &geom) const
Returns whether the specified geometry should be dumped.
art::EDAnalyzer::Table< Config > Parameters
art framework interface to geometry description