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
27 
30 
31 //
32 // constants, enums and typedefs
33 //
34 namespace edm {
35 
36  namespace one {
37  //
38  // static data member definitions
39  //
40 
41  //
42  // constructors and destructor
43  //
45  : ProducerBase(), moduleDescription_(), previousParentage_(), previousParentageId_() {}
46 
48 
50  ActivityRegistry* act,
51  ModuleCallingContext const* mcc) {
53  e.setConsumer(this);
54  e.setProducer(this, &previousParentage_);
55  e.setSharedResourcesAcquirer(&resourcesAcquirer_);
56  EventSignalsSentry sentry(act, mcc);
57  ESParentContext parentC(mcc);
58  const EventSetup c{
59  info, static_cast<unsigned int>(Transition::Event), esGetTokenIndices(Transition::Event), parentC};
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 
75 
76  this->beginJob();
77  }
78 
79  void EDProducerBase::doEndJob() { this->endJob(); }
80 
82  auto const nThreads = iPrealloc.numberOfThreads();
83  preallocThreads(nThreads);
85  }
86 
87  void EDProducerBase::preallocLumis(unsigned int){};
88 
90  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
91  processBlock.setConsumer(this);
92  ProcessBlock const& constProcessBlock = processBlock;
93  this->doBeginProcessBlock_(constProcessBlock);
94  processBlock.setProducer(this);
95  this->doBeginProcessBlockProduce_(processBlock);
96  commit_(processBlock);
97  }
98 
100  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
101  processBlock.setConsumer(this);
102  ProcessBlock const& constProcessBlock = processBlock;
103  this->doAccessInputProcessBlock_(constProcessBlock);
104  }
105 
107  ProcessBlock processBlock(pbp, moduleDescription_, mcc, true);
108  processBlock.setConsumer(this);
109  ProcessBlock const& constProcessBlock = processBlock;
110  this->doEndProcessBlock_(constProcessBlock);
111  processBlock.setProducer(this);
112  this->doEndProcessBlockProduce_(processBlock);
113  commit_(processBlock);
114  }
115 
117  Run r(info, moduleDescription_, mcc, false);
118  r.setConsumer(this);
119  Run const& cnstR = r;
120  ESParentContext parentC(mcc);
121  const EventSetup c{
122  info, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), parentC};
123  this->doBeginRun_(cnstR, c);
124  r.setProducer(this);
125  this->doBeginRunProduce_(r, c);
126  commit_(r);
127  }
128 
130  Run r(info, moduleDescription_, mcc, true);
131  r.setConsumer(this);
132  Run const& cnstR = r;
133  r.setProducer(this);
134  ESParentContext parentC(mcc);
135  const EventSetup c{
136  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC};
137  this->doEndRunProduce_(r, c);
138  this->doEndRun_(cnstR, c);
139  commit_(r);
140  }
141 
143  LuminosityBlock lb(info, moduleDescription_, mcc, false);
144  lb.setConsumer(this);
145  LuminosityBlock const& cnstLb = lb;
146  ESParentContext parentC(mcc);
147  const EventSetup c{info,
148  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
150  parentC};
151  this->doBeginLuminosityBlock_(cnstLb, c);
152  lb.setProducer(this);
154  commit_(lb);
155  }
156 
158  LuminosityBlock lb(info, moduleDescription_, mcc, true);
159  lb.setConsumer(this);
160  lb.setProducer(this);
161  ESParentContext parentC(mcc);
162  const EventSetup c{info,
163  static_cast<unsigned int>(Transition::EndLuminosityBlock),
165  parentC};
166  this->doEndLuminosityBlockProduce_(lb, c);
167  LuminosityBlock const& cnstLb = lb;
168  this->doEndLuminosityBlock_(cnstLb, c);
169  commit_(lb);
170  }
171 
175  void EDProducerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
176  void EDProducerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
179 
186 
188 
191  desc.setUnknown();
192  descriptions.addDefault(desc);
193  }
194 
196 
197  static const std::string kBaseType("EDProducer");
198 
200 
201  } // namespace one
202 } // namespace edm
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
static const std::string kBaseType("EDAnalyzer")
virtual void preallocLumis(unsigned int)
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
static const TGPicture * info(bool iBackgroundIsBlack)
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 doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
virtual SerialTaskQueue * globalRunsQueue()
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const
virtual void doBeginProcessBlockProduce_(ProcessBlock &)
virtual void doEndProcessBlockProduce_(ProcessBlock &)
ParentageID previousParentageId_
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
void addDefault(ParameterSetDescription const &psetDescription)
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
virtual void doEndLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
void setConsumer(EDConsumerBase const *iConsumer)
Definition: ProcessBlock.h:53
virtual void clearInputProcessBlockCaches()
virtual void doEndRun_(Run const &rp, EventSetup const &c)
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
virtual void doBeginLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
virtual void doEndProcessBlock_(ProcessBlock const &)
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
SharedResourcesAcquirer resourcesAcquirer_
void setProducer(ProducerBase const *iProducer)
Definition: ProcessBlock.cc:13
void doPreallocate(PreallocationConfiguration const &)
void setProducer(ProducerBase const *iProducer)
virtual void preallocThreads(unsigned int)
HLT enums.
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
static void prevalidate(ConfigurationDescriptions &descriptions)
void commit_(P &iPrincipal)
Definition: ProducerBase.h:121
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
virtual SharedResourcesAcquirer createAcquirer()
virtual void doBeginProcessBlock_(ProcessBlock const &)
std::vector< BranchID > previousParentage_
ModuleDescription moduleDescription_
virtual void produce(Event &, EventSetup const &)=0
Definition: Run.h:45