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
24 
27 
29 
32 
33 //
34 // constants, enums and typedefs
35 //
36 namespace edm {
37  namespace global {
38  //
39  // static data member definitions
40  //
41 
42  //
43  // constructors and destructor
44  //
45  EDAnalyzerBase::EDAnalyzerBase() : moduleDescription_() {}
46 
48 
50  EventSetupImpl const& ci,
51  ActivityRegistry* act,
52  ModuleCallingContext const* mcc) {
54  e.setConsumer(this);
55  EventSignalsSentry sentry(act, mcc);
56  const EventSetup c{ci, static_cast<unsigned int>(Transition::Event), esGetTokenIndices(Transition::Event), false};
57  this->analyze(e.streamID(), e, c);
58  return true;
59  }
60 
62  preallocStreams(iPrealloc.numberOfStreams());
65  preallocate(iPrealloc);
66  }
67 
69 
70  void EDAnalyzerBase::doEndJob() { this->endJob(); }
71 
73  Run r(rp, moduleDescription_, mcc, false);
74  r.setConsumer(this);
75  Run const& cnstR = r;
76  const EventSetup c{
77  ci, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), false};
78  this->doBeginRun_(cnstR, c);
79  this->doBeginRunSummary_(cnstR, c);
80  }
81 
83  Run r(rp, moduleDescription_, mcc, true);
84  r.setConsumer(this);
85  Run const& cnstR = r;
86  const EventSetup c{
87  ci, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), false};
88  this->doEndRunSummary_(r, c);
89  this->doEndRun_(cnstR, c);
90  }
91 
93  EventSetupImpl const& ci,
94  ModuleCallingContext const* mcc) {
95  LuminosityBlock lb(lbp, moduleDescription_, mcc, false);
96  lb.setConsumer(this);
97  LuminosityBlock const& cnstLb = lb;
98  const EventSetup c{ci,
99  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
101  false};
102  this->doBeginLuminosityBlock_(cnstLb, c);
103  this->doBeginLuminosityBlockSummary_(cnstLb, c);
104  }
105 
107  EventSetupImpl const& ci,
108  ModuleCallingContext const* mcc) {
109  LuminosityBlock lb(lbp, moduleDescription_, mcc, true);
110  lb.setConsumer(this);
111  LuminosityBlock const& cnstLb = lb;
112  const EventSetup c{ci,
113  static_cast<unsigned int>(Transition::EndLuminosityBlock),
115  false};
116  this->doEndLuminosityBlockSummary_(cnstLb, c);
117  this->doEndLuminosityBlock_(cnstLb, c);
118  }
119 
123  RunPrincipal const& rp,
124  EventSetupImpl const& ci,
125  ModuleCallingContext const* mcc) {
126  Run r(rp, moduleDescription_, mcc, false);
127  r.setConsumer(this);
128  const EventSetup c{
129  ci, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), false};
130  this->doStreamBeginRun_(id, r, c);
131  }
133  RunPrincipal const& rp,
134  EventSetupImpl const& ci,
135  ModuleCallingContext const* mcc) {
136  Run r(rp, moduleDescription_, mcc, true);
137  r.setConsumer(this);
138  const EventSetup c{
139  ci, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), false};
140  this->doStreamEndRun_(id, r, c);
141  this->doStreamEndRunSummary_(id, r, c);
142  }
144  LuminosityBlockPrincipal const& lbp,
145  EventSetupImpl const& ci,
146  ModuleCallingContext const* mcc) {
147  LuminosityBlock lb(lbp, moduleDescription_, mcc, false);
148  lb.setConsumer(this);
149  const EventSetup c{ci,
150  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
152  false};
153  this->doStreamBeginLuminosityBlock_(id, lb, c);
154  }
155 
157  LuminosityBlockPrincipal const& lbp,
158  EventSetupImpl const& ci,
159  ModuleCallingContext const* mcc) {
160  LuminosityBlock lb(lbp, moduleDescription_, mcc, true);
161  lb.setConsumer(this);
162  const EventSetup c{ci,
163  static_cast<unsigned int>(Transition::EndLuminosityBlock),
165  false};
166  this->doStreamEndLuminosityBlock_(id, lb, c);
167  this->doStreamEndLuminosityBlockSummary_(id, lb, c);
168  }
169 
171  //respondToOpenInputFile(fb);
172  }
173 
175  //respondToCloseInputFile(fb);
176  }
177 
178  void EDAnalyzerBase::preallocStreams(unsigned int) {}
179  void EDAnalyzerBase::preallocLumis(unsigned int) {}
185  void EDAnalyzerBase::doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c) {}
190  LuminosityBlock const& lbp,
191  EventSetup const& c) {}
192 
193  void EDAnalyzerBase::doBeginRun_(Run const& rp, EventSetup const& c) {}
194  void EDAnalyzerBase::doEndRun_(Run const& rp, EventSetup const& c) {}
197 
202 
205  desc.setUnknown();
206  descriptions.addDefault(desc);
207  }
208 
210 
214 
216  regService->watchProductAdditions(callWhenNewProductsRegistered_);
217  }
218  }
219  static const std::string kBaseType("EDAnalyzer");
220 
222 
223  } // namespace global
224 } // namespace edm
ConfigurationDescriptions.h
ConstProductRegistry.h
edm::global::EDAnalyzerBase::doBeginStream
void doBeginStream(StreamID id)
Definition: EDAnalyzerBase.cc:120
edm::global::kBaseType
static const std::string kBaseType("EDAnalyzer")
edm::StreamID
Definition: StreamID.h:30
edm::global::EDAnalyzerBase::doStreamBeginRun
void doStreamBeginRun(StreamID id, RunPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:122
edm::ProductRegistry::callForEachBranch
void callForEachBranch(T const &iFunc)
Definition: ProductRegistry.h:97
edm::global::EDAnalyzerBase::callWhenNewProductsRegistered_
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: EDAnalyzerBase.h:147
edm::global::EDAnalyzerBase::doBeginRunSummary_
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:195
edm::global::EDAnalyzerBase::doEndStream_
virtual void doEndStream_(StreamID id)
Definition: EDAnalyzerBase.cc:183
edm::global::EDAnalyzerBase::doStreamBeginRun_
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:184
edm::global::EDAnalyzerBase::doBeginStream_
virtual void doBeginStream_(StreamID id)
Definition: EDAnalyzerBase.cc:182
edm::EventSetupImpl
Definition: EventSetupImpl.h:44
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
LuminosityBlock.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::global::EDAnalyzerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:174
edm::Transition::Event
edm::global::EDAnalyzerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzerBase.h:145
edmodule_mightGet_config.h
edm::global::EDAnalyzerBase::preallocLumisSummary
virtual void preallocLumisSummary(unsigned int)
Definition: EDAnalyzerBase.cc:180
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::global::EDAnalyzerBase::preallocate
virtual void preallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:181
edm::LuminosityBlockPrincipal
Definition: LuminosityBlockPrincipal.h:31
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:221
edm::global::EDAnalyzerBase::doBeginJob
void doBeginJob()
Definition: EDAnalyzerBase.cc:68
edm::global::EDAnalyzerBase::doEndRun_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:194
EventSignalsSentry.h
edm::global::EDAnalyzerBase::doEndStream
void doEndStream(StreamID id)
Definition: EDAnalyzerBase.cc:121
edm::global::EDAnalyzerBase::doStreamEndLuminosityBlock
void doStreamEndLuminosityBlock(StreamID id, LuminosityBlockPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:156
edm::ProductRegistry
Definition: ProductRegistry.h:34
edm::global::EDAnalyzerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:198
edm::FileBlock
Definition: FileBlock.h:20
edm::PreallocationConfiguration::numberOfLuminosityBlocks
unsigned int numberOfLuminosityBlocks() const
Definition: PreallocationConfiguration.h:36
edm::global::EDAnalyzerBase
Definition: EDAnalyzerBase.h:47
edm::EventPrincipal
Definition: EventPrincipal.h:46
edm::global::EDAnalyzerBase::doStreamEndRunSummary_
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:186
Service.h
edm::ActivityRegistry
Definition: ActivityRegistry.h:132
Run.h
edm::global::EDAnalyzerBase::doBeginRun
void doBeginRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:72
edm::Transition::BeginLuminosityBlock
ParameterSetDescription.h
edm::global::EDAnalyzerBase::beginJob
virtual void beginJob()
Definition: EDAnalyzerBase.h:116
edm::global::EDAnalyzerBase::doStreamBeginLuminosityBlock
void doStreamBeginLuminosityBlock(StreamID id, LuminosityBlockPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:143
edm::global::EDAnalyzerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:61
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::global::EDAnalyzerBase::doEndJob
void doEndJob()
Definition: EDAnalyzerBase.cc:70
edm::global::EDAnalyzerBase::doEndRun
void doEndRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:82
Event.h
edm::LuminosityBlock::setConsumer
void setConsumer(EDConsumerBase const *iConsumer)
Definition: LuminosityBlock.cc:26
edm::global::EDAnalyzerBase::doStreamEndLuminosityBlockSummary_
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:189
edm::global::EDAnalyzerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:106
edm::Service
Definition: Service.h:30
edm::global::EDAnalyzerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDAnalyzerBase.cc:179
edm::global::EDAnalyzerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:203
edm::ParameterSetDescription::setUnknown
void setUnknown()
Definition: ParameterSetDescription.cc:39
edm::EventSetup
Definition: EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::global::EDAnalyzerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:170
edm::global::EDAnalyzerBase::endJob
virtual void endJob()
Definition: EDAnalyzerBase.h:117
edm::global::EDAnalyzerBase::doStreamEndLuminosityBlock_
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:188
edm::global::EDAnalyzerBase::doEndRunSummary_
virtual void doEndRunSummary_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:196
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::global::EDAnalyzerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:193
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::EventSignalsSentry
Definition: EventSignalsSentry.h:29
edm::Event::streamID
StreamID streamID() const
Definition: Event.h:97
edm::Transition::EndLuminosityBlock
edm::global::EDAnalyzerBase::doStreamEndRun
void doStreamEndRun(StreamID id, RunPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:132
edm::EDConsumerBase::esGetTokenIndices
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const
Definition: EDConsumerBase.h:110
edm::Transition::BeginRun
edm::global::EDAnalyzerBase::~EDAnalyzerBase
~EDAnalyzerBase() override
Definition: EDAnalyzerBase.cc:47
EventSetup.h
edm::PreallocationConfiguration::numberOfStreams
unsigned int numberOfStreams() const
Definition: PreallocationConfiguration.h:35
edm::global::EDAnalyzerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:92
edm::global::EDAnalyzerBase::doStreamEndRun_
virtual void doStreamEndRun_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:185
edm::global::EDAnalyzerBase::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDAnalyzerBase *module, ProductRegistry *reg)
Definition: EDAnalyzerBase.cc:211
edm::global::EDAnalyzerBase::doEvent
bool doEvent(EventPrincipal const &ep, EventSetupImpl const &c, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:49
edm::edmodule_mightGet_config
void edmodule_mightGet_config(ConfigurationDescriptions &iDesc)
Definition: edmodule_mightGet_config.cc:36
edm::global::EDAnalyzerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:209
edm::RunPrincipal
Definition: RunPrincipal.h:34
edm::global::EDAnalyzerBase::preallocStreams
virtual void preallocStreams(unsigned int)
Definition: EDAnalyzerBase.cc:178
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:199
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:200
EDAnalyzerBase.h
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
edm::global::EDAnalyzerBase::EDAnalyzerBase
EDAnalyzerBase()
Definition: EDAnalyzerBase.cc:45
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:201
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:187
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29