1 #ifndef FWCore_Framework_StreamSchedule_h
2 #define FWCore_Framework_StreamSchedule_h
95 class BranchIDListHelper;
97 class ExceptionCollector;
98 class OutputModuleCommunicator;
100 class UnscheduledCallProducer;
102 class ModuleRegistry;
103 class TriggerResultInserter;
104 class PreallocationConfiguration;
107 class TriggerNamesService;
111 template <
typename T>
112 class StreamScheduleSignalSentry {
114 StreamScheduleSignalSentry(
ActivityRegistry*
a,
typename T::Context
const* context) :
115 a_(a), context_(context), allowThrow_(
false) {
116 if (a_) T::preScheduleSignal(a_, context_);
120 if (a_) { T::postScheduleSignal(a_, context_); }
122 if(allowThrow_) {
throw;}
133 typename T::Context
const* context_;
153 std::shared_ptr<ModuleRegistry>,
160 std::shared_ptr<ActivityRegistry>
areg,
162 bool allowEarlyDelete,
168 template <
typename T>
171 bool cleaningUpAfterException =
false);
173 template <
typename T>
176 bool cleaningUpAfterException =
false);
192 void availablePaths(std::vector<std::string>& oLabelsToFill)
const;
196 std::vector<std::string>& oLabelsToFill)
const;
275 template <
typename T>
278 template <
typename T>
294 vstring* labelsOnTriggerPaths);
307 bool allowEarlyDelete);
351 reportSvc->reportSkippedEvent(ep.
id().
run(), ep.
id().
event());
354 template <
typename T>
357 bool cleaningUpAfterException) {
374 if (runTriggerPaths<T>(ep, es, &streamContext_)) {
395 ex.
addContext(
"Calling produce method for module TriggerResultInserter");
397 std::ostringstream ost;
398 ost <<
"Processing " << ep.id();
415 terminationSentry.completedSuccessfully();
421 template <
typename T>
424 bool cleaningUpAfterException) {
450 terminationSentry.completedSuccessfully();
456 template <
typename T>
460 p.processOneOccurrence<
T>(ep, es,
streamID_, context);
465 template <
typename T>
471 p.processOneOccurrence<
T>(ep, es,
streamID_, context);
EventNumber_t event() const
StreamContext const * context_
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
void runEndPaths(typename T::MyPrincipal &, EventSetup const &, typename T::Context const *)
std::vector< Worker * > Workers
std::vector< int > empty_trig_paths_
void fillEndPath(ParameterSet &proc_pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration const > processConfiguration, int bitpos, std::string const &name)
int totalEventsFailed() const
unsigned int numberOfUnscheduledModules() const
std::vector< Path > NonTrigPaths
void initializeEarlyDelete(ModuleRegistry &modReg, edm::ParameterSet const &opts, edm::ProductRegistry const &preg, bool allowEarlyDelete)
std::shared_ptr< HLTGlobalStatus > TrigResPtr
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
std::vector< std::pair< BranchID, unsigned int > > earlyDeleteBranchToCount_
void processOneOccurrence(typename T::MyPrincipal &principal, EventSetup const &eventSetup, StreamID streamID, typename T::Context const *topContext, U const *context, bool cleaningUpAfterException=false)
volatile bool endpathsAreActive_
EventID const & id() const
void addContextAndPrintException(char const *context, cms::Exception &ex, bool disablePrint)
std::string const & category() const
void addToAllWorkers(Worker *w)
vstring end_path_name_list_
exception_actions::ActionCodes find(const std::string &category) const
void reportSkipped(EventPrincipal const &ep) const
bool runTriggerPaths(typename T::MyPrincipal &, EventSetup const &, typename T::Context const *)
ExceptionToActionTable const & actionTable() const
returns the action table
void processOneEvent(typename T::MyPrincipal &principal, EventSetup const &eventSetup, bool cleaningUpAfterException=false)
std::shared_ptr< Worker > WorkerPtr
unsigned int number_of_unscheduled_modules_
WorkerManager workerManager_
std::shared_ptr< ActivityRegistry > actReg_
std::vector< WorkerInPath > PathWorkers
int totalEventsPassed() const
void getTriggerReport(TriggerReport &rep) const
StreamID streamID() const
PreStreamEarlyTermination preStreamEarlyTerminationSignal_
StreamSchedule(std::shared_ptr< TriggerResultInserter > inserter, std::shared_ptr< ModuleRegistry >, ParameterSet &proc_pset, service::TriggerNamesService &tns, PreallocationConfiguration const &prealloc, ProductRegistry &pregistry, BranchIDListHelper &branchIDListHelper, ExceptionToActionTable const &actions, std::shared_ptr< ActivityRegistry > areg, std::shared_ptr< ProcessConfiguration > processConfiguration, bool allowEarlyDelete, StreamID streamID, ProcessContext const *processContext)
SendTerminationSignalIfException(edm::ActivityRegistry *iReg, edm::StreamContext const *iContext)
void fillWorkers(ParameterSet &proc_pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration const > processConfiguration, std::string const &name, bool ignoreFilters, PathWorkers &out, vstring *labelsOnPaths)
StreamContext streamContext_
std::vector< std::string > vstring
std::list< std::string > const & context() const
std::vector< std::shared_ptr< OutputModuleCommunicator > > AllOutputModuleCommunicators
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e, edm::JobReport *jobRep=0, int rc=-1)
std::vector< Worker * > AllWorkers
vstring empty_trig_path_names_
void clearCounters()
Clear all the counters in the trigger report.
AllWorkers const & allWorkers() const
WorkerPtr results_inserter_
std::vector< unsigned int > earlyDeleteHelperToBranchIndicies_
void addContext(std::string const &context)
~SendTerminationSignalIfException()
bool endPathsEnabled() const
void fillTrigPath(ParameterSet &proc_pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration const > processConfiguration, int bitpos, std::string const &name, TrigResPtr, vstring *labelsOnTriggerPaths)
void replaceModule(maker::ModuleHolder *iMod, std::string const &iLabel)
clone the type of module with label iLabel but configure with iPSet.
void enableEndPaths(bool active)
auto wrap(F iFunc) -> decltype(iFunc())
volatile std::atomic< bool > shutdown_flag false
edm::ActivityRegistry * reg_
std::vector< Path > TrigPaths
std::vector< std::string > vstring
void processOneStream(typename T::MyPrincipal &principal, EventSetup const &eventSetup, bool cleaningUpAfterException=false)
ExceptionToActionTable const & actionTable() const
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
std::vector< EarlyDeleteHelper > earlyDeleteHelpers_
void modulesInPath(std::string const &iPathLabel, std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill in execution order the labels of all modules in path iPathLabel ...
void completedSuccessfully()