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
26 
29 
30 //
31 // constants, enums and typedefs
32 //
33 namespace edm {
34 
35  namespace one {
36  //
37  // static data member definitions
38  //
39 
40  //
41  // constructors and destructor
42  //
44  : ProducerBase(), moduleDescription_(), previousParentage_(), previousParentageId_() {}
45 
47 
49  ActivityRegistry* act,
50  ModuleCallingContext const* mcc) {
52  e.setConsumer(this);
53  e.setProducer(this, &previousParentage_);
54  e.setSharedResourcesAcquirer(&resourcesAcquirer_);
55  EventSignalsSentry sentry(act, mcc);
56  const EventSetup c{
57  info, static_cast<unsigned int>(Transition::Event), esGetTokenIndices(Transition::Event), false};
58  this->produce(e, c);
60  return true;
61  }
62 
65  std::vector<std::shared_ptr<SerialTaskQueue>>(1, std::make_shared<SerialTaskQueue>())};
66  }
67 
70 
73 
74  this->beginJob();
75  }
76 
77  void EDProducerBase::doEndJob() { this->endJob(); }
78 
80  auto const nThreads = iPrealloc.numberOfThreads();
83  }
84 
85  void EDProducerBase::preallocLumis(unsigned int){};
86 
88  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
89  processBlock.setConsumer(this);
90  ProcessBlock const& constProcessBlock = processBlock;
91  this->doBeginProcessBlock_(constProcessBlock);
92  processBlock.setProducer(this);
93  this->doBeginProcessBlockProduce_(processBlock);
94  commit_(processBlock);
95  }
96 
98  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
99  processBlock.setConsumer(this);
100  ProcessBlock const& constProcessBlock = processBlock;
101  this->doAccessInputProcessBlock_(constProcessBlock);
102  }
103 
105  ProcessBlock processBlock(pbp, moduleDescription_, mcc, true);
106  processBlock.setConsumer(this);
107  ProcessBlock const& constProcessBlock = processBlock;
108  this->doEndProcessBlock_(constProcessBlock);
109  processBlock.setProducer(this);
110  this->doEndProcessBlockProduce_(processBlock);
111  commit_(processBlock);
112  }
113 
115  Run r(info, moduleDescription_, mcc, false);
116  r.setConsumer(this);
117  Run const& cnstR = r;
118  const EventSetup c{
119  info, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), false};
120  this->doBeginRun_(cnstR, c);
121  r.setProducer(this);
122  this->doBeginRunProduce_(r, c);
123  commit_(r);
124  }
125 
127  Run r(info, moduleDescription_, mcc, true);
128  r.setConsumer(this);
129  Run const& cnstR = r;
130  r.setProducer(this);
131  const EventSetup c{
132  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), false};
133  this->doEndRunProduce_(r, c);
134  this->doEndRun_(cnstR, c);
135  commit_(r);
136  }
137 
139  LuminosityBlock lb(info, moduleDescription_, mcc, false);
140  lb.setConsumer(this);
141  LuminosityBlock const& cnstLb = lb;
142  const EventSetup c{info,
143  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
145  false};
146  this->doBeginLuminosityBlock_(cnstLb, c);
147  lb.setProducer(this);
149  commit_(lb);
150  }
151 
153  LuminosityBlock lb(info, moduleDescription_, mcc, true);
154  lb.setConsumer(this);
155  lb.setProducer(this);
156  const EventSetup c{info,
157  static_cast<unsigned int>(Transition::EndLuminosityBlock),
159  false};
160  this->doEndLuminosityBlockProduce_(lb, c);
161  LuminosityBlock const& cnstLb = lb;
162  this->doEndLuminosityBlock_(cnstLb, c);
163  commit_(lb);
164  }
165 
167  //respondToOpenInputFile(fb);
168  }
169 
171  //respondToCloseInputFile(fb);
172  }
173 
177  void EDProducerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
178  void EDProducerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
181 
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
ConfigurationDescriptions.h
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
edm::SharedResourcesAcquirer
Definition: SharedResourcesAcquirer.h:34
edm::one::EDProducerBase::endJob
virtual void endJob()
Definition: EDProducerBase.h:108
SiPixelPI::one
Definition: SiPixelPayloadInspectorHelper.h:39
edm::one::EDProducerBase::~EDProducerBase
~EDProducerBase() override
Definition: EDProducerBase.cc:46
edm::one::EDProducerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDProducerBase.cc:79
edm::one::EDProducerBase::preallocThreads
virtual void preallocThreads(unsigned int)
Definition: EDProducerBase.h:110
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:54
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:126
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:63
edm::one::EDProducerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDProducerBase.cc:166
edm::ProcessBlock::setProducer
void setProducer(ProducerBase const *iProducer)
Definition: ProcessBlock.cc:12
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
edm::one::EDProducerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDProducerBase.h:134
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:175
edm::one::EDProducerBase::doBeginProcessBlock_
virtual void doBeginProcessBlock_(ProcessBlock const &)
Definition: EDProducerBase.cc:174
edm::one::EDProducerBase::previousParentage_
std::vector< BranchID > previousParentage_
Definition: EDProducerBase.h:135
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:107
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:176
edm::one::EDProducerBase::doEndProcessBlock
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:104
edm::ActivityRegistry
Definition: ActivityRegistry.h:133
Run.h
edm::one::EDProducerBase::EDProducerBase
EDProducerBase()
Definition: EDProducerBase.cc:43
edm::one::EDProducerBase::doEndLuminosityBlock_
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:180
edm::Transition::BeginLuminosityBlock
edm::one::EDProducerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:138
runTheMatrix.nThreads
nThreads
Definition: runTheMatrix.py:355
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:185
edm::one::EDProducerBase::doBeginProcessBlockProduce_
virtual void doBeginProcessBlockProduce_(ProcessBlock &)
Definition: EDProducerBase.cc:182
edm::one::EDProducerBase::doAccessInputProcessBlock
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:97
edm::one::EDProducerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:177
Event.h
edm::one::EDProducerBase::globalRunsQueue
virtual SerialTaskQueue * globalRunsQueue()
Definition: EDProducerBase.cc:68
edm::LuminosityBlock::setConsumer
void setConsumer(EDConsumerBase const *iConsumer)
Definition: LuminosityBlock.cc:33
edm::one::EDProducerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDProducerBase.cc:195
edm::EventSetup
Definition: EventSetup.h:57
edm::one::EDProducerBase::globalLuminosityBlocksQueue
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
Definition: EDProducerBase.cc:69
edm::one::EDProducerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDProducerBase.cc:85
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::one::EDProducerBase::doEndProcessBlockProduce_
virtual void doEndProcessBlockProduce_(ProcessBlock &)
Definition: EDProducerBase.cc:183
edm::one::EDProducerBase::doEndJob
void doEndJob()
Definition: EDProducerBase.cc:77
edm::one::EDProducerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:152
edm::one::EDProducerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDProducerBase.cc:170
edm::one::EDProducerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDProducerBase.cc:189
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::one::EDProducerBase::baseType
static const std::string & baseType()
Definition: EDProducerBase.cc:199
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:178
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:187
edm::one::kBaseType
static const std::string kBaseType("EDAnalyzer")
edm::EDConsumerBase::esGetTokenIndices
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const
Definition: EDConsumerBase.h:118
edm::one::EDProducerBase::doBeginRun
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:114
edm::one::EDProducerBase::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDProducerBase.cc:48
edm::Transition::BeginRun
EventSetup.h
edm::one::EDProducerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:179
edm::one::EDProducerBase::doBeginJob
void doBeginJob()
Definition: EDProducerBase.cc:71
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:184
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:138
edm::ProcessBlock
Definition: ProcessBlock.h:36
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
edm::one::EDProducerBase::doBeginLuminosityBlockProduce_
virtual void doBeginLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:186
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edm::one::EDProducerBase::previousParentageId_
ParentageID previousParentageId_
Definition: EDProducerBase.h:136
edm::one::EDProducerBase::doBeginProcessBlock
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:87
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29