1 #ifndef FWCore_Framework_StreamSchedule_h
2 #define FWCore_Framework_StreamSchedule_h
96 class BranchIDListHelper;
98 class ExceptionCollector;
99 class OutputModuleCommunicator;
100 class ProcessContext;
101 class UnscheduledCallProducer;
103 class ModuleRegistry;
104 class TriggerResultInserter;
105 class PreallocationConfiguration;
108 class TriggerNamesService;
112 template <
typename T>
113 class StreamScheduleSignalSentry {
115 StreamScheduleSignalSentry(
ActivityRegistry*
a,
typename T::Context
const* context) :
116 a_(a), context_(context), allowThrow_(
false) {
117 if (a_) T::preScheduleSignal(a_, context_);
121 if (a_) { T::postScheduleSignal(a_, context_); }
123 if(allowThrow_) {
throw;}
134 typename T::Context
const* context_;
154 std::shared_ptr<ModuleRegistry>,
161 std::shared_ptr<ActivityRegistry>
areg,
163 bool allowEarlyDelete,
169 template <
typename T>
172 bool cleaningUpAfterException =
false);
174 template <
typename T>
177 bool cleaningUpAfterException =
false);
193 void availablePaths(std::vector<std::string>& oLabelsToFill)
const;
198 void triggerPaths(std::vector<std::string>& oLabelsToFill)
const;
201 void endPaths(std::vector<std::string>& oLabelsToFill)
const;
205 std::vector<std::string>& oLabelsToFill)
const;
208 std::vector<ModuleDescription const*>& descriptions,
209 unsigned int hint)
const;
212 std::vector<ModuleDescription const*>& descriptions,
213 unsigned int hint)
const;
292 template <
typename T>
295 template <
typename T>
311 vstring* labelsOnTriggerPaths);
324 bool allowEarlyDelete);
371 reportSvc->reportSkippedEvent(ep.
id().
run(), ep.
id().
event());
374 template <
typename T>
377 bool cleaningUpAfterException) {
394 if (runTriggerPaths<T>(ep, es, &streamContext_)) {
415 ex.
addContext(
"Calling produce method for module TriggerResultInserter");
417 std::ostringstream ost;
418 ost <<
"Processing " << ep.id();
435 terminationSentry.completedSuccessfully();
441 template <
typename T>
444 bool cleaningUpAfterException) {
470 terminationSentry.completedSuccessfully();
476 template <
typename T>
480 p.processOneOccurrence<
T>(ep, es,
streamID_, context);
485 template <
typename T>
491 p.processOneOccurrence<
T>(ep, es,
streamID_, context);
void triggerPaths(std::vector< std::string > &oLabelsToFill) const
void moduleDescriptionsInEndPath(std::string const &iEndPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
EventNumber_t event() const
StreamContext const * context_
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
std::shared_ptr< HLTGlobalStatus const > TrigResConstPtr
std::vector< Worker * > Workers
std::vector< int > empty_trig_paths_
void moduleDescriptionsInPath(std::string const &iPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
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
edm::propagate_const< WorkerPtr > results_inserter_
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
void runEndPaths(typename T::MyPrincipal const &, EventSetup const &, typename T::Context const *)
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::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
std::vector< Worker * > AllWorkers
vstring empty_trig_path_names_
element_type const * get() const
void clearCounters()
Clear all the counters in the trigger report.
AllWorkers const & allWorkers() const
std::vector< unsigned int > earlyDeleteHelperToBranchIndicies_
edm::propagate_const< TrigResPtr > results_
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
bool runTriggerPaths(typename T::MyPrincipal const &, EventSetup const &, typename T::Context const *)
edm::ActivityRegistry * reg_
TrigResConstPtr results() const
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()
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)
void endPaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all end paths in the process