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
29 
30 // forward declarations
31 namespace edm {
32 
33  class ModuleCallingContext;
34  class PreallocationConfiguration;
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 one {
46 
47  class EDAnalyzerBase : public EDConsumerBase {
48  public:
49  template <typename T>
50  friend class edm::WorkerT;
51  template <typename T>
53 
55 
57  ~EDAnalyzerBase() override;
58 
59  static void fillDescriptions(ConfigurationDescriptions& descriptions);
60  static void prevalidate(ConfigurationDescriptions& descriptions);
61  static const std::string& baseType();
62 
63  // Warning: the returned moduleDescription will be invalid during construction
65 
66  virtual bool wantsGlobalRuns() const = 0;
67  virtual bool wantsGlobalLuminosityBlocks() const = 0;
68  bool wantsStreamRuns() const { return false; }
69  bool wantsStreamLuminosityBlocks() const { return false; };
70 
74 
75  private:
77  //For now this is a placeholder
78  /*virtual*/ void preActionBeforeRunEventAsync(WaitingTask* iTask,
79  ModuleCallingContext const& iModuleCallingContext,
80  Principal const& iPrincipal) const {}
81 
83  virtual void preallocLumis(unsigned int);
84  void doBeginJob();
85  void doEndJob();
86 
87  void doBeginRun(RunPrincipal const& rp, EventSetupImpl const& c, ModuleCallingContext const*);
88  void doEndRun(RunPrincipal const& rp, EventSetupImpl const& c, ModuleCallingContext const*);
90  EventSetupImpl const& c,
91  ModuleCallingContext const*);
93  EventSetupImpl const& c,
94  ModuleCallingContext const*);
95 
96  //For now, the following are just dummy implemenations 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 doBeginRun_(Run const& rp, EventSetup const& c);
111  virtual void doEndRun_(Run const& rp, EventSetup const& c);
112  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
113  virtual void doEndLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
114 
115  bool hasAcquire() const { return false; }
116  bool hasAccumulator() const { return false; }
117 
119 
123 
125  };
126  } // namespace one
127 } // namespace edm
128 #endif
edm::SharedResourcesAcquirer
Definition: SharedResourcesAcquirer.h:34
edm::one::EDAnalyzerBase::wantsStreamLuminosityBlocks
bool wantsStreamLuminosityBlocks() const
Definition: EDAnalyzerBase.h:69
edm::one::EDAnalyzerBase::doEndJob
void doEndJob()
Definition: EDAnalyzerBase.cc:78
edm::one::EDAnalyzerBase::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTask *iTask, ModuleCallingContext const &iModuleCallingContext, Principal const &iPrincipal) const
Definition: EDAnalyzerBase.h:78
ActivityRegistry
edm::EventSetupImpl
Definition: EventSetupImpl.h:44
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::one::EDAnalyzerBase::moduleDescription
ModuleDescription const & moduleDescription() const
Definition: EDAnalyzerBase.h:64
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::one::EDAnalyzerBase::~EDAnalyzerBase
~EDAnalyzerBase() override
Definition: EDAnalyzerBase.cc:45
edm::one::EDAnalyzerBase::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDAnalyzerBase const *module, ProductRegistry *reg)
Definition: EDAnalyzerBase.cc:154
edm::one::EDAnalyzerBase::ModuleType
EDAnalyzerBase ModuleType
Definition: EDAnalyzerBase.h:54
edm::LuminosityBlockPrincipal
Definition: LuminosityBlockPrincipal.h:31
edm::one::EDAnalyzerBase::callWhenNewProductsRegistered_
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: EDAnalyzerBase.h:122
edm::Principal
Definition: Principal.h:57
edm::SerialTaskQueue
Definition: SerialTaskQueue.h:67
edm::one::EDAnalyzerBase::doBeginJob
void doBeginJob()
Definition: EDAnalyzerBase.cc:72
edm::WorkerT
Definition: Frameworkfwd.h:54
edm::one::EDAnalyzerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzerBase.h:121
edm::one::EDAnalyzerBase::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: EDAnalyzerBase.cc:47
edm::one::EDAnalyzerBase::doEndRun
void doEndRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:94
edm::one::EDAnalyzerBase::resourcesAcquirer_
SharedResourcesAcquirer resourcesAcquirer_
Definition: EDAnalyzerBase.h:124
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::one::EDAnalyzerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:137
edm::ProductRegistry
Definition: ProductRegistry.h:34
ModuleDescription.h
edm::FileBlock
Definition: FileBlock.h:20
SharedResourcesAcquirer.h
edm::one::EDAnalyzerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:129
edm::EDConsumerBase
Definition: EDConsumerBase.h:62
edm::one::EDAnalyzerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:139
edm::EventPrincipal
Definition: EventPrincipal.h:46
WaitingTask
edm::one::EDAnalyzerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzerBase.cc:133
edm::one::EDAnalyzerBase::wantsStreamRuns
bool wantsStreamRuns() const
Definition: EDAnalyzerBase.h:68
edm::one::EDAnalyzerBase::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDAnalyzerBase.h:120
edm::ActivityRegistry
Definition: ActivityRegistry.h:132
edm::one::EDAnalyzerBase::beginJob
virtual void beginJob()
Definition: EDAnalyzerBase.h:107
edm::one::EDAnalyzerBase::EDAnalyzerBase
EDAnalyzerBase()
Definition: EDAnalyzerBase.cc:43
edm::maker::ModuleHolderT
Definition: EDAnalyzer.h:26
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:80
edm::one::EDAnalyzerBase::sharedResourcesAcquirer
SharedResourcesAcquirer & sharedResourcesAcquirer()
Definition: EDAnalyzerBase.h:104
edm::one::EDAnalyzerBase::wantsGlobalRuns
virtual bool wantsGlobalRuns() const =0
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:35
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:138
edm::one::EDAnalyzerBase::endJob
virtual void endJob()
Definition: EDAnalyzerBase.h:108
edm::one::EDAnalyzerBase::hasAcquire
bool hasAcquire() const
Definition: EDAnalyzerBase.h:115
EDConsumerBase.h
edm::one::EDAnalyzerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:148
edm::one::EDAnalyzerBase::doRegisterThinnedAssociations
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: EDAnalyzerBase.h:99
edm::EventSetup
Definition: EventSetup.h:57
edm::one::EDAnalyzerBase::doEndLuminosityBlock_
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDAnalyzerBase.cc:140
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
module
Definition: vlib.h:198
edm::one::EDAnalyzerBase::hasAccumulator
bool hasAccumulator() const
Definition: EDAnalyzerBase.h:116
edm::one::EDAnalyzerBase::createAcquirer
virtual SharedResourcesAcquirer createAcquirer()
Definition: EDAnalyzerBase.cc:64
edm::one::EDAnalyzerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:116
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::one::EDAnalyzerBase::analyze
virtual void analyze(Event const &, EventSetup const &)=0
edm::WaitingTask
Definition: WaitingTask.h:36
edm::one::EDAnalyzerBase::doEvent
bool doEvent(EventPrincipal const &ep, EventSetupImpl const &c, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:51
Frameworkfwd.h
edm::one::EDAnalyzerBase::globalLuminosityBlocksQueue
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
Definition: EDAnalyzerBase.cc:70
edm::one::EDAnalyzerBase::doBeginRun
void doBeginRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:85
edm::one::EDAnalyzerBase::baseType
static const std::string & baseType()
Definition: EDAnalyzerBase.cc:152
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:83
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:29
edm::one::EDAnalyzerBase::globalRunsQueue
virtual SerialTaskQueue * globalRunsQueue()
Definition: EDAnalyzerBase.cc:69
edm::BranchDescription
Definition: BranchDescription.h:32
edm::RunPrincipal
Definition: RunPrincipal.h:34
edm::Event
Definition: Event.h:73
edm::one::EDAnalyzerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDAnalyzerBase.cc:103
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
edm::one::EDAnalyzerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzerBase.cc:142
edm::one::EDAnalyzerBase
Definition: EDAnalyzerBase.h:47
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29