20 #include "range/v3/view.hpp" 80 Comment(
"data product (subrun level) with the summary information"),
84 Name(
"SummaryCategory"),
85 Comment(
"name of the output category the summary is sent to"),
90 Name(
"RunSummaryCategory"),
91 Comment(
"name of the output category the summary is sent to"),
118 virtual void endJob()
override;
138 std::map<art::RunID, art::SummedValue<sumdata::POTSummary>>
fRunPOT;
172 auto const&
ID = subRun.
id();
181 <<
"Fragment of subrun " <<
ID <<
" has no '" <<
fPOTtag.
encode() <<
"' POT summary.";
192 fRunPOT[
ID.runID()].update(summaryHandle);
246 unsigned int nFragments = nMissing;
248 if (iFound != fend) nFragments += iFound->second;
250 log <<
"\n" <<
id <<
": " << nMissing <<
" / " << nFragments <<
" \"fragments\"";
262 std::map<art::RunID, unsigned int> subrunCount;
264 ++subrunCount[
ID.runID()];
268 for (
auto const& [
id, POT] :
fRunPOT) {
269 log <<
"\n " <<
id <<
" (" << subrunCount[id]
fhicl::Atom< art::InputTag > SummaryTag
POTaccumulator(Parameters const &config)
Configuration-checking constructor.
std::string fSummaryOutputCategory
Name of the main stream for output.
std::map< art::RunID, art::SummedValue< sumdata::POTSummary > > fRunPOT
Partial count of POT in the run, per run.
ChannelGroupService::Name Name
EDAnalyzer(fhicl::ParameterSet const &pset)
fhicl::Atom< std::string > SummaryCategory
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
POTaccumulator & operator=(POTaccumulator const &)=delete
static std::string to_string(sumdata::POTSummary const &POT)
Converts the information from POT in a compact string.
virtual void endJob() override
Prints the general summary.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
#define DEFINE_ART_MODULE(klass)
fhicl::Atom< std::string > RunSummaryCategory
Collection of configuration parameters for the module.
void printRunSummary() const
Prints the list of POT per run.
std::string fRunOutputCategory
Name of the run stream for output.
void printMissingSubrunList() const
Prints the list of subruns with partial or missing POT information.
Code to link reconstructed objects back to the MC truth information.
Prints on console the total Protons On Target from the input subruns.
void aggregate(POTSummary const &other)
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
virtual void analyze(art::Event const &event) override
virtual void endSubRun(art::SubRun const &subRun) override
Collects information from each subrun.
std::map< art::SubRunID, unsigned int > fPresentSubrunFragments
Count of subrun fragments with POT information.
art::InputTag fPOTtag
Name of sumdata::POTSummary data product.
void printSummary(sumdata::POTSummary const &totalPOT) const
Prints the total POT summary totalPOT.
std::string to_string(ModuleType const mt)
std::map< art::SubRunID, unsigned int > fMissingSubrunFragments
Count of subrun fragments without POT information.
Event finding and building.