CMS 3D CMS Logo

EDAnalyzerBase.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/Framework
4 // Class : global::EDAnalyzerBase
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 
31 
35 
36 //
37 // constants, enums and typedefs
38 //
39 namespace edm {
40  namespace global {
41  //
42  // static data member definitions
43  //
44 
45  //
46  // constructors and destructor
47  //
48  EDAnalyzerBase::EDAnalyzerBase() : moduleDescription_() {}
49 
51 
53  ActivityRegistry* act,
54  ModuleCallingContext const* mcc) {
56  e.setConsumer(this);
57  EventSignalsSentry sentry(act, mcc);
58  ESParentContext parentC(mcc);
59  const EventSetup c{
60  info, static_cast<unsigned int>(Transition::Event), esGetTokenIndices(Transition::Event), parentC, false};
61  this->analyze(e.streamID(), e, c);
62  return true;
63  }
64 
66  preallocStreams(iPrealloc.numberOfStreams());
69  preallocate(iPrealloc);
70  }
71 
73 
74  void EDAnalyzerBase::doEndJob() { this->endJob(); }
75 
77  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
78  processBlock.setConsumer(this);
79  ProcessBlock const& constProcessBlock = processBlock;
80  this->doBeginProcessBlock_(constProcessBlock);
81  }
82 
84  ProcessBlock processBlock(pbp, moduleDescription_, mcc, false);
85  processBlock.setConsumer(this);
86  ProcessBlock const& constProcessBlock = processBlock;
87  this->doAccessInputProcessBlock_(constProcessBlock);
88  }
89 
91  ProcessBlock processBlock(pbp, moduleDescription_, mcc, true);
92  processBlock.setConsumer(this);
93  ProcessBlock const& constProcessBlock = processBlock;
94  this->doEndProcessBlock_(constProcessBlock);
95  }
96 
98  Run r(info, moduleDescription_, mcc, false);
99  r.setConsumer(this);
100  Run const& cnstR = r;
101  ESParentContext parentC(mcc);
102  const EventSetup c{info,
103  static_cast<unsigned int>(Transition::BeginRun),
105  parentC,
106  false};
107  this->doBeginRun_(cnstR, c);
108  this->doBeginRunSummary_(cnstR, c);
109  }
110 
112  Run r(info, moduleDescription_, mcc, true);
113  r.setConsumer(this);
114  Run const& cnstR = r;
115  ESParentContext parentC(mcc);
116  const EventSetup c{
117  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC, false};
118  this->doEndRunSummary_(r, c);
119  this->doEndRun_(cnstR, c);
120  }
121 
123  LuminosityBlock lb(info, moduleDescription_, mcc, false);
124  lb.setConsumer(this);
125  LuminosityBlock const& cnstLb = lb;
126  ESParentContext parentC(mcc);
127  const EventSetup c{info,
128  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
130  parentC,
131  false};
132  this->doBeginLuminosityBlock_(cnstLb, c);
133  this->doBeginLuminosityBlockSummary_(cnstLb, c);
134  }
135 
137  LuminosityBlock lb(info, moduleDescription_, mcc, true);
138  lb.setConsumer(this);
139  LuminosityBlock const& cnstLb = lb;
140  ESParentContext parentC(mcc);
141  const EventSetup c{info,
142  static_cast<unsigned int>(Transition::EndLuminosityBlock),
144  parentC,
145  false};
146  this->doEndLuminosityBlockSummary_(cnstLb, c);
147  this->doEndLuminosityBlock_(cnstLb, c);
148  }
149 
153  Run r(info, moduleDescription_, mcc, false);
154  r.setConsumer(this);
155  ESParentContext parentC(mcc);
156  const EventSetup c{info,
157  static_cast<unsigned int>(Transition::BeginRun),
159  parentC,
160  false};
161  this->doStreamBeginRun_(id, r, c);
162  }
164  Run r(info, moduleDescription_, mcc, true);
165  r.setConsumer(this);
166  ESParentContext parentC(mcc);
167  const EventSetup c{
168  info, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC, false};
169  this->doStreamEndRun_(id, r, c);
170  this->doStreamEndRunSummary_(id, r, c);
171  }
173  LumiTransitionInfo const& info,
174  ModuleCallingContext const* mcc) {
175  LuminosityBlock lb(info, moduleDescription_, mcc, false);
176  lb.setConsumer(this);
177  ESParentContext parentC(mcc);
178  const EventSetup c{info,
179  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
181  parentC,
182  false};
183  this->doStreamBeginLuminosityBlock_(id, lb, c);
184  }
185 
187  LumiTransitionInfo const& info,
188  ModuleCallingContext const* mcc) {
189  LuminosityBlock lb(info, moduleDescription_, mcc, true);
190  lb.setConsumer(this);
191  ESParentContext parentC(mcc);
192  const EventSetup c{info,
193  static_cast<unsigned int>(Transition::EndLuminosityBlock),
195  parentC,
196  false};
197  this->doStreamEndLuminosityBlock_(id, lb, c);
198  this->doStreamEndLuminosityBlockSummary_(id, lb, c);
199  }
200 
202  //respondToOpenInputFile(fb);
203  }
204 
206  //respondToCloseInputFile(fb);
207  }
208 
209  void EDAnalyzerBase::preallocStreams(unsigned int) {}
210  void EDAnalyzerBase::preallocLumis(unsigned int) {}
216  void EDAnalyzerBase::doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c) {}
221  LuminosityBlock const& lbp,
222  EventSetup const& c) {}
226  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
227  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
230 
235 
238  desc.setUnknown();
239  descriptions.addDefault(desc);
240  }
241 
243 
247 
249  regService->watchProductAdditions(callWhenNewProductsRegistered_);
250  }
251  }
252  static const std::string kBaseType("EDAnalyzer");
253 
255 
256  } // namespace global
257 } // namespace edm
ConfigurationDescriptions.h
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
ConstProductRegistry.h
edm::global::EDAnalyzerBase::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:52
edm::global::EDAnalyzerBase::doBeginStream
void doBeginStream(StreamID id)
Definition: EDAnalyzerBase.cc:150
edm::global::kBaseType
static const std::string kBaseType("EDAnalyzer")
edm::StreamID
Definition: StreamID.h:30
edm::ProductRegistry::callForEachBranch
void callForEachBranch(T const &iFunc)
Definition: ProductRegistry.h:100
edm::global::EDAnalyzerBase::callWhenNewProductsRegistered_
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: EDAnalyzerBase.h:144
edm::global::EDAnalyzerBase::doBeginRunSummary_
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:228
edm::global::EDAnalyzerBase::doEndStream_
virtual void doEndStream_(StreamID id)
Definition: EDAnalyzerBase.cc:214
edm::global::EDAnalyzerBase::doStreamBeginRun_
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:215
edm::global::EDAnalyzerBase::doBeginStream_
virtual void doBeginStream_(StreamID id)
Definition: EDAnalyzerBase.cc:213
edm::global::EDAnalyzerBase::doEndProcessBlock
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:90
edm::LumiTransitionInfo
Definition: TransitionInfoTypes.h:42
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
edm::global::EDAnalyzerBase::doStreamEndRun
void doStreamEndRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:163
LuminosityBlock.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::global::EDAnalyzerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:205
edm::Transition::Event
edm::global::EDAnalyzerBase::doAccessInputProcessBlock_
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:224
edm::global::EDAnalyzerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzerBase.h:142
ProcessBlock.h
edmodule_mightGet_config.h
edm::global::EDAnalyzerBase::preallocLumisSummary
virtual void preallocLumisSummary(unsigned int)
Definition: EDAnalyzerBase.cc:211
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::global::EDAnalyzerBase::preallocate
virtual void preallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:212
edm::global::EDAnalyzerBase::doEndProcessBlock_
virtual void doEndProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:225
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
edm::global::EDAnalyzerBase::doBeginProcessBlock_
virtual void doBeginProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:223
edm::global::EDAnalyzerBase::analyze
virtual void analyze(StreamID, Event const &, EventSetup const &) const =0
PreallocationConfiguration.h
ProductRegistry.h
edm::global::EDAnalyzerBase::baseType
static const std::string & baseType()
Definition: EDAnalyzerBase.cc:254
edm::global::EDAnalyzerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:122
edm::global::EDAnalyzerBase::doBeginJob
void doBeginJob()
Definition: EDAnalyzerBase.cc:72
edm::global::EDAnalyzerBase::doEndRun_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:227
edm::RunTransitionInfo
Definition: TransitionInfoTypes.h:64
EventSignalsSentry.h
edm::ProcessBlockPrincipal
Definition: ProcessBlockPrincipal.h:22
edm::global::EDAnalyzerBase::doStreamEndLuminosityBlock
void doStreamEndLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:186
edm::global::EDAnalyzerBase::doEndStream
void doEndStream(StreamID id)
Definition: EDAnalyzerBase.cc:151
edm::ProductRegistry
Definition: ProductRegistry.h:37
edm::global::EDAnalyzerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:231
edm::FileBlock
Definition: FileBlock.h:20
edm::PreallocationConfiguration::numberOfLuminosityBlocks
unsigned int numberOfLuminosityBlocks() const
Definition: PreallocationConfiguration.h:36
edm::global::EDAnalyzerBase
Definition: EDAnalyzerBase.h:46
edm::global::EDAnalyzerBase::doStreamBeginRun
void doStreamBeginRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:152
edm::global::EDAnalyzerBase::doStreamEndRunSummary_
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:217
edm::ProcessBlock::setConsumer
void setConsumer(EDConsumerBase const *iConsumer)
Definition: ProcessBlock.h:53
Service.h
edm::ActivityRegistry
Definition: ActivityRegistry.h:134
Run.h
edm::Transition::BeginLuminosityBlock
ParameterSetDescription.h
edm::global::EDAnalyzerBase::beginJob
virtual void beginJob()
Definition: EDAnalyzerBase.h:110
edm::global::EDAnalyzerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:65
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::global::EDAnalyzerBase::doBeginProcessBlock
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:76
edm::global::EDAnalyzerBase::doEndJob
void doEndJob()
Definition: EDAnalyzerBase.cc:74
edm::global::EDAnalyzerBase::doAccessInputProcessBlock
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:83
ESParentContext.h
Event.h
edm::LuminosityBlock::setConsumer
void setConsumer(EDConsumerBase const *iConsumer)
Definition: LuminosityBlock.cc:34
edm::global::EDAnalyzerBase::doStreamEndLuminosityBlockSummary_
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:220
edm::Service
Definition: Service.h:30
edm::global::EDAnalyzerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDAnalyzerBase.cc:210
edm::global::EDAnalyzerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:236
edm::EventSetup
Definition: EventSetup.h:58
edm::ESParentContext
Definition: ESParentContext.h:21
edm::global::EDAnalyzerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:201
edm::global::EDAnalyzerBase::endJob
virtual void endJob()
Definition: EDAnalyzerBase.h:111
edm::global::EDAnalyzerBase::doStreamEndLuminosityBlock_
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:219
edm::global::EDAnalyzerBase::doEndRunSummary_
virtual void doEndRunSummary_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:229
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::global::EDAnalyzerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:226
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::EventSignalsSentry
Definition: EventSignalsSentry.h:29
edm::Event::streamID
StreamID streamID() const
Definition: Event.h:98
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::Transition::EndLuminosityBlock
edm::EDConsumerBase::esGetTokenIndices
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const
Definition: EDConsumerBase.h:120
edm::Transition::BeginRun
edm::global::EDAnalyzerBase::~EDAnalyzerBase
~EDAnalyzerBase() override
Definition: EDAnalyzerBase.cc:50
EventSetup.h
edm::global::EDAnalyzerBase::doStreamBeginLuminosityBlock
void doStreamBeginLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:172
edm::PreallocationConfiguration::numberOfStreams
unsigned int numberOfStreams() const
Definition: PreallocationConfiguration.h:35
edm::global::EDAnalyzerBase::doStreamEndRun_
virtual void doStreamEndRun_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:216
edm::global::EDAnalyzerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:136
edm::global::EDAnalyzerBase::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDAnalyzerBase *module, ProductRegistry *reg)
Definition: EDAnalyzerBase.cc:244
edm::edmodule_mightGet_config
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
Definition: edmodule_mightGet_config.cc:36
TransitionInfoTypes.h
edm::global::EDAnalyzerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:242
edm::global::EDAnalyzerBase::doEndRun
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:111
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm::global::EDAnalyzerBase::preallocStreams
virtual void preallocStreams(unsigned int)
Definition: EDAnalyzerBase.cc:209
edm::Event
Definition: Event.h:73
edm::Transition::EndRun
edm::global::EDAnalyzerBase::doEndLuminosityBlock_
virtual void doEndLuminosityBlock_(LuminosityBlock const &lb, EventSetup const &c)
Definition: EDAnalyzerBase.cc:232
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::global::EDAnalyzerBase::doBeginLuminosityBlockSummary_
virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:233
EDAnalyzerBase.h
edm::global::EDAnalyzerBase::doBeginRun
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:97
edm::global::EDAnalyzerBase::EDAnalyzerBase
EDAnalyzerBase()
Definition: EDAnalyzerBase.cc:48
edm::ProcessBlock
Definition: ProcessBlock.h:36
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
edm::global::EDAnalyzerBase::doEndLuminosityBlockSummary_
virtual void doEndLuminosityBlockSummary_(LuminosityBlock const &lb, EventSetup const &c)
Definition: EDAnalyzerBase.cc:234
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edm::global::EDAnalyzerBase::doStreamBeginLuminosityBlock_
virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:218
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29