CMS 3D CMS Logo

EDAnalyzerBase.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_global_EDAnalyzerBase_h
2 #define FWCore_Framework_global_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
28 
29 // forward declarations
30 
31 namespace edm {
32  class ModuleCallingContext;
33  class PreallocationConfiguration;
34  class StreamID;
35  class ActivityRegistry;
36  class ProductRegistry;
37  class ThinnedAssociationsHelper;
38  class WaitingTask;
39 
40  namespace maker {
41  template <typename T>
42  class ModuleHolderT;
43  }
44 
45  namespace global {
46 
47  class EDAnalyzerBase : public EDConsumerBase {
48  public:
49  template <typename T>
50  friend class edm::WorkerT;
51  template <typename T>
54 
56  ~EDAnalyzerBase() override;
57 
58  static void fillDescriptions(ConfigurationDescriptions& descriptions);
59  static void prevalidate(ConfigurationDescriptions& descriptions);
60  static const std::string& baseType();
61 
62  // Warning: the returned moduleDescription will be invalid during construction
64 
65  virtual bool wantsGlobalRuns() const = 0;
66  virtual bool wantsGlobalLuminosityBlocks() const = 0;
67  virtual bool wantsStreamRuns() const = 0;
68  virtual bool wantsStreamLuminosityBlocks() const = 0;
69 
72  }
73 
74  private:
76  //For now this is a placeholder
77  /*virtual*/ void preActionBeforeRunEventAsync(WaitingTask* iTask,
78  ModuleCallingContext const& iModuleCallingContext,
79  Principal const& iPrincipal) const {}
80 
82  void doBeginJob();
83  void doEndJob();
84 
85  void doBeginStream(StreamID id);
86  void doEndStream(StreamID id);
91  EventSetupImpl const& c,
92  ModuleCallingContext const*);
95  EventSetupImpl const& c,
96  ModuleCallingContext const*);
97 
98  void doBeginRun(RunPrincipal const& rp, EventSetupImpl const& c, ModuleCallingContext const*);
99  void doEndRun(RunPrincipal const& rp, EventSetupImpl const& c, ModuleCallingContext const*);
101  EventSetupImpl const& c,
102  ModuleCallingContext const*);
104  EventSetupImpl const& c,
105  ModuleCallingContext const*);
106 
107  //For now, the following are just dummy implemenations with no ability for users to override
111 
113  std::string workerType() const { return "WorkerT<EDAnalyzer>"; }
114 
115  virtual void analyze(StreamID, Event const&, EventSetup const&) const = 0;
116  virtual void beginJob() {}
117  virtual void endJob() {}
118 
119  virtual void preallocStreams(unsigned int);
120  virtual void preallocLumis(unsigned int);
121  virtual void preallocLumisSummary(unsigned int);
122  virtual void preallocate(PreallocationConfiguration const&);
123  virtual void doBeginStream_(StreamID id);
124  virtual void doEndStream_(StreamID id);
125  virtual void doStreamBeginRun_(StreamID id, Run const& rp, EventSetup const& c);
126  virtual void doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c);
127  virtual void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c);
128  virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
129  virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
130  virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
131 
132  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
133  virtual void doBeginRunSummary_(Run const& rp, EventSetup const& c);
134  virtual void doEndRunSummary_(Run const& rp, EventSetup const& c);
135  virtual void doEndRun_(Run const& rp, EventSetup const& c);
136  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
137  virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const& rp, EventSetup const& c);
138  virtual void doEndLuminosityBlockSummary_(LuminosityBlock const& lb, EventSetup const& c);
139  virtual void doEndLuminosityBlock_(LuminosityBlock const& lb, EventSetup const& c);
140 
141  bool hasAcquire() const { return false; }
142  bool hasAccumulator() const { return false; }
143 
146 
148  };
149 
150  } // namespace global
151 } // namespace edm
152 
153 #endif
edm::global::EDAnalyzerBase::doBeginStream
void doBeginStream(StreamID id)
Definition: EDAnalyzerBase.cc:120
edm::StreamID
Definition: StreamID.h:30
edm::global::EDAnalyzerBase::doStreamBeginRun
void doStreamBeginRun(StreamID id, RunPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:122
edm::global::EDAnalyzerBase::callWhenNewProductsRegistered_
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: EDAnalyzerBase.h:147
edm::global::EDAnalyzerBase::doBeginRunSummary_
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:195
edm::global::EDAnalyzerBase::doEndStream_
virtual void doEndStream_(StreamID id)
Definition: EDAnalyzerBase.cc:183
edm::global::EDAnalyzerBase::doStreamBeginRun_
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:184
edm::global::EDAnalyzerBase::doBeginStream_
virtual void doBeginStream_(StreamID id)
Definition: EDAnalyzerBase.cc:182
ActivityRegistry
edm::EventSetupImpl
Definition: EventSetupImpl.h:44
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::global::EDAnalyzerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:174
edm::global::EDAnalyzerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzerBase.h:145
edm::global::EDAnalyzerBase::doRegisterThinnedAssociations
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: EDAnalyzerBase.h:110
edm::global::EDAnalyzerBase::hasAcquire
bool hasAcquire() const
Definition: EDAnalyzerBase.h:141
edm::global::EDAnalyzerBase::preallocLumisSummary
virtual void preallocLumisSummary(unsigned int)
Definition: EDAnalyzerBase.cc:180
edm::global::EDAnalyzerBase::preallocate
virtual void preallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:181
edm::LuminosityBlockPrincipal
Definition: LuminosityBlockPrincipal.h:31
edm::global::EDAnalyzerBase::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: EDAnalyzerBase.h:70
edm::Principal
Definition: Principal.h:57
edm::global::EDAnalyzerBase::analyze
virtual void analyze(StreamID, Event const &, EventSetup const &) const =0
edm::global::EDAnalyzerBase::baseType
static const std::string & baseType()
Definition: EDAnalyzerBase.cc:221
edm::WorkerT
Definition: Frameworkfwd.h:54
edm::global::EDAnalyzerBase::doBeginJob
void doBeginJob()
Definition: EDAnalyzerBase.cc:68
edm::global::EDAnalyzerBase::doEndRun_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:194
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::global::EDAnalyzerBase::doEndStream
void doEndStream(StreamID id)
Definition: EDAnalyzerBase.cc:121
edm::global::EDAnalyzerBase::doStreamEndLuminosityBlock
void doStreamEndLuminosityBlock(StreamID id, LuminosityBlockPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:156
edm::global::EDAnalyzerBase::workerType
std::string workerType() const
Definition: EDAnalyzerBase.h:113
edm::ProductRegistry
Definition: ProductRegistry.h:34
ModuleDescription.h
edm::global::EDAnalyzerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:198
edm::FileBlock
Definition: FileBlock.h:20
edm::global::EDAnalyzerBase
Definition: EDAnalyzerBase.h:47
edm::EDConsumerBase
Definition: EDConsumerBase.h:62
edm::EventPrincipal
Definition: EventPrincipal.h:46
edm::global::EDAnalyzerBase::doStreamEndRunSummary_
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:186
edm::global::EDAnalyzerBase::wantsStreamLuminosityBlocks
virtual bool wantsStreamLuminosityBlocks() const =0
WaitingTask
edm::global::EDAnalyzerBase::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTask *iTask, ModuleCallingContext const &iModuleCallingContext, Principal const &iPrincipal) const
Definition: EDAnalyzerBase.h:77
edm::global::EDAnalyzerBase::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDAnalyzerBase.h:144
edm::ActivityRegistry
Definition: ActivityRegistry.h:132
edm::global::EDAnalyzerBase::doBeginRun
void doBeginRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:72
edm::maker::ModuleHolderT
Definition: EDAnalyzer.h:26
edm::global::EDAnalyzerBase::beginJob
virtual void beginJob()
Definition: EDAnalyzerBase.h:116
edm::global::EDAnalyzerBase::moduleDescription
ModuleDescription const & moduleDescription() const
Definition: EDAnalyzerBase.h:63
edm::global::EDAnalyzerBase::doStreamBeginLuminosityBlock
void doStreamBeginLuminosityBlock(StreamID id, LuminosityBlockPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:143
edm::global::EDAnalyzerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:61
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::global::EDAnalyzerBase::doEndJob
void doEndJob()
Definition: EDAnalyzerBase.cc:70
edm::global::EDAnalyzerBase::doEndRun
void doEndRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:82
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:35
EDConsumerBase.h
edm::global::EDAnalyzerBase::doStreamEndLuminosityBlockSummary_
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:189
edm::global::EDAnalyzerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:106
edm::global::EDAnalyzerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDAnalyzerBase.cc:179
edm::global::EDAnalyzerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:203
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::global::EDAnalyzerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:170
edm::global::EDAnalyzerBase::endJob
virtual void endJob()
Definition: EDAnalyzerBase.h:117
edm::global::EDAnalyzerBase::doStreamEndLuminosityBlock_
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:188
edm::global::EDAnalyzerBase::doEndRunSummary_
virtual void doEndRunSummary_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:196
edm::global::EDAnalyzerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:193
edm::global::EDAnalyzerBase::wantsGlobalRuns
virtual bool wantsGlobalRuns() const =0
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::WaitingTask
Definition: WaitingTask.h:36
edm::global::EDAnalyzerBase::wantsGlobalLuminosityBlocks
virtual bool wantsGlobalLuminosityBlocks() const =0
edm::global::EDAnalyzerBase::doStreamEndRun
void doStreamEndRun(StreamID id, RunPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:132
Frameworkfwd.h
edm::global::EDAnalyzerBase::ModuleType
EDAnalyzerBase ModuleType
Definition: EDAnalyzerBase.h:53
HiBiasedCentrality_cfi.function
function
Definition: HiBiasedCentrality_cfi.py:4
edm::global::EDAnalyzerBase::~EDAnalyzerBase
~EDAnalyzerBase() override
Definition: EDAnalyzerBase.cc:47
ParameterSetfwd.h
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:29
edm::global::EDAnalyzerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:92
edm::global::EDAnalyzerBase::doStreamEndRun_
virtual void doStreamEndRun_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:185
edm::global::EDAnalyzerBase::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDAnalyzerBase *module, ProductRegistry *reg)
Definition: EDAnalyzerBase.cc:211
edm::BranchDescription
Definition: BranchDescription.h:32
edm::global::EDAnalyzerBase::doEvent
bool doEvent(EventPrincipal const &ep, EventSetupImpl const &c, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:49
edm::global::EDAnalyzerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:209
edm::RunPrincipal
Definition: RunPrincipal.h:34
edm::global::EDAnalyzerBase::preallocStreams
virtual void preallocStreams(unsigned int)
Definition: EDAnalyzerBase.cc:178
edm::global::EDAnalyzerBase::wantsStreamRuns
virtual bool wantsStreamRuns() const =0
edm::Event
Definition: Event.h:73
edm::global::EDAnalyzerBase::doEndLuminosityBlock_
virtual void doEndLuminosityBlock_(LuminosityBlock const &lb, EventSetup const &c)
Definition: EDAnalyzerBase.cc:199
edm::global::EDAnalyzerBase::doBeginLuminosityBlockSummary_
virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:200
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
edm::global::EDAnalyzerBase::EDAnalyzerBase
EDAnalyzerBase()
Definition: EDAnalyzerBase.cc:45
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:201
edm::global::EDAnalyzerBase::doStreamBeginLuminosityBlock_
virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:187
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29
edm::global::EDAnalyzerBase::hasAccumulator
bool hasAccumulator() const
Definition: EDAnalyzerBase.h:142