CMS 3D CMS Logo

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...
 
 ~StGenEvent () override
 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() [1/2]

StGenEvent::StGenEvent ( )

empty constructor

Definition at line 9 of file StGenEvent.cc.

9 {}

◆ StGenEvent() [2/2]

StGenEvent::StGenEvent ( reco::GenParticleRefProd parts,
reco::GenParticleRefProd inits 
)

default constructor

Definition at line 11 of file StGenEvent.cc.

11  {
12  parts_ = parts;
13  initPartons_ = inits;
14 }

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

◆ ~StGenEvent()

StGenEvent::~StGenEvent ( )
override

default destructor

Definition at line 16 of file StGenEvent.cc.

16 {}

Member Function Documentation

◆ associatedB()

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

return associated b

Definition at line 34 of file StGenEvent.cc.

34  {
35  const reco::GenParticle* cand = nullptr;
36  if (singleLepton()) {
37  const reco::GenParticleCollection& partsColl = *parts_;
38  const reco::GenParticle& singleLep = *singleLepton();
39  for (unsigned int i = 0; i < parts_->size(); ++i) {
40  if (std::abs(partsColl[i].pdgId()) == TopDecayID::bID &&
41  reco::flavour(singleLep) == reco::flavour(partsColl[i])) {
42  // ... but it should be the opposite!
43  cand = &partsColl[i];
44  }
45  }
46  }
47  return cand;
48 }

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

◆ decayB()

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

return decay b

Definition at line 18 of file StGenEvent.cc.

18  {
19  const reco::GenParticle* cand = nullptr;
20  if (singleLepton()) {
21  const reco::GenParticleCollection& partsColl = *parts_;
22  const reco::GenParticle& singleLep = *singleLepton();
23  for (unsigned int i = 0; i < parts_->size(); ++i) {
24  if (std::abs(partsColl[i].pdgId()) == TopDecayID::bID &&
25  reco::flavour(singleLep) == -reco::flavour(partsColl[i])) {
26  // ... but it should be the opposite!
27  cand = &partsColl[i];
28  }
29  }
30  }
31  return cand;
32 }

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

Referenced by StEvtSolution::getGenBottom().

◆ singleLepton()

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

return single lepton if available; 0 else

Definition at line 50 of file StGenEvent.cc.

50  {
51  const reco::GenParticle* cand = nullptr;
52  const reco::GenParticleCollection& partsColl = *parts_;
53  for (unsigned int i = 0; i < partsColl.size(); ++i) {
54  if (reco::isLepton(partsColl[i]) && partsColl[i].mother() &&
55  std::abs(partsColl[i].mother()->pdgId()) == TopDecayID::WID) {
56  cand = &partsColl[i];
57  }
58  }
59  return cand;
60 }

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

Referenced by associatedB(), decayB(), StEvtSolution::getGenLepton(), singleTop(), and singleW().

◆ singleNeutrino()

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

return single neutrino if available; 0 else

Definition at line 62 of file StGenEvent.cc.

62  {
63  const reco::GenParticle* cand = nullptr;
64  const reco::GenParticleCollection& partsColl = *parts_;
65  for (unsigned int i = 0; i < partsColl.size(); ++i) {
66  if (reco::isNeutrino(partsColl[i]) && partsColl[i].mother() &&
67  std::abs(partsColl[i].mother()->pdgId()) == TopDecayID::WID) {
68  cand = &partsColl[i];
69  }
70  }
71  return cand;
72 }

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

Referenced by StEvtSolution::getGenNeutrino().

◆ singleTop()

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

return single Top

Definition at line 90 of file StGenEvent.cc.

90  {
91  const reco::GenParticle* cand = nullptr;
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::tID &&
97  reco::flavour(singleLep) != reco::flavour(partsColl[i])) {
98  cand = &partsColl[i];
99  }
100  }
101  }
102  return cand;
103 }

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

Referenced by StEvtSolution::getGenLept().

◆ singleW()

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

return single W

Definition at line 74 of file StGenEvent.cc.

74  {
75  const reco::GenParticle* cand = nullptr;
76  if (singleLepton()) {
77  const reco::GenParticleCollection& partsColl = *parts_;
78  const reco::GenParticle& singleLep = *singleLepton();
79  for (unsigned int i = 0; i < partsColl.size(); ++i) {
80  if (std::abs(partsColl[i].pdgId()) == TopDecayID::WID &&
81  reco::flavour(singleLep) == -reco::flavour(partsColl[i])) {
82  // PDG Id:13=mu- 24=W+ (+24)->(-13) (-24)->(+13) opposite sign
83  cand = &partsColl[i];
84  }
85  }
86  }
87  return cand;
88 }

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

Referenced by StEvtSolution::getGenLepW().

mps_fire.i
i
Definition: mps_fire.py:428
reco::GenParticle
Definition: GenParticle.h:21
reco::flavour
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:21
TopDecayID::bID
static const int bID
Definition: TopGenEvent.h:13
reco::GenParticleCollection
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
Definition: GenParticleFwd.h:13
TopGenEvent::initPartons_
reco::GenParticleRefProd initPartons_
reference to the list of initial partons (has to be kept in the event!)
Definition: TopGenEvent.h:113
reco::isNeutrino
bool isNeutrino(const Candidate &part)
Definition: pdgIdUtils.h:17
reco::isLepton
bool isLepton(const Candidate &part)
Definition: pdgIdUtils.h:13
contentValuesFiles.parts
parts
Definition: contentValuesFiles.py:58
TopDecayID::tID
static const int tID
Definition: TopGenEvent.h:12
StGenEvent::singleLepton
const reco::GenParticle * singleLepton() const
return single lepton if available; 0 else
Definition: StGenEvent.cc:50
cand
Definition: decayParser.h:32
EgammaValidation_cff.pdgId
pdgId
Definition: EgammaValidation_cff.py:117
TopDecayID::WID
static const int WID
Definition: TopGenEvent.h:17
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TopGenEvent::parts_
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111