14 #include "art/Framework/Core/EDAnalyzer.h"
15 #include "art/Framework/Core/ModuleMacros.h"
16 #include "art/Framework/Principal/Event.h"
17 #include "art/Framework/Principal/Handle.h"
18 #include "canvas/Utilities/InputTag.h"
20 #include "fhiclcpp/types/Atom.h"
21 #include "messagefacility/MessageLogger/MessageLogger.h"
25 class DumpOpDetBacktrackerRecords;
29 using namespace fhicl;
34 using Comment = fhicl::Comment;
36 fhicl::Atom<art::InputTag> InputOpDetBacktrackerRecord {
37 Name(
"InputOpDetBacktrackerRecord"),
38 Comment(
"data product with the OpDetBacktrackerRecord to be dumped")
41 fhicl::Atom<std::string> OutputCategory {
42 Name(
"OutputCategory"),
43 Comment(
"name of the output stream (managed by the message facility)"),
44 "DumpOpDetBacktrackerRecords"
69 void analyze(art::Event
const& event)
override;
85 template <
typename Stream>
86 void DumpOpDetBacktrackerRecord(
88 std::string indent =
"",
bool bIndentFirst =
true
106 , fInputChannels(config().InputOpDetBacktrackerRecord())
107 , fOutputCategory(config().OutputCategory())
112 template <
typename Stream>
115 std::string indent ,
bool bIndentFirst
117 if (bIndentFirst) out << indent;
118 channel.
Dump(out, indent);
127 = *(
event.getValidHandle<std::vector<sim::OpDetBacktrackerRecord>>(fInputChannels));
129 mf::LogVerbatim(fOutputCategory) <<
"Event " <<
event.id()
130 <<
" : data product '" << fInputChannels.encode() <<
"' contains "
133 unsigned int iOpDetBacktrackerRecord = 0;
137 mf::LogVerbatim log(fOutputCategory);
138 log <<
"[#" << (iOpDetBacktrackerRecord++) <<
"] ";
139 DumpOpDetBacktrackerRecord(log, simChannel,
" ",
false);
142 mf::LogVerbatim(fOutputCategory) <<
"\n";
process_name opflashCryo1 flashfilter analyze
DumpOpDetBacktrackerRecords(Parameters const &config)
Configuration-checking constructor.
art::InputTag fInputChannels
name of OpDetBacktrackerRecord's data product
Energy deposited on a readout Optical Detector by simulated tracks.
void Dump(Stream &&out, std::string indent, std::string first_indent) const
Dumps the full content of the OpDetBacktrackerRecord into a stream.
BEGIN_PROLOG vertical distance to the surface Name
void analyze(art::Event const &event) override
void DumpOpDetBacktrackerRecord(Stream &&out, sim::OpDetBacktrackerRecord const &simchannel, std::string indent="", bool bIndentFirst=true) const
Dumps the content of the specified OpDetBacktrackerRecord in the output stream.
art::EDAnalyzer::Table< Config > Parameters
std::string fOutputCategory
name of the stream for output