12 #include "art/Framework/Core/ModuleMacros.h"
13 #include "art/Framework/Core/EDAnalyzer.h"
14 #include "art/Framework/Principal/Run.h"
15 #include "canvas/Persistency/Provenance/RunID.h"
16 #include "canvas/Utilities/InputTag.h"
17 #include "messagefacility/MessageLogger/MessageLogger.h"
18 #include "fhiclcpp/types/Atom.h"
27 namespace sbn {
class DumpPMTconfiguration; }
71 Name(
"PMTconfigurationTag"),
72 Comment(
"tag of PMT configuration data product (from art::Run)")
77 Comment(
"verbosity level [default: maximum]"),
82 Name(
"SkipDuplicateRuns"),
83 Comment(
"print only one PMT configuration from each run"),
88 Name(
"OutputCategory"),
89 Comment(
"name of the category used for the output"),
90 "DumpPMTconfiguration"
108 virtual void beginRun(art::Run
const& run)
override;
111 virtual void analyze(art::Event
const& event)
override {}
144 : art::EDAnalyzer(config)
146 , fPMTconfigurationTag(config().PMTconfigurationTag())
147 , fVerbosity (config().Verbosity())
148 , fSkipDuplicateRuns (config().SkipDuplicateRuns())
149 , fOutputCategory (config().OutputCategory())
152 consumes<sbn::PMTconfiguration, art::InRun>(fPMTconfigurationTag);
161 art::RunID
const&
id = run.id();
162 if (
fRuns.count(
id)) {
163 mf::LogTrace(
fOutputCategory) <<
id <<
" has already been encountered.";
172 std::ostringstream sstr;
Dumps on console the content of sbn::PMTconfiguration data product.
std::string const fOutputCategory
Category used for message facility stream.
fhicl::Atom< std::string > OutputCategory
bool const fSkipDuplicateRuns
Print only once from each run.
art::InputTag const fPMTconfigurationTag
Input PMT configuration tag.
fhicl::Atom< art::InputTag > PMTconfigurationTag
static constexpr unsigned int MaxDumpVerbosity
Maximum supported verbosity level supported by dump().
DumpPMTconfiguration(Parameters const &config)
void dump(std::ostream &out, std::string const &indent, std::string const &firstIndent, unsigned int verbosity=MaxDumpVerbosity) const
Dumps the content of the configuration into out stream.
art::EDAnalyzer::Table< Config > Parameters
BEGIN_PROLOG vertical distance to the surface Name
Information from the configuration of PMT readout.
fhicl::Atom< bool > SkipDuplicateRuns
unsigned int const fVerbosity
Verbosity level used for dumping.
virtual void analyze(art::Event const &event) override
Does nothing, but it is mandatory.
std::set< art::RunID > fRuns
Set of runs already encountered.
fhicl::Atom< unsigned int > Verbosity
Class containing configuration for PMT readout.
virtual void beginRun(art::Run const &run) override
Dumps the data product.