test
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_);
60  EventSignalsSentry sentry(act,mcc);
61  this->produce(e, c);
62  }
64  }
65  return true;
66  }
67 
69  return SharedResourcesAcquirer{};
70  }
71 
72  void
75 
76  this->beginJob();
77  }
78 
79  void
81  this->endJob();
82  }
83 
84  void
86  ModuleCallingContext const* mcc) {
87  Run r(rp, moduleDescription_, mcc);
88  r.setConsumer(this);
89  Run const& cnstR = r;
90  this->doBeginRun_(cnstR, c);
91  this->doBeginRunProduce_(r,c);
92  commit_(r);
93  }
94 
95  void
97  ModuleCallingContext const* mcc) {
98  Run r(rp, moduleDescription_, mcc);
99  r.setConsumer(this);
100  Run const& cnstR = r;
101  this->doEndRun_(cnstR, c);
102  this->doEndRunProduce_(r, c);
103  commit_(r);
104  }
105 
106  void
108  ModuleCallingContext const* mcc) {
109  LuminosityBlock lb(lbp, moduleDescription_, mcc);
110  lb.setConsumer(this);
111  LuminosityBlock const& cnstLb = lb;
112  this->doBeginLuminosityBlock_(cnstLb, c);
113  this->doBeginLuminosityBlockProduce_(lb, c);
114  commit_(lb);
115  }
116 
117  void
119  ModuleCallingContext const* mcc) {
120  LuminosityBlock lb(lbp, moduleDescription_, mcc);
121  lb.setConsumer(this);
122  LuminosityBlock const& cnstLb = lb;
123  this->doEndLuminosityBlock_(cnstLb, c);
124  this->doEndLuminosityBlockProduce_(lb, c);
125  commit_(lb);
126  }
127 
128  void
130  //respondToOpenInputFile(fb);
131  }
132 
133  void
135  //respondToCloseInputFile(fb);
136  }
137 
138  void
140  //preForkReleaseResources();
141  }
142 
143  void
144  EDProducerBase::doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren) {
145  //postForkReacquireResources(iChildIndex, iNumberOfChildren);
146  }
147 
148  void EDProducerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
149  void EDProducerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
152 
157 
158  void
161  desc.setUnknown();
162  descriptions.addDefault(desc);
163  }
164 
165  void
167  edmodule_mightGet_config(iConfig);
168  }
169 
170  static const std::string kBaseType("EDProducer");
171 
172  const std::string&
174  return kBaseType;
175  }
176 
177  }
178 }
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 *)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Event.cc:40
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 *)
static void prevalidate(ConfigurationDescriptions &descriptions)
void commit_(P &iPrincipal)
Definition: ProducerBase.h:65
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
virtual SharedResourcesAcquirer createAcquirer()
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Run.h:48
std::vector< BranchID > previousParentage_
ModuleDescription moduleDescription_
virtual void produce(Event &, EventSetup const &)=0
Definition: Run.h:41