Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
TopQuarkAnalysis
Examples
plugins
TopGenEventAnalyzer.cc
Go to the documentation of this file.
1
#include "
AnalysisDataFormats/TopObjects/interface/TtGenEvent.h
"
2
#include "
TopQuarkAnalysis/Examples/plugins/TopGenEventAnalyzer.h
"
3
4
TopGenEventAnalyzer::TopGenEventAnalyzer
(
const
edm::ParameterSet
& cfg):
5
inputGenEvent_(cfg.getParameter<edm::InputTag>(
"genEvent"
))
6
{
7
edm::Service<TFileService>
fs;
8
nLep_
= fs->
make
<TH1F>(
"nLep"
,
"N(Lepton)"
, 5, 0., 5.);
9
topPt_
= fs->
make
<TH1F>(
"topPt"
,
"pt (top)"
, 100, 0., 500.);
10
topEta_
= fs->
make
<TH1F>(
"topEta"
,
"eta(top)"
, 40, -5., 5.);
11
topPhi_
= fs->
make
<TH1F>(
"topPhi"
,
"phi(top)"
, 60, -3.5, 3.5);
12
topBarPt_
= fs->
make
<TH1F>(
"topBarPt"
,
"pt (topBar)"
, 100, 0., 500.);
13
topBarEta_
= fs->
make
<TH1F>(
"topBarEta"
,
"eta(topBar)"
, 40, -5., 5.);
14
topBarPhi_
= fs->
make
<TH1F>(
"topBarPhi"
,
"phi(topBar)"
, 60, -3.5, 3.5);
15
ttbarPt_
= fs->
make
<TH1F>(
"ttbarPt"
,
"pt (ttbar)"
, 100, 0., 500.);
16
ttbarEta_
= fs->
make
<TH1F>(
"ttbarEta"
,
"eta(ttbar)"
, 40, -5., 5.);
17
ttbarPhi_
= fs->
make
<TH1F>(
"ttbarPhi"
,
"phi(ttbar)"
, 60, -3.5, 3.5);
18
}
19
20
TopGenEventAnalyzer::~TopGenEventAnalyzer
()
21
{
22
}
23
24
void
25
TopGenEventAnalyzer::analyze
(
const
edm::Event
& evt,
const
edm::EventSetup
& setup)
26
{
27
edm::Handle<TtGenEvent>
genEvent
;
28
evt.
getByLabel
(
inputGenEvent_
, genEvent);
29
30
// fill BR's
31
nLep_
->Fill(genEvent->numberOfLeptons());
32
33
//fill top kinematic
34
topPt_
->Fill(genEvent->top ()->pt ());
35
topEta_
->Fill(genEvent->top ()->eta());
36
topPhi_
->Fill(genEvent->top ()->phi());
37
topBarPt_
->Fill(genEvent->topBar()->pt ());
38
topBarEta_
->Fill(genEvent->topBar()->eta());
39
topBarPhi_
->Fill(genEvent->topBar()->phi());
40
41
//fill ttbar kinematics
42
reco::Particle::LorentzVector
p4
= genEvent->top()->p4()+genEvent->topBar()->p4();
43
ttbarPt_
->Fill(p4.pt() );
44
ttbarEta_
->Fill(p4.eta());
45
ttbarPhi_
->Fill(p4.phi());
46
}
47
48
void
TopGenEventAnalyzer::beginJob
()
49
{
50
}
51
52
void
TopGenEventAnalyzer::endJob
()
53
{
54
}
edm::Service< TFileService >
TopGenEventAnalyzer::TopGenEventAnalyzer
TopGenEventAnalyzer(const edm::ParameterSet &)
Definition:
TopGenEventAnalyzer.cc:4
TopGenEventAnalyzer::topPhi_
TH1F * topPhi_
Definition:
TopGenEventAnalyzer.h:32
TopGenEventAnalyzer::ttbarPt_
TH1F * ttbarPt_
Definition:
TopGenEventAnalyzer.h:36
TopGenEventAnalyzer.h
TopGenEventAnalyzer::inputGenEvent_
edm::InputTag inputGenEvent_
Definition:
TopGenEventAnalyzer.h:27
TopGenEventAnalyzer::beginJob
virtual void beginJob()
Definition:
TopGenEventAnalyzer.cc:48
TtGenEvent.h
TopGenEventAnalyzer::ttbarPhi_
TH1F * ttbarPhi_
Definition:
TopGenEventAnalyzer.h:38
edm::Handle
Definition:
AssociativeIterator.h:48
TopGenEventAnalyzer::topBarPt_
TH1F * topBarPt_
Definition:
TopGenEventAnalyzer.h:33
p4
double p4[4]
Definition:
TauolaWrapper.h:92
TopGenEventAnalyzer::analyze
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition:
TopGenEventAnalyzer.cc:25
MCTruth.genEvent
tuple genEvent
Definition:
MCTruth.py:33
edm::EventSetup
Definition:
EventSetup.h:44
TopGenEventAnalyzer::topPt_
TH1F * topPt_
Definition:
TopGenEventAnalyzer.h:30
TopGenEventAnalyzer::endJob
virtual void endJob()
Definition:
TopGenEventAnalyzer.cc:52
TopGenEventAnalyzer::~TopGenEventAnalyzer
~TopGenEventAnalyzer()
Definition:
TopGenEventAnalyzer.cc:20
edm::Event::getByLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition:
Event.h:359
TopGenEventAnalyzer::topEta_
TH1F * topEta_
Definition:
TopGenEventAnalyzer.h:31
TopGenEventAnalyzer::nLep_
TH1F * nLep_
Definition:
TopGenEventAnalyzer.h:29
TopGenEventAnalyzer::topBarPhi_
TH1F * topBarPhi_
Definition:
TopGenEventAnalyzer.h:35
TopGenEventAnalyzer::ttbarEta_
TH1F * ttbarEta_
Definition:
TopGenEventAnalyzer.h:37
TFileDirectory::make
T * make() const
make new ROOT object
Definition:
TFileDirectory.h:59
edm::ParameterSet
Definition:
ParameterSet.h:31
TopGenEventAnalyzer::topBarEta_
TH1F * topBarEta_
Definition:
TopGenEventAnalyzer.h:34
edm::Event
Definition:
Event.h:49
reco::Particle::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition:
Particle.h:26
Generated for CMSSW Reference Manual by
1.8.5