CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::PathsAndConsumesOfModules Class Reference

#include <PathsAndConsumesOfModules.h>

Inheritance diagram for edm::PathsAndConsumesOfModules:
edm::PathsAndConsumesOfModulesBase

Public Member Functions

void initialize (Schedule const *, std::shared_ptr< ProductRegistry const >)
 
 ~PathsAndConsumesOfModules () override
 
- Public Member Functions inherited from edm::PathsAndConsumesOfModulesBase
std::vector< ModuleDescription const * > const & allModules () const
 
std::vector< ConsumesInfoconsumesInfo (unsigned int moduleID) const
 
std::vector< std::string > const & endPaths () const
 
ModuleDescription const * moduleDescription (unsigned int moduleID) const
 
std::vector< ModuleDescription const * > const & modulesOnEndPath (unsigned int endPathIndex) const
 
std::vector< ModuleDescription const * > const & modulesOnPath (unsigned int pathIndex) const
 
std::vector< ModuleDescription const * > const & modulesWhoseProductsAreConsumedBy (unsigned int moduleID) const
 
std::vector< std::string > const & paths () const
 
virtual ~PathsAndConsumesOfModulesBase ()
 

Private Member Functions

std::vector< ModuleDescription const * > const & doAllModules () const override
 
std::vector< ConsumesInfodoConsumesInfo (unsigned int moduleID) const override
 
std::vector< std::string > const & doEndPaths () const override
 
ModuleDescription const * doModuleDescription (unsigned int moduleID) const override
 
std::vector< ModuleDescription const * > const & doModulesOnEndPath (unsigned int endPathIndex) const override
 
std::vector< ModuleDescription const * > const & doModulesOnPath (unsigned int pathIndex) const override
 
std::vector< ModuleDescription const * > const & doModulesWhoseProductsAreConsumedBy (unsigned int moduleID) const override
 
std::vector< std::string > const & doPaths () const override
 
unsigned int moduleIndex (unsigned int moduleID) const
 

Private Attributes

std::vector< ModuleDescription const * > allModuleDescriptions_
 
std::vector< std::string > endPaths_
 
std::vector< std::pair< unsigned int, unsigned int > > moduleIDToIndex_
 
std::vector< std::vector< ModuleDescription const * > > modulesOnEndPaths_
 
std::vector< std::vector< ModuleDescription const * > > modulesOnPaths_
 
std::vector< std::vector< ModuleDescription const * > > modulesWhoseProductsAreConsumedBy_
 
std::vector< std::string > paths_
 
std::shared_ptr< ProductRegistry const > preg_
 
Schedule const * schedule_
 

Detailed Description

Description: See comments in the base class

Usage:

Definition at line 29 of file PathsAndConsumesOfModules.h.

Constructor & Destructor Documentation

◆ ~PathsAndConsumesOfModules()

edm::PathsAndConsumesOfModules::~PathsAndConsumesOfModules ( )
override

Definition at line 12 of file PathsAndConsumesOfModules.cc.

12 {}

Member Function Documentation

◆ doAllModules()

std::vector<ModuleDescription const*> const& edm::PathsAndConsumesOfModules::doAllModules ( ) const
inlineoverrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 39 of file PathsAndConsumesOfModules.h.

39 { return allModuleDescriptions_; }

References allModuleDescriptions_.

◆ doConsumesInfo()

std::vector< ConsumesInfo > edm::PathsAndConsumesOfModules::doConsumesInfo ( unsigned int  moduleID) const
overrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 73 of file PathsAndConsumesOfModules.cc.

73  {
74  Worker const* worker = schedule_->allWorkers().at(moduleIndex(moduleID));
75  return worker->consumesInfo();
76  }

References edm::Schedule::allWorkers(), edm::Worker::consumesInfo(), moduleIndex(), and schedule_.

◆ doEndPaths()

std::vector<std::string> const& edm::PathsAndConsumesOfModules::doEndPaths ( ) const
inlineoverrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 37 of file PathsAndConsumesOfModules.h.

37 { return endPaths_; }

References endPaths_.

◆ doModuleDescription()

ModuleDescription const * edm::PathsAndConsumesOfModules::doModuleDescription ( unsigned int  moduleID) const
overrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 48 of file PathsAndConsumesOfModules.cc.

48  {
49  unsigned int dummy = 0;
50  auto target = std::make_pair(moduleID, dummy);
51  std::vector<std::pair<unsigned int, unsigned int>>::const_iterator iter =
53  if (iter == moduleIDToIndex_.end() || iter->first != moduleID) {
54  throw Exception(errors::LogicError) << "PathsAndConsumesOfModules::moduleDescription: Unknown moduleID\n";
55  }
56  return allModuleDescriptions_.at(iter->second);
57  }

References allModuleDescriptions_, Exception, edm::errors::LogicError, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, moduleIDToIndex_, and filterCSVwithJSON::target.

◆ doModulesOnEndPath()

std::vector< ModuleDescription const * > const & edm::PathsAndConsumesOfModules::doModulesOnEndPath ( unsigned int  endPathIndex) const
overrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 63 of file PathsAndConsumesOfModules.cc.

64  {
65  return modulesOnEndPaths_.at(endPathIndex);
66  }

References modulesOnEndPaths_.

◆ doModulesOnPath()

std::vector< ModuleDescription const * > const & edm::PathsAndConsumesOfModules::doModulesOnPath ( unsigned int  pathIndex) const
overrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 59 of file PathsAndConsumesOfModules.cc.

59  {
60  return modulesOnPaths_.at(pathIndex);
61  }

References modulesOnPaths_.

◆ doModulesWhoseProductsAreConsumedBy()

std::vector< ModuleDescription const * > const & edm::PathsAndConsumesOfModules::doModulesWhoseProductsAreConsumedBy ( unsigned int  moduleID) const
overrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 68 of file PathsAndConsumesOfModules.cc.

69  {
71  }

References moduleIndex(), and modulesWhoseProductsAreConsumedBy_.

◆ doPaths()

std::vector<std::string> const& edm::PathsAndConsumesOfModules::doPaths ( ) const
inlineoverrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 36 of file PathsAndConsumesOfModules.h.

36 { return paths_; }

References paths_.

◆ initialize()

void edm::PathsAndConsumesOfModules::initialize ( Schedule const *  schedule,
std::shared_ptr< ProductRegistry const >  preg 
)

Definition at line 14 of file PathsAndConsumesOfModules.cc.

14  {
16  preg_ = preg;
17 
18  paths_.clear();
19  schedule->triggerPaths(paths_);
20 
21  endPaths_.clear();
22  schedule->endPaths(endPaths_);
23 
24  modulesOnPaths_.resize(paths_.size());
25  unsigned int i = 0;
26  unsigned int hint = 0;
27  for (auto const& path : paths_) {
28  schedule->moduleDescriptionsInPath(path, modulesOnPaths_.at(i), hint);
29  if (!modulesOnPaths_.at(i).empty())
30  ++hint;
31  ++i;
32  }
33 
34  modulesOnEndPaths_.resize(endPaths_.size());
35  i = 0;
36  hint = 0;
37  for (auto const& endpath : endPaths_) {
38  schedule->moduleDescriptionsInEndPath(endpath, modulesOnEndPaths_.at(i), hint);
39  if (!modulesOnEndPaths_.at(i).empty())
40  ++hint;
41  ++i;
42  }
43 
44  schedule->fillModuleAndConsumesInfo(
46  }

References allModuleDescriptions_, endPaths_, mps_fire::i, moduleIDToIndex_, modulesOnEndPaths_, modulesOnPaths_, modulesWhoseProductsAreConsumedBy_, castor_dqm_sourceclient_file_cfg::path, paths_, preg_, filterRecHits_cfg::schedule, and schedule_.

Referenced by edm::EventProcessor::beginJob(), and edm::SubProcess::beginJob().

◆ moduleIndex()

unsigned int edm::PathsAndConsumesOfModules::moduleIndex ( unsigned int  moduleID) const
private

Definition at line 78 of file PathsAndConsumesOfModules.cc.

78  {
79  unsigned int dummy = 0;
80  auto target = std::make_pair(moduleID, dummy);
81  std::vector<std::pair<unsigned int, unsigned int>>::const_iterator iter =
83  if (iter == moduleIDToIndex_.end() || iter->first != moduleID) {
84  throw Exception(errors::LogicError) << "PathsAndConsumesOfModules::moduleIndex: Unknown moduleID\n";
85  }
86  return iter->second;
87  }

References Exception, edm::errors::LogicError, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, moduleIDToIndex_, and filterCSVwithJSON::target.

Referenced by doConsumesInfo(), and doModulesWhoseProductsAreConsumedBy().

Member Data Documentation

◆ allModuleDescriptions_

std::vector<ModuleDescription const*> edm::PathsAndConsumesOfModules::allModuleDescriptions_
private

Definition at line 56 of file PathsAndConsumesOfModules.h.

Referenced by doAllModules(), doModuleDescription(), and initialize().

◆ endPaths_

std::vector<std::string> edm::PathsAndConsumesOfModules::endPaths_
private

Definition at line 54 of file PathsAndConsumesOfModules.h.

Referenced by doEndPaths(), and initialize().

◆ moduleIDToIndex_

std::vector<std::pair<unsigned int, unsigned int> > edm::PathsAndConsumesOfModules::moduleIDToIndex_
private

Definition at line 63 of file PathsAndConsumesOfModules.h.

Referenced by doModuleDescription(), initialize(), and moduleIndex().

◆ modulesOnEndPaths_

std::vector<std::vector<ModuleDescription const*> > edm::PathsAndConsumesOfModules::modulesOnEndPaths_
private

Definition at line 59 of file PathsAndConsumesOfModules.h.

Referenced by doModulesOnEndPath(), and initialize().

◆ modulesOnPaths_

std::vector<std::vector<ModuleDescription const*> > edm::PathsAndConsumesOfModules::modulesOnPaths_
private

Definition at line 58 of file PathsAndConsumesOfModules.h.

Referenced by doModulesOnPath(), and initialize().

◆ modulesWhoseProductsAreConsumedBy_

std::vector<std::vector<ModuleDescription const*> > edm::PathsAndConsumesOfModules::modulesWhoseProductsAreConsumedBy_
private

Definition at line 65 of file PathsAndConsumesOfModules.h.

Referenced by doModulesWhoseProductsAreConsumedBy(), and initialize().

◆ paths_

std::vector<std::string> edm::PathsAndConsumesOfModules::paths_
private

◆ preg_

std::shared_ptr<ProductRegistry const> edm::PathsAndConsumesOfModules::preg_
private

Definition at line 68 of file PathsAndConsumesOfModules.h.

Referenced by initialize().

◆ schedule_

Schedule const* edm::PathsAndConsumesOfModules::schedule_
private
mps_fire.i
i
Definition: mps_fire.py:428
edm::PathsAndConsumesOfModules::modulesOnPaths_
std::vector< std::vector< ModuleDescription const * > > modulesOnPaths_
Definition: PathsAndConsumesOfModules.h:58
edm::errors::LogicError
Definition: EDMException.h:37
edm::PathsAndConsumesOfModules::modulesOnEndPaths_
std::vector< std::vector< ModuleDescription const * > > modulesOnEndPaths_
Definition: PathsAndConsumesOfModules.h:59
edm::PathsAndConsumesOfModules::modulesWhoseProductsAreConsumedBy_
std::vector< std::vector< ModuleDescription const * > > modulesWhoseProductsAreConsumedBy_
Definition: PathsAndConsumesOfModules.h:65
edm::PathsAndConsumesOfModules::paths_
std::vector< std::string > paths_
Definition: PathsAndConsumesOfModules.h:53
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
edm::PathsAndConsumesOfModules::preg_
std::shared_ptr< ProductRegistry const > preg_
Definition: PathsAndConsumesOfModules.h:68
edm::PathsAndConsumesOfModules::moduleIDToIndex_
std::vector< std::pair< unsigned int, unsigned int > > moduleIDToIndex_
Definition: PathsAndConsumesOfModules.h:63
edm::PathsAndConsumesOfModules::endPaths_
std::vector< std::string > endPaths_
Definition: PathsAndConsumesOfModules.h:54
edm::PathsAndConsumesOfModules::allModuleDescriptions_
std::vector< ModuleDescription const * > allModuleDescriptions_
Definition: PathsAndConsumesOfModules.h:56
edm::Schedule::allWorkers
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1438
edm::PathsAndConsumesOfModules::schedule_
Schedule const * schedule_
Definition: PathsAndConsumesOfModules.h:67
Exception
Definition: hltDiff.cc:246
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
dummy
Definition: DummySelector.h:38
filterRecHits_cfg.schedule
schedule
Definition: filterRecHits_cfg.py:62
edm::PathsAndConsumesOfModules::moduleIndex
unsigned int moduleIndex(unsigned int moduleID) const
Definition: PathsAndConsumesOfModules.cc:78