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 
72 
73  void
76 
77  this->beginJob();
78  }
79 
80  void
82  this->endJob();
83  }
84 
85  void
87  auto const nThreads = iPrealloc.numberOfThreads();
90  }
91 
92  void EDProducerBase::preallocLumis(unsigned int) {};
93 
94 
95  void
97  ModuleCallingContext const* mcc) {
98  Run r(rp, moduleDescription_, mcc, false);
99  r.setConsumer(this);
100  Run const& cnstR = r;
101  this->doBeginRun_(cnstR, c);
102  r.setProducer(this);
103  this->doBeginRunProduce_(r,c);
104  commit_(r);
105  }
106 
107  void
109  ModuleCallingContext const* mcc) {
110  Run r(rp, moduleDescription_, mcc, true);
111  r.setConsumer(this);
112  Run const& cnstR = r;
113  this->doEndRun_(cnstR, c);
114  r.setProducer(this);
115  this->doEndRunProduce_(r, c);
116  commit_(r);
117  }
118 
119  void
121  ModuleCallingContext const* mcc) {
122  LuminosityBlock lb(lbp, moduleDescription_, mcc, false);
123  lb.setConsumer(this);
124  LuminosityBlock const& cnstLb = lb;
125  this->doBeginLuminosityBlock_(cnstLb, c);
126  lb.setProducer(this);
127  this->doBeginLuminosityBlockProduce_(lb, c);
128  commit_(lb);
129  }
130 
131  void
133  ModuleCallingContext const* mcc) {
134  LuminosityBlock lb(lbp, moduleDescription_, mcc, true);
135  lb.setConsumer(this);
136  LuminosityBlock const& cnstLb = lb;
137  this->doEndLuminosityBlock_(cnstLb, c);
138  lb.setProducer(this);
139  this->doEndLuminosityBlockProduce_(lb, c);
140  commit_(lb);
141  }
142 
143  void
145  //respondToOpenInputFile(fb);
146  }
147 
148  void
150  //respondToCloseInputFile(fb);
151  }
152 
153  void EDProducerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
154  void EDProducerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
157 
162 
163  void
166  desc.setUnknown();
167  descriptions.addDefault(desc);
168  }
169 
170  void
172  edmodule_mightGet_config(iConfig);
173  }
174 
175  static const std::string kBaseType("EDProducer");
176 
177  const std::string&
179  return kBaseType;
180  }
181 
182  }
183 }
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
static const std::string kBaseType("EDAnalyzer")
virtual void preallocLumis(unsigned int)
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)
virtual SerialTaskQueue * globalRunsQueue()
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:51
std::vector< BranchID > previousParentage_
ModuleDescription moduleDescription_
virtual void produce(Event &, EventSetup const &)=0
Definition: Run.h:44