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