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

edm::PathsAndConsumesOfModules::~PathsAndConsumesOfModules ( )
override

Definition at line 12 of file PathsAndConsumesOfModules.cc.

12 {}

Member Function Documentation

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 73 of file PathsAndConsumesOfModules.cc.

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

Referenced by doAllModules().

73  {
74  Worker const* worker = schedule_->allWorkers().at(moduleIndex(moduleID));
75  return worker->consumesInfo();
76  }
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1249
unsigned int moduleIndex(unsigned int moduleID) const
std::vector<std::string> const& edm::PathsAndConsumesOfModules::doEndPaths ( ) const
inlineoverrideprivatevirtual

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 37 of file PathsAndConsumesOfModules.h.

References endPaths_.

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

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 48 of file PathsAndConsumesOfModules.cc.

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

Referenced by doAllModules().

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  }
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 63 of file PathsAndConsumesOfModules.cc.

References modulesOnEndPaths_.

Referenced by doAllModules().

64  {
65  return modulesOnEndPaths_.at(endPathIndex);
66  }
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 59 of file PathsAndConsumesOfModules.cc.

References modulesOnPaths_.

Referenced by doAllModules().

59  {
60  return modulesOnPaths_.at(pathIndex);
61  }
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 68 of file PathsAndConsumesOfModules.cc.

References moduleIndex(), and modulesWhoseProductsAreConsumedBy_.

Referenced by doAllModules().

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

Implements edm::PathsAndConsumesOfModulesBase.

Definition at line 36 of file PathsAndConsumesOfModules.h.

References paths_.

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

Definition at line 14 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().

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  }
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 78 of file PathsAndConsumesOfModules.cc.

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

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

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  }
std::vector< std::pair< unsigned int, unsigned int > > moduleIDToIndex_

Member Data Documentation

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

Definition at line 56 of file PathsAndConsumesOfModules.h.

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

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

Definition at line 54 of file PathsAndConsumesOfModules.h.

Referenced by doEndPaths(), and initialize().

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().

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

Definition at line 59 of file PathsAndConsumesOfModules.h.

Referenced by doModulesOnEndPath(), and initialize().

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

Definition at line 58 of file PathsAndConsumesOfModules.h.

Referenced by doModulesOnPath(), and initialize().

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

Definition at line 65 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 68 of file PathsAndConsumesOfModules.h.

Referenced by initialize().

Schedule const* edm::PathsAndConsumesOfModules::schedule_
private