CMS 3D CMS Logo

EDAnalyzerBase.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_one_EDAnalyzerBase_h
2 #define FWCore_Framework_one_EDAnalyzerBase_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : one::EDAnalyzerBase
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Thu, 01 Aug 2013 21:21:21 GMT
19 //
20 
21 // system include files
22 
23 // user include files
30 
31 // forward declarations
32 namespace edm {
33 
34  class ModuleCallingContext;
35  class PreallocationConfiguration;
36  class ActivityRegistry;
37  class ThinnedAssociationsHelper;
38 
39  namespace maker {
40  template <typename T>
41  class ModuleHolderT;
42  }
43 
44  namespace one {
45 
46  class EDAnalyzerBase : public EDConsumerBase {
47  public:
48  template <typename T>
49  friend class edm::WorkerT;
50  template <typename T>
52 
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  bool wantsStreamRuns() const { return false; }
70  bool wantsStreamLuminosityBlocks() const { return false; };
71 
75 
76  private:
78  //For now this is a placeholder
80  ModuleCallingContext const&,
81  Principal const&) const {}
82 
84  virtual void preallocLumis(unsigned int);
85  void doBeginJob();
86  void doEndJob();
87 
92  void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*);
95 
96  //For now, the following are just dummy implementations with no ability for users to override
100 
102  std::string workerType() const { return "WorkerT<EDAnalyzer>"; }
103 
105 
106  virtual void analyze(Event const&, EventSetup const&) = 0;
107  virtual void beginJob() {}
108  virtual void endJob() {}
109 
110  virtual void doBeginProcessBlock_(ProcessBlock const&);
111  virtual void doAccessInputProcessBlock_(ProcessBlock const&);
112  virtual void doEndProcessBlock_(ProcessBlock const&);
113  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
114  virtual void doEndRun_(Run const& rp, EventSetup const& c);
115  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
116  virtual void doEndLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
117 
118  bool hasAcquire() const { return false; }
119  bool hasAccumulator() const { return false; }
120 
122 
126 
128  };
129  } // namespace one
130 } // namespace edm
131 #endif
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
edm::SharedResourcesAcquirer
Definition: SharedResourcesAcquirer.h:34
edm::one::EDAnalyzerBase::wantsStreamLuminosityBlocks
bool wantsStreamLuminosityBlocks() const
Definition: EDAnalyzerBase.h:70
SiPixelPI::one
Definition: SiPixelPayloadInspectorHelper.h:39
edm::one::EDAnalyzerBase::doEndJob
void doEndJob()
Definition: EDAnalyzerBase.cc:82
edm::one::EDAnalyzerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:146
ActivityRegistry
edm::LumiTransitionInfo
Definition: TransitionInfoTypes.h:42
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::one::EDAnalyzerBase::moduleDescription
ModuleDescription const & moduleDescription() const
Definition: EDAnalyzerBase.h:63
edm::Run
Definition: Run.h:45
WaitingTaskHolder.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::one::EDAnalyzerBase::~EDAnalyzerBase
~EDAnalyzerBase() override
Definition: EDAnalyzerBase.cc:48
edm::one::EDAnalyzerBase::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:54
edm::maker::ModuleHolderT::module
std::shared_ptr< T > module() const
Definition: ModuleHolder.h:60
edm::one::EDAnalyzerBase::doBeginRun
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:110
edm::one::EDAnalyzerBase::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDAnalyzerBase const *module, ProductRegistry *reg)
Definition: EDAnalyzerBase.cc:188
edm::one::EDAnalyzerBase::ModuleType
EDAnalyzerBase ModuleType
Definition: EDAnalyzerBase.h:53
edm::one::EDAnalyzerBase::callWhenNewProductsRegistered_
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: EDAnalyzerBase.h:125
edm::Principal
Definition: Principal.h:56
edm::SerialTaskQueue
Definition: SerialTaskQueue.h:67
edm::one::EDAnalyzerBase::doBeginJob
void doBeginJob()
Definition: EDAnalyzerBase.cc:76
edm::one::EDAnalyzerBase::doBeginProcessBlock_
virtual void doBeginProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:167
edm::WorkerT
Definition: Frameworkfwd.h:62
edm::one::EDAnalyzerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzerBase.h:124
edm::one::EDAnalyzerBase::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: EDAnalyzerBase.cc:50
edm::RunTransitionInfo
Definition: TransitionInfoTypes.h:64
edm::ProcessBlockPrincipal
Definition: ProcessBlockPrincipal.h:22
edm::one::EDAnalyzerBase::doBeginProcessBlock
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:89
edm::one::EDAnalyzerBase::resourcesAcquirer_
SharedResourcesAcquirer resourcesAcquirer_
Definition: EDAnalyzerBase.h:127
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::one::EDAnalyzerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:171
edm::ProductRegistry
Definition: ProductRegistry.h:37
ModuleDescription.h
edm::FileBlock
Definition: FileBlock.h:20
edm::one::EDAnalyzerBase::doEndProcessBlock
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:103
SharedResourcesAcquirer.h
edm::one::EDAnalyzerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:159
edm::EDConsumerBase
Definition: EDConsumerBase.h:71
edm::one::EDAnalyzerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:173
edm::one::EDAnalyzerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:163
edm::one::EDAnalyzerBase::wantsStreamRuns
bool wantsStreamRuns() const
Definition: EDAnalyzerBase.h:69
edm::one::EDAnalyzerBase::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDAnalyzerBase.h:123
edm::ActivityRegistry
Definition: ActivityRegistry.h:134
edm::one::EDAnalyzerBase::beginJob
virtual void beginJob()
Definition: EDAnalyzerBase.h:107
edm::one::EDAnalyzerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:133
edm::one::EDAnalyzerBase::EDAnalyzerBase
EDAnalyzerBase()
Definition: EDAnalyzerBase.cc:46
edm::maker::ModuleHolderT
Definition: EDAnalyzer.h:25
edm::one::EDAnalyzerBase::doAccessInputProcessBlock_
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:168
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::one::EDAnalyzerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerBase.cc:84
edm::one::EDAnalyzerBase::sharedResourcesAcquirer
SharedResourcesAcquirer & sharedResourcesAcquirer()
Definition: EDAnalyzerBase.h:104
edm::one::EDAnalyzerBase::wantsGlobalRuns
virtual bool wantsGlobalRuns() const =0
edm::one::EDAnalyzerBase::doEndProcessBlock_
virtual void doEndProcessBlock_(ProcessBlock const &)
Definition: EDAnalyzerBase.cc:169
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:37
edm::one::EDAnalyzerBase::wantsGlobalLuminosityBlocks
virtual bool wantsGlobalLuminosityBlocks() const =0
edm::one::EDAnalyzerBase::doEndRun_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:172
edm::one::EDAnalyzerBase::endJob
virtual void endJob()
Definition: EDAnalyzerBase.h:108
edm::one::EDAnalyzerBase::hasAcquire
bool hasAcquire() const
Definition: EDAnalyzerBase.h:118
EDConsumerBase.h
edm::one::EDAnalyzerBase::wantsInputProcessBlocks
virtual bool wantsInputProcessBlocks() const =0
edm::WaitingTaskHolder
Definition: WaitingTaskHolder.h:32
edm::one::EDAnalyzerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:182
edm::one::EDAnalyzerBase::doRegisterThinnedAssociations
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: EDAnalyzerBase.h:99
edm::EventSetup
Definition: EventSetup.h:58
edm::one::EDAnalyzerBase::doEndLuminosityBlock_
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:174
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
edm::one::EDAnalyzerBase::doEndRun
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:123
edm::one::EDAnalyzerBase::hasAccumulator
bool hasAccumulator() const
Definition: EDAnalyzerBase.h:119
edm::one::EDAnalyzerBase::createAcquirer
virtual SharedResourcesAcquirer createAcquirer()
Definition: EDAnalyzerBase.cc:68
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::one::EDAnalyzerBase::analyze
virtual void analyze(Event const &, EventSetup const &)=0
Frameworkfwd.h
edm::one::EDAnalyzerBase::globalLuminosityBlocksQueue
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
Definition: EDAnalyzerBase.cc:74
edm::one::EDAnalyzerBase::baseType
static const std::string & baseType()
Definition: EDAnalyzerBase.cc:186
edm::one::EDAnalyzerBase::workerType
std::string workerType() const
Definition: EDAnalyzerBase.h:102
HiBiasedCentrality_cfi.function
function
Definition: HiBiasedCentrality_cfi.py:4
ParameterSetfwd.h
edm::one::EDAnalyzerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDAnalyzerBase.cc:87
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
edm::one::EDAnalyzerBase::globalRunsQueue
virtual SerialTaskQueue * globalRunsQueue()
Definition: EDAnalyzerBase.cc:73
edm::BranchDescription
Definition: BranchDescription.h:32
edm::one::EDAnalyzerBase::doAccessInputProcessBlock
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:96
edm::one::EDAnalyzerBase::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const &, Principal const &) const
Definition: EDAnalyzerBase.h:79
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm::Event
Definition: Event.h:73
edm::ProcessBlock
Definition: ProcessBlock.h:36
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
edm::one::EDAnalyzerBase::wantsProcessBlocks
virtual bool wantsProcessBlocks() const =0
edm::one::EDAnalyzerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:176
edm::one::EDAnalyzerBase
Definition: EDAnalyzerBase.h:46
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29