CMS 3D CMS Logo

EDAnalyzerBase.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_limited_EDAnalyzerBase_h
2 #define FWCore_Framework_limited_EDAnalyzerBase_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : EDAnalyzerBase
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Thu, 18 Jul 2013 11:51:14 GMT
19 //
20 
21 // system include files
22 
23 // user include files
29 
30 // forward declarations
31 
32 namespace edm {
33  class ModuleCallingContext;
34  class PreallocationConfiguration;
35  class StreamID;
36  class ActivityRegistry;
37  class ProductRegistry;
38  class ThinnedAssociationsHelper;
39  class WaitingTask;
40 
41  namespace maker {
42  template <typename T>
43  class ModuleHolderT;
44  }
45 
46  namespace limited {
47 
48  class EDAnalyzerBase : public EDConsumerBase {
49  public:
50  template <typename T>
51  friend class edm::WorkerT;
52  template <typename T>
55 
57  ~EDAnalyzerBase() override;
58 
59  static void fillDescriptions(ConfigurationDescriptions& descriptions);
60  static void prevalidate(ConfigurationDescriptions& descriptions);
61  static const std::string& baseType();
62 
63  // Warning: the returned moduleDescription will be invalid during construction
65 
66  virtual bool wantsGlobalRuns() const = 0;
67  virtual bool wantsGlobalLuminosityBlocks() const = 0;
68  virtual bool wantsStreamRuns() const = 0;
69  virtual bool wantsStreamLuminosityBlocks() const = 0;
70 
73  }
74 
75  unsigned int concurrencyLimit() const { return queue_.concurrencyLimit(); }
76 
77  LimitedTaskQueue& queue() { return queue_; }
78 
79  private:
81  //For now this is a placeholder
82  /*virtual*/ void preActionBeforeRunEventAsync(WaitingTask* iTask,
83  ModuleCallingContext const& iModuleCallingContext,
84  Principal const& iPrincipal) const {}
85 
87  void doBeginJob();
88  void doEndJob();
89 
90  void doBeginStream(StreamID id);
91  void doEndStream(StreamID id);
96  EventSetupImpl const& c,
97  ModuleCallingContext const*);
100  EventSetupImpl const& c,
101  ModuleCallingContext const*);
102 
103  void doBeginRun(RunPrincipal const& rp, EventSetupImpl const& c, ModuleCallingContext const*);
104  void doEndRun(RunPrincipal const& rp, EventSetupImpl const& c, ModuleCallingContext const*);
106  EventSetupImpl const& c,
107  ModuleCallingContext const*);
109  EventSetupImpl const& c,
110  ModuleCallingContext const*);
111 
112  //For now, the following are just dummy implemenations with no ability for users to override
116 
118  std::string workerType() const { return "WorkerT<EDAnalyzer>"; }
119 
120  virtual void analyze(StreamID, Event const&, EventSetup const&) const = 0;
121  virtual void beginJob() {}
122  virtual void endJob() {}
123 
124  virtual void preallocStreams(unsigned int);
125  virtual void preallocLumis(unsigned int);
126  virtual void preallocLumisSummary(unsigned int);
127  virtual void preallocate(PreallocationConfiguration const&);
128  virtual void doBeginStream_(StreamID id);
129  virtual void doEndStream_(StreamID id);
130  virtual void doStreamBeginRun_(StreamID id, Run const& rp, EventSetup const& c);
131  virtual void doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c);
132  virtual void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c);
133  virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
134  virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
135  virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
136 
137  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
138  virtual void doBeginRunSummary_(Run const& rp, EventSetup const& c);
139  virtual void doEndRunSummary_(Run const& rp, EventSetup const& c);
140  virtual void doEndRun_(Run const& rp, EventSetup const& c);
141  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
142  virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const& rp, EventSetup const& c);
143  virtual void doEndLuminosityBlockSummary_(LuminosityBlock const& lb, EventSetup const& c);
144  virtual void doEndLuminosityBlock_(LuminosityBlock const& lb, EventSetup const& c);
145 
146  bool hasAcquire() const { return false; }
147  bool hasAccumulator() const { return false; }
148 
151 
153 
155  };
156 
157  } // namespace limited
158 } // namespace edm
159 
160 #endif
edm::StreamID
Definition: StreamID.h:30
edm::limited::EDAnalyzerBase::wantsStreamRuns
virtual bool wantsStreamRuns() const =0
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
ActivityRegistry
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
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::limited::EDAnalyzerBase::doStreamBeginLuminosityBlock_
virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:188
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
edm::limited::EDAnalyzerBase::workerType
std::string workerType() const
Definition: EDAnalyzerBase.h:118
edm::Principal
Definition: Principal.h:57
edm::limited::EDAnalyzerBase::doRegisterThinnedAssociations
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: EDAnalyzerBase.h:115
edm::WorkerT
Definition: Frameworkfwd.h:54
edm::limited::EDAnalyzerBase::queue
LimitedTaskQueue & queue()
Definition: EDAnalyzerBase.h:77
edm::limited::EDAnalyzerBase::doStreamEndLuminosityBlockSummary_
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:190
edm::ModuleDescription
Definition: ModuleDescription.h:21
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
ModuleDescription.h
edm::FileBlock
Definition: FileBlock.h:20
edm::limited::EDAnalyzerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDAnalyzerBase.cc:180
edm::EDConsumerBase
Definition: EDConsumerBase.h:62
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::LimitedTaskQueue
Definition: LimitedTaskQueue.h:39
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
WaitingTask
edm::limited::EDAnalyzerBase::hasAccumulator
bool hasAccumulator() const
Definition: EDAnalyzerBase.h:147
edm::limited::EDAnalyzerBase::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDAnalyzerBase.h:149
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
edm::limited::EDAnalyzerBase::wantsGlobalRuns
virtual bool wantsGlobalRuns() const =0
edm::limited::EDAnalyzerBase::wantsStreamLuminosityBlocks
virtual bool wantsStreamLuminosityBlocks() const =0
edm::limited::EDAnalyzerBase::ModuleType
EDAnalyzerBase ModuleType
Definition: EDAnalyzerBase.h:54
edm::limited::EDAnalyzerBase::queue_
LimitedTaskQueue queue_
Definition: EDAnalyzerBase.h:154
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::maker::ModuleHolderT
Definition: EDAnalyzer.h:26
LimitedTaskQueue.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::LimitedTaskQueue::concurrencyLimit
unsigned int concurrencyLimit() const
Definition: LimitedTaskQueue.h:116
edm::limited::EDAnalyzerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:210
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:35
edm::ParameterSet
Definition: ParameterSet.h:36
EDConsumerBase.h
edm::limited::EDAnalyzerBase
Definition: EDAnalyzerBase.h:48
edm::limited::EDAnalyzerBase::wantsGlobalLuminosityBlocks
virtual bool wantsGlobalLuminosityBlocks() const =0
edm::limited::EDAnalyzerBase::hasAcquire
bool hasAcquire() const
Definition: EDAnalyzerBase.h:146
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::limited::EDAnalyzerBase::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: EDAnalyzerBase.h:71
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::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
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
module
Definition: vlib.h:198
edm::limited::EDAnalyzerBase::doEndLuminosityBlock_
virtual void doEndLuminosityBlock_(LuminosityBlock const &lb, EventSetup const &c)
Definition: EDAnalyzerBase.cc:200
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::WaitingTask
Definition: WaitingTask.h:36
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
Frameworkfwd.h
edm::limited::EDAnalyzerBase::concurrencyLimit
unsigned int concurrencyLimit() const
Definition: EDAnalyzerBase.h:75
edm::limited::EDAnalyzerBase::moduleDescription
ModuleDescription const & moduleDescription() const
Definition: EDAnalyzerBase.h:64
edm::limited::EDAnalyzerBase::endJob
virtual void endJob()
Definition: EDAnalyzerBase.h:122
HiBiasedCentrality_cfi.function
function
Definition: HiBiasedCentrality_cfi.py:4
edm::limited::EDAnalyzerBase::doEndLuminosityBlockSummary_
virtual void doEndLuminosityBlockSummary_(LuminosityBlock const &lb, EventSetup const &c)
Definition: EDAnalyzerBase.cc:202
ParameterSetfwd.h
edm::limited::EDAnalyzerBase::EDAnalyzerBase
EDAnalyzerBase(ParameterSet const &pset)
Definition: EDAnalyzerBase.cc:45
edm::limited::EDAnalyzerBase::doBeginJob
void doBeginJob()
Definition: EDAnalyzerBase.cc:69
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:29
edm::limited::EDAnalyzerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:204
edm::BranchDescription
Definition: BranchDescription.h:32
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::limited::EDAnalyzerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:62
edm::limited::EDAnalyzerBase::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTask *iTask, ModuleCallingContext const &iModuleCallingContext, Principal const &iPrincipal) const
Definition: EDAnalyzerBase.h:82
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
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29