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"
19 #include "fhiclcpp/types/Atom.h"
20 #include "messagefacility/MessageLogger/MessageLogger.h"
24 class DumpSimChannels;
28 using namespace fhicl;
33 using Comment = fhicl::Comment;
35 fhicl::Atom<art::InputTag> InputSimChannels {
36 Name(
"InputSimChannels"),
37 Comment(
"data product with the SimChannels to be dumped")
40 fhicl::Atom<std::string> OutputCategory {
41 Name(
"OutputCategory"),
42 Comment(
"name of the output stream (managed by the message facility)"),
68 void analyze(art::Event
const& event)
override;
84 template <
typename Stream>
87 std::string indent =
"",
bool bIndentFirst =
true
105 , fInputChannels(config().InputSimChannels())
106 , fOutputCategory(config().OutputCategory())
111 template <
typename Stream>
114 std::string indent ,
bool bIndentFirst
116 if (bIndentFirst) out << indent;
117 channel.
Dump(out, indent);
125 auto const& SimChannels
126 = *(
event.getValidHandle<std::vector<sim::SimChannel>>(fInputChannels));
128 mf::LogVerbatim(fOutputCategory) <<
"Event " <<
event.id()
129 <<
" : data product '" << fInputChannels.encode() <<
"' contains "
130 << SimChannels.size() <<
" SimChannels";
132 unsigned int iSimChannel = 0;
136 mf::LogVerbatim log(fOutputCategory);
137 log <<
"[#" << (iSimChannel++) <<
"] ";
138 DumpSimChannel(log, simChannel,
" ",
false);
141 mf::LogVerbatim(fOutputCategory) <<
"\n";
process_name opflashCryo1 flashfilter analyze
Energy deposited on a readout channel by simulated tracks.
void Dump(Stream &&out, std::string indent, std::string first_indent) const
Dumps the full content of the SimChannel into a stream.
art::EDAnalyzer::Table< Config > Parameters
BEGIN_PROLOG vertical distance to the surface Name
std::string fOutputCategory
name of the stream for output
art::InputTag fInputChannels
name of SimChannel's data product
void DumpSimChannel(Stream &&out, sim::SimChannel const &simchannel, std::string indent="", bool bIndentFirst=true) const
Dumps the content of the specified SimChannel in the output stream.
object containing MC truth information necessary for making RawDigits and doing back tracking ...
DumpSimChannels(Parameters const &config)
Configuration-checking constructor.
void analyze(art::Event const &event) override