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, false};
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();
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{info,
122  static_cast<unsigned int>(Transition::BeginRun),
124  parentC,
125  false};
126  this->doBeginRun_(cnstR, c);
127  r.setProducer(this);
128  this->doBeginRunProduce_(r, c);
129  commit_(r);
130  }
131 
133  Run r(info, moduleDescription_, mcc, true);
134  r.setConsumer(this);
135  Run const& cnstR = r;
136  r.setProducer(this);
137  ESParentContext parentC(mcc);
138  const EventSetup c{
139  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC, false};
140  this->doEndRunProduce_(r, c);
141  this->doEndRun_(cnstR, c);
142  commit_(r);
143  }
144 
146  LuminosityBlock lb(info, moduleDescription_, mcc, false);
147  lb.setConsumer(this);
148  LuminosityBlock const& cnstLb = lb;
149  ESParentContext parentC(mcc);
150  const EventSetup c{info,
151  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
153  parentC,
154  false};
155  this->doBeginLuminosityBlock_(cnstLb, c);
156  lb.setProducer(this);
158  commit_(lb);
159  }
160 
162  LuminosityBlock lb(info, moduleDescription_, mcc, true);
163  lb.setConsumer(this);
164  lb.setProducer(this);
165  ESParentContext parentC(mcc);
166  const EventSetup c{info,
167  static_cast<unsigned int>(Transition::EndLuminosityBlock),
169  parentC,
170  false};
171  this->doEndLuminosityBlockProduce_(lb, c);
172  LuminosityBlock const& cnstLb = lb;
173  this->doEndLuminosityBlock_(cnstLb, c);
174  commit_(lb);
175  }
176 
180  void EDProducerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
181  void EDProducerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
184 
191 
193 
196  desc.setUnknown();
197  descriptions.addDefault(desc);
198  }
199 
201 
202  static const std::string kBaseType("EDProducer");
203 
205 
206  } // namespace one
207 } // namespace edm
ConfigurationDescriptions.h
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
edm::SharedResourcesAcquirer
Definition: SharedResourcesAcquirer.h:34
edm::one::EDProducerBase::endJob
virtual void endJob()
Definition: EDProducerBase.h:109
SiPixelPI::one
Definition: SiPixelPayloadInspectorHelper.h:39
edm::one::EDProducerBase::~EDProducerBase
~EDProducerBase() override
Definition: EDProducerBase.cc:47
edm::one::EDProducerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDProducerBase.cc:81
edm::one::EDProducerBase::preallocThreads
virtual void preallocThreads(unsigned int)
Definition: EDProducerBase.h:111
edm::LumiTransitionInfo
Definition: TransitionInfoTypes.h:42
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
edm::PreallocationConfiguration::numberOfThreads
unsigned int numberOfThreads() const
Definition: PreallocationConfiguration.h:34
edm::LuminosityBlock::setProducer
void setProducer(ProducerBase const *iProducer)
Definition: LuminosityBlock.cc:55
LuminosityBlock.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::Transition::Event
ProcessBlock.h
edm::one::EDProducerBase::doEndRun
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:132
edmodule_mightGet_config.h
edm::ProducerBase::commit_
void commit_(P &iPrincipal)
Definition: ProducerBase.h:120
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::one::EDProducerBase::createAcquirer
virtual SharedResourcesAcquirer createAcquirer()
Definition: EDProducerBase.cc:65
edm::ProcessBlock::setProducer
void setProducer(ProducerBase const *iProducer)
Definition: ProcessBlock.cc:13
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
edm::one::EDProducerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDProducerBase.h:136
edm::SerialTaskQueue
Definition: SerialTaskQueue.h:67
edm::one::EDProducerBase::produce
virtual void produce(Event &, EventSetup const &)=0
PreallocationConfiguration.h
edm::RunTransitionInfo
Definition: TransitionInfoTypes.h:64
EventSignalsSentry.h
edm::ProcessBlockPrincipal
Definition: ProcessBlockPrincipal.h:22
edm::one::EDProducerBase::doAccessInputProcessBlock_
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
Definition: EDProducerBase.cc:178
edm::one::EDProducerBase::doBeginProcessBlock_
virtual void doBeginProcessBlock_(ProcessBlock const &)
Definition: EDProducerBase.cc:177
edm::one::EDProducerBase::previousParentage_
std::vector< BranchID > previousParentage_
Definition: EDProducerBase.h:137
edm::PreallocationConfiguration::numberOfLuminosityBlocks
unsigned int numberOfLuminosityBlocks() const
Definition: PreallocationConfiguration.h:36
edm::one::EDProducerBase::beginJob
virtual void beginJob()
Definition: EDProducerBase.h:108
EDProducerBase.h
edm::ProcessBlock::setConsumer
void setConsumer(EDConsumerBase const *iConsumer)
Definition: ProcessBlock.h:53
edm::one::EDProducerBase::doEndProcessBlock_
virtual void doEndProcessBlock_(ProcessBlock const &)
Definition: EDProducerBase.cc:179
edm::one::EDProducerBase::doEndProcessBlock
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:106
edm::ActivityRegistry
Definition: ActivityRegistry.h:134
Run.h
edm::one::EDProducerBase::EDProducerBase
EDProducerBase()
Definition: EDProducerBase.cc:44
edm::one::EDProducerBase::doEndLuminosityBlock_
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:183
edm::Transition::BeginLuminosityBlock
edm::one::EDProducerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:145
runTheMatrix.nThreads
nThreads
Definition: runTheMatrix.py:371
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::one::EDProducerBase::doEndRunProduce_
virtual void doEndRunProduce_(Run &rp, EventSetup const &c)
Definition: EDProducerBase.cc:188
edm::one::EDProducerBase::doBeginProcessBlockProduce_
virtual void doBeginProcessBlockProduce_(ProcessBlock &)
Definition: EDProducerBase.cc:185
edm::one::EDProducerBase::doAccessInputProcessBlock
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:99
edm::one::EDProducerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:180
ESParentContext.h
Event.h
edm::one::EDProducerBase::globalRunsQueue
virtual SerialTaskQueue * globalRunsQueue()
Definition: EDProducerBase.cc:70
edm::LuminosityBlock::setConsumer
void setConsumer(EDConsumerBase const *iConsumer)
Definition: LuminosityBlock.cc:34
edm::one::EDProducerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDProducerBase.cc:200
edm::EventSetup
Definition: EventSetup.h:58
edm::one::EDProducerBase::globalLuminosityBlocksQueue
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
Definition: EDProducerBase.cc:71
edm::ESParentContext
Definition: ESParentContext.h:21
edm::one::EDProducerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDProducerBase.cc:87
edm::one::EDProducerBase::doEndProcessBlockProduce_
virtual void doEndProcessBlockProduce_(ProcessBlock &)
Definition: EDProducerBase.cc:186
edm::one::EDProducerBase::doEndJob
void doEndJob()
Definition: EDProducerBase.cc:79
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::one::EDProducerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:161
edm::one::EDProducerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDProducerBase.cc:194
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::one::EDProducerBase::baseType
static const std::string & baseType()
Definition: EDProducerBase.cc:204
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::one::EDProducerBase::clearInputProcessBlockCaches
virtual void clearInputProcessBlockCaches()
Definition: EDProducerBase.cc:192
edm::EventSignalsSentry
Definition: EventSignalsSentry.h:29
edm::one::EDProducerBase::doEndRun_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:181
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::Transition::EndLuminosityBlock
edm::one::EDProducerBase::doEndLuminosityBlockProduce_
virtual void doEndLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:190
edm::one::kBaseType
static const std::string kBaseType("EDAnalyzer")
edm::EDConsumerBase::esGetTokenIndices
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const
Definition: EDConsumerBase.h:124
edm::one::EDProducerBase::doBeginRun
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:116
edm::one::EDProducerBase::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDProducerBase.cc:49
edm::Transition::BeginRun
EventSetup.h
edm::one::EDProducerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:182
edm::one::EDProducerBase::doBeginJob
void doBeginJob()
Definition: EDProducerBase.cc:73
edm::edmodule_mightGet_config
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
Definition: edmodule_mightGet_config.cc:36
TransitionInfoTypes.h
edm::one::EDProducerBase::doBeginRunProduce_
virtual void doBeginRunProduce_(Run &rp, EventSetup const &c)
Definition: EDProducerBase.cc:187
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::ProducerBase
Definition: ProducerBase.h:70
edm::Event
Definition: Event.h:73
edm::Transition::EndRun
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::one::EDProducerBase::resourcesAcquirer_
SharedResourcesAcquirer resourcesAcquirer_
Definition: EDProducerBase.h:140
edm::ProcessBlock
Definition: ProcessBlock.h:36
edm::one::EDProducerBase::doBeginLuminosityBlockProduce_
virtual void doBeginLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:189
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edm::one::EDProducerBase::previousParentageId_
ParentageID previousParentageId_
Definition: EDProducerBase.h:138
edm::one::EDProducerBase::doBeginProcessBlock
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:89
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29