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 
11 
12 #include <string>
13 
14 // EDAnalyzer is the base class for all analyzer "modules".
15 
16 namespace edm {
17 
18  class ModuleCallingContext;
19  class PreallocationConfiguration;
20  class ActivityRegistry;
21  class ThinnedAssociationsHelper;
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*);
75  void doRespondToOpenInputFile(FileBlock const& fb);
76  void doRespondToCloseInputFile(FileBlock const& fb);
79 
81 
83 
84  virtual void analyze(Event const&, EventSetup const&) = 0;
85  virtual void beginJob() {}
86  virtual void endJob() {}
87  virtual void beginRun(Run const&, EventSetup const&) {}
88  virtual void endRun(Run const&, EventSetup const&) {}
89  virtual void beginLuminosityBlock(LuminosityBlock const&, EventSetup const&) {}
90  virtual void endLuminosityBlock(LuminosityBlock const&, EventSetup const&) {}
91  virtual void respondToOpenInputFile(FileBlock const&) {}
92  virtual void respondToCloseInputFile(FileBlock const&) {}
93 
94  bool hasAcquire() const { return false; }
95  bool hasAccumulator() const { return false; }
96 
100 
103 
105  };
106 } // namespace edm
107 
108 #endif
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
edm::EDAnalyzer::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzer.cc:99
edm::SharedResourcesAcquirer
Definition: SharedResourcesAcquirer.h:34
edm::EDAnalyzer::wantsProcessBlocks
static bool wantsProcessBlocks()
Definition: EDAnalyzer.h:48
edm::EDAnalyzer::doEndJob
void doEndJob()
Definition: EDAnalyzer.cc:51
edm::EDAnalyzer::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDAnalyzer.cc:32
edm::EDAnalyzer::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDAnalyzer.h:97
edm::EDAnalyzer::sharedResourcesAcquirer
SharedResourcesAcquirer & sharedResourcesAcquirer()
Definition: EDAnalyzer.h:82
edm::EDAnalyzer::beginJob
virtual void beginJob()
Definition: EDAnalyzer.h:85
edm::EDAnalyzer::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzer.cc:107
ActivityRegistry
edm::LumiTransitionInfo
Definition: TransitionInfoTypes.h:42
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
WaitingTaskHolder.h
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:101
edm::EDAnalyzer::respondToCloseInputFile
virtual void respondToCloseInputFile(FileBlock const &)
Definition: EDAnalyzer.h:92
edm::Principal
Definition: Principal.h:56
edm::SerialTaskQueue
Definition: SerialTaskQueue.h:67
edm::EDAnalyzer::~EDAnalyzer
~EDAnalyzer() override
Definition: EDAnalyzer.cc:27
edm::EDAnalyzer::EDAnalyzer
EDAnalyzer()
Definition: EDAnalyzer.cc:28
edm::EDAnalyzer::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzer.cc:101
edm::WorkerT
Definition: Frameworkfwd.h:63
edm::EDAnalyzer::baseType
static const std::string & baseType()
Definition: EDAnalyzer.cc:125
edm::RunTransitionInfo
Definition: TransitionInfoTypes.h:64
edm::ProcessBlockPrincipal
Definition: ProcessBlockPrincipal.h:22
edm::EDAnalyzer::doRespondToCloseOutputFile
void doRespondToCloseOutputFile()
Definition: EDAnalyzer.h:77
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:99
edm::EDAnalyzer::beginLuminosityBlock
virtual void beginLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Definition: EDAnalyzer.h:89
edm::FileBlock
Definition: FileBlock.h:22
SharedResourcesAcquirer.h
edm::EDConsumerBase
Definition: EDConsumerBase.h:71
edm::EDAnalyzer::endJob
virtual void endJob()
Definition: EDAnalyzer.h:86
SerialTaskQueue.h
edm::EDAnalyzer::hasAcquire
bool hasAcquire() const
Definition: EDAnalyzer.h:94
edm::EDAnalyzer::hasAccumulator
bool hasAccumulator() const
Definition: EDAnalyzer.h:95
edm::EDAnalyzer::beginRun
virtual void beginRun(Run const &, EventSetup const &)
Definition: EDAnalyzer.h:87
edm::EDAnalyzer::workerType
std::string workerType() const
Definition: EDAnalyzer.h:39
edm::ActivityRegistry
Definition: ActivityRegistry.h:134
edm::maker::ModuleHolderT
Definition: EDAnalyzer.h:25
edm::EDAnalyzer::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDAnalyzer.h:65
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
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:113
edm::EDAnalyzer::respondToOpenInputFile
virtual void respondToOpenInputFile(FileBlock const &)
Definition: EDAnalyzer.h:91
EDConsumerBase.h
edm::WaitingTaskHolder
Definition: WaitingTaskHolder.h:32
edm::EDAnalyzer::doBeginJob
void doBeginJob()
Definition: EDAnalyzer.cc:44
edm::EDAnalyzer::callWhenNewProductsRegistered_
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: EDAnalyzer.h:104
edm::EDAnalyzer::endRun
virtual void endRun(Run const &, EventSetup const &)
Definition: EDAnalyzer.h:88
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:53
edm::EDAnalyzer::doEndLuminosityBlock
bool doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzer.cc:86
edm::EDAnalyzer::moduleDescription
ModuleDescription const & moduleDescription() const
Definition: EDAnalyzer.h:46
edm::EventSetup
Definition: EventSetup.h:58
edm::EDAnalyzer::doEndRun
bool doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzer.cc:63
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
edm::EDAnalyzer::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const &, Principal const &) const
Definition: EDAnalyzer.h:63
edm::EDAnalyzer::globalLuminosityBlocksQueue
SerialTaskQueue * globalLuminosityBlocksQueue()
Definition: EDAnalyzer.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::EDAnalyzer::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzer.h:98
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
Frameworkfwd.h
edm::EDAnalyzer::luminosityBlockQueue_
SerialTaskQueue luminosityBlockQueue_
Definition: EDAnalyzer.h:102
edm::EDAnalyzer::callWhenNewProductsRegistered
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: EDAnalyzer.cc:103
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:115
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:78
edm::EDAnalyzer::wantsInputProcessBlocks
static bool wantsInputProcessBlocks()
Definition: EDAnalyzer.h:49
edm::EDAnalyzer::endLuminosityBlock
virtual void endLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Definition: EDAnalyzer.h:90
edm::EDAnalyzer::wantsGlobalRuns
static bool wantsGlobalRuns()
Definition: EDAnalyzer.h:50
edm::EDAnalyzer::doBeginLuminosityBlock
bool doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzer.cc:73
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
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29