CMS 3D CMS Logo

ScheduleItems.cc
Go to the documentation of this file.
2 
22 
23 #include <memory>
24 
25 #include <set>
26 
27 namespace edm {
29  : actReg_(std::make_shared<ActivityRegistry>()),
30  preg_(std::make_shared<SignallingProductRegistry>()),
31  branchIDListHelper_(std::make_shared<BranchIDListHelper>()),
32  thinnedAssociationsHelper_(std::make_shared<ThinnedAssociationsHelper>()),
33  subProcessParentageHelper_(),
34  act_table_(),
35  processConfiguration_() {}
36 
38  : actReg_(std::make_shared<ActivityRegistry>()),
39  preg_(std::make_shared<SignallingProductRegistry>(preg)),
40  branchIDListHelper_(std::make_shared<BranchIDListHelper>()),
41  thinnedAssociationsHelper_(std::make_shared<ThinnedAssociationsHelper>()),
42  subProcessParentageHelper_(std::make_shared<SubProcessParentageHelper>()),
43  act_table_(),
44  processConfiguration_() {
45  for (auto& item : preg_->productListUpdator()) {
46  BranchDescription& prod = item.second;
47  prod.setOnDemand(false);
48  prod.setProduced(false);
49  }
50 
51  // Mark dropped branches as dropped in the product registry.
52  std::set<BranchID> keptBranches;
53  SelectedProducts const& keptVectorP = om.keptProducts()[InProcess];
54  for (auto const& item : keptVectorP) {
55  BranchDescription const& desc = *item.first;
56  keptBranches.insert(desc.branchID());
57  }
58  SelectedProducts const& keptVectorR = om.keptProducts()[InRun];
59  for (auto const& item : keptVectorR) {
60  BranchDescription const& desc = *item.first;
61  keptBranches.insert(desc.branchID());
62  }
63  SelectedProducts const& keptVectorL = om.keptProducts()[InLumi];
64  for (auto const& item : keptVectorL) {
65  BranchDescription const& desc = *item.first;
66  keptBranches.insert(desc.branchID());
67  }
68  SelectedProducts const& keptVectorE = om.keptProducts()[InEvent];
69  for (auto const& item : keptVectorE) {
70  BranchDescription const& desc = *item.first;
71  keptBranches.insert(desc.branchID());
72  }
73  for (auto& item : preg_->productListUpdator()) {
74  BranchDescription& prod = item.second;
75  if (keptBranches.find(prod.branchID()) == keptBranches.end()) {
76  prod.setDropped(true);
77  }
78  }
79  }
80 
81  ServiceToken ScheduleItems::initServices(std::vector<ParameterSet>& pServiceSets,
83  ServiceToken const& iToken,
85  bool associate) {
86  //create the services
87  ServiceToken token(ServiceRegistry::createSet(pServiceSets, iToken, iLegacy, associate));
88 
89  //see if any of the Services have to have their PSets stored
90  for (auto const& item : pServiceSets) {
91  if (item.exists("@save_config")) {
92  parameterSet.addParameter(item.getParameter<std::string>("@service_type"), item);
93  }
94  }
95  // Copy slots that hold all the registered callback functions like
96  // PostBeginJob into an ActivityRegistry
97  token.copySlotsTo(*actReg_);
98  return token;
99  }
100 
102  //add the ProductRegistry as a service ONLY for the construction phase
104  auto reg = std::make_shared<w_CPR>(std::make_unique<ConstProductRegistry>(*preg_));
106 
107  // the next thing is ugly: pull out the trigger path pset and
108  // create a service and extra token for it
109 
110  typedef service::TriggerNamesService TNS;
112 
113  auto tnsptr = std::make_shared<w_TNS>(std::make_unique<TNS>(parameterSet));
114 
116  }
117 
118  std::shared_ptr<CommonParams> ScheduleItems::initMisc(ParameterSet& parameterSet) {
119  act_table_ = std::make_unique<ExceptionToActionTable>(parameterSet);
121  processConfiguration_ = std::make_shared<ProcessConfiguration>(
122  processName, getReleaseVersion(), getPassID()); // propagate_const<T> has no reset() function
123  auto common = std::make_shared<CommonParams>(
125  parameterSet.getUntrackedParameterSet("maxLuminosityBlocks").getUntrackedParameter<int>("input"),
126  parameterSet.getUntrackedParameterSet("maxSecondsUntilRampdown").getUntrackedParameter<int>("input"));
127  return common;
128  }
129 
131  bool hasSubprocesses,
133  ProcessContext const* processContext) {
134  return std::make_unique<Schedule>(parameterSet,
135  ServiceRegistry::instance().get<service::TriggerNamesService>(),
136  *preg_,
140  *act_table_,
141  actReg_,
143  hasSubprocesses,
144  config,
145  processContext);
146  }
147 
149  // propagate_const<T> has no reset() function
150  actReg_ = nullptr;
151  preg_ = nullptr;
152  branchIDListHelper_ = nullptr;
153  thinnedAssociationsHelper_ = nullptr;
154  processConfiguration_ = nullptr;
155  }
156 } // namespace edm
ConstProductRegistry.h
ThinnedAssociationsHelper.h
edm::ScheduleItems::processConfiguration
std::shared_ptr< ProcessConfiguration const > processConfiguration() const
Definition: ScheduleItems.h:68
edm::SubProcessParentageHelper
Definition: SubProcessParentageHelper.h:21
ServiceRegistry.h
edm::SubProcess
Definition: SubProcess.h:50
BranchType.h
edm::ScheduleItems::processConfiguration_
edm::propagate_const< std::shared_ptr< ProcessConfiguration > > processConfiguration_
Definition: ScheduleItems.h:79
edm::ParameterSet::getUntrackedParameterSet
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
Definition: ParameterSet.cc:2136
edm::SubProcess::keptProducts
SelectedProductsForBranchType const & keptProducts() const
Definition: SubProcess.h:77
BranchIDListHelper.h
TriggerNamesService.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ProcessContext
Definition: ProcessContext.h:27
BranchID.h
edm::ScheduleItems::thinnedAssociationsHelper_
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: ScheduleItems.h:76
edm::ServiceRegistry::createSet
static ServiceToken createSet(std::vector< ParameterSet > &)
Definition: ServiceRegistry.cc:75
SignallingProductRegistry.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::getPassID
std::string getPassID()
Definition: GetPassID.h:7
edm::ScheduleItems::preg_
edm::propagate_const< std::shared_ptr< SignallingProductRegistry > > preg_
Definition: ScheduleItems.h:74
edm::ScheduleItems::initMisc
std::shared_ptr< CommonParams > initMisc(ParameterSet &parameterSet)
Definition: ScheduleItems.cc:118
edm::ScheduleItems::branchIDListHelper_
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: ScheduleItems.h:75
edm::InRun
Definition: BranchType.h:11
edm::ScheduleItems::addCPRandTNS
ServiceToken addCPRandTNS(ParameterSet const &parameterSet, ServiceToken const &token)
Definition: ScheduleItems.cc:101
edm::SelectedProducts
std::vector< std::pair< BranchDescription const *, EDGetToken > > SelectedProducts
Definition: SelectedProducts.h:11
edm::ProductRegistry
Definition: ProductRegistry.h:37
ActivityRegistry.h
edm::parameterSet
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
config
Definition: config.py:1
edm::ServiceToken
Definition: ServiceToken.h:42
edm::InProcess
Definition: BranchType.h:11
submitPVResolutionJobs.config
config
parse the configuration file
Definition: submitPVResolutionJobs.py:281
edm::ScheduleItems::act_table_
std::unique_ptr< ExceptionToActionTable const > act_table_
Definition: ScheduleItems.h:78
SubProcessParentageHelper.h
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
edm::ActivityRegistry
Definition: ActivityRegistry.h:134
edm::ScheduleItems::actReg_
std::shared_ptr< ActivityRegistry > actReg_
Definition: ScheduleItems.h:73
CommonParams.h
edm::ScheduleItems::initServices
ServiceToken initServices(std::vector< ParameterSet > &servicePSets, ParameterSet &processPSet, ServiceToken const &iToken, serviceregistry::ServiceLegacy iLegacy, bool associate)
Definition: ScheduleItems.cc:81
edm::ScheduleItems::ScheduleItems
ScheduleItems()
Definition: ScheduleItems.cc:28
edm::InEvent
Definition: BranchType.h:11
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:37
BranchDescription.h
edm::ParameterSet
Definition: ParameterSet.h:47
GetReleaseVersion.h
edm::InLumi
Definition: BranchType.h:11
edm::serviceregistry::kOverlapIsError
Definition: ServiceLegacy.h:29
edm::ParameterSet::addParameter
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:135
edm::BranchIDListHelper
Definition: BranchIDListHelper.h:15
Schedule.h
edm::ScheduleItems::subProcessParentageHelper_
edm::propagate_const< std::shared_ptr< SubProcessParentageHelper > > subProcessParentageHelper_
Definition: ScheduleItems.h:77
GetPassID.h
ExceptionActions.h
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::ServiceRegistry::instance
static ServiceRegistry & instance()
Definition: ServiceRegistry.cc:90
SubProcess.h
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
edm::service::TriggerNamesService
Definition: TriggerNamesService.h:42
ScheduleItems.h
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
std
Definition: JetResolutionObject.h:76
edm::ServiceRegistry::createContaining
static ServiceToken createContaining(std::unique_ptr< T > iService)
create a service token that holds the service defined by iService
Definition: ServiceRegistry.h:99
edm::getReleaseVersion
std::string getReleaseVersion()
Definition: GetReleaseVersion.cc:7
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ScheduleItems::initSchedule
std::unique_ptr< Schedule > initSchedule(ParameterSet &parameterSet, bool hasSubprocesses, PreallocationConfiguration const &iAllocConfig, ProcessContext const *)
Definition: ScheduleItems.cc:130
edm::BranchDescription
Definition: BranchDescription.h:32
ParameterSet.h
edm::ScheduleItems::clear
void clear()
Definition: ScheduleItems.cc:148
trackingPlots.common
common
Definition: trackingPlots.py:206
SelectedProducts.h
edm::serviceregistry::ServiceLegacy
ServiceLegacy
Definition: ServiceLegacy.h:29
edm::SignallingProductRegistry
Definition: SignallingProductRegistry.h:32
common
Definition: common.py:1
edm::serviceregistry::ServiceWrapper
Definition: ServiceRegistry.h:35
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316