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 ThinnedAssociationsHelper;
38  class WaitingTask;
39 
40  namespace maker {
41  template <typename T>
42  class ModuleHolderT;
43  }
44 
45  namespace limited {
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 wantsProcessBlocks() const = 0;
66  virtual bool wantsInputProcessBlocks() const = 0;
67  virtual bool wantsGlobalRuns() const = 0;
68  virtual bool wantsGlobalLuminosityBlocks() const = 0;
69  virtual bool wantsStreamRuns() const = 0;
70  virtual bool wantsStreamLuminosityBlocks() const = 0;
71 
74  }
75 
76  unsigned int concurrencyLimit() const { return queue_.concurrencyLimit(); }
77 
78  LimitedTaskQueue& queue() { return queue_; }
79 
80  private:
82  //For now this is a placeholder
83  /*virtual*/ void preActionBeforeRunEventAsync(WaitingTask* iTask,
84  ModuleCallingContext const& iModuleCallingContext,
85  Principal const& iPrincipal) const {}
86 
88  void doBeginJob();
89  void doEndJob();
90 
91  void doBeginStream(StreamID id);
92  void doEndStream(StreamID id);
97 
102  void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*);
105 
106  //For now, the following are just dummy implemenations with no ability for users to override
110 
112  std::string workerType() const { return "WorkerT<EDAnalyzer>"; }
113 
114  virtual void analyze(StreamID, Event const&, EventSetup const&) const = 0;
115  virtual void beginJob() {}
116  virtual void endJob() {}
117 
118  virtual void preallocStreams(unsigned int);
119  virtual void preallocLumis(unsigned int);
120  virtual void preallocLumisSummary(unsigned int);
121  virtual void preallocate(PreallocationConfiguration const&);
122  virtual void doBeginStream_(StreamID id);
123  virtual void doEndStream_(StreamID id);
124  virtual void doStreamBeginRun_(StreamID id, Run const& rp, EventSetup const& c);
125  virtual void doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c);
126  virtual void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c);
127  virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
128  virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
129  virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
130 
131  virtual void doBeginProcessBlock_(ProcessBlock const&);
132  virtual void doAccessInputProcessBlock_(ProcessBlock const&);
133  virtual void doEndProcessBlock_(ProcessBlock const&);
134  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
135  virtual void doBeginRunSummary_(Run const& rp, EventSetup const& c);
136  virtual void doEndRunSummary_(Run const& rp, EventSetup const& c);
137  virtual void doEndRun_(Run const& rp, EventSetup const& c);
138  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
139  virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const& rp, EventSetup const& c);
140  virtual void doEndLuminosityBlockSummary_(LuminosityBlock const& lb, EventSetup const& c);
141  virtual void doEndLuminosityBlock_(LuminosityBlock const& lb, EventSetup const& c);
142 
143  bool hasAcquire() const { return false; }
144  bool hasAccumulator() const { return false; }
145 
148 
150 
152  };
153 
154  } // namespace limited
155 } // namespace edm
156 
157 #endif
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
edm::StreamID
Definition: StreamID.h:30
edm::limited::EDAnalyzerBase::wantsStreamRuns
virtual bool wantsStreamRuns() const =0
edm::limited::EDAnalyzerBase::doStreamEndLuminosityBlock
void doStreamEndLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:169
edm::limited::EDAnalyzerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:128
edm::limited::EDAnalyzerBase::~EDAnalyzerBase
~EDAnalyzerBase() override
Definition: EDAnalyzerBase.cc:50
ActivityRegistry
edm::LumiTransitionInfo
Definition: TransitionInfoTypes.h:42
edm::limited::EDAnalyzerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:213
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::limited::EDAnalyzerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzerBase.h:147
edm::limited::EDAnalyzerBase::doBeginLuminosityBlockSummary_
virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:215
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::maker::ModuleHolderT::module
std::shared_ptr< T > module() const
Definition: ModuleHolder.h:60
edm::limited::EDAnalyzerBase::doStreamBeginLuminosityBlock_
virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:199
edm::limited::EDAnalyzerBase::doStreamBeginRun
void doStreamBeginRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:142
edm::limited::EDAnalyzerBase::doBeginStream_
virtual void doBeginStream_(StreamID id)
Definition: EDAnalyzerBase.cc:194
edm::limited::EDAnalyzerBase::baseType
static const std::string & baseType()
Definition: EDAnalyzerBase.cc:236
edm::limited::EDAnalyzerBase::doBeginProcessBlock
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:75
edm::limited::EDAnalyzerBase::workerType
std::string workerType() const
Definition: EDAnalyzerBase.h:112
edm::Principal
Definition: Principal.h:57
edm::limited::EDAnalyzerBase::doRegisterThinnedAssociations
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: EDAnalyzerBase.h:109
edm::WorkerT
Definition: Frameworkfwd.h:62
edm::limited::EDAnalyzerBase::doEndProcessBlock
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:89
edm::RunTransitionInfo
Definition: TransitionInfoTypes.h:64
edm::limited::EDAnalyzerBase::queue
LimitedTaskQueue & queue()
Definition: EDAnalyzerBase.h:78
edm::ProcessBlockPrincipal
Definition: ProcessBlockPrincipal.h:22
edm::limited::EDAnalyzerBase::doStreamEndLuminosityBlockSummary_
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:201
edm::ModuleDescription
Definition: ModuleDescription.h:21
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:210
edm::limited::EDAnalyzerBase::doBeginStream
void doBeginStream(StreamID id)
Definition: EDAnalyzerBase.cc:140
edm::ProductRegistry
Definition: ProductRegistry.h:37
ModuleDescription.h
edm::FileBlock
Definition: FileBlock.h:20
edm::limited::EDAnalyzerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDAnalyzerBase.cc:191
edm::EDConsumerBase
Definition: EDConsumerBase.h:70
edm::limited::EDAnalyzerBase::doEndStream_
virtual void doEndStream_(StreamID id)
Definition: EDAnalyzerBase.cc:195
edm::LimitedTaskQueue
Definition: LimitedTaskQueue.h:39
edm::limited::EDAnalyzerBase::preallocate
virtual void preallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:193
edm::limited::EDAnalyzerBase::doStreamEndLuminosityBlock_
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:200
edm::limited::EDAnalyzerBase::doStreamEndRun
void doStreamEndRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:149
WaitingTask
edm::limited::EDAnalyzerBase::hasAccumulator
bool hasAccumulator() const
Definition: EDAnalyzerBase.h:144
edm::limited::EDAnalyzerBase::doAccessInputProcessBlock
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:82
edm::limited::EDAnalyzerBase::wantsInputProcessBlocks
virtual bool wantsInputProcessBlocks() const =0
edm::limited::EDAnalyzerBase::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDAnalyzerBase.h:146
edm::limited::EDAnalyzerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:182
edm::ActivityRegistry
Definition: ActivityRegistry.h:133
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:53
edm::limited::EDAnalyzerBase::queue_
LimitedTaskQueue queue_
Definition: EDAnalyzerBase.h:151
edm::limited::EDAnalyzerBase::preallocStreams
virtual void preallocStreams(unsigned int)
Definition: EDAnalyzerBase.cc:190
edm::maker::ModuleHolderT
Definition: EDAnalyzer.h:25
LimitedTaskQueue.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LimitedTaskQueue::concurrencyLimit
unsigned int concurrencyLimit() const
Definition: LimitedTaskQueue.h:118
edm::limited::EDAnalyzerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:224
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:37
edm::ParameterSet
Definition: ParameterSet.h:47
EDConsumerBase.h
edm::limited::EDAnalyzerBase
Definition: EDAnalyzerBase.h:47
edm::limited::EDAnalyzerBase::wantsGlobalLuminosityBlocks
virtual bool wantsGlobalLuminosityBlocks() const =0
edm::limited::EDAnalyzerBase::hasAcquire
bool hasAcquire() const
Definition: EDAnalyzerBase.h:143
edm::limited::EDAnalyzerBase::doStreamEndRunSummary_
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:198
edm::limited::EDAnalyzerBase::preallocLumisSummary
virtual void preallocLumisSummary(unsigned int)
Definition: EDAnalyzerBase.cc:192
edm::limited::EDAnalyzerBase::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: EDAnalyzerBase.h:72
edm::limited::EDAnalyzerBase::doEndRun
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:106
edm::limited::EDAnalyzerBase::doStreamBeginLuminosityBlock
void doStreamBeginLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:157
edm::limited::EDAnalyzerBase::wantsProcessBlocks
virtual bool wantsProcessBlocks() const =0
edm::limited::EDAnalyzerBase::doStreamBeginRun_
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:196
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:226
edm::EventSetup
Definition: EventSetup.h:57
edm::limited::EDAnalyzerBase::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:52
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
edm::limited::EDAnalyzerBase::doEndLuminosityBlock_
virtual void doEndLuminosityBlock_(LuminosityBlock const &lb, EventSetup const &c)
Definition: EDAnalyzerBase.cc:214
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:209
edm::limited::EDAnalyzerBase::doEndStream
void doEndStream(StreamID id)
Definition: EDAnalyzerBase.cc:141
edm::limited::EDAnalyzerBase::doEndJob
void doEndJob()
Definition: EDAnalyzerBase.cc:73
Frameworkfwd.h
edm::limited::EDAnalyzerBase::concurrencyLimit
unsigned int concurrencyLimit() const
Definition: EDAnalyzerBase.h:76
edm::limited::EDAnalyzerBase::moduleDescription
ModuleDescription const & moduleDescription() const
Definition: EDAnalyzerBase.h:63
edm::limited::EDAnalyzerBase::endJob
virtual void endJob()
Definition: EDAnalyzerBase.h:116
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:216
ParameterSetfwd.h
edm::limited::EDAnalyzerBase::EDAnalyzerBase
EDAnalyzerBase(ParameterSet const &pset)
Definition: EDAnalyzerBase.cc:47
edm::limited::EDAnalyzerBase::doBeginJob
void doBeginJob()
Definition: EDAnalyzerBase.cc:71
edm::limited::EDAnalyzerBase::doBeginProcessBlock_
virtual void doBeginProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:205
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
edm::limited::EDAnalyzerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:218
edm::BranchDescription
Definition: BranchDescription.h:32
edm::limited::EDAnalyzerBase::doEndRunSummary_
virtual void doEndRunSummary_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:211
edm::limited::EDAnalyzerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:186
edm::limited::EDAnalyzerBase::doBeginRun
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:96
edm::limited::EDAnalyzerBase::callWhenNewProductsRegistered_
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: EDAnalyzerBase.h:149
edm::limited::EDAnalyzerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:208
edm::Event
Definition: Event.h:73
edm::limited::EDAnalyzerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:64
edm::limited::EDAnalyzerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:116
edm::limited::EDAnalyzerBase::doEndProcessBlock_
virtual void doEndProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:207
edm::limited::EDAnalyzerBase::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTask *iTask, ModuleCallingContext const &iModuleCallingContext, Principal const &iPrincipal) const
Definition: EDAnalyzerBase.h:83
edm::ProcessBlock
Definition: ProcessBlock.h:36
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:197
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29
edm::limited::EDAnalyzerBase::doAccessInputProcessBlock_
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:206