CMS 3D CMS Logo

TopGenEventAnalyzer.cc
Go to the documentation of this file.
2 
4  : inputGenEventToken_(consumes<TtGenEvent>(cfg.getParameter<edm::InputTag>("genEvent"))) {
6  nLep_ = fs->make<TH1F>("nLep", "N(Lepton)", 5, 0., 5.);
7  topPt_ = fs->make<TH1F>("topPt", "pt (top)", 100, 0., 500.);
8  topEta_ = fs->make<TH1F>("topEta", "eta(top)", 40, -5., 5.);
9  topPhi_ = fs->make<TH1F>("topPhi", "phi(top)", 60, -3.5, 3.5);
10  topBarPt_ = fs->make<TH1F>("topBarPt", "pt (topBar)", 100, 0., 500.);
11  topBarEta_ = fs->make<TH1F>("topBarEta", "eta(topBar)", 40, -5., 5.);
12  topBarPhi_ = fs->make<TH1F>("topBarPhi", "phi(topBar)", 60, -3.5, 3.5);
13  ttbarPt_ = fs->make<TH1F>("ttbarPt", "pt (ttbar)", 100, 0., 500.);
14  ttbarEta_ = fs->make<TH1F>("ttbarEta", "eta(ttbar)", 40, -5., 5.);
15  ttbarPhi_ = fs->make<TH1F>("ttbarPhi", "phi(ttbar)", 60, -3.5, 3.5);
16  prodChan_ = fs->make<TH1F>("prodChan", "production mode", 3, 0, 3);
17  prodChan_->GetXaxis()->SetBinLabel(1, "gg");
18  prodChan_->GetXaxis()->SetBinLabel(2, "qqbar");
19  prodChan_->GetXaxis()->SetBinLabel(3, "other");
20 }
21 
23 
27 
28  if (!genEvent->isTtBar())
29  return;
30 
31  if (genEvent->fromGluonFusion())
32  prodChan_->Fill("gg", 1);
33  else if (genEvent->fromQuarkAnnihilation())
34  prodChan_->Fill("qqbar", 1);
35  else
36  prodChan_->Fill("other", 1);
37 
38  // fill BR's
39  nLep_->Fill(genEvent->numberOfLeptons());
40 
41  //fill top kinematic
42  topPt_->Fill(genEvent->top()->pt());
43  topEta_->Fill(genEvent->top()->eta());
44  topPhi_->Fill(genEvent->top()->phi());
45  topBarPt_->Fill(genEvent->topBar()->pt());
46  topBarEta_->Fill(genEvent->topBar()->eta());
47  topBarPhi_->Fill(genEvent->topBar()->phi());
48 
49  //fill ttbar kinematics
50  ttbarPt_->Fill(genEvent->topPair()->pt());
51  ttbarEta_->Fill(genEvent->topPair()->eta());
52  ttbarPhi_->Fill(genEvent->topPair()->phi());
53 }
54 
56 
TopGenEventAnalyzer::topPt_
TH1F * topPt_
Definition: TopGenEventAnalyzer.h:28
TopGenEventAnalyzer::topEta_
TH1F * topEta_
Definition: TopGenEventAnalyzer.h:29
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
TopGenEventAnalyzer::inputGenEventToken_
edm::EDGetTokenT< TtGenEvent > inputGenEventToken_
Definition: TopGenEventAnalyzer.h:25
TtGenEvent
Class derived from the TopGenEvent for ttbar events.
Definition: TtGenEvent.h:18
TopGenEventAnalyzer::topBarPhi_
TH1F * topBarPhi_
Definition: TopGenEventAnalyzer.h:33
edm::Handle
Definition: AssociativeIterator.h:50
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
TopGenEventAnalyzer.h
TopGenEventAnalyzer::topPhi_
TH1F * topPhi_
Definition: TopGenEventAnalyzer.h:30
TopGenEventAnalyzer::~TopGenEventAnalyzer
~TopGenEventAnalyzer() override
Definition: TopGenEventAnalyzer.cc:22
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:531
TopGenEventAnalyzer::beginJob
void beginJob() override
Definition: TopGenEventAnalyzer.cc:55
edm::ParameterSet
Definition: ParameterSet.h:47
TopGenEventAnalyzer::topBarPt_
TH1F * topBarPt_
Definition: TopGenEventAnalyzer.h:31
TopGenEventAnalyzer::topBarEta_
TH1F * topBarEta_
Definition: TopGenEventAnalyzer.h:32
TopGenEventAnalyzer::TopGenEventAnalyzer
TopGenEventAnalyzer(const edm::ParameterSet &)
Definition: TopGenEventAnalyzer.cc:3
edm::Service< TFileService >
TopGenEventAnalyzer::ttbarEta_
TH1F * ttbarEta_
Definition: TopGenEventAnalyzer.h:35
edm::EventSetup
Definition: EventSetup.h:57
TopGenEventAnalyzer::ttbarPt_
TH1F * ttbarPt_
Definition: TopGenEventAnalyzer.h:34
looper.cfg
cfg
Definition: looper.py:297
TopGenEventAnalyzer::endJob
void endJob() override
Definition: TopGenEventAnalyzer.cc:57
TopGenEventAnalyzer::ttbarPhi_
TH1F * ttbarPhi_
Definition: TopGenEventAnalyzer.h:36
genWeightsTable_cfi.genEvent
genEvent
Definition: genWeightsTable_cfi.py:4
TopGenEventAnalyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: TopGenEventAnalyzer.cc:24
TopGenEventAnalyzer::prodChan_
TH1F * prodChan_
Definition: TopGenEventAnalyzer.h:37
edm::Event
Definition: Event.h:73
TopGenEventAnalyzer::nLep_
TH1F * nLep_
Definition: TopGenEventAnalyzer.h:27
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64