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 : global::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
23 
26 
27 
28 //
29 // constants, enums and typedefs
30 //
31 namespace edm {
32  namespace global {
33  //
34  // static data member definitions
35  //
36 
37  //
38  // constructors and destructor
39  //
41  ProducerBase(),
42  moduleDescription_(),
43  previousParentages_(),
44  previousParentageIds_() { }
45 
47  {
48  }
49 
50  bool
52  ActivityRegistry* act,
53  ModuleCallingContext const* mcc) {
54  Event e(ep, moduleDescription_, mcc);
55  e.setConsumer(this);
56  EventSignalsSentry sentry(act,mcc);
57  this->produce(e.streamID(), e, c);
58  const auto streamIndex = e.streamID().value();
59  commit_(e,&previousParentages_[streamIndex], &previousParentageIds_[streamIndex]);
60  return true;
61  }
62 
63  void
65  auto const nStreams = iPrealloc.numberOfStreams();
66  previousParentages_.reset(new std::vector<BranchID>[nStreams]);
67  previousParentageIds_.reset( new ParentageID[nStreams]);
68  preallocStreams(nStreams);
69  }
70 
71  void
73  this->beginJob();
74  }
75 
76  void
78  this->endJob();
79  }
80 
81  void
83  ModuleCallingContext const* mcc) {
84  Run r(rp, moduleDescription_, mcc);
85  r.setConsumer(this);
86  Run const& cnstR = r;
87  this->doBeginRun_(cnstR, c);
88  this->doBeginRunSummary_(cnstR, c);
89  this->doBeginRunProduce_(r,c);
90  commit_(r);
91  }
92 
93  void
95  ModuleCallingContext const* mcc) {
96  Run r(rp, moduleDescription_, mcc);
97  r.setConsumer(this);
98  Run const& cnstR = r;
99  this->doEndRunProduce_(r, c);
100  this->doEndRunSummary_(r,c);
101  this->doEndRun_(cnstR, c);
102  commit_(r);
103  }
104 
105  void
107  ModuleCallingContext const* mcc) {
108  LuminosityBlock lb(lbp, moduleDescription_, mcc);
109  lb.setConsumer(this);
110  LuminosityBlock const& cnstLb = lb;
111  this->doBeginLuminosityBlock_(cnstLb, c);
112  this->doBeginLuminosityBlockSummary_(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->doEndLuminosityBlockProduce_(lb, c);
124  this->doEndLuminosityBlockSummary_(cnstLb,c);
125  this->doEndLuminosityBlock_(cnstLb, c);
126  commit_(lb);
127  }
128 
129  void
131  doBeginStream_(id);
132  }
133  void
135  doEndStream_(id);
136  }
137  void
139  RunPrincipal& rp,
140  EventSetup const& c,
141  ModuleCallingContext const* mcc)
142  {
143  Run r(rp, moduleDescription_, mcc);
144  r.setConsumer(this);
145  this->doStreamBeginRun_(id, r, c);
146  }
147  void
149  RunPrincipal& rp,
150  EventSetup const& c,
151  ModuleCallingContext const* mcc) {
152  Run r(rp, moduleDescription_, mcc);
153  r.setConsumer(this);
154  this->doStreamEndRun_(id, r, c);
155  this->doStreamEndRunSummary_(id, r, c);
156  }
157  void
160  EventSetup const& c,
161  ModuleCallingContext const* mcc) {
162  LuminosityBlock lb(lbp, moduleDescription_, mcc);
163  lb.setConsumer(this);
164  this->doStreamBeginLuminosityBlock_(id,lb, c);
165  }
166 
167  void
170  EventSetup const& c,
171  ModuleCallingContext const* mcc) {
172  LuminosityBlock lb(lbp, moduleDescription_, mcc);
173  lb.setConsumer(this);
174  this->doStreamEndLuminosityBlock_(id,lb, c);
175  this->doStreamEndLuminosityBlockSummary_(id,lb, c);
176  }
177 
178 
179 
180  void
182  //respondToOpenInputFile(fb);
183  }
184 
185  void
187  //respondToCloseInputFile(fb);
188  }
189 
190  void
193  }
194 
195  void
196  EDProducerBase::doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren) {
197  postForkReacquireResources(iChildIndex, iNumberOfChildren);
198  }
199 
200  void EDProducerBase::preallocStreams(unsigned int) {}
204  void EDProducerBase::doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c) {}
209 
210 
211  void EDProducerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
212  void EDProducerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
215 
220 
225 
226  void
229  desc.setUnknown();
230  descriptions.addDefault(desc);
231  }
232 
233  void
235  edmodule_mightGet_config(iConfig);
236  }
237 
238  static const std::string kBaseType("EDProducer");
239 
240  const std::string&
242  return kBaseType;
243  }
244 
245  }
246 }
static const std::string kBaseType("EDAnalyzer")
ModuleDescription moduleDescription_
void setConsumer(EDConsumerBase const *iConsumer)
virtual void doEndRunSummary_(Run const &rp, EventSetup const &c)
virtual void doBeginLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
bool doEvent(EventPrincipal &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
virtual void doEndStream_(StreamID id)
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
void doBeginStream(StreamID id)
Definition: Hash.h:42
virtual void doEndRun_(Run const &rp, EventSetup const &c)
std::unique_ptr< ParentageID[]> previousParentageIds_
void doPreallocate(PreallocationConfiguration const &)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Event.cc:37
void doEndRun(RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *)
void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
virtual void doBeginStream_(StreamID id)
virtual void doEndLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
void doStreamEndRun(StreamID id, RunPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
static void prevalidate(ConfigurationDescriptions &descriptions)
void addDefault(ParameterSetDescription const &psetDescription)
virtual void preallocStreams(unsigned int)
void doStreamBeginRun(StreamID id, RunPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
virtual void preForkReleaseResources()
void doRespondToOpenInputFile(FileBlock const &fb)
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
virtual void doStreamEndRun_(StreamID id, Run const &rp, EventSetup const &c)
void doStreamEndLuminosityBlock(StreamID id, LuminosityBlockPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
std::unique_ptr< std::vector< BranchID >[]> previousParentages_
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doEndLuminosityBlockSummary_(LuminosityBlock const &lb, EventSetup const &c)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
static const std::string & baseType()
virtual void doBeginRunProduce_(Run &rp, EventSetup const &c)
void doStreamBeginLuminosityBlock(StreamID id, LuminosityBlockPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
unsigned int value() const
Definition: StreamID.h:46
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const &rp, EventSetup const &c)
virtual void produce(StreamID, Event &, EventSetup const &) const =0
virtual void doEndLuminosityBlock_(LuminosityBlock const &lb, EventSetup const &c)
void doEndLuminosityBlock(LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *)
virtual void postForkReacquireResources(unsigned int, unsigned int)
void doBeginRun(RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *)
StreamID streamID() const
Definition: Event.h:72
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
void commit_(P &iPrincipal)
Definition: ProducerBase.h:65
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
void doRespondToCloseInputFile(FileBlock const &fb)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Run.h:48
void doBeginLuminosityBlock(LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *)
virtual void doEndRunProduce_(Run &rp, EventSetup const &c)
Definition: Run.h:41
void doEndStream(StreamID id)