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) {
51  e.setConsumer(this);
52  e.setProducer(this, &previousParentage_);
53  e.setSharedResourcesAcquirer(&resourcesAcquirer_);
54  EventSignalsSentry sentry(act, mcc);
55  const EventSetup c{ci, static_cast<unsigned int>(Transition::Event), esGetTokenIndices(Transition::Event), false};
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{
90  ci, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), false};
91  this->doBeginRun_(cnstR, c);
92  r.setProducer(this);
93  this->doBeginRunProduce_(r, c);
94  commit_(r);
95  }
96 
98  Run r(rp, moduleDescription_, mcc, true);
99  r.setConsumer(this);
100  Run const& cnstR = r;
101  r.setProducer(this);
102  const EventSetup c{
103  ci, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), false};
104  this->doEndRunProduce_(r, c);
105  this->doEndRun_(cnstR, c);
106  commit_(r);
107  }
108 
110  EventSetupImpl const& ci,
111  ModuleCallingContext const* mcc) {
112  LuminosityBlock lb(lbp, moduleDescription_, mcc, false);
113  lb.setConsumer(this);
114  LuminosityBlock const& cnstLb = lb;
115  const EventSetup c{ci,
116  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
118  false};
119  this->doBeginLuminosityBlock_(cnstLb, c);
120  lb.setProducer(this);
122  commit_(lb);
123  }
124 
126  EventSetupImpl const& ci,
127  ModuleCallingContext const* mcc) {
128  LuminosityBlock lb(lbp, moduleDescription_, mcc, true);
129  lb.setConsumer(this);
130  lb.setProducer(this);
131  const EventSetup c{ci,
132  static_cast<unsigned int>(Transition::EndLuminosityBlock),
134  false};
135  this->doEndLuminosityBlockProduce_(lb, c);
136  LuminosityBlock const& cnstLb = lb;
137  this->doEndLuminosityBlock_(cnstLb, c);
138  commit_(lb);
139  }
140 
142  //respondToOpenInputFile(fb);
143  }
144 
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 
161  desc.setUnknown();
162  descriptions.addDefault(desc);
163  }
164 
166 
167  static const std::string kBaseType("EDProducer");
168 
170 
171  } // namespace one
172 } // namespace edm
ConfigurationDescriptions.h
edm::SharedResourcesAcquirer
Definition: SharedResourcesAcquirer.h:34
edm::one::EDProducerBase::endJob
virtual void endJob()
Definition: EDProducerBase.h:109
edm::one::EDProducerBase::~EDProducerBase
~EDProducerBase() override
Definition: EDProducerBase.cc:44
edm::one::EDProducerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDProducerBase.cc:77
edm::one::EDProducerBase::preallocThreads
virtual void preallocThreads(unsigned int)
Definition: EDProducerBase.h:111
edm::EventSetupImpl
Definition: EventSetupImpl.h:44
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:47
LuminosityBlock.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::Transition::Event
edmodule_mightGet_config.h
edm::ProducerBase::commit_
void commit_(P &iPrincipal)
Definition: ProducerBase.h:115
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::one::EDProducerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDProducerBase.cc:109
edm::one::EDProducerBase::createAcquirer
virtual SharedResourcesAcquirer createAcquirer()
Definition: EDProducerBase.cc:61
edm::LuminosityBlockPrincipal
Definition: LuminosityBlockPrincipal.h:31
edm::one::EDProducerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDProducerBase.cc:141
edm::one::EDProducerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDProducerBase.h:130
edm::SerialTaskQueue
Definition: SerialTaskQueue.h:67
edm::one::EDProducerBase::produce
virtual void produce(Event &, EventSetup const &)=0
PreallocationConfiguration.h
EventSignalsSentry.h
edm::one::EDProducerBase::previousParentage_
std::vector< BranchID > previousParentage_
Definition: EDProducerBase.h:131
edm::FileBlock
Definition: FileBlock.h:20
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::EventPrincipal
Definition: EventPrincipal.h:46
edm::ActivityRegistry
Definition: ActivityRegistry.h:132
Run.h
edm::one::EDProducerBase::EDProducerBase
EDProducerBase()
Definition: EDProducerBase.cc:41
edm::one::EDProducerBase::doEndLuminosityBlock_
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:152
edm::Transition::BeginLuminosityBlock
runTheMatrix.nThreads
nThreads
Definition: runTheMatrix.py:344
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::one::EDProducerBase::doEndRunProduce_
virtual void doEndRunProduce_(Run &rp, EventSetup const &c)
Definition: EDProducerBase.cc:155
edm::one::EDProducerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:149
Event.h
edm::one::EDProducerBase::globalRunsQueue
virtual SerialTaskQueue * globalRunsQueue()
Definition: EDProducerBase.cc:66
edm::LuminosityBlock::setConsumer
void setConsumer(EDConsumerBase const *iConsumer)
Definition: LuminosityBlock.cc:26
edm::one::EDProducerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDProducerBase.cc:165
edm::one::EDProducerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDProducerBase.cc:125
edm::ParameterSetDescription::setUnknown
void setUnknown()
Definition: ParameterSetDescription.cc:39
edm::EventSetup
Definition: EventSetup.h:57
edm::one::EDProducerBase::globalLuminosityBlocksQueue
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
Definition: EDProducerBase.cc:67
edm::one::EDProducerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDProducerBase.cc:83
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::one::EDProducerBase::doEndJob
void doEndJob()
Definition: EDProducerBase.cc:75
edm::one::EDProducerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDProducerBase.cc:145
edm::one::EDProducerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDProducerBase.cc:159
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::one::EDProducerBase::baseType
static const std::string & baseType()
Definition: EDProducerBase.cc:169
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::EventSignalsSentry
Definition: EventSignalsSentry.h:29
edm::one::EDProducerBase::doEndRun_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:150
edm::one::EDProducerBase::doEvent
bool doEvent(EventPrincipal const &ep, EventSetupImpl const &c, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDProducerBase.cc:46
edm::Transition::EndLuminosityBlock
edm::one::EDProducerBase::doEndLuminosityBlockProduce_
virtual void doEndLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:157
edm::one::kBaseType
static const std::string kBaseType("EDAnalyzer")
edm::EDConsumerBase::esGetTokenIndices
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const
Definition: EDConsumerBase.h:110
edm::Transition::BeginRun
EventSetup.h
edm::one::EDProducerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:151
edm::one::EDProducerBase::doBeginRun
void doBeginRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDProducerBase.cc:85
edm::one::EDProducerBase::doBeginJob
void doBeginJob()
Definition: EDProducerBase.cc:69
edm::edmodule_mightGet_config
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
Definition: edmodule_mightGet_config.cc:36
edm::one::EDProducerBase::doBeginRunProduce_
virtual void doBeginRunProduce_(Run &rp, EventSetup const &c)
Definition: EDProducerBase.cc:154
edm::RunPrincipal
Definition: RunPrincipal.h:34
edm::ProducerBase
Definition: ProducerBase.h:65
edm::one::EDProducerBase::doEndRun
void doEndRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDProducerBase.cc:97
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:134
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
edm::one::EDProducerBase::doBeginLuminosityBlockProduce_
virtual void doBeginLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:156
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edm::one::EDProducerBase::previousParentageId_
ParentageID previousParentageId_
Definition: EDProducerBase.h:132
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29