13 #ifndef ICARUSCODE_UTILITIES_DUPLICATEEVENTTRACKER_H
14 #define ICARUSCODE_UTILITIES_DUPLICATEEVENTTRACKER_H
21 #include "art/Framework/Services/Registry/ServiceDeclarationMacros.h"
22 #include "art/Framework/Services/Registry/ServiceTable.h"
23 #include "fhiclcpp/types/Atom.h"
24 #include "cetlib_except/exception.h"
34 class ActivityRegistry;
35 class ScheduleContext;
40 namespace sbn {
class DuplicateEventTracker; }
112 Comment(
"just emit a warning on screen instead of throwing an exception"),
118 Comment(
"do not print a summary of the duplicate events at end of job"),
123 Name(
"ExceptionAtEnd"),
125 (
"in case of duplicate, wait until the end of job to throw an exception"),
132 (
"tag of output category used by this service to the message facility"),
133 "DuplicateEventTracker"
196 #endif // ICARUSCODE_UTILITIES_DUPLICATEEVENTTRACKER_H
void postEndJob()
Prints the summary and throws an exception depending on the configuration.
std::string const fLogCategory
Message service category tag.
fhicl::Atom< std::string > LogCategory
std::atomic< unsigned int > fNDuplicateEvents
Duplicate event count.
fhicl::Atom< bool > SkipSummary
static constexpr FileID_t NoFileID
Mnemonic for no file ID.
void postEventReading(art::Event const &event, art::ScheduleContext)
Records the event and throws an exception depending on the configuration.
void printSummary() const
Prints a summary of the current duplicates.
art::ServiceTable< Config > Parameters
Class keeping track of art event IDs.
DuplicateEventTracker(Parameters const &config, art::ActivityRegistry ®)
Constructor: reads the configuration.
bool const fSkipSummary
Do not print the summary of duplicate events.
bool const fWarningOnly
Only warning, no exception.
BEGIN_PROLOG vertical distance to the surface Name
sbn::EventRegistry fEventRegistry
Record of all events and their source.
bool const fExceptionAtEnd
Throw exception as late as possible.
fhicl::Atom< bool > ExceptionAtEnd
std::size_t FileID_t
Type used to identify a source file.
services TFileService fileName
Keeps a record of all registered events and their source.
fhicl::Atom< bool > WarningOnly
Keeps track of duplicate events in the job.
sbn::EventRegistry::FileID_t fCurrentInputFileID
ID in the event registry of the current input file.
void postOpenFile(std::string const &fileName)
Records the current file name.