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 >)
 
virtual ~PathsAndConsumesOfModules ()
 
- 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

virtual std::vector< ModuleDescription const * > const & doAllModules () const override
 
virtual std::vector< ConsumesInfodoConsumesInfo (unsigned int moduleID) const override
 
virtual std::vector< std::string > const & doEndPaths () const override
 
virtual ModuleDescription const * doModuleDescription (unsigned int moduleID) const override
 
virtual std::vector< ModuleDescription const * > const & doModulesOnEndPath (unsigned int endPathIndex) const override
 
virtual std::vector< ModuleDescription const * > const & doModulesOnPath (unsigned int pathIndex) const override
 
virtual std::vector< ModuleDescription const * > const & doModulesWhoseProductsAreConsumedBy (unsigned int moduleID) const override
 
virtual 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

edm::PathsAndConsumesOfModules::~PathsAndConsumesOfModules ( )
virtual

Definition at line 12 of file PathsAndConsumesOfModules.cc.

12  {
13  }

Member Function Documentation

virtual std::vector<ModuleDescription const*> const& edm::PathsAndConsumesOfModules::doAllModules ( ) const
inlineoverrideprivatevirtual
std::vector< ConsumesInfo > edm::PathsAndConsumesOfModules::doConsumesInfo ( unsigned int  moduleID) const
overrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 79 of file PathsAndConsumesOfModules.cc.

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

Referenced by doAllModules().

79  {
80  Worker const* worker = schedule_->allWorkers().at(moduleIndex(moduleID));
81  return worker->consumesInfo();
82  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1089
unsigned int moduleIndex(unsigned int moduleID) const
virtual std::vector<std::string> const& edm::PathsAndConsumesOfModules::doEndPaths ( ) const
inlineoverrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 39 of file PathsAndConsumesOfModules.h.

References endPaths_.

39 { return endPaths_; }
std::vector< std::string > endPaths_
ModuleDescription const * edm::PathsAndConsumesOfModules::doModuleDescription ( unsigned int  moduleID) const
overrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 51 of file PathsAndConsumesOfModules.cc.

References allModuleDescriptions_, Exception, edm::errors::LogicError, moduleIDToIndex_, and edmPickEvents::target.

Referenced by doAllModules().

51  {
52  unsigned int dummy = 0;
53  auto target = std::make_pair(moduleID, dummy);
54  std::vector<std::pair<unsigned int, unsigned int> >::const_iterator iter =
55  std::lower_bound(moduleIDToIndex_.begin(), moduleIDToIndex_.end(), target);
56  if (iter == moduleIDToIndex_.end() || iter->first != moduleID) {
58  << "PathsAndConsumesOfModules::moduleDescription: Unknown moduleID\n";
59  }
60  return allModuleDescriptions_.at(iter->second);
61  }
std::vector< std::pair< unsigned int, unsigned int > > moduleIDToIndex_
std::vector< ModuleDescription const * > allModuleDescriptions_
std::vector< ModuleDescription const * > const & edm::PathsAndConsumesOfModules::doModulesOnEndPath ( unsigned int  endPathIndex) const
overrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 69 of file PathsAndConsumesOfModules.cc.

References modulesOnEndPaths_.

Referenced by doAllModules().

69  {
70  return modulesOnEndPaths_.at(endPathIndex);
71  }
std::vector< std::vector< ModuleDescription const * > > modulesOnEndPaths_
std::vector< ModuleDescription const * > const & edm::PathsAndConsumesOfModules::doModulesOnPath ( unsigned int  pathIndex) const
overrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 64 of file PathsAndConsumesOfModules.cc.

References modulesOnPaths_.

Referenced by doAllModules().

64  {
65  return modulesOnPaths_.at(pathIndex);
66  }
std::vector< std::vector< ModuleDescription const * > > modulesOnPaths_
std::vector< ModuleDescription const * > const & edm::PathsAndConsumesOfModules::doModulesWhoseProductsAreConsumedBy ( unsigned int  moduleID) const
overrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 74 of file PathsAndConsumesOfModules.cc.

References moduleIndex(), and modulesWhoseProductsAreConsumedBy_.

Referenced by doAllModules().

74  {
76  }
std::vector< std::vector< ModuleDescription const * > > modulesWhoseProductsAreConsumedBy_
unsigned int moduleIndex(unsigned int moduleID) const
virtual std::vector<std::string> const& edm::PathsAndConsumesOfModules::doPaths ( ) const
inlineoverrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 38 of file PathsAndConsumesOfModules.h.

References paths_.

38 { return paths_; }
void edm::PathsAndConsumesOfModules::initialize ( Schedule const *  schedule,
std::shared_ptr< ProductRegistry const >  preg 
)

Definition at line 15 of file PathsAndConsumesOfModules.cc.

References allModuleDescriptions_, edm::Schedule::endPaths(), endPaths_, edm::Schedule::fillModuleAndConsumesInfo(), mps_fire::i, edm::Schedule::moduleDescriptionsInEndPath(), edm::Schedule::moduleDescriptionsInPath(), moduleIDToIndex_, modulesOnEndPaths_, modulesOnPaths_, modulesWhoseProductsAreConsumedBy_, callgraph::path, paths_, preg_, JustL1Validation_cff::schedule, schedule_, and edm::Schedule::triggerPaths().

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

15  {
16 
18  preg_ = preg;
19 
20  paths_.clear();
21  schedule->triggerPaths(paths_);
22 
23  endPaths_.clear();
24  schedule->endPaths(endPaths_);
25 
26  modulesOnPaths_.resize(paths_.size());
27  unsigned int i = 0;
28  unsigned int hint = 0;
29  for(auto const& path : paths_) {
30  schedule->moduleDescriptionsInPath(path, modulesOnPaths_.at(i), hint);
31  if(!modulesOnPaths_.at(i).empty()) ++hint;
32  ++i;
33  }
34 
35  modulesOnEndPaths_.resize(endPaths_.size());
36  i = 0;
37  hint = 0;
38  for(auto const& endpath : endPaths_) {
39  schedule->moduleDescriptionsInEndPath(endpath, modulesOnEndPaths_.at(i), hint);
40  if(!modulesOnEndPaths_.at(i).empty()) ++hint;
41  ++i;
42  }
43 
44  schedule->fillModuleAndConsumesInfo(allModuleDescriptions_,
47  *preg);
48  }
std::vector< std::vector< ModuleDescription const * > > modulesWhoseProductsAreConsumedBy_
std::vector< std::pair< unsigned int, unsigned int > > moduleIDToIndex_
std::vector< ModuleDescription const * > allModuleDescriptions_
std::vector< std::vector< ModuleDescription const * > > modulesOnPaths_
std::vector< std::string > endPaths_
std::shared_ptr< ProductRegistry const > preg_
std::vector< std::vector< ModuleDescription const * > > modulesOnEndPaths_
unsigned int edm::PathsAndConsumesOfModules::moduleIndex ( unsigned int  moduleID) const
private

Definition at line 85 of file PathsAndConsumesOfModules.cc.

References Exception, edm::errors::LogicError, moduleIDToIndex_, and edmPickEvents::target.

Referenced by edm::checkForModuleDependencyCorrectness(), doAllModules(), doConsumesInfo(), and doModulesWhoseProductsAreConsumedBy().

85  {
86  unsigned int dummy = 0;
87  auto target = std::make_pair(moduleID, dummy);
88  std::vector<std::pair<unsigned int, unsigned int> >::const_iterator iter =
89  std::lower_bound(moduleIDToIndex_.begin(), moduleIDToIndex_.end(), target);
90  if (iter == moduleIDToIndex_.end() || iter->first != moduleID) {
92  << "PathsAndConsumesOfModules::moduleIndex: Unknown moduleID\n";
93  }
94  return iter->second;
95  }
std::vector< std::pair< unsigned int, unsigned int > > moduleIDToIndex_

Member Data Documentation

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

Definition at line 57 of file PathsAndConsumesOfModules.h.

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

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

Definition at line 55 of file PathsAndConsumesOfModules.h.

Referenced by doEndPaths(), and initialize().

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

Definition at line 64 of file PathsAndConsumesOfModules.h.

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

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

Definition at line 60 of file PathsAndConsumesOfModules.h.

Referenced by doModulesOnEndPath(), and initialize().

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

Definition at line 59 of file PathsAndConsumesOfModules.h.

Referenced by doModulesOnPath(), and initialize().

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

Definition at line 66 of file PathsAndConsumesOfModules.h.

Referenced by doModulesWhoseProductsAreConsumedBy(), and initialize().

std::vector<std::string> edm::PathsAndConsumesOfModules::paths_
private
std::shared_ptr<ProductRegistry const> edm::PathsAndConsumesOfModules::preg_
private

Definition at line 69 of file PathsAndConsumesOfModules.h.

Referenced by initialize().

Schedule const* edm::PathsAndConsumesOfModules::schedule_
private