CMS 3D CMS Logo

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

Class derived from the TopGenEvent for single-top events. More...

#include "AnalysisDataFormats/TopObjects/interface/StGenEvent.h"

Inheritance diagram for StGenEvent:
TopGenEvent

Public Member Functions

const reco::GenParticleassociatedB () const
 return associated b More...
 
const reco::GenParticledecayB () const
 return decay b More...
 
const reco::GenParticlesingleLepton () const
 return single lepton if available; 0 else More...
 
const reco::GenParticlesingleNeutrino () const
 return single neutrino if available; 0 else More...
 
const reco::GenParticlesingleTop () const
 return single Top More...
 
const reco::GenParticlesingleW () const
 return single W More...
 
 StGenEvent ()
 empty constructor More...
 
 StGenEvent (reco::GenParticleRefProd &, reco::GenParticleRefProd &)
 default constructor More...
 
virtual ~StGenEvent ()
 default destructor More...
 
- Public Member Functions inherited from TopGenEvent
const reco::GenParticleb () const
 return b quark if available; 0 else More...
 
const reco::GenParticlebBar () const
 return anti-b quark if available; 0 else More...
 
const reco::GenParticlecandidate (int id, unsigned int parentId=0) const
 get candidate with given pdg id if available; 0 else More...
 
const reco::GenParticledaughterQuarkBarOfWMinus () const
 return anti-quark daughter of anti-W boson More...
 
const reco::GenParticledaughterQuarkBarOfWPlus () const
 return anti-quark daughter of W boson More...
 
const reco::GenParticledaughterQuarkOfTop (bool invertCharge=false) const
 return daughter quark of top quark (which can have flavor b, s or d) More...
 
const reco::GenParticledaughterQuarkOfTopBar () const
 return daughter quark of anti-top quark (which can have flavor b, s or d) More...
 
const reco::GenParticledaughterQuarkOfWMinus () const
 return quark daughter of anti-W boson More...
 
const reco::GenParticledaughterQuarkOfWPlus (bool invertQuarkCharge=false, bool invertBosonCharge=false) const
 return quark daughter quark of W boson More...
 
const reco::GenParticleeMinus () const
 return electron if available; 0 else More...
 
const reco::GenParticleePlus () const
 return positron if available; 0 else More...
 
const reco::GenParticleCollectioninitialPartons () const
 return particles of initial partons More...
 
std::vector< const
reco::GenParticle * > 
lightQuarks (bool includingBQuarks=false) const
 return all light quarks or all quarks including b's More...
 
const reco::GenParticlemuMinus () const
 return muon if available; 0 else More...
 
const reco::GenParticlemuPlus () const
 return anti-muon if available; 0 else More...
 
int numberOfBQuarks (bool fromTopQuark=true) const
 return number of b quarks in the decay chain More...
 
int numberOfLeptons (bool fromWBoson=true) const
 return number of leptons in the decay chain More...
 
int numberOfLeptons (WDecay::LeptonType type, bool fromWBoson=true) const
 return number of leptons in the decay chain More...
 
const reco::GenParticleCollectionparticles () const
 return particles of decay chain More...
 
void print () const
 
std::vector< const
reco::GenParticle * > 
radiatedGluons (int pdgId) const
 return radiated gluons from particle with pdgId More...
 
const reco::GenParticletauMinus () const
 return tau if available; 0 else More...
 
const reco::GenParticletauPlus () const
 return anti-tau if available; 0 else More...
 
const reco::GenParticletop () const
 return top if available; 0 else More...
 
const reco::GenParticletopBar () const
 return anti-top if available; 0 else More...
 
 TopGenEvent ()
 empty constructor More...
 
 TopGenEvent (reco::GenParticleRefProd &decaySubset, reco::GenParticleRefProd &iniSubset)
 default constructor More...
 
std::vector< const
reco::GenParticle * > 
topSisters () const
 return number of top anti-top sisters More...
 
const reco::GenParticlewMinus () const
 return W minus if available; 0 else More...
 
const reco::GenParticlewPlus () const
 return W plus if available; 0 else More...
 
virtual ~TopGenEvent ()
 default destructor More...
 

Additional Inherited Members

- Protected Attributes inherited from TopGenEvent
reco::GenParticleRefProd initPartons_
 reference to the list of initial partons (has to be kept in the event!) More...
 
reco::GenParticleRefProd parts_
 reference to the top decay chain (has to be kept in the event!) More...
 

Detailed Description

Class derived from the TopGenEvent for single-top events.

The structure holds reference information to the generator particles of the decay chains for each top quark and of the initial partons and provides access and administration. The derived class contains a few additional getters with respect to its base class.

Definition at line 17 of file StGenEvent.h.

Constructor & Destructor Documentation

StGenEvent::StGenEvent ( )

empty constructor

Definition at line 10 of file StGenEvent.cc.

11 {
12 }
StGenEvent::StGenEvent ( reco::GenParticleRefProd parts,
reco::GenParticleRefProd inits 
)

default constructor

Definition at line 14 of file StGenEvent.cc.

References TopGenEvent::initPartons_, CfgNavigationSchool_cfi::parts, and TopGenEvent::parts_.

15 {
16  parts_ = parts;
17  initPartons_= inits;
18 }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
reco::GenParticleRefProd initPartons_
reference to the list of initial partons (has to be kept in the event!)
Definition: TopGenEvent.h:117
StGenEvent::~StGenEvent ( )
virtual

default destructor

Definition at line 20 of file StGenEvent.cc.

21 {
22 }

Member Function Documentation

const reco::GenParticle * StGenEvent::associatedB ( ) const

return associated b

Definition at line 43 of file StGenEvent.cc.

References abs, TopDecayID::bID, reco::flavour(), i, TopGenEvent::parts_, benchmark_cfg::pdgId, and singleLepton().

44 {
45  const reco::GenParticle* cand=0;
46  if (singleLepton()) {
47  const reco::GenParticleCollection & partsColl = *parts_;
48  const reco::GenParticle & singleLep = *singleLepton();
49  for (unsigned int i = 0; i < parts_->size(); ++i) {
50  if (std::abs(partsColl[i].pdgId())==TopDecayID::bID &&
51  reco::flavour(singleLep)== reco::flavour(partsColl[i])) {
52  // ... but it should be the opposite!
53  cand = &partsColl[i];
54  }
55  }
56  }
57  return cand;
58 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
static const int bID
Definition: TopGenEvent.h:14
const reco::GenParticle * singleLepton() const
return single lepton if available; 0 else
Definition: StGenEvent.cc:61
#define abs(x)
Definition: mlp_lapack.h:159
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
const reco::GenParticle * StGenEvent::decayB ( ) const

return decay b

Definition at line 25 of file StGenEvent.cc.

References abs, TopDecayID::bID, reco::flavour(), i, TopGenEvent::parts_, benchmark_cfg::pdgId, and singleLepton().

26 {
27  const reco::GenParticle* cand=0;
28  if (singleLepton()) {
29  const reco::GenParticleCollection & partsColl = *parts_;
30  const reco::GenParticle & singleLep = *singleLepton();
31  for (unsigned int i = 0; i < parts_->size(); ++i) {
32  if (std::abs(partsColl[i].pdgId())==TopDecayID::bID &&
33  reco::flavour(singleLep)== - reco::flavour(partsColl[i])) {
34  // ... but it should be the opposite!
35  cand = &partsColl[i];
36  }
37  }
38  }
39  return cand;
40 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
static const int bID
Definition: TopGenEvent.h:14
const reco::GenParticle * singleLepton() const
return single lepton if available; 0 else
Definition: StGenEvent.cc:61
#define abs(x)
Definition: mlp_lapack.h:159
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
const reco::GenParticle * StGenEvent::singleLepton ( ) const

return single lepton if available; 0 else

Definition at line 61 of file StGenEvent.cc.

References abs, i, reco::isLepton(), TopGenEvent::parts_, benchmark_cfg::pdgId, and TopDecayID::WID.

Referenced by associatedB(), decayB(), singleTop(), and singleW().

62 {
63  const reco::GenParticle* cand = 0;
64  const reco::GenParticleCollection& partsColl = *parts_;
65  for (unsigned int i = 0; i < partsColl.size(); ++i) {
66  if (reco::isLepton(partsColl[i]) && partsColl[i].mother() &&
67  std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) {
68  cand = &partsColl[i];
69  }
70  }
71  return cand;
72 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
#define abs(x)
Definition: mlp_lapack.h:159
bool isLepton(const Candidate &part)
Definition: pdgIdUtils.h:19
static const int WID
Definition: TopGenEvent.h:18
const reco::GenParticle * StGenEvent::singleNeutrino ( ) const

return single neutrino if available; 0 else

Definition at line 75 of file StGenEvent.cc.

References abs, i, reco::isNeutrino(), TopGenEvent::parts_, benchmark_cfg::pdgId, and TopDecayID::WID.

76 {
77  const reco::GenParticle* cand=0;
78  const reco::GenParticleCollection & partsColl = *parts_;
79  for (unsigned int i = 0; i < partsColl.size(); ++i) {
80  if (reco::isNeutrino(partsColl[i]) && partsColl[i].mother() &&
81  std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) {
82  cand = &partsColl[i];
83  }
84  }
85  return cand;
86 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
#define abs(x)
Definition: mlp_lapack.h:159
bool isNeutrino(const Candidate &part)
Definition: pdgIdUtils.h:25
static const int WID
Definition: TopGenEvent.h:18
const reco::GenParticle * StGenEvent::singleTop ( ) const

return single Top

Definition at line 107 of file StGenEvent.cc.

References abs, reco::flavour(), i, TopGenEvent::parts_, benchmark_cfg::pdgId, singleLepton(), and TopDecayID::tID.

108 {
109  const reco::GenParticle* cand=0;
110  if (singleLepton()) {
111  const reco::GenParticleCollection & partsColl = *parts_;
112  const reco::GenParticle & singleLep = *singleLepton();
113  for (unsigned int i = 0; i < partsColl.size(); ++i) {
114  if (std::abs(partsColl[i].pdgId())==TopDecayID::tID &&
115  reco::flavour(singleLep)!=reco::flavour(partsColl[i])) {
116  cand = &partsColl[i];
117  }
118  }
119  }
120  return cand;
121 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
const reco::GenParticle * singleLepton() const
return single lepton if available; 0 else
Definition: StGenEvent.cc:61
#define abs(x)
Definition: mlp_lapack.h:159
static const int tID
Definition: TopGenEvent.h:13
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
const reco::GenParticle * StGenEvent::singleW ( ) const

return single W

Definition at line 89 of file StGenEvent.cc.

References abs, reco::flavour(), i, TopGenEvent::parts_, benchmark_cfg::pdgId, singleLepton(), and TopDecayID::WID.

90 {
91  const reco::GenParticle* cand=0;
92  if (singleLepton()) {
93  const reco::GenParticleCollection & partsColl = *parts_;
94  const reco::GenParticle & singleLep = *singleLepton();
95  for (unsigned int i = 0; i < partsColl.size(); ++i) {
96  if (std::abs(partsColl[i].pdgId())==TopDecayID::WID &&
97  reco::flavour(singleLep) == - reco::flavour(partsColl[i])){
98  // PDG Id:13=mu- 24=W+ (+24)->(-13) (-24)->(+13) opposite sign
99  cand = &partsColl[i];
100  }
101  }
102  }
103  return cand;
104 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
const reco::GenParticle * singleLepton() const
return single lepton if available; 0 else
Definition: StGenEvent.cc:61
#define abs(x)
Definition: mlp_lapack.h:159
static const int WID
Definition: TopGenEvent.h:18
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31