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 class TriggerTimingReport;
107 class ModuleRegistry;
108 class TriggerResultInserter;
109 class PreallocationConfiguration;
112 class TriggerNamesService;
116 template <
typename T>
117 class StreamScheduleSignalSentry {
120 a_(a), principal_(principal), es_(es), context_(context), allowThrow_(
false) {
121 if (a_) T::preScheduleSignal(a_, principal_, context_);
125 if (a_ and principal_) { T::postScheduleSignal(a_, principal_, es_, context_); }
127 if(allowThrow_) {
throw;}
138 typename T::MyPrincipal* principal_;
140 typename T::Context
const* context_;
160 boost::shared_ptr<ModuleRegistry>,
167 boost::shared_ptr<ActivityRegistry>
areg,
169 bool allowEarlyDelete,
175 template <
typename T>
178 bool cleaningUpAfterException =
false);
180 template <
typename T>
183 bool cleaningUpAfterException =
false);
203 void availablePaths(std::vector<std::string>& oLabelsToFill)
const;
207 std::vector<std::string>& oLabelsToFill)
const;
268 template <
typename T>
271 template <
typename T>
287 vstring* labelsOnTriggerPaths);
300 bool allowEarlyDelete);
346 reportSvc->reportSkippedEvent(ep.
id().
run(), ep.
id().
event());
349 template <
typename T>
352 bool cleaningUpAfterException) {
371 if (runTriggerPaths<T>(ep, es, &streamContext_)) {
393 ex.
addContext(
"Calling produce method for module TriggerResultInserter");
395 std::ostringstream ost;
396 ost <<
"Processing " << ep.id();
423 template <
typename T>
426 bool cleaningUpAfterException) {
460 template <
typename T>
464 p.processOneOccurrence<
T>(ep, es,
streamID_, context);
469 template <
typename T>
475 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
void stdToEDM(std::exception const &e)
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
void charPtrToEDM(char const *c)
WorkerPtr results_inserter_
void stringToEDM(std::string &s)
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)
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 ...