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
29 
30 // forward declarations
31 
32 namespace edm {
33  class ModuleCallingContext;
34  class PreallocationConfiguration;
35  class StreamID;
36  class ActivityRegistry;
37  class ThinnedAssociationsHelper;
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
79  ModuleCallingContext const&,
80  Principal const&) const {}
81 
83  void doBeginJob();
84  void doEndJob();
85 
86  void doBeginStream(StreamID id);
87  void doEndStream(StreamID id);
92 
97  void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*);
100 
101  //For now, the following are just dummy implemenations with no ability for users to override
105 
107  std::string workerType() const { return "WorkerT<EDAnalyzer>"; }
108 
109  virtual void analyze(StreamID, Event const&, EventSetup const&) const = 0;
110  virtual void beginJob() {}
111  virtual void endJob() {}
112 
113  virtual void preallocStreams(unsigned int);
114  virtual void preallocLumis(unsigned int);
115  virtual void preallocLumisSummary(unsigned int);
116  virtual void preallocate(PreallocationConfiguration const&);
117  virtual void doBeginStream_(StreamID id);
118  virtual void doEndStream_(StreamID id);
119  virtual void doStreamBeginRun_(StreamID id, Run const& rp, EventSetup const& c);
120  virtual void doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c);
121  virtual void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c);
122  virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
123  virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
124  virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
125 
126  virtual void doBeginProcessBlock_(ProcessBlock const&);
127  virtual void doAccessInputProcessBlock_(ProcessBlock const&);
128  virtual void doEndProcessBlock_(ProcessBlock const&);
129  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
130  virtual void doBeginRunSummary_(Run const& rp, EventSetup const& c);
131  virtual void doEndRunSummary_(Run const& rp, EventSetup const& c);
132  virtual void doEndRun_(Run const& rp, EventSetup const& c);
133  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
134  virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const& rp, EventSetup const& c);
135  virtual void doEndLuminosityBlockSummary_(LuminosityBlock const& lb, EventSetup const& c);
136  virtual void doEndLuminosityBlock_(LuminosityBlock const& lb, EventSetup const& c);
137 
138  bool hasAcquire() const { return false; }
139  bool hasAccumulator() const { return false; }
140 
143 
145  };
146 
147  } // namespace global
148 } // namespace edm
149 
150 #endif
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
edm::global::EDAnalyzerBase::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:52
edm::global::EDAnalyzerBase::doBeginStream
void doBeginStream(StreamID id)
Definition: EDAnalyzerBase.cc:150
edm::StreamID
Definition: StreamID.h:30
edm::global::EDAnalyzerBase::callWhenNewProductsRegistered_
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: EDAnalyzerBase.h:144
edm::global::EDAnalyzerBase::doBeginRunSummary_
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:228
edm::global::EDAnalyzerBase::doEndStream_
virtual void doEndStream_(StreamID id)
Definition: EDAnalyzerBase.cc:214
edm::global::EDAnalyzerBase::doStreamBeginRun_
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:215
edm::global::EDAnalyzerBase::doBeginStream_
virtual void doBeginStream_(StreamID id)
Definition: EDAnalyzerBase.cc:213
edm::global::EDAnalyzerBase::doEndProcessBlock
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:90
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:163
WaitingTaskHolder.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::global::EDAnalyzerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:205
edm::global::EDAnalyzerBase::doAccessInputProcessBlock_
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:224
edm::global::EDAnalyzerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzerBase.h:142
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:104
edm::global::EDAnalyzerBase::hasAcquire
bool hasAcquire() const
Definition: EDAnalyzerBase.h:138
edm::global::EDAnalyzerBase::preallocLumisSummary
virtual void preallocLumisSummary(unsigned int)
Definition: EDAnalyzerBase.cc:211
edm::global::EDAnalyzerBase::preallocate
virtual void preallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:212
edm::global::EDAnalyzerBase::doEndProcessBlock_
virtual void doEndProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:225
edm::global::EDAnalyzerBase::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: EDAnalyzerBase.h:71
edm::Principal
Definition: Principal.h:56
edm::global::EDAnalyzerBase::doBeginProcessBlock_
virtual void doBeginProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:223
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:254
edm::WorkerT
Definition: Frameworkfwd.h:62
edm::global::EDAnalyzerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:122
edm::global::EDAnalyzerBase::doBeginJob
void doBeginJob()
Definition: EDAnalyzerBase.cc:72
edm::global::EDAnalyzerBase::doEndRun_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:227
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:186
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::global::EDAnalyzerBase::doEndStream
void doEndStream(StreamID id)
Definition: EDAnalyzerBase.cc:151
edm::global::EDAnalyzerBase::workerType
std::string workerType() const
Definition: EDAnalyzerBase.h:107
edm::ProductRegistry
Definition: ProductRegistry.h:37
ModuleDescription.h
edm::global::EDAnalyzerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:231
edm::FileBlock
Definition: FileBlock.h:20
edm::global::EDAnalyzerBase
Definition: EDAnalyzerBase.h:46
edm::EDConsumerBase
Definition: EDConsumerBase.h:71
edm::global::EDAnalyzerBase::doStreamBeginRun
void doStreamBeginRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:152
edm::global::EDAnalyzerBase::doStreamEndRunSummary_
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:217
edm::global::EDAnalyzerBase::wantsStreamLuminosityBlocks
virtual bool wantsStreamLuminosityBlocks() const =0
edm::global::EDAnalyzerBase::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDAnalyzerBase.h:141
edm::ActivityRegistry
Definition: ActivityRegistry.h:134
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:110
edm::global::EDAnalyzerBase::moduleDescription
ModuleDescription const & moduleDescription() const
Definition: EDAnalyzerBase.h:62
edm::global::EDAnalyzerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:65
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:76
edm::global::EDAnalyzerBase::doEndJob
void doEndJob()
Definition: EDAnalyzerBase.cc:74
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:37
EDConsumerBase.h
edm::global::EDAnalyzerBase::doAccessInputProcessBlock
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:83
edm::WaitingTaskHolder
Definition: WaitingTaskHolder.h:32
edm::global::EDAnalyzerBase::doStreamEndLuminosityBlockSummary_
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:220
edm::global::EDAnalyzerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDAnalyzerBase.cc:210
edm::global::EDAnalyzerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:236
edm::EventSetup
Definition: EventSetup.h:58
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
edm::global::EDAnalyzerBase::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const &, Principal const &) const
Definition: EDAnalyzerBase.h:78
edm::global::EDAnalyzerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:201
edm::global::EDAnalyzerBase::endJob
virtual void endJob()
Definition: EDAnalyzerBase.h:111
edm::global::EDAnalyzerBase::doStreamEndLuminosityBlock_
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:219
edm::global::EDAnalyzerBase::doEndRunSummary_
virtual void doEndRunSummary_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:229
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:226
edm::global::EDAnalyzerBase::wantsGlobalRuns
virtual bool wantsGlobalRuns() const =0
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
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:50
ParameterSetfwd.h
edm::global::EDAnalyzerBase::doStreamBeginLuminosityBlock
void doStreamBeginLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:172
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:216
edm::global::EDAnalyzerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:136
edm::global::EDAnalyzerBase::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDAnalyzerBase *module, ProductRegistry *reg)
Definition: EDAnalyzerBase.cc:244
edm::BranchDescription
Definition: BranchDescription.h:32
edm::global::EDAnalyzerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:242
edm::global::EDAnalyzerBase::doEndRun
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:111
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm::global::EDAnalyzerBase::preallocStreams
virtual void preallocStreams(unsigned int)
Definition: EDAnalyzerBase.cc:209
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:232
edm::global::EDAnalyzerBase::doBeginLuminosityBlockSummary_
virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:233
edm::global::EDAnalyzerBase::doBeginRun
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:97
edm::global::EDAnalyzerBase::EDAnalyzerBase
EDAnalyzerBase()
Definition: EDAnalyzerBase.cc:48
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:234
edm::global::EDAnalyzerBase::doStreamBeginLuminosityBlock_
virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:218
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29
edm::global::EDAnalyzerBase::hasAccumulator
bool hasAccumulator() const
Definition: EDAnalyzerBase.h:139