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  //Temporary: switch order of locks to avoid a deadlock with unscheduled
58  // proper fix is to releaes resourcesAcquirer when doing a 'getBy*'
59  std::lock_guard<SharedResourcesAcquirer> guard(resourcesAcquirer_);
60  {
61  std::lock_guard<std::mutex> guard(mutex_);
62  EventSignalsSentry sentry(act,mcc);
63  this->produce(e, c);
64  }
66  }
67  return true;
68  }
69 
71  return SharedResourcesAcquirer{};
72  }
73 
74  void
77 
78  this->beginJob();
79  }
80 
81  void
83  this->endJob();
84  }
85 
86  void
88  ModuleCallingContext const* mcc) {
89  Run r(rp, moduleDescription_, mcc);
90  r.setConsumer(this);
91  Run const& cnstR = r;
92  this->doBeginRun_(cnstR, c);
93  this->doBeginRunProduce_(r,c);
94  commit_(r);
95  }
96 
97  void
99  ModuleCallingContext const* mcc) {
100  Run r(rp, moduleDescription_, mcc);
101  r.setConsumer(this);
102  Run const& cnstR = r;
103  this->doEndRun_(cnstR, c);
104  this->doEndRunProduce_(r, c);
105  commit_(r);
106  }
107 
108  void
110  ModuleCallingContext const* mcc) {
111  LuminosityBlock lb(lbp, moduleDescription_, mcc);
112  lb.setConsumer(this);
113  LuminosityBlock const& cnstLb = lb;
114  this->doBeginLuminosityBlock_(cnstLb, c);
115  this->doBeginLuminosityBlockProduce_(lb, c);
116  commit_(lb);
117  }
118 
119  void
121  ModuleCallingContext const* mcc) {
122  LuminosityBlock lb(lbp, moduleDescription_, mcc);
123  lb.setConsumer(this);
124  LuminosityBlock const& cnstLb = lb;
125  this->doEndLuminosityBlock_(cnstLb, c);
126  this->doEndLuminosityBlockProduce_(lb, c);
127  commit_(lb);
128  }
129 
130  void
132  //respondToOpenInputFile(fb);
133  }
134 
135  void
137  //respondToCloseInputFile(fb);
138  }
139 
140  void
143  }
144 
145  void
146  EDProducerBase::doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren) {
147  postForkReacquireResources(iChildIndex, iNumberOfChildren);
148  }
149 
150  void EDProducerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
151  void EDProducerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
154 
159 
160  void
163  desc.setUnknown();
164  descriptions.addDefault(desc);
165  }
166 
167  void
169  edmodule_mightGet_config(iConfig);
170  }
171 
172  static const std::string kBaseType("EDProducer");
173 
174  const std::string&
176  return kBaseType;
177  }
178 
179  }
180 }
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 *)
virtual void preForkReleaseResources()
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