CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EDAnalyzerWrapper.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_UtilAlgos_interface_EDAnalyzerWrapper_h
2 #define PhysicsTools_UtilAlgos_interface_EDAnalyzerWrapper_h
3 
8 
41 namespace edm {
42 
43  template <class T>
44  class AnalyzerWrapper : public EDAnalyzer {
45  public:
49  ~AnalyzerWrapper() override{};
51  void beginJob() override { analyzer_->beginJob(); }
53  void analyze(edm::Event const& event, const edm::EventSetup& eventSetup) override { analyzer_->analyze(event); }
55  void endJob() override { analyzer_->endJob(); }
56 
57  protected:
59  std::shared_ptr<T> analyzer_;
60  };
61 
63  template <class T>
65  // defined TFileService
66  edm::Service<TFileService> fileService;
67  // create analysis class of type BasicAnalyzer
68  analyzer_ = std::shared_ptr<T>(new T(cfg, fileService->tFileDirectory(), consumesCollector()));
69  }
70 
71 } // namespace edm
72 
73 #endif
tuple cfg
Definition: looper.py:296
TFileDirectory & tFileDirectory()
Definition: TFileService.h:42
dictionary analyzer_
void endJob() override
everything which has to be done after the event loop
~AnalyzerWrapper() override
default destructor
AnalyzerWrapper(const edm::ParameterSet &cfg)
default contructor
void beginJob() override
everything which has to be done before the event loop
std::shared_ptr< T > analyzer_
shared pointer to analysis class of type BasicAnalyzer
void analyze(edm::Event const &event, const edm::EventSetup &eventSetup) override
everything which has to be done during the event loop. NOTE: We can&#39;t use the eventSetup in FWLite so...
long double T