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