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 ThinnedAssociationsHelper;
37  class WaitingTask;
38 
39  namespace maker {
40  template <typename T>
41  class ModuleHolderT;
42  }
43 
44  namespace global {
45 
46  class EDAnalyzerBase : public EDConsumerBase {
47  public:
48  template <typename T>
49  friend class edm::WorkerT;
50  template <typename T>
53 
55  ~EDAnalyzerBase() override;
56 
57  static void fillDescriptions(ConfigurationDescriptions& descriptions);
58  static void prevalidate(ConfigurationDescriptions& descriptions);
59  static const std::string& baseType();
60 
61  // Warning: the returned moduleDescription will be invalid during construction
63 
64  virtual bool wantsProcessBlocks() const = 0;
65  virtual bool wantsInputProcessBlocks() const = 0;
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  private:
77  //For now this is a placeholder
78  /*virtual*/ void preActionBeforeRunEventAsync(WaitingTask*, ModuleCallingContext const&, Principal const&) const {
79  }
80 
82  void doBeginJob();
83  void doEndJob();
84 
85  void doBeginStream(StreamID id);
86  void doEndStream(StreamID id);
91 
96  void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*);
99 
100  //For now, the following are just dummy implemenations with no ability for users to override
104 
106  std::string workerType() const { return "WorkerT<EDAnalyzer>"; }
107 
108  virtual void analyze(StreamID, Event const&, EventSetup const&) const = 0;
109  virtual void beginJob() {}
110  virtual void endJob() {}
111 
112  virtual void preallocStreams(unsigned int);
113  virtual void preallocLumis(unsigned int);
114  virtual void preallocLumisSummary(unsigned int);
115  virtual void preallocate(PreallocationConfiguration const&);
116  virtual void doBeginStream_(StreamID id);
117  virtual void doEndStream_(StreamID id);
118  virtual void doStreamBeginRun_(StreamID id, Run const& rp, EventSetup const& c);
119  virtual void doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c);
120  virtual void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c);
121  virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
122  virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
123  virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
124 
125  virtual void doBeginProcessBlock_(ProcessBlock const&);
126  virtual void doAccessInputProcessBlock_(ProcessBlock const&);
127  virtual void doEndProcessBlock_(ProcessBlock const&);
128  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
129  virtual void doBeginRunSummary_(Run const& rp, EventSetup const& c);
130  virtual void doEndRunSummary_(Run const& rp, EventSetup const& c);
131  virtual void doEndRun_(Run const& rp, EventSetup const& c);
132  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
133  virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const& rp, EventSetup const& c);
134  virtual void doEndLuminosityBlockSummary_(LuminosityBlock const& lb, EventSetup const& c);
135  virtual void doEndLuminosityBlock_(LuminosityBlock const& lb, EventSetup const& c);
136 
137  bool hasAcquire() const { return false; }
138  bool hasAccumulator() const { return false; }
139 
142 
144  };
145 
146  } // namespace global
147 } // namespace edm
148 
149 #endif
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
edm::global::EDAnalyzerBase::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:51
edm::global::EDAnalyzerBase::doBeginStream
void doBeginStream(StreamID id)
Definition: EDAnalyzerBase.cc:139
edm::StreamID
Definition: StreamID.h:30
edm::global::EDAnalyzerBase::callWhenNewProductsRegistered_
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: EDAnalyzerBase.h:143
edm::global::EDAnalyzerBase::doBeginRunSummary_
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:208
edm::global::EDAnalyzerBase::doEndStream_
virtual void doEndStream_(StreamID id)
Definition: EDAnalyzerBase.cc:194
edm::global::EDAnalyzerBase::doStreamBeginRun_
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:195
edm::global::EDAnalyzerBase::doBeginStream_
virtual void doBeginStream_(StreamID id)
Definition: EDAnalyzerBase.cc:193
edm::global::EDAnalyzerBase::doEndProcessBlock
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:88
ActivityRegistry
edm::LumiTransitionInfo
Definition: TransitionInfoTypes.h:42
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
edm::global::EDAnalyzerBase::doStreamEndRun
void doStreamEndRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:148
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::global::EDAnalyzerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:185
edm::global::EDAnalyzerBase::doAccessInputProcessBlock_
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:204
edm::global::EDAnalyzerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzerBase.h:141
edm::maker::ModuleHolderT::module
std::shared_ptr< T > module() const
Definition: ModuleHolder.h:60
edm::global::EDAnalyzerBase::doRegisterThinnedAssociations
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: EDAnalyzerBase.h:103
edm::global::EDAnalyzerBase::hasAcquire
bool hasAcquire() const
Definition: EDAnalyzerBase.h:137
edm::global::EDAnalyzerBase::preallocLumisSummary
virtual void preallocLumisSummary(unsigned int)
Definition: EDAnalyzerBase.cc:191
edm::global::EDAnalyzerBase::preallocate
virtual void preallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:192
edm::global::EDAnalyzerBase::doEndProcessBlock_
virtual void doEndProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:205
edm::global::EDAnalyzerBase::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: EDAnalyzerBase.h:71
edm::Principal
Definition: Principal.h:57
edm::global::EDAnalyzerBase::doBeginProcessBlock_
virtual void doBeginProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:203
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:234
edm::WorkerT
Definition: Frameworkfwd.h:62
edm::global::EDAnalyzerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:115
edm::global::EDAnalyzerBase::doBeginJob
void doBeginJob()
Definition: EDAnalyzerBase.cc:70
edm::global::EDAnalyzerBase::doEndRun_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:207
edm::RunTransitionInfo
Definition: TransitionInfoTypes.h:64
edm::ProcessBlockPrincipal
Definition: ProcessBlockPrincipal.h:22
edm::global::EDAnalyzerBase::doStreamEndLuminosityBlock
void doStreamEndLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:168
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::global::EDAnalyzerBase::doEndStream
void doEndStream(StreamID id)
Definition: EDAnalyzerBase.cc:140
edm::global::EDAnalyzerBase::workerType
std::string workerType() const
Definition: EDAnalyzerBase.h:106
edm::ProductRegistry
Definition: ProductRegistry.h:37
ModuleDescription.h
edm::global::EDAnalyzerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:211
edm::FileBlock
Definition: FileBlock.h:20
edm::global::EDAnalyzerBase
Definition: EDAnalyzerBase.h:46
edm::EDConsumerBase
Definition: EDConsumerBase.h:70
edm::global::EDAnalyzerBase::doStreamBeginRun
void doStreamBeginRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:141
edm::global::EDAnalyzerBase::doStreamEndRunSummary_
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:197
edm::global::EDAnalyzerBase::wantsStreamLuminosityBlocks
virtual bool wantsStreamLuminosityBlocks() const =0
WaitingTask
edm::global::EDAnalyzerBase::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDAnalyzerBase.h:140
edm::ActivityRegistry
Definition: ActivityRegistry.h:133
edm::global::EDAnalyzerBase::wantsInputProcessBlocks
virtual bool wantsInputProcessBlocks() const =0
edm::maker::ModuleHolderT
Definition: EDAnalyzer.h:25
edm::global::EDAnalyzerBase::beginJob
virtual void beginJob()
Definition: EDAnalyzerBase.h:109
edm::global::EDAnalyzerBase::moduleDescription
ModuleDescription const & moduleDescription() const
Definition: EDAnalyzerBase.h:62
edm::global::EDAnalyzerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:63
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::global::EDAnalyzerBase::doBeginProcessBlock
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:74
edm::global::EDAnalyzerBase::doEndJob
void doEndJob()
Definition: EDAnalyzerBase.cc:72
edm::global::EDAnalyzerBase::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTask *, ModuleCallingContext const &, Principal const &) const
Definition: EDAnalyzerBase.h:78
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:37
EDConsumerBase.h
edm::global::EDAnalyzerBase::doAccessInputProcessBlock
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:81
edm::global::EDAnalyzerBase::doStreamEndLuminosityBlockSummary_
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:200
edm::global::EDAnalyzerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDAnalyzerBase.cc:190
edm::global::EDAnalyzerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:216
edm::EventSetup
Definition: EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
edm::global::EDAnalyzerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:181
edm::global::EDAnalyzerBase::endJob
virtual void endJob()
Definition: EDAnalyzerBase.h:110
edm::global::EDAnalyzerBase::doStreamEndLuminosityBlock_
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:199
edm::global::EDAnalyzerBase::doEndRunSummary_
virtual void doEndRunSummary_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:209
edm::global::EDAnalyzerBase::wantsProcessBlocks
virtual bool wantsProcessBlocks() const =0
edm::global::EDAnalyzerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:206
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
Frameworkfwd.h
edm::global::EDAnalyzerBase::ModuleType
EDAnalyzerBase ModuleType
Definition: EDAnalyzerBase.h:52
HiBiasedCentrality_cfi.function
function
Definition: HiBiasedCentrality_cfi.py:4
edm::global::EDAnalyzerBase::~EDAnalyzerBase
~EDAnalyzerBase() override
Definition: EDAnalyzerBase.cc:49
ParameterSetfwd.h
edm::global::EDAnalyzerBase::doStreamBeginLuminosityBlock
void doStreamBeginLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:156
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
edm::global::EDAnalyzerBase::doStreamEndRun_
virtual void doStreamEndRun_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:196
edm::global::EDAnalyzerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:127
edm::global::EDAnalyzerBase::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDAnalyzerBase *module, ProductRegistry *reg)
Definition: EDAnalyzerBase.cc:224
edm::BranchDescription
Definition: BranchDescription.h:32
edm::global::EDAnalyzerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:222
edm::global::EDAnalyzerBase::doEndRun
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:105
edm::global::EDAnalyzerBase::preallocStreams
virtual void preallocStreams(unsigned int)
Definition: EDAnalyzerBase.cc:189
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:212
edm::global::EDAnalyzerBase::doBeginLuminosityBlockSummary_
virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:213
edm::global::EDAnalyzerBase::doBeginRun
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:95
edm::global::EDAnalyzerBase::EDAnalyzerBase
EDAnalyzerBase()
Definition: EDAnalyzerBase.cc:47
edm::ProcessBlock
Definition: ProcessBlock.h:36
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:214
edm::global::EDAnalyzerBase::doStreamBeginLuminosityBlock_
virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:198
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29
edm::global::EDAnalyzerBase::hasAccumulator
bool hasAccumulator() const
Definition: EDAnalyzerBase.h:138