CMS 3D CMS Logo

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
23 
26 
27 
28 //
29 // constants, enums and typedefs
30 //
31 namespace edm {
32 
33  namespace one {
34  //
35  // static data member definitions
36  //
37 
38  //
39  // constructors and destructor
40  //
42  ProducerBase(),
43  moduleDescription_(),
44  previousParentage_(),
45  previousParentageId_() { }
46 
48  {
49  }
50 
51  bool
53  ActivityRegistry* act,
54  ModuleCallingContext const* mcc) {
55  Event e(ep, moduleDescription_, mcc);
56  e.setConsumer(this);
59  EventSignalsSentry sentry(act,mcc);
60  this->produce(e, c);
62  return true;
63  }
64 
67  std::vector<std::shared_ptr<SerialTaskQueue>>(1, std::make_shared<SerialTaskQueue>())};
68  }
69 
70  void
73 
74  this->beginJob();
75  }
76 
77  void
79  this->endJob();
80  }
81 
82  void
84  auto const nThreads = iPrealloc.numberOfThreads();
85  preallocThreads(nThreads);
86  }
87 
88  void
90  ModuleCallingContext const* mcc) {
91  Run r(rp, moduleDescription_, mcc);
92  r.setConsumer(this);
93  Run const& cnstR = r;
94  this->doBeginRun_(cnstR, c);
95  r.setProducer(this);
96  this->doBeginRunProduce_(r,c);
97  commit_(r);
98  }
99 
100  void
102  ModuleCallingContext const* mcc) {
103  Run r(rp, moduleDescription_, mcc);
104  r.setConsumer(this);
105  Run const& cnstR = r;
106  this->doEndRun_(cnstR, c);
107  r.setProducer(this);
108  this->doEndRunProduce_(r, c);
109  commit_(r);
110  }
111 
112  void
114  ModuleCallingContext const* mcc) {
115  LuminosityBlock lb(lbp, moduleDescription_, mcc);
116  lb.setConsumer(this);
117  LuminosityBlock const& cnstLb = lb;
118  this->doBeginLuminosityBlock_(cnstLb, c);
119  lb.setProducer(this);
120  this->doBeginLuminosityBlockProduce_(lb, c);
121  commit_(lb);
122  }
123 
124  void
126  ModuleCallingContext const* mcc) {
127  LuminosityBlock lb(lbp, moduleDescription_, mcc);
128  lb.setConsumer(this);
129  LuminosityBlock const& cnstLb = lb;
130  this->doEndLuminosityBlock_(cnstLb, c);
131  lb.setProducer(this);
132  this->doEndLuminosityBlockProduce_(lb, c);
133  commit_(lb);
134  }
135 
136  void
138  //respondToOpenInputFile(fb);
139  }
140 
141  void
143  //respondToCloseInputFile(fb);
144  }
145 
146  void EDProducerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
147  void EDProducerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
150 
155 
156  void
159  desc.setUnknown();
160  descriptions.addDefault(desc);
161  }
162 
163  void
165  edmodule_mightGet_config(iConfig);
166  }
167 
168  static const std::string kBaseType("EDProducer");
169 
170  const std::string&
172  return kBaseType;
173  }
174 
175  }
176 }
static const std::string kBaseType("EDAnalyzer")
void doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
void setProducer(ProducerBase const *iProducer)
Definition: Run.cc:79
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 setConsumer(EDConsumerBase const *iConsumer)
Definition: Event.cc:42
ParentageID previousParentageId_
void doEndRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
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)
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
virtual void doBeginLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
SharedResourcesAcquirer resourcesAcquirer_
void setProducer(ProducerBase const *iProd, std::vector< BranchID > *previousParentage, std::vector< BranchID > *gotBranchIDsFromAcquire=0)
Definition: Event.cc:66
void doPreallocate(PreallocationConfiguration const &)
void setProducer(ProducerBase const *iProducer)
bool doEvent(EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
virtual void preallocThreads(unsigned int)
void setSharedResourcesAcquirer(SharedResourcesAcquirer *iResourceAcquirer)
Definition: Event.cc:49
HLT enums.
void doBeginRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
void doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
static void prevalidate(ConfigurationDescriptions &descriptions)
void commit_(P &iPrincipal)
Definition: ProducerBase.h:107
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