CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::StreamSchedule Class Reference

#include <StreamSchedule.h>

Classes

class  SendTerminationSignalIfException
 

Public Types

typedef std::vector< Worker * > AllWorkers
 
typedef std::vector< PathNonTrigPaths
 
typedef std::vector< WorkerInPathPathWorkers
 
typedef std::vector< PathTrigPaths
 
typedef std::shared_ptr
< HLTGlobalStatus const > 
TrigResConstPtr
 
typedef std::shared_ptr
< HLTGlobalStatus
TrigResPtr
 
typedef std::vector< std::string > vstring
 
typedef std::shared_ptr< WorkerWorkerPtr
 
typedef std::vector< Worker * > Workers
 

Public Member Functions

AllWorkers const & allWorkers () const
 returns the collection of pointers to workers More...
 
void availablePaths (std::vector< std::string > &oLabelsToFill) const
 adds to oLabelsToFill the labels for all paths in the process More...
 
void beginStream ()
 
void clearCounters ()
 Clear all the counters in the trigger report. More...
 
void enableEndPaths (bool active)
 
void endPaths (std::vector< std::string > &oLabelsToFill) const
 adds to oLabelsToFill the labels for all end paths in the process More...
 
bool endPathsEnabled () const
 
void endStream ()
 
std::vector< ModuleDescription
const * > 
getAllModuleDescriptions () const
 
void getTriggerReport (TriggerReport &rep) const
 
void moduleDescriptionsInEndPath (std::string const &iEndPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
 
void moduleDescriptionsInPath (std::string const &iPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
 
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 More...
 
unsigned int numberOfUnscheduledModules () const
 
template<typename T >
void processOneEvent (typename T::MyPrincipal &principal, EventSetup const &eventSetup, bool cleaningUpAfterException=false)
 
template<typename T >
void processOneStream (typename T::MyPrincipal &principal, EventSetup const &eventSetup, bool cleaningUpAfterException=false)
 
void replaceModule (maker::ModuleHolder *iMod, std::string const &iLabel)
 clone the type of module with label iLabel but configure with iPSet. More...
 
StreamID streamID () const
 
 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)
 
 StreamSchedule (StreamSchedule const &)=delete
 
int totalEvents () const
 
int totalEventsFailed () const
 
int totalEventsPassed () const
 
void triggerPaths (std::vector< std::string > &oLabelsToFill) const
 

Private Member Functions

ExceptionToActionTable const & actionTable () const
 returns the action table More...
 
void addToAllWorkers (Worker *w)
 
void fillEndPath (ParameterSet &proc_pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration const > processConfiguration, int bitpos, std::string const &name)
 
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 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)
 
void initializeEarlyDelete (ModuleRegistry &modReg, edm::ParameterSet const &opts, edm::ProductRegistry const &preg, bool allowEarlyDelete)
 
void reportSkipped (EventPrincipal const &ep) const
 
void resetAll ()
 
void resetEarlyDelete ()
 
TrigResConstPtr results () const
 
TrigResPtrresults ()
 
template<typename T >
void runEndPaths (typename T::MyPrincipal const &, EventSetup const &, typename T::Context const *)
 
template<typename T >
bool runTriggerPaths (typename T::MyPrincipal const &, EventSetup const &, typename T::Context const *)
 

Private Attributes

std::shared_ptr< ActivityRegistryactReg_
 
std::vector< std::pair
< BranchID, unsigned int > > 
earlyDeleteBranchToCount_
 
std::vector< EarlyDeleteHelperearlyDeleteHelpers_
 
std::vector< unsigned int > earlyDeleteHelperToBranchIndicies_
 
vstring empty_trig_path_names_
 
std::vector< int > empty_trig_paths_
 
vstring end_path_name_list_
 
TrigPaths end_paths_
 
volatile bool endpathsAreActive_
 
unsigned int number_of_unscheduled_modules_
 
edm::propagate_const< TrigResPtrresults_
 
edm::propagate_const< WorkerPtrresults_inserter_
 
StreamContext streamContext_
 
StreamID streamID_
 
int total_events_
 
int total_passed_
 
vstring trig_name_list_
 
TrigPaths trig_paths_
 
WorkerManager workerManager_
 

Detailed Description

Definition at line 139 of file StreamSchedule.h.

Member Typedef Documentation

typedef std::vector<Worker*> edm::StreamSchedule::AllWorkers

Definition at line 147 of file StreamSchedule.h.

Definition at line 143 of file StreamSchedule.h.

Definition at line 151 of file StreamSchedule.h.

typedef std::vector<Path> edm::StreamSchedule::TrigPaths

Definition at line 142 of file StreamSchedule.h.

typedef std::shared_ptr<HLTGlobalStatus const> edm::StreamSchedule::TrigResConstPtr

Definition at line 145 of file StreamSchedule.h.

Definition at line 144 of file StreamSchedule.h.

typedef std::vector<std::string> edm::StreamSchedule::vstring

Definition at line 141 of file StreamSchedule.h.

typedef std::shared_ptr<Worker> edm::StreamSchedule::WorkerPtr

Definition at line 146 of file StreamSchedule.h.

typedef std::vector<Worker*> edm::StreamSchedule::Workers

Definition at line 149 of file StreamSchedule.h.

Constructor & Destructor Documentation

edm::StreamSchedule::StreamSchedule ( std::shared_ptr< TriggerResultInserter inserter,
std::shared_ptr< ModuleRegistry modReg,
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 
)

Definition at line 133 of file StreamSchedule.cc.

References actReg_, addToAllWorkers(), edm::WorkerManager::addToUnscheduledWorkers(), allWorkers(), assert(), end_path_name_list_, end_paths_, fillEndPath(), fillTrigPath(), edm::propagate_const< T >::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getPSetForUpdate(), edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), initializeEarlyDelete(), diffTwoXMLs::label, number_of_unscheduled_modules_, geometryDiff::opts, results(), results_inserter_, edm::WorkerManager::setOnDemandProducts(), trig_name_list_, trig_paths_, edm::StreamID::value(), and workerManager_.

145  :
146  workerManager_(modReg,areg, actions),
147  actReg_(areg),
148  trig_name_list_(tns.getTrigPaths()),
149  end_path_name_list_(tns.getEndPaths()),
150  results_(new HLTGlobalStatus(trig_name_list_.size())),
152  trig_paths_(),
153  end_paths_(),
154  total_events_(),
155  total_passed_(),
158  streamContext_(streamID_, processContext),
159  endpathsAreActive_(true) {
160 
161  ParameterSet const& opts = proc_pset.getUntrackedParameterSet("options", ParameterSet());
162  bool hasPath = false;
163 
164  int trig_bitpos = 0;
165  trig_paths_.reserve(trig_name_list_.size());
166  vstring labelsOnTriggerPaths;
167  for (auto const& trig_name : trig_name_list_) {
168  fillTrigPath(proc_pset, preg, &prealloc, processConfiguration, trig_bitpos, trig_name, results(), &labelsOnTriggerPaths);
169  ++trig_bitpos;
170  hasPath = true;
171  }
172 
173  if (hasPath) {
174  // the results inserter stands alone
175  inserter->setTrigResultForStream(streamID.value(), results());
176 
177  results_inserter_ = makeInserter(actions, actReg_, inserter);
179  }
180 
181  // fill normal endpaths
182  int bitpos = 0;
183  end_paths_.reserve(end_path_name_list_.size());
184  for (auto const& end_path_name : end_path_name_list_) {
185  fillEndPath(proc_pset, preg, &prealloc, processConfiguration, bitpos, end_path_name);
186  ++bitpos;
187  }
188 
189  //See if all modules were used
190  std::set<std::string> usedWorkerLabels;
191  for (auto const& worker : allWorkers()) {
192  usedWorkerLabels.insert(worker->description().moduleLabel());
193  }
194  std::vector<std::string> modulesInConfig(proc_pset.getParameter<std::vector<std::string> >("@all_modules"));
195  std::set<std::string> modulesInConfigSet(modulesInConfig.begin(), modulesInConfig.end());
196  std::vector<std::string> unusedLabels;
197  set_difference(modulesInConfigSet.begin(), modulesInConfigSet.end(),
198  usedWorkerLabels.begin(), usedWorkerLabels.end(),
199  back_inserter(unusedLabels));
200  //does the configuration say we should allow on demand?
201  bool allowUnscheduled = opts.getUntrackedParameter<bool>("allowUnscheduled", false);
202  std::set<std::string> unscheduledLabels;
203  std::vector<std::string> shouldBeUsedLabels;
204  if (!unusedLabels.empty()) {
205  //Need to
206  // 1) create worker
207  // 2) if it is a WorkerT<EDProducer>, add it to our list
208  // 3) hand list to our delayed reader
209  for (auto const& label : unusedLabels) {
210  if (allowUnscheduled) {
211  bool isTracked;
212  ParameterSet* modulePSet(proc_pset.getPSetForUpdate(label, isTracked));
213  assert(isTracked);
214  assert(modulePSet != nullptr);
215  workerManager_.addToUnscheduledWorkers(*modulePSet, preg, &prealloc, processConfiguration, label, unscheduledLabels, shouldBeUsedLabels);
216  } else {
217  //everthing is marked are unused so no 'on demand' allowed
218  shouldBeUsedLabels.push_back(label);
219  }
220  }
221  if (!shouldBeUsedLabels.empty()) {
222  std::ostringstream unusedStream;
223  unusedStream << "'" << shouldBeUsedLabels.front() << "'";
224  for (std::vector<std::string>::iterator itLabel = shouldBeUsedLabels.begin() + 1,
225  itLabelEnd = shouldBeUsedLabels.end();
226  itLabel != itLabelEnd;
227  ++itLabel) {
228  unusedStream << ",'" << *itLabel << "'";
229  }
230  LogInfo("path")
231  << "The following module labels are not assigned to any path:\n"
232  << unusedStream.str()
233  << "\n";
234  }
235  }
236  if (!unscheduledLabels.empty()) {
237  number_of_unscheduled_modules_=unscheduledLabels.size();
238  workerManager_.setOnDemandProducts(preg, unscheduledLabels);
239  }
240 
241 
242  initializeEarlyDelete(*modReg, opts,preg,allowEarlyDelete);
243 
244  } // StreamSchedule::StreamSchedule
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
void fillEndPath(ParameterSet &proc_pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration const > processConfiguration, int bitpos, std::string const &name)
vector< string > vstring
Definition: ExoticaDQM.cc:86
void initializeEarlyDelete(ModuleRegistry &modReg, edm::ParameterSet const &opts, edm::ProductRegistry const &preg, bool allowEarlyDelete)
void setOnDemandProducts(ProductRegistry &pregistry, std::set< std::string > const &unscheduledLabels) const
void addToUnscheduledWorkers(ParameterSet &pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration > processConfiguration, std::string label, std::set< std::string > &unscheduledLabels, std::vector< std::string > &shouldBeUsedLabels)
volatile bool endpathsAreActive_
assert(m_qm.get())
processConfiguration
Definition: Schedule.cc:374
void addToAllWorkers(Worker *w)
edm::propagate_const< WorkerPtr > results_inserter_
actions
Definition: Schedule.cc:374
unsigned int number_of_unscheduled_modules_
WorkerManager workerManager_
std::shared_ptr< ActivityRegistry > actReg_
StreamID streamID() const
StreamContext streamContext_
element_type const * get() const
areg
Definition: Schedule.cc:374
unsigned int value() const
Definition: StreamID.h:46
edm::propagate_const< TrigResPtr > results_
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)
preg
Definition: Schedule.cc:374
TrigResConstPtr results() const
prealloc
Definition: Schedule.cc:374
edm::StreamSchedule::StreamSchedule ( StreamSchedule const &  )
delete

Member Function Documentation

ExceptionToActionTable const& edm::StreamSchedule::actionTable ( ) const
inlineprivate

returns the action table

Definition at line 285 of file StreamSchedule.h.

References edm::WorkerManager::actionTable(), and workerManager_.

Referenced by fillEndPath(), fillTrigPath(), and processOneEvent().

285  {
286  return workerManager_.actionTable();
287  }
WorkerManager workerManager_
ExceptionToActionTable const & actionTable() const
Definition: WorkerManager.h:68
void edm::StreamSchedule::addToAllWorkers ( Worker w)
private

Definition at line 725 of file StreamSchedule.cc.

References edm::WorkerManager::addToAllWorkers(), and workerManager_.

Referenced by fillEndPath(), fillTrigPath(), and StreamSchedule().

725  {
727  }
const double w
Definition: UKUtility.cc:23
WorkerManager workerManager_
void addToAllWorkers(Worker *w)
AllWorkers const& edm::StreamSchedule::allWorkers ( ) const
inline

returns the collection of pointers to workers

Definition at line 253 of file StreamSchedule.h.

References edm::WorkerManager::allWorkers(), and workerManager_.

Referenced by clearCounters(), getAllModuleDescriptions(), getTriggerReport(), initializeEarlyDelete(), replaceModule(), and StreamSchedule().

253  {
254  return workerManager_.allWorkers();
255  }
WorkerManager workerManager_
AllWorkers const & allWorkers() const
Definition: WorkerManager.h:64
void edm::StreamSchedule::availablePaths ( std::vector< std::string > &  oLabelsToFill) const

adds to oLabelsToFill the labels for all paths in the process

Definition at line 545 of file StreamSchedule.cc.

References edm::Path::name(), create_public_lumi_plots::transform, and trig_paths_.

545  {
546  oLabelsToFill.reserve(trig_paths_.size());
547  std::transform(trig_paths_.begin(),
548  trig_paths_.end(),
549  std::back_inserter(oLabelsToFill),
550  std::bind(&Path::name, std::placeholders::_1));
551  }
std::string const & name() const
Definition: Path.h:63
void edm::StreamSchedule::beginStream ( )

Definition at line 507 of file StreamSchedule.cc.

References edm::WorkerManager::beginStream(), streamContext_, streamID_, and workerManager_.

507  {
509  }
WorkerManager workerManager_
StreamContext streamContext_
void beginStream(StreamID iID, StreamContext &streamContext)
void edm::StreamSchedule::clearCounters ( )

Clear all the counters in the trigger report.

Definition at line 711 of file StreamSchedule.cc.

References allWorkers(), edm::Path::clearCounters(), edm::Worker::clearCounters(), end_paths_, edm::for_all(), total_events_, total_passed_, and trig_paths_.

711  {
712  using std::placeholders::_1;
714  for_all(trig_paths_, std::bind(&Path::clearCounters, _1));
715  for_all(end_paths_, std::bind(&Path::clearCounters, _1));
716  for_all(allWorkers(), std::bind(&Worker::clearCounters, _1));
717  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
void clearCounters()
Definition: Worker.h:122
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
void clearCounters()
Definition: Path.cc:158
void edm::StreamSchedule::enableEndPaths ( bool  active)

Turn end_paths "off" if "active" is false; turn end_paths "on" if "active" is true.

Definition at line 639 of file StreamSchedule.cc.

References endpathsAreActive_.

639  {
640  endpathsAreActive_ = active;
641  }
volatile bool endpathsAreActive_
void edm::StreamSchedule::endPaths ( std::vector< std::string > &  oLabelsToFill) const

adds to oLabelsToFill the labels for all end paths in the process

Definition at line 559 of file StreamSchedule.cc.

References end_path_name_list_.

559  {
560  oLabelsToFill = end_path_name_list_;
561  }
bool edm::StreamSchedule::endPathsEnabled ( ) const

Return true if end_paths are active, and false if they are inactive.

Definition at line 644 of file StreamSchedule.cc.

References endpathsAreActive_.

644  {
645  return endpathsAreActive_;
646  }
volatile bool endpathsAreActive_
void edm::StreamSchedule::endStream ( )

Definition at line 511 of file StreamSchedule.cc.

References edm::WorkerManager::endStream(), streamContext_, streamID_, and workerManager_.

511  {
513  }
void endStream(StreamID iID, StreamContext &streamContext)
WorkerManager workerManager_
StreamContext streamContext_
void edm::StreamSchedule::fillEndPath ( ParameterSet proc_pset,
ProductRegistry preg,
PreallocationConfiguration const *  prealloc,
std::shared_ptr< ProcessConfiguration const >  processConfiguration,
int  bitpos,
std::string const &  name 
)
private

Definition at line 487 of file StreamSchedule.cc.

References actionTable(), actReg_, addToAllWorkers(), end_paths_, fillWorkers(), edm::for_all(), edm::PathContext::kEndPath, and streamContext_.

Referenced by StreamSchedule().

491  {
492  using std::placeholders::_1;
493  PathWorkers tmpworkers;
494  fillWorkers(proc_pset, preg, prealloc, processConfiguration, name, true, tmpworkers, 0);
495  Workers holder;
496 
497  for (PathWorkers::iterator wi(tmpworkers.begin()), we(tmpworkers.end()); wi != we; ++wi) {
498  holder.push_back(wi->getWorker());
499  }
500 
501  if (!tmpworkers.empty()) {
502  end_paths_.emplace_back(bitpos, name, tmpworkers, TrigResPtr(), actionTable(), actReg_, &streamContext_, PathContext::PathType::kEndPath);
503  }
504  for_all(holder, std::bind(&StreamSchedule::addToAllWorkers, this, _1));
505  }
std::vector< Worker * > Workers
std::shared_ptr< HLTGlobalStatus > TrigResPtr
processConfiguration
Definition: Schedule.cc:374
void addToAllWorkers(Worker *w)
ExceptionToActionTable const & actionTable() const
returns the action table
std::shared_ptr< ActivityRegistry > actReg_
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
std::vector< WorkerInPath > PathWorkers
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_
preg
Definition: Schedule.cc:374
prealloc
Definition: Schedule.cc:374
void edm::StreamSchedule::fillTrigPath ( ParameterSet proc_pset,
ProductRegistry preg,
PreallocationConfiguration const *  prealloc,
std::shared_ptr< ProcessConfiguration const >  processConfiguration,
int  bitpos,
std::string const &  name,
TrigResPtr  trptr,
vstring labelsOnTriggerPaths 
)
private

Definition at line 461 of file StreamSchedule.cc.

References actionTable(), actReg_, addToAllWorkers(), empty_trig_path_names_, empty_trig_paths_, fillWorkers(), edm::for_all(), edm::PathContext::kPath, streamContext_, and trig_paths_.

Referenced by StreamSchedule().

466  {
467  using std::placeholders::_1;
468  PathWorkers tmpworkers;
469  Workers holder;
470  fillWorkers(proc_pset, preg, prealloc, processConfiguration, name, false, tmpworkers, labelsOnTriggerPaths);
471 
472  for (PathWorkers::iterator wi(tmpworkers.begin()),
473  we(tmpworkers.end()); wi != we; ++wi) {
474  holder.push_back(wi->getWorker());
475  }
476 
477  // an empty path will cause an extra bit that is not used
478  if (!tmpworkers.empty()) {
479  trig_paths_.emplace_back(bitpos, name, tmpworkers, trptr, actionTable(), actReg_, &streamContext_, PathContext::PathType::kPath);
480  } else {
481  empty_trig_paths_.push_back(bitpos);
482  empty_trig_path_names_.push_back(name);
483  }
484  for_all(holder, std::bind(&StreamSchedule::addToAllWorkers, this, _1));
485  }
std::vector< Worker * > Workers
std::vector< int > empty_trig_paths_
processConfiguration
Definition: Schedule.cc:374
void addToAllWorkers(Worker *w)
ExceptionToActionTable const & actionTable() const
returns the action table
std::shared_ptr< ActivityRegistry > actReg_
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
std::vector< WorkerInPath > PathWorkers
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_
vstring empty_trig_path_names_
preg
Definition: Schedule.cc:374
prealloc
Definition: Schedule.cc:374
void edm::StreamSchedule::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 
)
private

Definition at line 402 of file StreamSchedule.cc.

References assert(), edm::errors::Configuration, edm::Worker::description(), end_path_name_list_, Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getPSetForUpdate(), edm::ParameterSet::getUntrackedParameter(), edm::WorkerManager::getWorker(), edm::WorkerInPath::Ignore, edm::Worker::kFilter, edm::ModuleDescription::moduleName(), edm::Worker::moduleType(), mergeVDriftHistosByStation::name, edm::WorkerInPath::Normal, edm::search_all(), AlCaHLTBitMon_QueryRunRegistry::string, edm::WorkerInPath::Veto, and workerManager_.

Referenced by fillEndPath(), and fillTrigPath().

409  {
410  vstring modnames = proc_pset.getParameter<vstring>(name);
411  PathWorkers tmpworkers;
412 
413  unsigned int placeInPath = 0;
414  for (auto const& name : modnames) {
415 
416  if (labelsOnPaths) labelsOnPaths->push_back(name);
417 
419  if (name[0] == '!') filterAction = WorkerInPath::Veto;
420  else if (name[0] == '-') filterAction = WorkerInPath::Ignore;
421 
422  std::string moduleLabel = name;
423  if (filterAction != WorkerInPath::Normal) moduleLabel.erase(0, 1);
424 
425  bool isTracked;
426  ParameterSet* modpset = proc_pset.getPSetForUpdate(moduleLabel, isTracked);
427  if (modpset == 0) {
428  std::string pathType("endpath");
430  pathType = std::string("path");
431  }
433  "The unknown module label \"" << moduleLabel <<
434  "\" appears in " << pathType << " \"" << name <<
435  "\"\n please check spelling or remove that label from the path.";
436  }
437  assert(isTracked);
438 
439  Worker* worker = workerManager_.getWorker(*modpset, preg, prealloc, processConfiguration, moduleLabel);
440  if (ignoreFilters && filterAction != WorkerInPath::Ignore && worker->moduleType()==Worker::kFilter) {
441  // We have a filter on an end path, and the filter is not explicitly ignored.
442  // See if the filter is allowed.
443  std::vector<std::string> allowed_filters = proc_pset.getUntrackedParameter<vstring>("@filters_on_endpaths");
444  if (!search_all(allowed_filters, worker->description().moduleName())) {
445  // Filter is not allowed. Ignore the result, and issue a warning.
446  filterAction = WorkerInPath::Ignore;
447  LogWarning("FilterOnEndPath")
448  << "The EDFilter '" << worker->description().moduleName() << "' with module label '" << moduleLabel << "' appears on EndPath '" << name << "'.\n"
449  << "The return value of the filter will be ignored.\n"
450  << "To suppress this warning, either remove the filter from the endpath,\n"
451  << "or explicitly ignore it in the configuration by using cms.ignore().\n";
452  }
453  }
454  tmpworkers.emplace_back(worker, filterAction, placeInPath);
455  ++placeInPath;
456  }
457 
458  out.swap(tmpworkers);
459  }
vector< string > vstring
Definition: ExoticaDQM.cc:86
assert(m_qm.get())
processConfiguration
Definition: Schedule.cc:374
WorkerManager workerManager_
std::vector< WorkerInPath > PathWorkers
bool search_all(ForwardSequence const &s, Datum const &d)
Definition: Algorithms.h:46
preg
Definition: Schedule.cc:374
Worker * getWorker(ParameterSet &pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration const > processConfiguration, std::string const &label)
prealloc
Definition: Schedule.cc:374
std::vector< ModuleDescription const * > edm::StreamSchedule::getAllModuleDescriptions ( ) const

Return a vector allowing const access to all the ModuleDescriptions for this StreamSchedule. *** N.B. *** Ownership of the ModuleDescriptions is not *** passed to the caller. Do not call delete on these *** pointers!

Definition at line 533 of file StreamSchedule.cc.

References allWorkers(), AlCaHLTBitMon_ParallelJobs::p, query::result, and findQualityFiles::size.

533  {
534  std::vector<ModuleDescription const*> result;
535  result.reserve(allWorkers().size());
536 
537  for (auto const& worker : allWorkers()) {
538  ModuleDescription const* p = worker->descPtr();
539  result.push_back(p);
540  }
541  return result;
542  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
tuple result
Definition: query.py:137
tuple size
Write out results.
void edm::StreamSchedule::getTriggerReport ( TriggerReport rep) const

Return the trigger report information on paths, modules-in-path, modules-in-endpath, and modules.

Definition at line 699 of file StreamSchedule.cc.

References allWorkers(), end_paths_, edm::TriggerReport::endPathSummaries, edm::TriggerReport::eventSummary, edm::fillPathSummary(), edm::fillWorkerSummary(), edm::sort_all(), edm::EventSummary::totalEvents, totalEvents(), edm::EventSummary::totalEventsFailed, totalEventsFailed(), edm::EventSummary::totalEventsPassed, totalEventsPassed(), trig_paths_, edm::TriggerReport::trigPathSummaries, and edm::TriggerReport::workerSummaries.

699  {
700  rep.eventSummary.totalEvents += totalEvents();
701  rep.eventSummary.totalEventsPassed += totalEventsPassed();
702  rep.eventSummary.totalEventsFailed += totalEventsFailed();
703 
704  fill_summary(trig_paths_, rep.trigPathSummaries, &fillPathSummary);
705  fill_summary(end_paths_, rep.endPathSummaries, &fillPathSummary);
706  fill_summary(allWorkers(), rep.workerSummaries, &fillWorkerSummary);
707  sort_all(rep.workerSummaries);
708  }
string rep
Definition: cuy.py:1188
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
int totalEventsFailed() const
int totalEvents() const
int totalEventsPassed() const
static void fillPathSummary(Path const &path, PathSummary &sum)
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:120
static void fillWorkerSummary(Worker const *pw, WorkerSummary &sum)
void edm::StreamSchedule::initializeEarlyDelete ( ModuleRegistry modReg,
edm::ParameterSet const &  opts,
edm::ProductRegistry const &  preg,
bool  allowEarlyDelete 
)
private

Definition at line 247 of file StreamSchedule.cc.

References allWorkers(), edm::maker::ModuleHolder::createOutputModuleCommunicator(), delta, earlyDeleteBranchToCount_, earlyDeleteHelpers_, earlyDeleteHelperToBranchIndicies_, end_paths_, edm::ModuleRegistry::forAllModuleHolders(), newFWLiteAna::found, edm::pset::Registry::getMapped(), cmsHarvester::index, edm::InEvent, edm::pset::Registry::instance(), cmsLHEtoEOSManager::l, gen::n, AlCaHLTBitMon_ParallelJobs::p, TrackValidation_cff::pset, resetEarlyDelete(), AlCaHLTBitMon_QueryRunRegistry::string, trig_paths_, and w.

Referenced by StreamSchedule().

249  {
250  //for now, if have a subProcess, don't allow early delete
251  // In the future we should use the SubProcess's 'keep list' to decide what can be kept
252  if(not allowEarlyDelete) return;
253 
254  //see if 'canDeleteEarly' was set and if so setup the list with those products actually
255  // registered for this job
256  std::multimap<std::string,Worker*> branchToReadingWorker;
257  initializeBranchToReadingWorker(opts,preg,branchToReadingWorker);
258 
259  //If no delete early items have been specified we don't have to do anything
260  if(branchToReadingWorker.size()==0) {
261  return;
262  }
263  const std::vector<std::string> kEmpty;
264  std::map<Worker*,unsigned int> reserveSizeForWorker;
265  unsigned int upperLimitOnReadingWorker =0;
266  unsigned int upperLimitOnIndicies = 0;
267  unsigned int nUniqueBranchesToDelete=branchToReadingWorker.size();
268 
269  //talk with output modules first
270  modReg.forAllModuleHolders([this, &branchToReadingWorker,&nUniqueBranchesToDelete](maker::ModuleHolder* iHolder){
271  auto comm = iHolder->createOutputModuleCommunicator();
272  if (comm) {
273  if(branchToReadingWorker.size()>0) {
274  //If an OutputModule needs a product, we can't delete it early
275  // so we should remove it from our list
276  SelectedProductsForBranchType const&kept = comm->keptProducts();
277  for( auto const& item: kept[InEvent]) {
278  auto found = branchToReadingWorker.equal_range(item->branchName());
279  if(found.first !=found.second) {
280  --nUniqueBranchesToDelete;
281  branchToReadingWorker.erase(found.first,found.second);
282  }
283  }
284  }
285  }
286  });
287 
288  if(branchToReadingWorker.size()==0) {
289  return;
290  }
291 
292  for (auto w :allWorkers()) {
293  //determine if this module could read a branch we want to delete early
294  auto pset = pset::Registry::instance()->getMapped(w->description().parameterSetID());
295  if(0!=pset) {
296  auto branches = pset->getUntrackedParameter<std::vector<std::string>>("mightGet",kEmpty);
297  if(not branches.empty()) {
298  ++upperLimitOnReadingWorker;
299  }
300  for(auto const& branch:branches){
301  auto found = branchToReadingWorker.equal_range(branch);
302  if(found.first != found.second) {
303  ++upperLimitOnIndicies;
304  ++reserveSizeForWorker[w];
305  if(nullptr == found.first->second) {
306  found.first->second = w;
307  } else {
308  branchToReadingWorker.insert(make_pair(found.first->first,w));
309  }
310  }
311  }
312  }
313  }
314  {
315  auto it = branchToReadingWorker.begin();
316  std::vector<std::string> unusedBranches;
317  while(it !=branchToReadingWorker.end()) {
318  if(it->second == nullptr) {
319  unusedBranches.push_back(it->first);
320  //erasing the object invalidates the iterator so must advance it first
321  auto temp = it;
322  ++it;
323  branchToReadingWorker.erase(temp);
324  } else {
325  ++it;
326  }
327  }
328  if(not unusedBranches.empty()) {
329  LogWarning l("UnusedProductsForCanDeleteEarly");
330  l<<"The following products in the 'canDeleteEarly' list are not used in this job and will be ignored.\n"
331  " If possible, remove the producer from the job or add the product to the producer's own 'mightGet' list.";
332  for(auto const& n:unusedBranches){
333  l<<"\n "<<n;
334  }
335  }
336  }
337  if(0!=branchToReadingWorker.size()) {
338  earlyDeleteHelpers_.reserve(upperLimitOnReadingWorker);
339  earlyDeleteHelperToBranchIndicies_.resize(upperLimitOnIndicies,0);
340  earlyDeleteBranchToCount_.reserve(nUniqueBranchesToDelete);
341  std::map<const Worker*,EarlyDeleteHelper*> alreadySeenWorkers;
342  std::string lastBranchName;
343  size_t nextOpenIndex = 0;
344  unsigned int* beginAddress = &(earlyDeleteHelperToBranchIndicies_.front());
345  for(auto& branchAndWorker:branchToReadingWorker) {
346  if(lastBranchName != branchAndWorker.first) {
347  //have to put back the period we removed earlier in order to get the proper name
348  BranchID bid(branchAndWorker.first+".");
349  earlyDeleteBranchToCount_.emplace_back(std::make_pair(bid,0U));
350  lastBranchName = branchAndWorker.first;
351  }
352  auto found = alreadySeenWorkers.find(branchAndWorker.second);
353  if(alreadySeenWorkers.end() == found) {
354  //NOTE: we will set aside enough space in earlyDeleteHelperToBranchIndicies_ to accommodate
355  // all the branches that might be read by this worker. However, initially we will only tell the
356  // EarlyDeleteHelper about the first one. As additional branches are added via 'appendIndex' the
357  // EarlyDeleteHelper will automatically advance its internal end pointer.
358  size_t index = nextOpenIndex;
359  size_t nIndices = reserveSizeForWorker[branchAndWorker.second];
361  earlyDeleteHelpers_.emplace_back(EarlyDeleteHelper(beginAddress+index,
362  beginAddress+index+1,
364  branchAndWorker.second->setEarlyDeleteHelper(&(earlyDeleteHelpers_.back()));
365  alreadySeenWorkers.insert(std::make_pair(branchAndWorker.second,&(earlyDeleteHelpers_.back())));
366  nextOpenIndex +=nIndices;
367  } else {
368  found->second->appendIndex(earlyDeleteBranchToCount_.size()-1);
369  }
370  }
371 
372  //Now we can compactify the earlyDeleteHelperToBranchIndicies_ since we may have over estimated the
373  // space needed for each module
374  auto itLast = earlyDeleteHelpers_.begin();
375  for(auto it = earlyDeleteHelpers_.begin()+1;it != earlyDeleteHelpers_.end();++it) {
376  if(itLast->end() != it->begin()) {
377  //figure the offset for next Worker since it hasn't been moved yet so it has the original address
378  unsigned int delta = it->begin()- itLast->end();
379  it->shiftIndexPointers(delta);
380 
382  (itLast->end()-beginAddress),
384  (it->begin()-beginAddress));
385  }
386  itLast = it;
387  }
388  earlyDeleteHelperToBranchIndicies_.erase(earlyDeleteHelperToBranchIndicies_.begin()+(itLast->end()-beginAddress),
390 
391  //now tell the paths about the deleters
392  for(auto& p : trig_paths_) {
393  p.setEarlyDeleteHelpers(alreadySeenWorkers);
394  }
395  for(auto& p : end_paths_) {
396  p.setEarlyDeleteHelpers(alreadySeenWorkers);
397  }
399  }
400  }
dbl * delta
Definition: mlp_gen.cc:36
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
const double w
Definition: UKUtility.cc:23
std::vector< std::pair< BranchID, unsigned int > > earlyDeleteBranchToCount_
bool getMapped(key_type const &k, value_type &result) const
Definition: Registry.cc:18
boost::array< SelectedProducts, NumBranchTypes > SelectedProductsForBranchType
std::vector< unsigned int > earlyDeleteHelperToBranchIndicies_
preg
Definition: Schedule.cc:374
static Registry * instance()
Definition: Registry.cc:12
std::vector< EarlyDeleteHelper > earlyDeleteHelpers_
void edm::StreamSchedule::moduleDescriptionsInEndPath ( std::string const &  iEndPathLabel,
std::vector< ModuleDescription const * > &  descriptions,
unsigned int  hint 
) const

Definition at line 610 of file StreamSchedule.cc.

References end_paths_, newFWLiteAna::found, i, and edm::Path::name().

612  {
613  descriptions.clear();
614  bool found = false;
615  TrigPaths::const_iterator itFound;
616 
617  if(hint < end_paths_.size()) {
618  itFound = end_paths_.begin() + hint;
619  if(itFound->name() == iEndPathLabel) found = true;
620  }
621  if(!found) {
622  // if the hint did not work, do it the slow way
623  itFound = std::find_if (end_paths_.begin(),
624  end_paths_.end(),
625  std::bind(std::equal_to<std::string>(),
626  iEndPathLabel,
627  std::bind(&Path::name, std::placeholders::_1)));
628  if (itFound != end_paths_.end()) found = true;
629  }
630  if (found) {
631  descriptions.reserve(itFound->size());
632  for (size_t i = 0; i < itFound->size(); ++i) {
633  descriptions.push_back(itFound->getWorker(i)->descPtr());
634  }
635  }
636  }
int i
Definition: DBlmapReader.cc:9
std::string const & name() const
Definition: Path.h:63
void edm::StreamSchedule::moduleDescriptionsInPath ( std::string const &  iPathLabel,
std::vector< ModuleDescription const * > &  descriptions,
unsigned int  hint 
) const

Definition at line 581 of file StreamSchedule.cc.

References newFWLiteAna::found, i, edm::Path::name(), and trig_paths_.

583  {
584  descriptions.clear();
585  bool found = false;
586  TrigPaths::const_iterator itFound;
587 
588  if(hint < trig_paths_.size()) {
589  itFound = trig_paths_.begin() + hint;
590  if(itFound->name() == iPathLabel) found = true;
591  }
592  if(!found) {
593  // if the hint did not work, do it the slow way
594  itFound = std::find_if (trig_paths_.begin(),
595  trig_paths_.end(),
596  std::bind(std::equal_to<std::string>(),
597  iPathLabel,
598  std::bind(&Path::name, std::placeholders::_1)));
599  if (itFound != trig_paths_.end()) found = true;
600  }
601  if (found) {
602  descriptions.reserve(itFound->size());
603  for (size_t i = 0; i < itFound->size(); ++i) {
604  descriptions.push_back(itFound->getWorker(i)->descPtr());
605  }
606  }
607  }
int i
Definition: DBlmapReader.cc:9
std::string const & name() const
Definition: Path.h:63
void edm::StreamSchedule::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

Definition at line 564 of file StreamSchedule.cc.

References i, edm::Path::name(), and trig_paths_.

565  {
566  TrigPaths::const_iterator itFound =
567  std::find_if (trig_paths_.begin(),
568  trig_paths_.end(),
569  std::bind(std::equal_to<std::string>(),
570  iPathLabel,
571  std::bind(&Path::name, std::placeholders::_1)));
572  if (itFound!=trig_paths_.end()) {
573  oLabelsToFill.reserve(itFound->size());
574  for (size_t i = 0; i < itFound->size(); ++i) {
575  oLabelsToFill.push_back(itFound->getWorker(i)->description().moduleLabel());
576  }
577  }
578  }
int i
Definition: DBlmapReader.cc:9
std::string const & name() const
Definition: Path.h:63
unsigned int edm::StreamSchedule::numberOfUnscheduledModules ( ) const
inline

Definition at line 257 of file StreamSchedule.h.

References number_of_unscheduled_modules_.

257  {
259  }
unsigned int number_of_unscheduled_modules_
template<typename T >
void edm::StreamSchedule::processOneEvent ( typename T::MyPrincipal &  principal,
EventSetup const &  eventSetup,
bool  cleaningUpAfterException = false 
)

Definition at line 375 of file StreamSchedule.h.

References alignCSCRings::action, actionTable(), actReg_, cms::Exception::addContext(), edm::addContextAndPrintException(), assert(), cms::Exception::category(), cms::Exception::context(), alignCSCRings::e, empty_trig_paths_, endpathsAreActive_, edm::exception_actions::FailPath, edm::ExceptionToActionTable::find(), edm::propagate_const< T >::get(), edm::exception_actions::IgnoreCompletely, edm::hlt::Pass, edm::printCmsExceptionWarning(), edm::WorkerManager::processOneOccurrence(), resetAll(), resetEarlyDelete(), results_, results_inserter_, edm::exception_actions::SkipEvent, streamContext_, streamID_, total_events_, total_passed_, workerManager_, and edm::convertException::wrap().

377  {
378  this->resetAll();
379  for (int empty_trig_path : empty_trig_paths_) {
380  results_->at(empty_trig_path) = HLTPathStatus(hlt::Pass, 0);
381  }
382 
383  T::setStreamContext(streamContext_, ep);
384  StreamScheduleSignalSentry<T> sentry(actReg_.get(), &streamContext_);
385 
386  SendTerminationSignalIfException terminationSentry(actReg_.get(), &streamContext_);
387  // This call takes care of the unscheduled processing.
388  workerManager_.processOneOccurrence<T>(ep, es, streamID_, &streamContext_, &streamContext_, cleaningUpAfterException);
389 
390  ++total_events_;
391  try {
392  convertException::wrap([&]() {
393  try {
394  if (runTriggerPaths<T>(ep, es, &streamContext_)) {
395  ++total_passed_;
396  }
397  }
398  catch(cms::Exception& e) {
402  if (action == exception_actions::SkipEvent) {
403  edm::printCmsExceptionWarning("SkipEvent", e);
404  } else {
405  throw;
406  }
407  }
408 
409  try {
410  ParentContext parentContext(&streamContext_);
411  if (results_inserter_.get()) results_inserter_->doWork<T>(ep, es, streamID_, parentContext, &streamContext_);
412  }
413  catch (cms::Exception & ex) {
414  if (T::isEvent_) {
415  ex.addContext("Calling produce method for module TriggerResultInserter");
416  }
417  std::ostringstream ost;
418  ost << "Processing " << ep.id();
419  ex.addContext(ost.str());
420  throw;
421  }
422 
423  if (endpathsAreActive_) runEndPaths<T>(ep, es, &streamContext_);
425  });
426  }
427  catch(cms::Exception& ex) {
428  if (ex.context().empty()) {
429  addContextAndPrintException("Calling function StreamSchedule::processOneEvent", ex, cleaningUpAfterException);
430  } else {
431  addContextAndPrintException("", ex, cleaningUpAfterException);
432  }
433  throw;
434  }
435  terminationSentry.completedSuccessfully();
436 
437  //If we got here no other exception has happened so we can propogate any Service related exceptions
438  sentry.allowThrow();
439  }
std::vector< int > empty_trig_paths_
void processOneOccurrence(typename T::MyPrincipal &principal, EventSetup const &eventSetup, StreamID streamID, typename T::Context const *topContext, U const *context, bool cleaningUpAfterException=false)
Definition: WorkerManager.h:95
volatile bool endpathsAreActive_
assert(m_qm.get())
void addContextAndPrintException(char const *context, cms::Exception &ex, bool disablePrint)
std::string const & category() const
Definition: Exception.cc:183
exception_actions::ActionCodes find(const std::string &category) const
edm::propagate_const< WorkerPtr > results_inserter_
ExceptionToActionTable const & actionTable() const
returns the action table
WorkerManager workerManager_
std::shared_ptr< ActivityRegistry > actReg_
accept
Definition: HLTenums.h:19
StreamContext streamContext_
std::list< std::string > const & context() const
Definition: Exception.cc:191
element_type const * get() const
edm::propagate_const< TrigResPtr > results_
void addContext(std::string const &context)
Definition: Exception.cc:227
auto wrap(F iFunc) -> decltype(iFunc())
long double T
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)
template<typename T >
void edm::StreamSchedule::processOneStream ( typename T::MyPrincipal &  principal,
EventSetup const &  eventSetup,
bool  cleaningUpAfterException = false 
)

Definition at line 442 of file StreamSchedule.h.

References actReg_, edm::addContextAndPrintException(), cms::Exception::context(), endpathsAreActive_, edm::WorkerManager::processOneOccurrence(), resetAll(), streamContext_, streamID_, workerManager_, and edm::convertException::wrap().

444  {
445  this->resetAll();
446 
447  T::setStreamContext(streamContext_, ep);
448  StreamScheduleSignalSentry<T> sentry(actReg_.get(), &streamContext_);
449 
450  SendTerminationSignalIfException terminationSentry(actReg_.get(), &streamContext_);
451 
452  // This call takes care of the unscheduled processing.
453  workerManager_.processOneOccurrence<T>(ep, es, streamID_, &streamContext_, &streamContext_, cleaningUpAfterException);
454 
455  try {
456  convertException::wrap([&]() {
457  runTriggerPaths<T>(ep, es, &streamContext_);
458 
459  if (endpathsAreActive_) runEndPaths<T>(ep, es, &streamContext_);
460  });
461  }
462  catch(cms::Exception& ex) {
463  if (ex.context().empty()) {
464  addContextAndPrintException("Calling function StreamSchedule::processOneStream", ex, cleaningUpAfterException);
465  } else {
466  addContextAndPrintException("", ex, cleaningUpAfterException);
467  }
468  throw;
469  }
470  terminationSentry.completedSuccessfully();
471 
472  //If we got here no other exception has happened so we can propogate any Service related exceptions
473  sentry.allowThrow();
474  }
void processOneOccurrence(typename T::MyPrincipal &principal, EventSetup const &eventSetup, StreamID streamID, typename T::Context const *topContext, U const *context, bool cleaningUpAfterException=false)
Definition: WorkerManager.h:95
volatile bool endpathsAreActive_
void addContextAndPrintException(char const *context, cms::Exception &ex, bool disablePrint)
WorkerManager workerManager_
std::shared_ptr< ActivityRegistry > actReg_
StreamContext streamContext_
std::list< std::string > const & context() const
Definition: Exception.cc:191
auto wrap(F iFunc) -> decltype(iFunc())
long double T
void edm::StreamSchedule::replaceModule ( maker::ModuleHolder iMod,
std::string const &  iLabel 
)

clone the type of module with label iLabel but configure with iPSet.

Definition at line 515 of file StreamSchedule.cc.

References allWorkers(), edm::Worker::beginStream(), newFWLiteAna::found, edm::maker::ModuleHolder::replaceModuleFor(), streamContext_, and streamID_.

516  {
517  Worker* found = nullptr;
518  for (auto const& worker : allWorkers()) {
519  if (worker->description().moduleLabel() == iLabel) {
520  found = worker;
521  break;
522  }
523  }
524  if (nullptr == found) {
525  return;
526  }
527 
528  iMod->replaceModuleFor(found);
529  found->beginStream(streamID_,streamContext_);
530  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
StreamContext streamContext_
void edm::StreamSchedule::reportSkipped ( EventPrincipal const &  ep) const
inlineprivate

Definition at line 369 of file StreamSchedule.h.

References edm::EventID::event(), edm::EventPrincipal::id(), and edm::EventID::run().

369  {
370  Service<JobReport> reportSvc;
371  reportSvc->reportSkippedEvent(ep.id().run(), ep.id().event());
372  }
void edm::StreamSchedule::resetAll ( )
private

Definition at line 720 of file StreamSchedule.cc.

References results_.

Referenced by processOneEvent(), and processOneStream().

720  {
721  results_->reset();
722  }
edm::propagate_const< TrigResPtr > results_
void edm::StreamSchedule::resetEarlyDelete ( )
private

Definition at line 730 of file StreamSchedule.cc.

References KineDebug3::count(), earlyDeleteBranchToCount_, earlyDeleteHelpers_, earlyDeleteHelperToBranchIndicies_, and cmsHarvester::index.

Referenced by initializeEarlyDelete(), and processOneEvent().

730  {
731  //must be sure we have cleared the count first
732  for(auto& count:earlyDeleteBranchToCount_) {
733  count.second = 0;
734  }
735  //now reset based on how many helpers use that branch
737  ++(earlyDeleteBranchToCount_[index].second);
738  }
739  for(auto& helper: earlyDeleteHelpers_) {
740  helper.reset();
741  }
742  }
std::vector< std::pair< BranchID, unsigned int > > earlyDeleteBranchToCount_
std::vector< unsigned int > earlyDeleteHelperToBranchIndicies_
std::vector< EarlyDeleteHelper > earlyDeleteHelpers_
TrigResConstPtr edm::StreamSchedule::results ( ) const
inlineprivate

Definition at line 326 of file StreamSchedule.h.

References edm::get_underlying_safe(), and results_.

Referenced by StreamSchedule().

326 {return get_underlying_safe(results_);}
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< TrigResPtr > results_
TrigResPtr& edm::StreamSchedule::results ( )
inlineprivate

Definition at line 327 of file StreamSchedule.h.

References edm::get_underlying_safe(), and results_.

327 {return get_underlying_safe(results_);}
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< TrigResPtr > results_
template<typename T >
void edm::StreamSchedule::runEndPaths ( typename T::MyPrincipal const &  ep,
EventSetup const &  es,
typename T::Context const *  context 
)
private

Definition at line 487 of file StreamSchedule.h.

References end_paths_, AlCaHLTBitMon_ParallelJobs::p, and streamID_.

487  {
488  // Note there is no state-checking safety controlling the
489  // activation/deactivation of endpaths.
490  for(auto& p : end_paths_) {
491  p.processOneOccurrence<T>(ep, es, streamID_, context);
492  }
493  }
long double T
template<typename T >
bool edm::StreamSchedule::runTriggerPaths ( typename T::MyPrincipal const &  ep,
EventSetup const &  es,
typename T::Context const *  context 
)
private

Definition at line 478 of file StreamSchedule.h.

References AlCaHLTBitMon_ParallelJobs::p, results_, streamID_, and trig_paths_.

478  {
479  for(auto& p : trig_paths_) {
480  p.processOneOccurrence<T>(ep, es, streamID_, context);
481  }
482  return results_->accept();
483  }
edm::propagate_const< TrigResPtr > results_
long double T
StreamID edm::StreamSchedule::streamID ( ) const
inline

Definition at line 182 of file StreamSchedule.h.

References streamID_.

182 { return streamID_; }
int edm::StreamSchedule::totalEvents ( ) const
inline

Return the number of events this StreamSchedule has tried to process (inclues both successes and failures, including failures due to exceptions during processing).

Definition at line 218 of file StreamSchedule.h.

References total_events_.

Referenced by getTriggerReport(), and totalEventsFailed().

218  {
219  return total_events_;
220  }
int edm::StreamSchedule::totalEventsFailed ( ) const
inline

Return the number of events that have not passed any trigger. (N.B. totalEventsFailed() + totalEventsPassed() == totalEvents()

Definition at line 230 of file StreamSchedule.h.

References totalEvents(), and totalEventsPassed().

Referenced by getTriggerReport().

230  {
231  return totalEvents() - totalEventsPassed();
232  }
int totalEvents() const
int totalEventsPassed() const
int edm::StreamSchedule::totalEventsPassed ( ) const
inline

Return the number of events which have been passed by one or more trigger paths.

Definition at line 224 of file StreamSchedule.h.

References total_passed_.

Referenced by getTriggerReport(), and totalEventsFailed().

224  {
225  return total_passed_;
226  }
void edm::StreamSchedule::triggerPaths ( std::vector< std::string > &  oLabelsToFill) const

adds to oLabelsToFill the labels for all trigger paths in the process this is different from availablePaths because it includes the empty paths so matches the entries in TriggerResults exactly.

Definition at line 554 of file StreamSchedule.cc.

References trig_name_list_.

554  {
555  oLabelsToFill = trig_name_list_;
556  }

Member Data Documentation

std::shared_ptr<ActivityRegistry> edm::StreamSchedule::actReg_
private
std::vector<std::pair<BranchID,unsigned int> > edm::StreamSchedule::earlyDeleteBranchToCount_
private

Definition at line 346 of file StreamSchedule.h.

Referenced by initializeEarlyDelete(), and resetEarlyDelete().

std::vector<EarlyDeleteHelper> edm::StreamSchedule::earlyDeleteHelpers_
private

Definition at line 356 of file StreamSchedule.h.

Referenced by initializeEarlyDelete(), and resetEarlyDelete().

std::vector<unsigned int> edm::StreamSchedule::earlyDeleteHelperToBranchIndicies_
private

Definition at line 353 of file StreamSchedule.h.

Referenced by initializeEarlyDelete(), and resetEarlyDelete().

vstring edm::StreamSchedule::empty_trig_path_names_
private

Definition at line 341 of file StreamSchedule.h.

Referenced by fillTrigPath().

std::vector<int> edm::StreamSchedule::empty_trig_paths_
private

Definition at line 340 of file StreamSchedule.h.

Referenced by fillTrigPath(), and processOneEvent().

vstring edm::StreamSchedule::end_path_name_list_
private

Definition at line 333 of file StreamSchedule.h.

Referenced by endPaths(), fillWorkers(), and StreamSchedule().

TrigPaths edm::StreamSchedule::end_paths_
private
volatile bool edm::StreamSchedule::endpathsAreActive_
private
unsigned int edm::StreamSchedule::number_of_unscheduled_modules_
private

Definition at line 360 of file StreamSchedule.h.

Referenced by numberOfUnscheduledModules(), and StreamSchedule().

edm::propagate_const<TrigResPtr> edm::StreamSchedule::results_
private

Definition at line 335 of file StreamSchedule.h.

Referenced by processOneEvent(), resetAll(), results(), and runTriggerPaths().

edm::propagate_const<WorkerPtr> edm::StreamSchedule::results_inserter_
private

Definition at line 337 of file StreamSchedule.h.

Referenced by processOneEvent(), and StreamSchedule().

StreamContext edm::StreamSchedule::streamContext_
private
StreamID edm::StreamSchedule::streamID_
private
int edm::StreamSchedule::total_events_
private

Definition at line 358 of file StreamSchedule.h.

Referenced by clearCounters(), processOneEvent(), and totalEvents().

int edm::StreamSchedule::total_passed_
private

Definition at line 359 of file StreamSchedule.h.

Referenced by clearCounters(), processOneEvent(), and totalEventsPassed().

vstring edm::StreamSchedule::trig_name_list_
private

Definition at line 332 of file StreamSchedule.h.

Referenced by StreamSchedule(), and triggerPaths().

TrigPaths edm::StreamSchedule::trig_paths_
private
WorkerManager edm::StreamSchedule::workerManager_
private