CMS 3D CMS Logo

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