CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EDProducerBase.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/Framework
4 // Class : one::EDProducerBase
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Chris Jones
10 // Created: Thu, 02 May 2013 21:56:04 GMT
11 //
12 
13 // system include files
14 
15 // user include files
22 
25 
26 
27 //
28 // constants, enums and typedefs
29 //
30 namespace edm {
31 
32  namespace one {
33  //
34  // static data member definitions
35  //
36 
37  //
38  // constructors and destructor
39  //
41  ProducerBase(),
42  moduleDescription_(),
43  previousParentage_(),
44  previousParentageId_() { }
45 
47  {
48  }
49 
50  bool
52  ActivityRegistry* act,
53  ModuleCallingContext const* mcc) {
54  Event e(ep, moduleDescription_, mcc);
55  e.setConsumer(this);
56  {
57  std::lock_guard<std::mutex> guard(mutex_);
58  {
59  std::lock_guard<SharedResourcesAcquirer> guard(resourcesAcquirer_);
61  EventSignalsSentry sentry(act,mcc);
62  this->produce(e, c);
63  }
65  }
66  return true;
67  }
68 
70  return SharedResourcesAcquirer{};
71  }
72 
73  void
76 
77  this->beginJob();
78  }
79 
80  void
82  this->endJob();
83  }
84 
85  void
87  ModuleCallingContext const* mcc) {
88  Run r(rp, moduleDescription_, mcc);
89  r.setConsumer(this);
90  Run const& cnstR = r;
91  this->doBeginRun_(cnstR, c);
92  this->doBeginRunProduce_(r,c);
93  commit_(r);
94  }
95 
96  void
98  ModuleCallingContext const* mcc) {
99  Run r(rp, moduleDescription_, mcc);
100  r.setConsumer(this);
101  Run const& cnstR = r;
102  this->doEndRun_(cnstR, c);
103  this->doEndRunProduce_(r, c);
104  commit_(r);
105  }
106 
107  void
109  ModuleCallingContext const* mcc) {
110  LuminosityBlock lb(lbp, moduleDescription_, mcc);
111  lb.setConsumer(this);
112  LuminosityBlock const& cnstLb = lb;
113  this->doBeginLuminosityBlock_(cnstLb, c);
114  this->doBeginLuminosityBlockProduce_(lb, c);
115  commit_(lb);
116  }
117 
118  void
120  ModuleCallingContext const* mcc) {
121  LuminosityBlock lb(lbp, moduleDescription_, mcc);
122  lb.setConsumer(this);
123  LuminosityBlock const& cnstLb = lb;
124  this->doEndLuminosityBlock_(cnstLb, c);
125  this->doEndLuminosityBlockProduce_(lb, c);
126  commit_(lb);
127  }
128 
129  void
131  //respondToOpenInputFile(fb);
132  }
133 
134  void
136  //respondToCloseInputFile(fb);
137  }
138 
139  void
142  }
143 
144  void
145  EDProducerBase::doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren) {
146  postForkReacquireResources(iChildIndex, iNumberOfChildren);
147  }
148 
149  void EDProducerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
150  void EDProducerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
153 
158 
159  void
162  desc.setUnknown();
163  descriptions.addDefault(desc);
164  }
165 
166  void
168  edmodule_mightGet_config(iConfig);
169  }
170 
171  static const std::string kBaseType("EDProducer");
172 
173  const std::string&
175  return kBaseType;
176  }
177 
178  }
179 }
static const std::string kBaseType("EDAnalyzer")
static void fillDescriptions(ConfigurationDescriptions &descriptions)
void setConsumer(EDConsumerBase const *iConsumer)
static const std::string & baseType()
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
virtual void doBeginRunProduce_(Run &rp, EventSetup const &c)
virtual void doEndRunProduce_(Run &rp, EventSetup const &c)
void doEndLuminosityBlock(LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *)
virtual void postForkReacquireResources(unsigned int, unsigned int)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Event.cc:37
void doBeginRun(RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *)
ParentageID previousParentageId_
void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
void addDefault(ParameterSetDescription const &psetDescription)
virtual void doEndLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
void doRespondToCloseInputFile(FileBlock const &fb)
void doRespondToOpenInputFile(FileBlock const &fb)
virtual void doEndRun_(Run const &rp, EventSetup const &c)
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
bool doEvent(EventPrincipal &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
virtual void doBeginLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
SharedResourcesAcquirer resourcesAcquirer_
void doEndRun(RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *)
void doBeginLuminosityBlock(LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *)
void setSharedResourcesAcquirer(SharedResourcesAcquirer *iResourceAcquirer)
Definition: Event.cc:43
virtual void preForkReleaseResources()
static void prevalidate(ConfigurationDescriptions &descriptions)
void commit_(P &iPrincipal)
Definition: ProducerBase.h:64
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
virtual SharedResourcesAcquirer createAcquirer()
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Run.h:50
std::vector< BranchID > previousParentage_
ModuleDescription moduleDescription_
virtual void produce(Event &, EventSetup const &)=0
Definition: Run.h:43