CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ScheduleItems.cc
Go to the documentation of this file.
2 
20 
21 #include <set>
22 
23 namespace edm {
25  actReg_(new ActivityRegistry),
26  preg_(new SignallingProductRegistry),
27  branchIDListHelper_(new BranchIDListHelper),
28  act_table_(),
29  processConfiguration_() {
30  }
31 
33  actReg_(new ActivityRegistry),
34  preg_(new SignallingProductRegistry(preg)),
35  branchIDListHelper_(new BranchIDListHelper),
36  act_table_(),
37  processConfiguration_() {
38 
39  for(auto& item : preg_->productListUpdator()) {
40  BranchDescription& prod = item.second;
41  prod.setOnDemand(false);
42  prod.setProduced(false);
43  }
44 
45  // Mark dropped branches as dropped in the product registry.
46  std::set<BranchID> keptBranches;
47  SelectedProducts const& keptVectorR = om.keptProducts()[InRun];
48  for(auto const& item : keptVectorR) {
49  keptBranches.insert(item->branchID());
50  }
51  SelectedProducts const& keptVectorL = om.keptProducts()[InLumi];
52  for(auto const& item : keptVectorL) {
53  keptBranches.insert(item->branchID());
54  }
55  SelectedProducts const& keptVectorE = om.keptProducts()[InEvent];
56  for(auto const& item : keptVectorE) {
57  keptBranches.insert(item->branchID());
58  }
59  for(auto& item : preg_->productListUpdator()) {
60  BranchDescription& prod = item.second;
61  if(keptBranches.find(prod.branchID()) == keptBranches.end()) {
62  prod.setDropped(true);
63  }
64  }
65  }
66 
68  ScheduleItems::initServices(std::vector<ParameterSet>& pServiceSets,
70  ServiceToken const& iToken,
72  bool associate) {
73 
74  //create the services
75  ServiceToken token(ServiceRegistry::createSet(pServiceSets, iToken, iLegacy, associate));
76 
77  //see if any of the Services have to have their PSets stored
78  for(auto const& item : pServiceSets) {
79  if(item.exists("@save_config")) {
80  parameterSet.addParameter(item.getParameter<std::string>("@service_type"), item);
81  }
82  }
83  // Copy slots that hold all the registered callback functions like
84  // PostBeginJob into an ActivityRegistry
85  token.copySlotsTo(*actReg_);
86  return token;
87  }
88 
91 
92  //add the ProductRegistry as a service ONLY for the construction phase
94  auto reg = std::make_shared<w_CPR>(std::auto_ptr<ConstProductRegistry>(new ConstProductRegistry(*preg_)));
96  token,
98 
99  // the next thing is ugly: pull out the trigger path pset and
100  // create a service and extra token for it
101 
102  typedef service::TriggerNamesService TNS;
104 
105  auto tnsptr = std::make_shared<w_TNS>(std::auto_ptr<TNS>(new TNS(parameterSet)));
106 
107  return ServiceRegistry::createContaining(tnsptr,
108  tempToken,
110  }
111 
112  std::shared_ptr<CommonParams>
114  act_table_.reset(new ExceptionToActionTable(parameterSet));
115  std::string processName = parameterSet.getParameter<std::string>("@process_name");
117  auto common = std::make_shared<CommonParams>(
118  parameterSet.getUntrackedParameterSet(
119  "maxEvents", ParameterSet()).getUntrackedParameter<int>("input", -1),
120  parameterSet.getUntrackedParameterSet(
121  "maxLuminosityBlocks", ParameterSet()).getUntrackedParameter<int>("input", -1),
122  parameterSet.getUntrackedParameterSet(
123  "maxSecondsUntilRampdown", ParameterSet()).getUntrackedParameter<int>("input", -1));
124  return common;
125  }
126 
127  std::auto_ptr<Schedule>
129  ParameterSet const* subProcessPSet,
131  ProcessContext const* processContext) {
132  std::auto_ptr<Schedule> schedule(
133  new Schedule(parameterSet,
134  ServiceRegistry::instance().get<service::TriggerNamesService>(),
135  *preg_,
137  *act_table_,
138  actReg_,
140  subProcessPSet,
141  config,
142  processContext));
143  return schedule;
144  }
145 
146  void
148  actReg_.reset();
149  preg_.reset();
150  branchIDListHelper_.reset();
151  processConfiguration_.reset();
152  }
153 }
154 
std::shared_ptr< ActivityRegistry > actReg_
Definition: ScheduleItems.h:55
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string getPassID()
Definition: GetPassID.h:8
std::unique_ptr< ExceptionToActionTable const > act_table_
Definition: ScheduleItems.h:58
void setOnDemand(bool isOnDemand)
SelectedProductsForBranchType const & keptProducts() const
Definition: SubProcess.h:54
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
std::shared_ptr< ProcessConfiguration > processConfiguration_
Definition: ScheduleItems.h:59
static ServiceToken createContaining(std::auto_ptr< T > iService)
create a service token that holds the service defined by iService
std::shared_ptr< CommonParams > initMisc(ParameterSet &parameterSet)
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:142
void copySlotsTo(ActivityRegistry &)
copy our Service&#39;s slots to the argument&#39;s signals
Definition: ServiceToken.cc:75
static ServiceRegistry & instance()
std::unique_ptr< SignallingProductRegistry > preg_
Definition: ScheduleItems.h:56
BranchID const & branchID() const
void setDropped(bool isDropped)
static ServiceToken createSet(std::vector< ParameterSet > &)
std::string getReleaseVersion()
ServiceToken initServices(std::vector< ParameterSet > &servicePSets, ParameterSet &processPSet, ServiceToken const &iToken, serviceregistry::ServiceLegacy iLegacy, bool associate)
ServiceToken addCPRandTNS(ParameterSet const &parameterSet, ServiceToken const &token)
std::shared_ptr< BranchIDListHelper > branchIDListHelper_
Definition: ScheduleItems.h:57
std::vector< BranchDescription const * > SelectedProducts
preg
Definition: Schedule.cc:368
std::auto_ptr< Schedule > initSchedule(ParameterSet &parameterSet, ParameterSet const *subProcessPSet, PreallocationConfiguration const &iAllocConfig, ProcessContext const *)
void setProduced(bool isProduced)
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11