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
24 
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(), moduleDescription_(), previousParentage_(), previousParentageId_() {}
43 
45 
47  EventSetupImpl const& ci,
48  ActivityRegistry* act,
49  ModuleCallingContext const* mcc) {
50  Event e(ep, moduleDescription_, mcc);
51  e.setConsumer(this);
54  EventSignalsSentry sentry(act, mcc);
55  const EventSetup c{ci, static_cast<unsigned int>(Transition::Event), esGetTokenIndices(Transition::Event)};
56  this->produce(e, c);
58  return true;
59  }
60 
63  std::vector<std::shared_ptr<SerialTaskQueue>>(1, std::make_shared<SerialTaskQueue>())};
64  }
65 
68 
71 
72  this->beginJob();
73  }
74 
75  void EDProducerBase::doEndJob() { this->endJob(); }
76 
78  auto const nThreads = iPrealloc.numberOfThreads();
81  }
82 
83  void EDProducerBase::preallocLumis(unsigned int){};
84 
86  Run r(rp, moduleDescription_, mcc, false);
87  r.setConsumer(this);
88  Run const& cnstR = r;
89  const EventSetup c{ci, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun)};
90  this->doBeginRun_(cnstR, c);
91  r.setProducer(this);
92  this->doBeginRunProduce_(r, c);
93  commit_(r);
94  }
95 
97  Run r(rp, moduleDescription_, mcc, true);
98  r.setConsumer(this);
99  Run const& cnstR = r;
100  r.setProducer(this);
101  const EventSetup c{ci, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun)};
102  this->doEndRunProduce_(r, c);
103  this->doEndRun_(cnstR, c);
104  commit_(r);
105  }
106 
108  EventSetupImpl const& ci,
109  ModuleCallingContext const* mcc) {
110  LuminosityBlock lb(lbp, moduleDescription_, mcc, false);
111  lb.setConsumer(this);
112  LuminosityBlock const& cnstLb = lb;
113  const EventSetup c{ci,
114  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
116  this->doBeginLuminosityBlock_(cnstLb, c);
117  lb.setProducer(this);
119  commit_(lb);
120  }
121 
123  EventSetupImpl const& ci,
124  ModuleCallingContext const* mcc) {
125  LuminosityBlock lb(lbp, moduleDescription_, mcc, true);
126  lb.setConsumer(this);
127  lb.setProducer(this);
128  const EventSetup c{ci,
129  static_cast<unsigned int>(Transition::EndLuminosityBlock),
131  this->doEndLuminosityBlockProduce_(lb, c);
132  LuminosityBlock const& cnstLb = lb;
133  this->doEndLuminosityBlock_(cnstLb, c);
134  commit_(lb);
135  }
136 
138  //respondToOpenInputFile(fb);
139  }
140 
142  //respondToCloseInputFile(fb);
143  }
144 
145  void EDProducerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
146  void EDProducerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
149 
154 
157  desc.setUnknown();
158  descriptions.addDefault(desc);
159  }
160 
162 
163  static const std::string kBaseType("EDProducer");
164 
166 
167  } // namespace one
168 } // namespace edm
bool doEvent(EventPrincipal const &ep, EventSetupImpl const &c, ActivityRegistry *, ModuleCallingContext const *)
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
static const std::string kBaseType("EDAnalyzer")
virtual void preallocLumis(unsigned int)
void setProducer(ProducerBase const *iProducer)
Definition: Run.cc:70
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 doBeginRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: Event.cc:37
void doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
ParentageID previousParentageId_
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)
void doEndRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
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:55
void doPreallocate(PreallocationConfiguration const &)
void setProducer(ProducerBase const *iProducer)
virtual void preallocThreads(unsigned int)
void setSharedResourcesAcquirer(SharedResourcesAcquirer *iResourceAcquirer)
Definition: Event.cc:43
HLT enums.
static void prevalidate(ConfigurationDescriptions &descriptions)
void commit_(P &iPrincipal)
Definition: ProducerBase.h:111
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
virtual SharedResourcesAcquirer createAcquirer()
void doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
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:45
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const