CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
TopGenEvent Class Reference

Base class to hold information for reduced top generator information. More...

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

Inheritance diagram for TopGenEvent:
StGenEvent TtGenEvent

Public Member Functions

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...
 

Protected Attributes

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

Base class to hold information for reduced top generator information.

The structure holds reference information to the generator particles of the decay chains for each top quark and of the initial partons. It provides access and administration.

Definition at line 40 of file TopGenEvent.h.

Constructor & Destructor Documentation

◆ TopGenEvent() [1/2]

TopGenEvent::TopGenEvent ( )
inline

empty constructor

Definition at line 43 of file TopGenEvent.h.

43 {};

◆ TopGenEvent() [2/2]

TopGenEvent::TopGenEvent ( reco::GenParticleRefProd decaySubset,
reco::GenParticleRefProd iniSubset 
)

default constructor

default contructor

Definition at line 9 of file TopGenEvent.cc.

References TopDecaySubset_cfi::decaySubset, initPartons_, TopInitSubset_cfi::initSubset, and parts_.

9  {
12 }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111
reco::GenParticleRefProd initPartons_
reference to the list of initial partons (has to be kept in the event!)
Definition: TopGenEvent.h:113

◆ ~TopGenEvent()

virtual TopGenEvent::~TopGenEvent ( )
inlinevirtual

default destructor

Definition at line 47 of file TopGenEvent.h.

47 {};

Member Function Documentation

◆ b()

const reco::GenParticle* TopGenEvent::b ( ) const
inline

return b quark if available; 0 else

Definition at line 97 of file TopGenEvent.h.

References TopDecayID::bID, candidate(), and TopDecayID::tID.

Referenced by TtDilepEvtSolution::getGenB(), and TtHadEvtSolution::getGenHadb().

static const int bID
Definition: TopGenEvent.h:13
static const int tID
Definition: TopGenEvent.h:12
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:14

◆ bBar()

const reco::GenParticle* TopGenEvent::bBar ( ) const
inline

return anti-b quark if available; 0 else

Definition at line 99 of file TopGenEvent.h.

References TopDecayID::bID, candidate(), and TopDecayID::tID.

Referenced by TtDilepEvtSolution::getGenBbar(), and TtHadEvtSolution::getGenHadbbar().

static const int bID
Definition: TopGenEvent.h:13
static const int tID
Definition: TopGenEvent.h:12
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:14

◆ candidate()

const reco::GenParticle * TopGenEvent::candidate ( int  id,
unsigned int  parentId = 0 
) const

get candidate with given pdg id if available; 0 else

Definition at line 14 of file TopGenEvent.cc.

References funct::abs(), mps_fire::i, l1ctLayer2EG_cff::id, createfilelist::int, parts_, and EgammaValidation_cff::pdgId.

Referenced by b(), bBar(), eMinus(), ePlus(), muMinus(), muPlus(), tauMinus(), tauPlus(), top(), topBar(), wMinus(), and wPlus().

14  {
15  const reco::GenParticle* cand = nullptr;
16  const reco::GenParticleCollection& partsColl = *parts_;
17  for (unsigned int i = 0; i < partsColl.size(); ++i) {
18  if (partsColl[i].pdgId() == id) {
19  if (parentId == 0 ? true : partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId()) == (int)parentId) {
20  cand = &partsColl[i];
21  }
22  }
23  }
24  return cand;
25 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ daughterQuarkBarOfWMinus()

const reco::GenParticle* TopGenEvent::daughterQuarkBarOfWMinus ( ) const
inline

return anti-quark daughter of anti-W boson

Definition at line 76 of file TopGenEvent.h.

References daughterQuarkOfWPlus().

Referenced by TtHadEvtSolution::getGenHadk().

76 { return daughterQuarkOfWPlus(true, true); };
const reco::GenParticle * daughterQuarkOfWPlus(bool invertQuarkCharge=false, bool invertBosonCharge=false) const
return quark daughter quark of W boson
Definition: TopGenEvent.cc:150

◆ daughterQuarkBarOfWPlus()

const reco::GenParticle* TopGenEvent::daughterQuarkBarOfWPlus ( ) const
inline

return anti-quark daughter of W boson

Definition at line 74 of file TopGenEvent.h.

References daughterQuarkOfWPlus().

Referenced by TtHadEvtSolution::getGenHadq().

74 { return daughterQuarkOfWPlus(true, false); };
const reco::GenParticle * daughterQuarkOfWPlus(bool invertQuarkCharge=false, bool invertBosonCharge=false) const
return quark daughter quark of W boson
Definition: TopGenEvent.cc:150

◆ daughterQuarkOfTop()

const reco::GenParticle * TopGenEvent::daughterQuarkOfTop ( bool  invertCharge = false) const

return daughter quark of top quark (which can have flavor b, s or d)

Definition at line 132 of file TopGenEvent.cc.

References funct::abs(), reco::Candidate::begin(), TopDecayID::bID, reco::Candidate::end(), Exception, edm::errors::InvalidReference, parts_, reco::LeafCandidate::pdgId(), TopDecayID::tID, and top().

Referenced by daughterQuarkOfTopBar().

132  {
133  const reco::GenParticle* cand = nullptr;
134  for (reco::GenParticleCollection::const_iterator top = parts_->begin(); top < parts_->end(); ++top) {
135  if (top->pdgId() == (invertCharge ? -TopDecayID::tID : TopDecayID::tID)) {
136  for (reco::GenParticle::const_iterator quark = top->begin(); quark < top->end(); ++quark) {
137  if (std::abs(quark->pdgId()) <= TopDecayID::bID) {
138  cand = dynamic_cast<const reco::GenParticle*>(&(*quark));
139  if (cand == nullptr) {
140  throw edm::Exception(edm::errors::InvalidReference, "Not a GenParticle");
141  }
142  break;
143  }
144  }
145  }
146  }
147  return cand;
148 }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111
static const int bID
Definition: TopGenEvent.h:13
int pdgId() const final
PDG identifier.
static const int tID
Definition: TopGenEvent.h:12
const_iterator end() const
last daughter const_iterator
Definition: Candidate.h:145
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const reco::GenParticle * top() const
return top if available; 0 else
Definition: TopGenEvent.h:101
const_iterator begin() const
first daughter const_iterator
Definition: Candidate.h:143

◆ daughterQuarkOfTopBar()

const reco::GenParticle* TopGenEvent::daughterQuarkOfTopBar ( ) const
inline

return daughter quark of anti-top quark (which can have flavor b, s or d)

Definition at line 68 of file TopGenEvent.h.

References daughterQuarkOfTop().

68 { return daughterQuarkOfTop(true); };
const reco::GenParticle * daughterQuarkOfTop(bool invertCharge=false) const
return daughter quark of top quark (which can have flavor b, s or d)
Definition: TopGenEvent.cc:132

◆ daughterQuarkOfWMinus()

const reco::GenParticle* TopGenEvent::daughterQuarkOfWMinus ( ) const
inline

return quark daughter of anti-W boson

Definition at line 72 of file TopGenEvent.h.

References daughterQuarkOfWPlus().

Referenced by TtHadEvtSolution::getGenHadj().

72 { return daughterQuarkOfWPlus(false, true); };
const reco::GenParticle * daughterQuarkOfWPlus(bool invertQuarkCharge=false, bool invertBosonCharge=false) const
return quark daughter quark of W boson
Definition: TopGenEvent.cc:150

◆ daughterQuarkOfWPlus()

const reco::GenParticle * TopGenEvent::daughterQuarkOfWPlus ( bool  invertQuarkCharge = false,
bool  invertBosonCharge = false 
) const

return quark daughter quark of W boson

Definition at line 150 of file TopGenEvent.cc.

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

Referenced by daughterQuarkBarOfWMinus(), daughterQuarkBarOfWPlus(), daughterQuarkOfWMinus(), and TtHadEvtSolution::getGenHadp().

150  {
151  const reco::GenParticle* cand = nullptr;
152  const reco::GenParticleCollection& partsColl = *parts_;
153  for (unsigned int i = 0; i < partsColl.size(); ++i) {
154  if (partsColl[i].mother() &&
155  partsColl[i].mother()->pdgId() == (invertBosonCharge ? -TopDecayID::WID : TopDecayID::WID) &&
156  std::abs(partsColl[i].pdgId()) <= TopDecayID::bID &&
157  (invertQuarkCharge ? reco::flavour(partsColl[i]) < 0 : reco::flavour(partsColl[i]) > 0)) {
158  cand = &partsColl[i];
159  }
160  }
161  return cand;
162 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111
static const int bID
Definition: TopGenEvent.h:13
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int WID
Definition: TopGenEvent.h:17
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:21

◆ eMinus()

const reco::GenParticle* TopGenEvent::eMinus ( ) const
inline

return electron if available; 0 else

Definition at line 81 of file TopGenEvent.h.

References candidate(), TopDecayID::elecID, and TopDecayID::WID.

const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:14
static const int WID
Definition: TopGenEvent.h:17
static const int elecID
Definition: TopGenEvent.h:18

◆ ePlus()

const reco::GenParticle* TopGenEvent::ePlus ( ) const
inline

return positron if available; 0 else

Definition at line 83 of file TopGenEvent.h.

References candidate(), TopDecayID::elecID, and TopDecayID::WID.

const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:14
static const int WID
Definition: TopGenEvent.h:17
static const int elecID
Definition: TopGenEvent.h:18

◆ initialPartons()

const reco::GenParticleCollection& TopGenEvent::initialPartons ( ) const
inline

return particles of initial partons

Definition at line 52 of file TopGenEvent.h.

References initPartons_.

52 { return *initPartons_; }
reco::GenParticleRefProd initPartons_
reference to the list of initial partons (has to be kept in the event!)
Definition: TopGenEvent.h:113

◆ lightQuarks()

std::vector< const reco::GenParticle * > TopGenEvent::lightQuarks ( bool  includingBQuarks = false) const

return all light quarks or all quarks including b's

Definition at line 164 of file TopGenEvent.cc.

References funct::abs(), TopDecayID::bID, Exception, edm::errors::InvalidReference, and parts_.

164  {
165  std::vector<const reco::GenParticle*> lightQuarks;
166  for (reco::GenParticleCollection::const_iterator part = parts_->begin(); part < parts_->end(); ++part) {
167  if ((includingBQuarks && std::abs(part->pdgId()) == TopDecayID::bID) || std::abs(part->pdgId()) < TopDecayID::bID) {
168  if (dynamic_cast<const reco::GenParticle*>(&(*part)) == nullptr) {
169  throw edm::Exception(edm::errors::InvalidReference, "Not a GenParticle");
170  }
171  lightQuarks.push_back(part->clone());
172  }
173  }
174  return lightQuarks;
175 }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111
static const int bID
Definition: TopGenEvent.h:13
std::vector< const reco::GenParticle * > lightQuarks(bool includingBQuarks=false) const
return all light quarks or all quarks including b&#39;s
Definition: TopGenEvent.cc:164
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
part
Definition: HCALResponse.h:20

◆ muMinus()

const reco::GenParticle* TopGenEvent::muMinus ( ) const
inline

return muon if available; 0 else

Definition at line 85 of file TopGenEvent.h.

References candidate(), TopDecayID::muonID, and TopDecayID::WID.

const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:14
static const int muonID
Definition: TopGenEvent.h:19
static const int WID
Definition: TopGenEvent.h:17

◆ muPlus()

const reco::GenParticle* TopGenEvent::muPlus ( ) const
inline

return anti-muon if available; 0 else

Definition at line 87 of file TopGenEvent.h.

References candidate(), TopDecayID::muonID, and TopDecayID::WID.

const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:14
static const int muonID
Definition: TopGenEvent.h:19
static const int WID
Definition: TopGenEvent.h:17

◆ numberOfBQuarks()

int TopGenEvent::numberOfBQuarks ( bool  fromTopQuark = true) const

return number of b quarks in the decay chain

Definition at line 99 of file TopGenEvent.cc.

References funct::abs(), TopDecayID::bID, mps_fire::i, parts_, EgammaValidation_cff::pdgId, and TopDecayID::tID.

99  {
100  int bq = 0;
101  const reco::GenParticleCollection& partsColl = *parts_;
102  for (unsigned int i = 0; i < partsColl.size(); ++i) {
103  //depend if radiation qqbar are included or not
104  if (std::abs(partsColl[i].pdgId()) == TopDecayID::bID) {
105  if (fromTopQuark) {
106  if (partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId()) == TopDecayID::tID) {
107  ++bq;
108  }
109  } else {
110  ++bq;
111  }
112  }
113  }
114  return bq;
115 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111
static const int bID
Definition: TopGenEvent.h:13
static const int tID
Definition: TopGenEvent.h:12
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ numberOfLeptons() [1/2]

int TopGenEvent::numberOfLeptons ( bool  fromWBoson = true) const

return number of leptons in the decay chain

Definition at line 41 of file TopGenEvent.cc.

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

Referenced by TtGenEvent::isNumberOfLeptons().

41  {
42  int lep = 0;
43  const reco::GenParticleCollection& partsColl = *parts_;
44  for (unsigned int i = 0; i < partsColl.size(); ++i) {
45  if (reco::isLepton(partsColl[i])) {
46  if (fromWBoson) {
47  if (partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId()) == TopDecayID::WID) {
48  ++lep;
49  }
50  } else {
51  ++lep;
52  }
53  }
54  }
55  return lep;
56 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111
bool isLepton(const Candidate &part)
Definition: pdgIdUtils.h:13
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int WID
Definition: TopGenEvent.h:17

◆ numberOfLeptons() [2/2]

int TopGenEvent::numberOfLeptons ( WDecay::LeptonType  type,
bool  fromWBoson = true 
) const

return number of leptons in the decay chain

Definition at line 58 of file TopGenEvent.cc.

References funct::abs(), TopDecayID::elecID, mps_fire::i, reco::isLepton(), WDecay::kElec, WDecay::kMuon, WDecay::kNone, WDecay::kTau, objects.autophobj::leptonType, TopDecayID::muonID, parts_, EgammaValidation_cff::pdgId, TopDecayID::tauID, and TopDecayID::WID.

58  {
59  int leptonType = -1;
60  switch (typeRestriction) {
61  // resolve whether or not there is
62  // any restriction in lepton types
63  case WDecay::kElec:
65  break;
66  case WDecay::kMuon:
68  break;
69  case WDecay::kTau:
71  break;
72  case WDecay::kNone:
73  break;
74  }
75  int lep = 0;
76  const reco::GenParticleCollection& partsColl = *parts_;
77  for (unsigned int i = 0; i < partsColl.size(); ++i) {
78  if (fromWBoson) {
79  // restrict to particles originating from the W boson
80  if (!(partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId()) == TopDecayID::WID)) {
81  continue;
82  }
83  }
84  if (leptonType > 0) {
85  // in case of lepton type restriction
86  if (std::abs(partsColl[i].pdgId()) == leptonType) {
87  ++lep;
88  }
89  } else {
90  // take any lepton type into account else
91  if (reco::isLepton(partsColl[i])) {
92  ++lep;
93  }
94  }
95  }
96  return lep;
97 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111
bool isLepton(const Candidate &part)
Definition: pdgIdUtils.h:13
static const int tauID
Definition: TopGenEvent.h:20
leptonType
LEPTON
Definition: autophobj.py:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int muonID
Definition: TopGenEvent.h:19
static const int WID
Definition: TopGenEvent.h:17
static const int elecID
Definition: TopGenEvent.h:18

◆ particles()

const reco::GenParticleCollection& TopGenEvent::particles ( ) const
inline

return particles of decay chain

Definition at line 50 of file TopGenEvent.h.

References parts_.

50 { return *parts_; }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111

◆ print()

void TopGenEvent::print ( void  ) const

print content of the top decay chain as formated LogInfo to the MessageLogger output for debugging

Definition at line 27 of file TopGenEvent.cc.

References dqm-mbProfile::log, and parts_.

27  {
28  edm::LogVerbatim log("TopGenEvent");
29  log << "\n"
30  << "--------------------------------------\n"
31  << "- Dump TopGenEvent Content -\n"
32  << "--------------------------------------\n";
33  for (reco::GenParticleCollection::const_iterator part = parts_->begin(); part < parts_->end(); ++part) {
34  log << "pdgId:" << std::setw(5) << part->pdgId() << ", "
35  << "mass:" << std::setw(11) << part->p4().mass() << ", "
36  << "energy:" << std::setw(11) << part->energy() << ", "
37  << "pt:" << std::setw(11) << part->pt() << "\n";
38  }
39 }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111
part
Definition: HCALResponse.h:20

◆ radiatedGluons()

std::vector< const reco::GenParticle * > TopGenEvent::radiatedGluons ( int  pdgId) const

return radiated gluons from particle with pdgId

Definition at line 177 of file TopGenEvent.cc.

References Exception, TopDecayID::glueID, edm::errors::InvalidReference, parts_, and EgammaValidation_cff::pdgId.

Referenced by TtGenEvent::hadronicDecayTopRadiation(), and TtGenEvent::leptonicDecayTopRadiation().

177  {
178  std::vector<const reco::GenParticle*> rads;
179  for (reco::GenParticleCollection::const_iterator part = parts_->begin(); part < parts_->end(); ++part) {
180  if (part->mother() && part->mother()->pdgId() == pdgId) {
181  if (part->pdgId() == TopDecayID::glueID) {
182  if (dynamic_cast<const reco::GenParticle*>(&(*part)) == nullptr) {
183  throw edm::Exception(edm::errors::InvalidReference, "Not a GenParticle");
184  }
185  }
186  rads.push_back(part->clone());
187  }
188  }
189  return rads;
190 }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111
static const int glueID
Definition: TopGenEvent.h:14
part
Definition: HCALResponse.h:20

◆ tauMinus()

const reco::GenParticle* TopGenEvent::tauMinus ( ) const
inline

return tau if available; 0 else

Definition at line 89 of file TopGenEvent.h.

References candidate(), TopDecayID::tauID, and TopDecayID::WID.

static const int tauID
Definition: TopGenEvent.h:20
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:14
static const int WID
Definition: TopGenEvent.h:17

◆ tauPlus()

const reco::GenParticle* TopGenEvent::tauPlus ( ) const
inline

return anti-tau if available; 0 else

Definition at line 91 of file TopGenEvent.h.

References candidate(), TopDecayID::tauID, and TopDecayID::WID.

static const int tauID
Definition: TopGenEvent.h:20
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:14
static const int WID
Definition: TopGenEvent.h:17

◆ top()

const reco::GenParticle* TopGenEvent::top ( ) const
inline

return top if available; 0 else

Definition at line 101 of file TopGenEvent.h.

References candidate(), and TopDecayID::tID.

Referenced by daughterQuarkOfTop(), TtDilepEvtSolution::getGenT(), TtGenEvent::isTtBar(), and TtGenEvent::TtGenEvent().

101 { return candidate(TopDecayID::tID); }
static const int tID
Definition: TopGenEvent.h:12
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:14

◆ topBar()

const reco::GenParticle* TopGenEvent::topBar ( ) const
inline

return anti-top if available; 0 else

Definition at line 103 of file TopGenEvent.h.

References candidate(), and TopDecayID::tID.

Referenced by TtDilepEvtSolution::getGenTbar(), TtGenEvent::isTtBar(), and TtGenEvent::TtGenEvent().

103 { return candidate(-TopDecayID::tID); }
static const int tID
Definition: TopGenEvent.h:12
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:14

◆ topSisters()

std::vector< const reco::GenParticle * > TopGenEvent::topSisters ( ) const

return number of top anti-top sisters

Definition at line 117 of file TopGenEvent.cc.

References funct::abs(), Exception, edm::errors::InvalidReference, parts_, and TopDecayID::tID.

117  {
118  std::vector<const reco::GenParticle*> sisters;
119  for (reco::GenParticleCollection::const_iterator part = parts_->begin(); part < parts_->end(); ++part) {
120  if (part->numberOfMothers() == 0 && std::abs(part->pdgId()) != TopDecayID::tID) {
121  // choose top sister which do not have a
122  // mother and are whether top nor anti-top
123  if (dynamic_cast<const reco::GenParticle*>(&(*part)) == nullptr) {
124  throw edm::Exception(edm::errors::InvalidReference, "Not a GenParticle");
125  }
126  sisters.push_back(part->clone());
127  }
128  }
129  return sisters;
130 }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111
static const int tID
Definition: TopGenEvent.h:12
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
part
Definition: HCALResponse.h:20

◆ wMinus()

const reco::GenParticle* TopGenEvent::wMinus ( ) const
inline

return W minus if available; 0 else

Definition at line 93 of file TopGenEvent.h.

References candidate(), TopDecayID::tID, and TopDecayID::WID.

Referenced by TtDilepEvtSolution::getGenWm().

static const int tID
Definition: TopGenEvent.h:12
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:14
static const int WID
Definition: TopGenEvent.h:17

◆ wPlus()

const reco::GenParticle* TopGenEvent::wPlus ( ) const
inline

return W plus if available; 0 else

Definition at line 95 of file TopGenEvent.h.

References candidate(), TopDecayID::tID, and TopDecayID::WID.

Referenced by TtDilepEvtSolution::getGenWp().

static const int tID
Definition: TopGenEvent.h:12
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:14
static const int WID
Definition: TopGenEvent.h:17

Member Data Documentation

◆ initPartons_

reco::GenParticleRefProd TopGenEvent::initPartons_
protected

reference to the list of initial partons (has to be kept in the event!)

Definition at line 113 of file TopGenEvent.h.

Referenced by TtGenEvent::fromGluonFusion(), TtGenEvent::fromQuarkAnnihilation(), initialPartons(), StGenEvent::StGenEvent(), TopGenEvent(), and TtGenEvent::TtGenEvent().

◆ parts_

reco::GenParticleRefProd TopGenEvent::parts_
protected