28 class DumpSimPhotonsLite;
32 using namespace fhicl;
41 Comment(
"data product with the SimPhotonsLite to be dumped")};
44 Name(
"OutputCategory"),
45 Comment(
"name of the output stream (managed by the message facility)"),
83 template <
typename Stream>
87 std::string firstIndent)
const;
89 template <
typename Stream>
112 template <
typename Stream>
116 std::string firstIndent)
const 119 unsigned int const nPhotons =
123 [](
auto sum,
auto const& entry) {
return sum + entry.second; });
125 out << firstIndent <<
"channel=" << photons.
OpChannel <<
" has ";
127 out << nPhotons <<
" photons (format: [tick] photons):";
128 constexpr
unsigned int PageSize = 5;
129 unsigned int pager = 0;
132 pager = PageSize - 1;
133 out <<
"\n" << indent <<
" ";
135 out <<
" [" << pair.first <<
"] " << std::setw(6) << pair.second;
149 auto const& Photons = *(
event.getValidHandle<std::vector<sim::SimPhotonsLite>>(
fInputPhotons));
152 <<
"Event " <<
event.id() <<
" : data product '" <<
fInputPhotons.
encode() <<
"' contains " 153 << Photons.size() <<
" SimPhotonsLite";
155 unsigned int iChannel = 0;
160 log <<
"[#" << (iChannel++) <<
"] ";
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
EDAnalyzer(fhicl::ParameterSet const &pset)
DumpSimPhotonsLite & operator=(DumpSimPhotonsLite const &)=delete
art::InputTag fInputPhotons
name of SimPhotons's data product
std::map< int, int > DetectedPhotons
Number of photons detected at each given time: time tick -> photons.
Simulation objects for optical detectors.
DumpSimPhotonsLite(Parameters const &config)
Configuration-checking constructor.
#define DEFINE_ART_MODULE(klass)
std::string indent(std::size_t const i)
int OpChannel
Optical detector channel associated to this data.
void DumpPhoton(Stream &&out, sim::SimPhotonsLite const &photons, std::string indent="") const
Compact representation of photons on a channel.
void analyze(art::Event const &event) override
void DumpPhoton(Stream &&out, sim::SimPhotonsLite const &photons, std::string indent, std::string firstIndent) const
Dumps the content of specified SimPhotonsLite in the output stream.
Event finding and building.
std::string fOutputCategory
name of the stream for output