CMS 3D CMS Logo

EDAnalyzer.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_EDAnalyzer_h
2 #define FWCore_Framework_EDAnalyzer_h
3 
10 
11 #include <string>
12 
13 // EDAnalyzer is the base class for all analyzer "modules".
14 
15 namespace edm {
16 
17  class ModuleCallingContext;
18  class PreallocationConfiguration;
19  class ActivityRegistry;
20  class ThinnedAssociationsHelper;
21  class WaitingTask;
22 
23  namespace maker {
24  template <typename T>
26  }
27 
28  class EDAnalyzer : public EDConsumerBase {
29  public:
30  template <typename T>
31  friend class maker::ModuleHolderT;
32  template <typename T>
33  friend class WorkerT;
35 
36  EDAnalyzer();
37  ~EDAnalyzer() override;
38 
39  std::string workerType() const { return "WorkerT<EDAnalyzer>"; }
40 
41  static void fillDescriptions(ConfigurationDescriptions& descriptions);
42  static const std::string& baseType();
44 
45  // Warning: the returned moduleDescription will be invalid during construction
47 
48  static bool wantsProcessBlocks() { return false; }
49  static bool wantsInputProcessBlocks() { return false; }
50  static bool wantsGlobalRuns() { return true; }
51  static bool wantsGlobalLuminosityBlocks() { return true; }
52  static bool wantsStreamRuns() { return false; }
53  static bool wantsStreamLuminosityBlocks() { return false; };
54 
56 
59 
60  private:
62  //Needed by Worker but not something supported
64 
66  void doBeginJob();
67  void doEndJob();
72  bool doEndRun(RunTransitionInfo const&, ModuleCallingContext const*);
78 
80 
82 
83  virtual void analyze(Event const&, EventSetup const&) = 0;
84  virtual void beginJob() {}
85  virtual void endJob() {}
86  virtual void beginRun(Run const&, EventSetup const&) {}
87  virtual void endRun(Run const&, EventSetup const&) {}
88  virtual void beginLuminosityBlock(LuminosityBlock const&, EventSetup const&) {}
89  virtual void endLuminosityBlock(LuminosityBlock const&, EventSetup const&) {}
90  virtual void respondToOpenInputFile(FileBlock const&) {}
91  virtual void respondToCloseInputFile(FileBlock const&) {}
92 
93  bool hasAcquire() const { return false; }
94  bool hasAccumulator() const { return false; }
95 
99 
102 
104  };
105 } // namespace edm
106 
107 #endif
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
edm::EDAnalyzer::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzer.cc:90
edm::SharedResourcesAcquirer
Definition: SharedResourcesAcquirer.h:34
edm::EDAnalyzer::wantsProcessBlocks
static bool wantsProcessBlocks()
Definition: EDAnalyzer.h:48
edm::EDAnalyzer::doEndJob
void doEndJob()
Definition: EDAnalyzer.cc:48
edm::EDAnalyzer::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDAnalyzer.cc:31
edm::EDAnalyzer::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDAnalyzer.h:96
edm::EDAnalyzer::sharedResourcesAcquirer
SharedResourcesAcquirer & sharedResourcesAcquirer()
Definition: EDAnalyzer.h:81
edm::EDAnalyzer::beginJob
virtual void beginJob()
Definition: EDAnalyzer.h:84
edm::EDAnalyzer::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzer.cc:98
ActivityRegistry
edm::LumiTransitionInfo
Definition: TransitionInfoTypes.h:42
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
edm::EDAnalyzer::analyze
virtual void analyze(Event const &, EventSetup const &)=0
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::EDAnalyzer::runQueue_
SerialTaskQueue runQueue_
Definition: EDAnalyzer.h:100
edm::EDAnalyzer::respondToCloseInputFile
virtual void respondToCloseInputFile(FileBlock const &)
Definition: EDAnalyzer.h:91
edm::Principal
Definition: Principal.h:57
edm::SerialTaskQueue
Definition: SerialTaskQueue.h:67
edm::EDAnalyzer::~EDAnalyzer
~EDAnalyzer() override
Definition: EDAnalyzer.cc:26
edm::EDAnalyzer::EDAnalyzer
EDAnalyzer()
Definition: EDAnalyzer.cc:27
edm::EDAnalyzer::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzer.cc:92
edm::WorkerT
Definition: Frameworkfwd.h:62
edm::EDAnalyzer::baseType
static const std::string & baseType()
Definition: EDAnalyzer.cc:116
edm::RunTransitionInfo
Definition: TransitionInfoTypes.h:64
edm::ProcessBlockPrincipal
Definition: ProcessBlockPrincipal.h:22
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::EDAnalyzer::doEndProcessBlock
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzer.h:70
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
edm::ProductRegistry
Definition: ProductRegistry.h:37
ModuleDescription.h
edm::EDAnalyzer::resourceAcquirer_
SharedResourcesAcquirer resourceAcquirer_
Definition: EDAnalyzer.h:98
edm::EDAnalyzer::beginLuminosityBlock
virtual void beginLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Definition: EDAnalyzer.h:88
edm::FileBlock
Definition: FileBlock.h:20
SharedResourcesAcquirer.h
edm::EDConsumerBase
Definition: EDConsumerBase.h:70
edm::EDAnalyzer::endJob
virtual void endJob()
Definition: EDAnalyzer.h:85
edm::EDAnalyzer::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTask *, ModuleCallingContext const &, Principal const &) const
Definition: EDAnalyzer.h:63
SerialTaskQueue.h
edm::EDAnalyzer::hasAcquire
bool hasAcquire() const
Definition: EDAnalyzer.h:93
WaitingTask
edm::EDAnalyzer::hasAccumulator
bool hasAccumulator() const
Definition: EDAnalyzer.h:94
edm::EDAnalyzer::beginRun
virtual void beginRun(Run const &, EventSetup const &)
Definition: EDAnalyzer.h:86
edm::EDAnalyzer::workerType
std::string workerType() const
Definition: EDAnalyzer.h:39
edm::ActivityRegistry
Definition: ActivityRegistry.h:133
edm::maker::ModuleHolderT
Definition: EDAnalyzer.h:25
edm::EDAnalyzer::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDAnalyzer.h:65
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::EDAnalyzer::doAccessInputProcessBlock
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzer.h:69
edm::EDAnalyzer::wantsStreamLuminosityBlocks
static bool wantsStreamLuminosityBlocks()
Definition: EDAnalyzer.h:53
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:37
edm::EDAnalyzer::prevalidate
static void prevalidate(ConfigurationDescriptions &)
Definition: EDAnalyzer.cc:104
edm::EDAnalyzer::respondToOpenInputFile
virtual void respondToOpenInputFile(FileBlock const &)
Definition: EDAnalyzer.h:90
EDConsumerBase.h
edm::EDAnalyzer::doBeginJob
void doBeginJob()
Definition: EDAnalyzer.cc:41
edm::EDAnalyzer::callWhenNewProductsRegistered_
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: EDAnalyzer.h:103
edm::EDAnalyzer::endRun
virtual void endRun(Run const &, EventSetup const &)
Definition: EDAnalyzer.h:87
edm::EDAnalyzer::wantsGlobalLuminosityBlocks
static bool wantsGlobalLuminosityBlocks()
Definition: EDAnalyzer.h:51
edm::EDAnalyzer::ModuleType
EDAnalyzer ModuleType
Definition: EDAnalyzer.h:34
edm::EDAnalyzer::doBeginRun
bool doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzer.cc:50
edm::EDAnalyzer::doEndLuminosityBlock
bool doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzer.cc:79
edm::EDAnalyzer::moduleDescription
ModuleDescription const & moduleDescription() const
Definition: EDAnalyzer.h:46
edm::EventSetup
Definition: EventSetup.h:57
edm::EDAnalyzer::doEndRun
bool doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzer.cc:59
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
edm::EDAnalyzer::globalLuminosityBlocksQueue
SerialTaskQueue * globalLuminosityBlocksQueue()
Definition: EDAnalyzer.h:58
edm::EDAnalyzer::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzer.h:97
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::WaitingTask
Definition: WaitingTask.h:36
Frameworkfwd.h
edm::EDAnalyzer::luminosityBlockQueue_
SerialTaskQueue luminosityBlockQueue_
Definition: EDAnalyzer.h:101
edm::EDAnalyzer::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: EDAnalyzer.cc:94
edm::EDAnalyzer::globalRunsQueue
SerialTaskQueue * globalRunsQueue()
Definition: EDAnalyzer.h:57
HiBiasedCentrality_cfi.function
function
Definition: HiBiasedCentrality_cfi.py:4
ParameterSetfwd.h
edm::EDAnalyzer::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDAnalyzer const *, ProductRegistry *reg)
Definition: EDAnalyzer.cc:106
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
edm::BranchDescription
Definition: BranchDescription.h:32
edm::EDAnalyzer::doRegisterThinnedAssociations
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: EDAnalyzer.h:77
edm::EDAnalyzer::wantsInputProcessBlocks
static bool wantsInputProcessBlocks()
Definition: EDAnalyzer.h:49
edm::EDAnalyzer::endLuminosityBlock
virtual void endLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Definition: EDAnalyzer.h:89
edm::EDAnalyzer::wantsGlobalRuns
static bool wantsGlobalRuns()
Definition: EDAnalyzer.h:50
edm::EDAnalyzer::doBeginLuminosityBlock
bool doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzer.cc:68
edm::Event
Definition: Event.h:73
edm::EDAnalyzer::doBeginProcessBlock
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzer.h:68
edm::EDAnalyzer::wantsStreamRuns
static bool wantsStreamRuns()
Definition: EDAnalyzer.h:52
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29