CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
TopGenEventAnalyzer Class Reference

#include <TopGenEventAnalyzer.h>

Inheritance diagram for TopGenEventAnalyzer:
edm::EDAnalyzer

Public Member Functions

 TopGenEventAnalyzer (const edm::ParameterSet &)
 
 ~TopGenEventAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 

Private Attributes

edm::InputTag inputGenEvent_
 
TH1F * nLep_
 
TH1F * topBarEta_
 
TH1F * topBarPhi_
 
TH1F * topBarPt_
 
TH1F * topEta_
 
TH1F * topPhi_
 
TH1F * topPt_
 
TH1F * ttbarEta_
 
TH1F * ttbarPhi_
 
TH1F * ttbarPt_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 14 of file TopGenEventAnalyzer.h.

Constructor & Destructor Documentation

TopGenEventAnalyzer::TopGenEventAnalyzer ( const edm::ParameterSet cfg)
explicit

Definition at line 4 of file TopGenEventAnalyzer.cc.

References TFileDirectory::make(), nLep_, topBarEta_, topBarPhi_, topBarPt_, topEta_, topPhi_, topPt_, ttbarEta_, ttbarPhi_, and ttbarPt_.

4  :
6 {
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 }
T getParameter(std::string const &) const
edm::InputTag inputGenEvent_
T * make() const
make new ROOT object
TopGenEventAnalyzer::~TopGenEventAnalyzer ( )

Definition at line 20 of file TopGenEventAnalyzer.cc.

21 {
22 }

Member Function Documentation

void TopGenEventAnalyzer::analyze ( const edm::Event evt,
const edm::EventSetup setup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 25 of file TopGenEventAnalyzer.cc.

References MCTruth::genEvent, edm::Event::getByLabel(), inputGenEvent_, nLep_, p4, topBarEta_, topBarPhi_, topBarPt_, topEta_, topPhi_, topPt_, ttbarEta_, ttbarPhi_, and ttbarPt_.

26 {
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 }
edm::InputTag inputGenEvent_
double p4[4]
Definition: TauolaWrapper.h:92
tuple genEvent
Definition: MCTruth.py:33
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:26
void TopGenEventAnalyzer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 48 of file TopGenEventAnalyzer.cc.

49 {
50 }
void TopGenEventAnalyzer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 52 of file TopGenEventAnalyzer.cc.

53 {
54 }

Member Data Documentation

edm::InputTag TopGenEventAnalyzer::inputGenEvent_
private

Definition at line 27 of file TopGenEventAnalyzer.h.

Referenced by analyze().

TH1F* TopGenEventAnalyzer::nLep_
private

Definition at line 29 of file TopGenEventAnalyzer.h.

Referenced by analyze(), and TopGenEventAnalyzer().

TH1F* TopGenEventAnalyzer::topBarEta_
private

Definition at line 34 of file TopGenEventAnalyzer.h.

Referenced by analyze(), and TopGenEventAnalyzer().

TH1F* TopGenEventAnalyzer::topBarPhi_
private

Definition at line 35 of file TopGenEventAnalyzer.h.

Referenced by analyze(), and TopGenEventAnalyzer().

TH1F* TopGenEventAnalyzer::topBarPt_
private

Definition at line 33 of file TopGenEventAnalyzer.h.

Referenced by analyze(), and TopGenEventAnalyzer().

TH1F* TopGenEventAnalyzer::topEta_
private

Definition at line 31 of file TopGenEventAnalyzer.h.

Referenced by analyze(), and TopGenEventAnalyzer().

TH1F* TopGenEventAnalyzer::topPhi_
private

Definition at line 32 of file TopGenEventAnalyzer.h.

Referenced by analyze(), and TopGenEventAnalyzer().

TH1F* TopGenEventAnalyzer::topPt_
private

Definition at line 30 of file TopGenEventAnalyzer.h.

Referenced by analyze(), and TopGenEventAnalyzer().

TH1F* TopGenEventAnalyzer::ttbarEta_
private

Definition at line 37 of file TopGenEventAnalyzer.h.

Referenced by analyze(), and TopGenEventAnalyzer().

TH1F* TopGenEventAnalyzer::ttbarPhi_
private

Definition at line 38 of file TopGenEventAnalyzer.h.

Referenced by analyze(), and TopGenEventAnalyzer().

TH1F* TopGenEventAnalyzer::ttbarPt_
private

Definition at line 36 of file TopGenEventAnalyzer.h.

Referenced by analyze(), and TopGenEventAnalyzer().