1 #ifndef FWCore_Framework_StreamSchedule_h
2 #define FWCore_Framework_StreamSchedule_h
86 #include "boost/shared_ptr.hpp"
98 class BranchIDListHelper;
100 class ExceptionCollector;
101 class OutputModuleCommunicator;
102 class ProcessContext;
104 class UnscheduledCallProducer;
106 struct TriggerTimingReport;
107 class ModuleRegistry;
108 class TriggerResultInserter;
109 class PreallocationConfiguration;
112 class TriggerNamesService;
116 template <
typename T>
117 class StreamScheduleSignalSentry {
119 StreamScheduleSignalSentry(
ActivityRegistry*
a,
typename T::Context
const* context) :
120 a_(a), context_(context), allowThrow_(
false) {
121 if (a_) T::preScheduleSignal(a_, context_);
125 if (a_) { T::postScheduleSignal(a_, context_); }
127 if(allowThrow_) {
throw;}
138 typename T::Context
const* context_;
158 boost::shared_ptr<ModuleRegistry>,
165 boost::shared_ptr<ActivityRegistry>
areg,
167 bool allowEarlyDelete,
173 template <
typename T>
176 bool cleaningUpAfterException =
false);
178 template <
typename T>
181 bool cleaningUpAfterException =
false);
201 void availablePaths(std::vector<std::string>& oLabelsToFill)
const;
205 std::vector<std::string>& oLabelsToFill)
const;
266 template <
typename T>
269 template <
typename T>
285 vstring* labelsOnTriggerPaths);
298 bool allowEarlyDelete);
344 reportSvc->reportSkippedEvent(ep.
id().
run(), ep.
id().
event());
347 template <
typename T>
350 bool cleaningUpAfterException) {
369 if (runTriggerPaths<T>(ep, es, &streamContext_)) {
391 ex.
addContext(
"Calling produce method for module TriggerResultInserter");
393 std::ostringstream ost;
394 ost <<
"Processing " << ep.id();
415 template <
typename T>
418 bool cleaningUpAfterException) {
446 template <
typename T>
450 p.processOneOccurrence<
T>(ep, es,
streamID_, context);
455 template <
typename T>
461 p.processOneOccurrence<
T>(ep, es,
streamID_, context);
EventNumber_t event() const
std::vector< boost::shared_ptr< OutputModuleCommunicator > > AllOutputModuleCommunicators
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_
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::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)
unsigned int number_of_unscheduled_modules_
WorkerManager workerManager_
std::vector< WorkerInPath > PathWorkers
boost::shared_ptr< ActivityRegistry > actReg_
boost::shared_ptr< Worker > WorkerPtr
int totalEventsPassed() const
void getTriggerReport(TriggerReport &rep) const
StreamID streamID() const
boost::shared_ptr< CPUTimer > StopwatchPointer
std::pair< double, double > timeCpuReal() const
void fillWorkers(ParameterSet &proc_pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, boost::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
void fillEndPath(ParameterSet &proc_pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, boost::shared_ptr< ProcessConfiguration const > processConfiguration, int bitpos, std::string const &name)
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_
RunStopwatch::StopwatchPointer stopwatch_
boost::shared_ptr< HLTGlobalStatus > TrigResPtr
void addContext(std::string const &context)
StreamSchedule(TriggerResultInserter *inserter, boost::shared_ptr< ModuleRegistry >, ParameterSet &proc_pset, service::TriggerNamesService &tns, PreallocationConfiguration const &prealloc, ProductRegistry &pregistry, BranchIDListHelper &branchIDListHelper, ExceptionToActionTable const &actions, boost::shared_ptr< ActivityRegistry > areg, boost::shared_ptr< ProcessConfiguration > processConfiguration, bool allowEarlyDelete, StreamID streamID, ProcessContext const *processContext)
void getTriggerTimingReport(TriggerTimingReport &rep) const
bool endPathsEnabled() const
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
void fillTrigPath(ParameterSet &proc_pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, boost::shared_ptr< ProcessConfiguration const > processConfiguration, int bitpos, std::string const &name, TrigResPtr, vstring *labelsOnTriggerPaths)
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 ...