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