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 
14 
15 namespace edm {
17  actReg_(new ActivityRegistry),
18  preg_(new SignallingProductRegistry),
19  act_table_(),
20  processConfiguration_() {
21  }
22 
24  actReg_(new ActivityRegistry),
25  preg_(new SignallingProductRegistry(preg)),
26  act_table_(),
27  processConfiguration_() {
28  for(ProductRegistry::ProductList::iterator it = preg_->productListUpdator().begin(), itEnd = preg_->productListUpdator().end(); it != itEnd; ++it) {
29  it->second.onDemand() = false;
30  it->second.produced() = false;
31  }
32  }
33 
35  ScheduleItems::initServices(std::vector<ParameterSet>& pServiceSets,
36  ParameterSet& parameterSet,
37  ServiceToken const& iToken,
39  bool associate) {
40 
41  //create the services
42  ServiceToken token(ServiceRegistry::createSet(pServiceSets, iToken, iLegacy, associate));
43 
44  //see if any of the Services have to have their PSets stored
45  for(std::vector<ParameterSet>::const_iterator it = pServiceSets.begin(), itEnd = pServiceSets.end();
46  it != itEnd;
47  ++it) {
48  if(it->exists("@save_config")) {
49  parameterSet.addParameter(it->getParameter<std::string>("@service_type"), *it);
50  }
51  }
52  // Copy slots that hold all the registered callback functions like
53  // PostBeginJob into an ActivityRegistry
54  token.copySlotsTo(*actReg_);
55  return token;
56  }
57 
59  ScheduleItems::addCPRandTNS(ParameterSet const& parameterSet, ServiceToken const& token) {
60 
61  //add the ProductRegistry as a service ONLY for the construction phase
63  boost::shared_ptr<w_CPR>
64  reg(new w_CPR(std::auto_ptr<ConstProductRegistry>(new ConstProductRegistry(*preg_))));
66  token,
68 
69  // the next thing is ugly: pull out the trigger path pset and
70  // create a service and extra token for it
71 
72  typedef service::TriggerNamesService TNS;
74 
75  boost::shared_ptr<w_TNS> tnsptr
76  (new w_TNS(std::auto_ptr<TNS>(new TNS(parameterSet))));
77 
79  tempToken,
81  }
82 
83  boost::shared_ptr<CommonParams>
85  act_table_.reset(new ActionTable(parameterSet));
86  std::string processName = parameterSet.getParameter<std::string>("@process_name");
88  boost::shared_ptr<CommonParams>
89  common(new CommonParams(parameterSet.getUntrackedParameterSet(
90  "maxEvents", ParameterSet()).getUntrackedParameter<int>("input", -1),
91  parameterSet.getUntrackedParameterSet(
92  "maxLuminosityBlocks", ParameterSet()).getUntrackedParameter<int>("input", -1)));
93  return common;
94  }
95 
96  std::auto_ptr<Schedule>
98  ParameterSet const* subProcessPSet) {
99  std::auto_ptr<Schedule> schedule(
100  new Schedule(parameterSet,
101  ServiceRegistry::instance().get<service::TriggerNamesService>(),
102  *preg_,
103  *act_table_,
104  actReg_,
106  subProcessPSet));
107  return schedule;
108  }
109 
110  void
112  actReg_.reset();
113  preg_.reset();
114  processConfiguration_.reset();
115  }
116 }
117 
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
boost::shared_ptr< CommonParams > initMisc(ParameterSet &parameterSet)
std::string getPassID()
Definition: GetPassID.h:8
boost::shared_ptr< ProcessConfiguration > processConfiguration_
Definition: ScheduleItems.h:51
static ServiceToken createContaining(std::auto_ptr< T > iService)
create a service token that holds the service defined by iService
std::auto_ptr< Schedule > initSchedule(ParameterSet &parameterSet, ParameterSet const *subProcessPSet)
boost::shared_ptr< ActionTable const > act_table_
Definition: ScheduleItems.h:50
ParameterSet const & getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:145
void copySlotsTo(ActivityRegistry &)
copy our Service&#39;s slots to the argument&#39;s signals
Definition: ServiceToken.cc:76
static ServiceRegistry & instance()
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)
author Stefano ARGIRO author Bill Tanenbaum
boost::shared_ptr< SignallingProductRegistry > preg_
Definition: ScheduleItems.h:49
boost::shared_ptr< ActivityRegistry > actReg_
Definition: ScheduleItems.h:48