PhysicsTools
UtilAlgos
interface
EDAnalyzerWrapper.h
Go to the documentation of this file.
1
#ifndef PhysicsTools_UtilAlgos_interface_EDAnalyzerWrapper_h
2
#define PhysicsTools_UtilAlgos_interface_EDAnalyzerWrapper_h
3
4
#include "
FWCore/Framework/interface/Event.h
"
5
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
6
#include "
FWCore/ServiceRegistry/interface/Service.h
"
7
#include "
CommonTools/UtilAlgos/interface/TFileService.h
"
8
41
namespace
edm
{
42
43
template
<
class
T>
44
class
AnalyzerWrapper
:
public
EDAnalyzer
{
45
public
:
47
AnalyzerWrapper
(
const
edm::ParameterSet
&
cfg
);
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>
64
AnalyzerWrapper<T>::AnalyzerWrapper
(
const
edm::ParameterSet
&
cfg
) {
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
edm
HLT enums.
Definition:
AlignableModifier.h:19
TFileService::tFileDirectory
TFileDirectory & tFileDirectory()
Definition:
TFileService.h:42
edm::AnalyzerWrapper::AnalyzerWrapper
AnalyzerWrapper(const edm::ParameterSet &cfg)
default contructor
Definition:
EDAnalyzerWrapper.h:64
EDAnalyzer.h
edm::AnalyzerWrapper::beginJob
void beginJob() override
everything which has to be done before the event loop
Definition:
EDAnalyzerWrapper.h:51
edm::AnalyzerWrapper::~AnalyzerWrapper
~AnalyzerWrapper() override
default destructor
Definition:
EDAnalyzerWrapper.h:49
edm::AnalyzerWrapper::analyzer_
std::shared_ptr< T > analyzer_
shared pointer to analysis class of type BasicAnalyzer
Definition:
EDAnalyzerWrapper.h:59
edm::EDAnalyzer
Definition:
EDAnalyzer.h:28
edm::AnalyzerWrapper::analyze
void analyze(edm::Event const &event, const edm::EventSetup &eventSetup) override
everything which has to be done during the event loop. NOTE: We can't use the eventSetup in FWLite so...
Definition:
EDAnalyzerWrapper.h:53
Service.h
TFileService.h
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
edm::Service< TFileService >
edm::EventSetup
Definition:
EventSetup.h:58
looper.cfg
cfg
Definition:
looper.py:297
T
long double T
Definition:
Basic3DVectorLD.h:48
edm::AnalyzerWrapper
Definition:
EDAnalyzerWrapper.h:44
event
Definition:
event.py:1
edm::Event
Definition:
Event.h:73
edm::AnalyzerWrapper::endJob
void endJob() override
everything which has to be done after the event loop
Definition:
EDAnalyzerWrapper.h:55
Generated for CMSSW Reference Manual by
1.8.16