CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EDAnalyzer.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_EDAnalyzer_h
2 #define FWCore_Framework_EDAnalyzer_h
3 
12 
13 #include <string>
14 
15 // EDAnalyzer is the base class for all analyzer "modules".
16 
17 namespace edm {
18 
19  class ModuleCallingContext;
20  class PreallocationConfiguration;
21  class ActivityRegistry;
22  class ThinnedAssociationsHelper;
23 
24  namespace maker {
25  template <typename T>
27  }
28 
30  public:
31  template <typename T>
32  friend class maker::ModuleHolderT;
33  template <typename T>
34  friend class WorkerT;
36 
37  EDAnalyzer();
38  ~EDAnalyzer() override;
39 
40  std::string workerType() const { return "WorkerT<EDAnalyzer>"; }
41 
42  static void fillDescriptions(ConfigurationDescriptions& descriptions);
43  static const std::string& baseType();
44  static void prevalidate(ConfigurationDescriptions&);
45 
46  // Warning: the returned moduleDescription will be invalid during construction
47  ModuleDescription const& moduleDescription() const { return moduleDescription_; }
48 
49  static bool wantsProcessBlocks() { return false; }
50  static bool wantsInputProcessBlocks() { return false; }
51  static bool wantsGlobalRuns() { return true; }
52  static bool wantsGlobalLuminosityBlocks() { return true; }
53  static bool wantsStreamRuns() { return false; }
54  static bool wantsStreamLuminosityBlocks() { return false; };
55 
56  void callWhenNewProductsRegistered(std::function<void(BranchDescription const&)> const& func);
57 
58  SerialTaskQueue* globalRunsQueue() { return &runQueue_; }
59  SerialTaskQueue* globalLuminosityBlocksQueue() { return &luminosityBlockQueue_; }
60 
61  private:
62  bool doEvent(EventTransitionInfo const&, ActivityRegistry*, ModuleCallingContext const*);
63  //Needed by Worker but not something supported
65 
67  void doBeginJob();
68  void doEndJob();
72  bool doBeginRun(RunTransitionInfo const&, ModuleCallingContext const*);
73  bool doEndRun(RunTransitionInfo const&, ModuleCallingContext const*);
74  bool doBeginLuminosityBlock(LumiTransitionInfo const&, ModuleCallingContext const*);
75  bool doEndLuminosityBlock(LumiTransitionInfo const&, ModuleCallingContext const*);
76  void doRespondToOpenInputFile(FileBlock const& fb);
77  void doRespondToCloseInputFile(FileBlock const& fb);
80 
81  void registerProductsAndCallbacks(EDAnalyzer const*, ProductRegistry* reg);
82 
83  SharedResourcesAcquirer& sharedResourcesAcquirer() { return resourceAcquirer_; }
84 
85  virtual void analyze(Event const&, EventSetup const&) = 0;
86  virtual void beginJob() {}
87  virtual void endJob() {}
88  virtual void beginRun(Run const&, EventSetup const&) {}
89  virtual void endRun(Run const&, EventSetup const&) {}
90  virtual void beginLuminosityBlock(LuminosityBlock const&, EventSetup const&) {}
91  virtual void endLuminosityBlock(LuminosityBlock const&, EventSetup const&) {}
92  virtual void respondToOpenInputFile(FileBlock const&) {}
93  virtual void respondToCloseInputFile(FileBlock const&) {}
94 
95  bool hasAcquire() const { return false; }
96  bool hasAccumulator() const { return false; }
97 
98  void setModuleDescription(ModuleDescription const& md) { moduleDescription_ = md; }
101 
104 
105  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
106  };
107 } // namespace edm
108 
109 #endif
virtual void beginJob()
Definition: EDAnalyzer.h:86
virtual void endLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Definition: EDAnalyzer.h:91
std::string workerType() const
Definition: EDAnalyzer.h:40
void doRespondToCloseOutputFile()
Definition: EDAnalyzer.h:78
virtual void respondToCloseInputFile(FileBlock const &)
Definition: EDAnalyzer.h:93
static bool wantsProcessBlocks()
Definition: EDAnalyzer.h:49
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t Func __host__ __device__ V int Func func
virtual void beginRun(Run const &, EventSetup const &)
Definition: EDAnalyzer.h:88
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzer.h:71
SharedResourcesAcquirer resourceAcquirer_
Definition: EDAnalyzer.h:100
virtual void beginLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Definition: EDAnalyzer.h:90
SerialTaskQueue runQueue_
Definition: EDAnalyzer.h:102
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const &, Principal const &) const
Definition: EDAnalyzer.h:64
ModuleDescription const & moduleDescription() const
Definition: EDAnalyzer.h:47
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: EDAnalyzer.h:105
string function
Definition: callgraph.py:50
#define CMS_DEPRECATED
virtual void endJob()
Definition: EDAnalyzer.h:87
void doPreallocate(PreallocationConfiguration const &)
Definition: EDAnalyzer.h:66
ModuleDescription moduleDescription_
Definition: EDAnalyzer.h:99
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzer.h:70
EDAnalyzer ModuleType
Definition: EDAnalyzer.h:35
SerialTaskQueue * globalLuminosityBlocksQueue()
Definition: EDAnalyzer.h:59
SerialTaskQueue * globalRunsQueue()
Definition: EDAnalyzer.h:58
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static bool wantsStreamLuminosityBlocks()
Definition: EDAnalyzer.h:54
virtual void respondToOpenInputFile(FileBlock const &)
Definition: EDAnalyzer.h:92
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: EDAnalyzer.h:79
bool hasAcquire() const
Definition: EDAnalyzer.h:95
bool hasAccumulator() const
Definition: EDAnalyzer.h:96
static bool wantsGlobalLuminosityBlocks()
Definition: EDAnalyzer.h:52
virtual void endRun(Run const &, EventSetup const &)
Definition: EDAnalyzer.h:89
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDAnalyzer.h:69
SerialTaskQueue luminosityBlockQueue_
Definition: EDAnalyzer.h:103
static bool wantsInputProcessBlocks()
Definition: EDAnalyzer.h:50
static bool wantsGlobalRuns()
Definition: EDAnalyzer.h:51
static bool wantsStreamRuns()
Definition: EDAnalyzer.h:53
SharedResourcesAcquirer & sharedResourcesAcquirer()
Definition: EDAnalyzer.h:83
Definition: Run.h:45
void setModuleDescription(ModuleDescription const &md)
Definition: EDAnalyzer.h:98