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();
88  preallocThreads(nThreads);
89  }
90 
91  void
93  ModuleCallingContext const* mcc) {
94  Run r(rp, moduleDescription_, mcc, false);
95  r.setConsumer(this);
96  Run const& cnstR = r;
97  this->doBeginRun_(cnstR, c);
98  r.setProducer(this);
99  this->doBeginRunProduce_(r,c);
100  commit_(r);
101  }
102 
103  void
105  ModuleCallingContext const* mcc) {
106  Run r(rp, moduleDescription_, mcc, true);
107  r.setConsumer(this);
108  Run const& cnstR = r;
109  this->doEndRun_(cnstR, c);
110  r.setProducer(this);
111  this->doEndRunProduce_(r, c);
112  commit_(r);
113  }
114 
115  void
117  ModuleCallingContext const* mcc) {
118  LuminosityBlock lb(lbp, moduleDescription_, mcc, false);
119  lb.setConsumer(this);
120  LuminosityBlock const& cnstLb = lb;
121  this->doBeginLuminosityBlock_(cnstLb, c);
122  lb.setProducer(this);
123  this->doBeginLuminosityBlockProduce_(lb, c);
124  commit_(lb);
125  }
126 
127  void
129  ModuleCallingContext const* mcc) {
130  LuminosityBlock lb(lbp, moduleDescription_, mcc, true);
131  lb.setConsumer(this);
132  LuminosityBlock const& cnstLb = lb;
133  this->doEndLuminosityBlock_(cnstLb, c);
134  lb.setProducer(this);
135  this->doEndLuminosityBlockProduce_(lb, c);
136  commit_(lb);
137  }
138 
139  void
141  //respondToOpenInputFile(fb);
142  }
143 
144  void
146  //respondToCloseInputFile(fb);
147  }
148 
149  void EDProducerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
150  void EDProducerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
153 
158 
159  void
162  desc.setUnknown();
163  descriptions.addDefault(desc);
164  }
165 
166  void
168  edmodule_mightGet_config(iConfig);
169  }
170 
171  static const std::string kBaseType("EDProducer");
172 
173  const std::string&
175  return kBaseType;
176  }
177 
178  }
179 }
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
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)
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:50
std::vector< BranchID > previousParentage_
ModuleDescription moduleDescription_
virtual void produce(Event &, EventSetup const &)=0
Definition: Run.h:43