CMS 3D CMS Logo

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 one::EDAnalyzer<one::SharedResources> {
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  usesResource(TFileService::kSharedResource);
66  // defined TFileService
67  edm::Service<TFileService> fileService;
68  // create analysis class of type BasicAnalyzer
69  analyzer_ = std::shared_ptr<T>(new T(cfg, fileService->tFileDirectory(), consumesCollector()));
70  }
71 
72 } // namespace edm
73 
74 #endif
static const std::string kSharedResource
Definition: TFileService.h:76
TFileDirectory & tFileDirectory()
Definition: TFileService.h:42
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
HLT enums.
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
Definition: event.py:1