CMS 3D CMS Logo

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

Class derived from the TopGenEvent for ttbar events. More...

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

Inheritance diagram for TtGenEvent:
TopGenEvent

Public Member Functions

bool fromGluonFusion () const
 check if the tops were produced from a pair of gluons More...
 
bool fromQuarkAnnihilation () const
 check if the tops were produced from qqbar More...
 
std::pair< WDecay::LeptonType, WDecay::LeptonTypefullLeptonicChannel () const
 
const reco::GenParticlehadronicDecayB (bool excludeTauLeptons=false) const
 get b of hadronic decay branch More...
 
const reco::GenParticlehadronicDecayQuark (bool invertFlavor=false) const
 get light quark of hadronic decay branch More...
 
const reco::GenParticlehadronicDecayQuarkBar () const
 get light anti-quark of hadronic decay branch More...
 
const reco::GenParticlehadronicDecayTop (bool excludeTauLeptons=false) const
 get top of hadronic decay branch More...
 
std::vector< const reco::GenParticle * > hadronicDecayTopRadiation (bool excludeTauLeptons=false) const
 gluons as radiated from the hadronicly decaying top quark More...
 
const reco::GenParticlehadronicDecayW (bool excludeTauLeptons=false) const
 get W of hadronic decay branch More...
 
bool isFullHadronic (bool excludeTauLeptons=false) const
 check if the event can be classified as full hadronic More...
 
bool isFullLeptonic (bool excludeTauLeptons=false) const
 check if the event can be classified as full leptonic More...
 
bool isFullLeptonic (WDecay::LeptonType typeA, WDecay::LeptonType typeB) const
 check if the event is full leptonic with the lepton being of typeA or typeB irrelevant of order; all leptons including taus are allowed More...
 
bool isSemiLeptonic (bool excludeTauLeptons=false) const
 check if the event can be classified as semi-laptonic More...
 
bool isSemiLeptonic (WDecay::LeptonType typeA) const
 check if the event is semi-leptonic with the lepton being of typeA; all leptons including taus are allowed More...
 
bool isSemiLeptonic (WDecay::LeptonType typeA, WDecay::LeptonType typeB) const
 check if the event is semi-leptonic with the lepton being of typeA or typeB; all leptons including taus are allowed More...
 
bool isTtBar () const
 check if the event can be classified as ttbar More...
 
const reco::GenParticlelepton (bool excludeTauLeptons=false) const
 get lepton for semi-leptonic or full leptonic decays More...
 
const reco::GenParticleleptonBar (bool excludeTauLeptons=false) const
 get anti-lepton for semi-leptonic or full leptonic decays More...
 
const reco::GenParticleleptonicDecayB (bool excludeTauLeptons=false) const
 get b of leptonic decay branch More...
 
const reco::GenParticleleptonicDecayTop (bool excludeTauLeptons=false) const
 get top of leptonic decay branch More...
 
std::vector< const reco::GenParticle * > leptonicDecayTopRadiation (bool excludeTauLeptons=false) const
 gluons as radiated from the leptonicly decaying top quark More...
 
const reco::GenParticleleptonicDecayW (bool excludeTauLeptons=false) const
 get W of leptonic decay branch More...
 
const reco::GenParticleneutrino (bool excludeTauLeptons=false) const
 get neutrino for semi-leptonic or full leptonic decays More...
 
const reco::GenParticleneutrinoBar (bool excludeTauLeptons=false) const
 get anti-neutrino for semi-leptonic or full leptonic decays More...
 
WDecay::LeptonType semiLeptonicChannel () const
 return decay channel; all leptons including taus are allowed More...
 
const reco::GenParticlesingleLepton (bool excludeTauLeptons=false) const
 return single lepton if available; 0 else More...
 
const reco::GenParticlesingleNeutrino (bool excludeTauLeptons=false) const
 return single neutrino if available; 0 else More...
 
const math::XYZTLorentzVectortopPair () const
 return combined 4-vector of top and topBar More...
 
 TtGenEvent ()
 empty constructor More...
 
 TtGenEvent (reco::GenParticleRefProd &decaySubset, reco::GenParticleRefProd &initSubset)
 default constructor from decaySubset and initSubset More...
 
 ~TtGenEvent () 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...
 

Protected Attributes

math::XYZTLorentzVector topPair_
 combined 4-vector of top and topBar More...
 
- 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...
 

Private Member Functions

bool isNumberOfLeptons (bool excludeTauLeptons, int nlep) const
 

Detailed Description

Class derived from the TopGenEvent for ttbar 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 18 of file TtGenEvent.h.

Constructor & Destructor Documentation

◆ TtGenEvent() [1/2]

TtGenEvent::TtGenEvent ( )
inline

empty constructor

Definition at line 21 of file TtGenEvent.h.

21 {};

◆ TtGenEvent() [2/2]

TtGenEvent::TtGenEvent ( reco::GenParticleRefProd decaySubset,
reco::GenParticleRefProd initSubset 
)

default constructor from decaySubset and initSubset

Definition at line 10 of file TtGenEvent.cc.

10  {
13  if (top() && topBar())
15 }

References TopDecaySubset_cfi::decaySubset, TopGenEvent::initPartons_, TopInitSubset_cfi::initSubset, p4, TopGenEvent::parts_, TopGenEvent::top(), TopGenEvent::topBar(), and topPair_.

◆ ~TtGenEvent()

TtGenEvent::~TtGenEvent ( )
inlineoverride

default destructor

Definition at line 25 of file TtGenEvent.h.

25 {};

Member Function Documentation

◆ fromGluonFusion()

bool TtGenEvent::fromGluonFusion ( ) const

check if the tops were produced from a pair of gluons

Definition at line 17 of file TtGenEvent.cc.

17  {
18  const reco::GenParticleCollection& initPartsColl = *initPartons_;
19  if (initPartsColl.size() == 2)
20  if (initPartsColl[0].pdgId() == 21 && initPartsColl[1].pdgId() == 21)
21  return true;
22  return false;
23 }

References TopGenEvent::initPartons_, and EgammaValidation_cff::pdgId.

◆ fromQuarkAnnihilation()

bool TtGenEvent::fromQuarkAnnihilation ( ) const

check if the tops were produced from qqbar

Definition at line 25 of file TtGenEvent.cc.

25  {
26  const reco::GenParticleCollection& initPartsColl = *initPartons_;
27  if (initPartsColl.size() == 2)
28  if (std::abs(initPartsColl[0].pdgId()) < TopDecayID::tID && initPartsColl[0].pdgId() == -initPartsColl[1].pdgId())
29  return true;
30  return false;
31 }

References funct::abs(), TopGenEvent::initPartons_, EgammaValidation_cff::pdgId, and TopDecayID::tID.

◆ fullLeptonicChannel()

std::pair< WDecay::LeptonType, WDecay::LeptonType > TtGenEvent::fullLeptonicChannel ( ) const

Definition at line 46 of file TtGenEvent.cc.

46  {
48  if (isFullLeptonic()) {
49  if (lepton()) {
51  typeA = WDecay::kElec;
53  typeA = WDecay::kMuon;
55  typeA = WDecay::kTau;
56  }
57  if (leptonBar()) {
59  typeB = WDecay::kElec;
61  typeB = WDecay::kMuon;
63  typeB = WDecay::kTau;
64  }
65  }
66  return (std::pair<WDecay::LeptonType, WDecay::LeptonType>(typeA, typeB));
67 }

References funct::abs(), TopDecayID::elecID, isFullLeptonic(), WDecay::kElec, WDecay::kMuon, WDecay::kNone, WDecay::kTau, lepton(), leptonBar(), TopDecayID::muonID, EgammaValidation_cff::pdgId, and TopDecayID::tauID.

Referenced by isFullLeptonic().

◆ hadronicDecayB()

const reco::GenParticle * TtGenEvent::hadronicDecayB ( bool  excludeTauLeptons = false) const

get b of hadronic decay branch

Definition at line 181 of file TtGenEvent.cc.

181  {
182  const reco::GenParticle* cand = nullptr;
183  if (singleLepton(excludeTauLeptons)) {
184  const reco::GenParticleCollection& partsColl = *parts_;
185  const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons);
186  for (unsigned int i = 0; i < partsColl.size(); ++i) {
187  if (std::abs(partsColl[i].pdgId()) == TopDecayID::bID &&
188  reco::flavour(singleLep) == reco::flavour(partsColl[i])) {
189  cand = &partsColl[i];
190  }
191  }
192  }
193  return cand;
194 }

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

Referenced by TtSemiEvtSolution::getGenHadb().

◆ hadronicDecayQuark()

const reco::GenParticle * TtGenEvent::hadronicDecayQuark ( bool  invertFlavor = false) const

get light quark of hadronic decay branch

Definition at line 153 of file TtGenEvent.cc.

153  {
154  const reco::GenParticle* cand = nullptr;
155  // catch W boson and check its daughters for a quark;
156  // make sure the decay is semi-leptonic first; this
157  // only makes sense if taus are not excluded from the
158  // decision
159  if (singleLepton(false)) {
160  for (reco::GenParticleCollection::const_iterator w = parts_->begin(); w != parts_->end(); ++w) {
161  if (std::abs(w->pdgId()) == TopDecayID::WID) {
162  // make sure that the particle is a W daughter
163  for (reco::GenParticle::const_iterator wd = w->begin(); wd != w->end(); ++wd) {
164  // make sure that the parton is a quark
165  if (std::abs(wd->pdgId()) < TopDecayID::tID) {
166  if (invertFlavor ? reco::flavour(*wd) < 0 : reco::flavour(*wd) > 0) {
167  cand = dynamic_cast<const reco::GenParticle*>(&(*wd));
168  if (cand == nullptr) {
169  throw edm::Exception(edm::errors::InvalidReference, "Not a GenParticle");
170  }
171  break;
172  }
173  }
174  }
175  }
176  }
177  }
178  return cand;
179 }

References funct::abs(), Exception, reco::flavour(), edm::errors::InvalidReference, TopGenEvent::parts_, singleLepton(), TopDecayID::tID, w, and TopDecayID::WID.

Referenced by TtSemiEvtSolution::getGenHadp(), and hadronicDecayQuarkBar().

◆ hadronicDecayQuarkBar()

const reco::GenParticle* TtGenEvent::hadronicDecayQuarkBar ( ) const
inline

get light anti-quark of hadronic decay branch

Definition at line 78 of file TtGenEvent.h.

78 { return hadronicDecayQuark(true); };

References hadronicDecayQuark().

Referenced by TtSemiEvtSolution::getGenHadq().

◆ hadronicDecayTop()

const reco::GenParticle * TtGenEvent::hadronicDecayTop ( bool  excludeTauLeptons = false) const

get top of hadronic decay branch

Definition at line 212 of file TtGenEvent.cc.

212  {
213  const reco::GenParticle* cand = nullptr;
214  if (singleLepton(excludeTauLeptons)) {
215  const reco::GenParticleCollection& partsColl = *parts_;
216  const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons);
217  for (unsigned int i = 0; i < partsColl.size(); ++i) {
218  if (std::abs(partsColl[i].pdgId()) == TopDecayID::tID &&
219  reco::flavour(singleLep) == reco::flavour(partsColl[i])) {
220  cand = &partsColl[i];
221  }
222  }
223  }
224  return cand;
225 }

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

Referenced by TtSemiEvtSolution::getGenHadt(), and hadronicDecayTopRadiation().

◆ hadronicDecayTopRadiation()

std::vector< const reco::GenParticle * > TtGenEvent::hadronicDecayTopRadiation ( bool  excludeTauLeptons = false) const

gluons as radiated from the hadronicly decaying top quark

Definition at line 282 of file TtGenEvent.cc.

282  {
283  if (hadronicDecayTop(excludeTauLeptons)) {
284  return (hadronicDecayTop(excludeTauLeptons)->pdgId() > 0 ? radiatedGluons(TopDecayID::tID)
286  }
287  std::vector<const reco::GenParticle*> rad;
288  return (rad);
289 }

References hadronicDecayTop(), EgammaValidation_cff::pdgId, TopGenEvent::radiatedGluons(), and TopDecayID::tID.

◆ hadronicDecayW()

const reco::GenParticle * TtGenEvent::hadronicDecayW ( bool  excludeTauLeptons = false) const

get W of hadronic decay branch

Definition at line 196 of file TtGenEvent.cc.

196  {
197  const reco::GenParticle* cand = nullptr;
198  if (singleLepton(excludeTauLeptons)) {
199  const reco::GenParticleCollection& partsColl = *parts_;
200  const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons);
201  for (unsigned int i = 0; i < partsColl.size(); ++i) {
202  if (std::abs(partsColl[i].pdgId()) == TopDecayID::WID &&
203  reco::flavour(singleLep) != -reco::flavour(partsColl[i])) {
204  // PDG Id:13=mu- 24=W+ (+24)->(-13) (-24)->(+13) opposite sign
205  cand = &partsColl[i];
206  }
207  }
208  }
209  return cand;
210 }

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

Referenced by TtSemiEvtSolution::getGenHadW().

◆ isFullHadronic()

bool TtGenEvent::isFullHadronic ( bool  excludeTauLeptons = false) const
inline

check if the event can be classified as full hadronic

Definition at line 34 of file TtGenEvent.h.

34  {
35  return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 0) : false;
36  }

References isNumberOfLeptons(), and isTtBar().

Referenced by TtHadEvtSolution::setGenEvt().

◆ isFullLeptonic() [1/2]

bool TtGenEvent::isFullLeptonic ( bool  excludeTauLeptons = false) const
inline

check if the event can be classified as full leptonic

Definition at line 42 of file TtGenEvent.h.

42  {
43  return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 2) : false;
44  }

References isNumberOfLeptons(), and isTtBar().

Referenced by fullLeptonicChannel(), and TtDilepEvtSolution::setGenEvt().

◆ isFullLeptonic() [2/2]

bool TtGenEvent::isFullLeptonic ( WDecay::LeptonType  typeA,
WDecay::LeptonType  typeB 
) const
inline

check if the event is full leptonic with the lepton being of typeA or typeB irrelevant of order; all leptons including taus are allowed

Definition at line 107 of file TtGenEvent.h.

107  {
108  return ((fullLeptonicChannel().first == typeA && fullLeptonicChannel().second == typeB) ||
109  (fullLeptonicChannel().first == typeB && fullLeptonicChannel().second == typeA));
110 }

References first, fullLeptonicChannel(), and edm::second().

◆ isNumberOfLeptons()

bool TtGenEvent::isNumberOfLeptons ( bool  excludeTauLeptons,
int  nlep 
) const
inlineprivate

check whether the number of leptons among the daughters of the W boson is nlep or not; there is an option to exclude taus from the list of leptons to consider

Definition at line 102 of file TtGenEvent.h.

102  {
103  return excludeTauLeptons ? (numberOfLeptons() - numberOfLeptons(WDecay::kTau)) == nlep : numberOfLeptons() == nlep;
104  }

References WDecay::kTau, and TopGenEvent::numberOfLeptons().

Referenced by isFullHadronic(), isFullLeptonic(), and isSemiLeptonic().

◆ isSemiLeptonic() [1/3]

bool TtGenEvent::isSemiLeptonic ( bool  excludeTauLeptons = false) const
inline

check if the event can be classified as semi-laptonic

Definition at line 38 of file TtGenEvent.h.

38  {
39  return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 1) : false;
40  }

References isNumberOfLeptons(), and isTtBar().

Referenced by semiLeptonicChannel(), TtSemiEvtSolution::setGenEvt(), singleLepton(), and singleNeutrino().

◆ isSemiLeptonic() [2/3]

bool TtGenEvent::isSemiLeptonic ( WDecay::LeptonType  typeA) const
inline

check if the event is semi-leptonic with the lepton being of typeA; all leptons including taus are allowed

Definition at line 49 of file TtGenEvent.h.

49 { return semiLeptonicChannel() == typeA ? true : false; };

References semiLeptonicChannel(), and funct::true.

◆ isSemiLeptonic() [3/3]

bool TtGenEvent::isSemiLeptonic ( WDecay::LeptonType  typeA,
WDecay::LeptonType  typeB 
) const
inline

check if the event is semi-leptonic with the lepton being of typeA or typeB; all leptons including taus are allowed

Definition at line 51 of file TtGenEvent.h.

51  {
52  return (semiLeptonicChannel() == typeA || semiLeptonicChannel() == typeB) ? true : false;
53  };

References semiLeptonicChannel(), and funct::true.

◆ isTtBar()

bool TtGenEvent::isTtBar ( ) const
inline

check if the event can be classified as ttbar

Definition at line 28 of file TtGenEvent.h.

28 { return (top() && topBar()); }

References TopGenEvent::top(), and TopGenEvent::topBar().

Referenced by isFullHadronic(), isFullLeptonic(), and isSemiLeptonic().

◆ lepton()

const reco::GenParticle * TtGenEvent::lepton ( bool  excludeTauLeptons = false) const

get lepton for semi-leptonic or full leptonic decays

Definition at line 69 of file TtGenEvent.cc.

69  {
70  const reco::GenParticle* cand = nullptr;
71  const reco::GenParticleCollection& partsColl = *parts_;
72  for (unsigned int i = 0; i < partsColl.size(); ++i) {
73  if (reco::isLepton(partsColl[i]) && partsColl[i].mother() &&
74  std::abs(partsColl[i].mother()->pdgId()) == TopDecayID::WID) {
75  if (reco::flavour(partsColl[i]) > 0) {
76  cand = &partsColl[i];
77  }
78  }
79  }
80  return cand;
81 }

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

Referenced by fullLeptonicChannel(), and TtDilepEvtSolution::getGenLepm().

◆ leptonBar()

const reco::GenParticle * TtGenEvent::leptonBar ( bool  excludeTauLeptons = false) const

get anti-lepton for semi-leptonic or full leptonic decays

Definition at line 83 of file TtGenEvent.cc.

83  {
84  const reco::GenParticle* cand = nullptr;
85  const reco::GenParticleCollection& partsColl = *parts_;
86  for (unsigned int i = 0; i < partsColl.size(); ++i) {
87  if (reco::isLepton(partsColl[i]) && partsColl[i].mother() &&
88  std::abs(partsColl[i].mother()->pdgId()) == TopDecayID::WID) {
89  if (reco::flavour(partsColl[i]) < 0) {
90  cand = &partsColl[i];
91  }
92  }
93  }
94  return cand;
95 }

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

Referenced by fullLeptonicChannel(), and TtDilepEvtSolution::getGenLepp().

◆ leptonicDecayB()

const reco::GenParticle * TtGenEvent::leptonicDecayB ( bool  excludeTauLeptons = false) const

get b of leptonic decay branch

Definition at line 227 of file TtGenEvent.cc.

227  {
228  const reco::GenParticle* cand = nullptr;
229  if (singleLepton(excludeTauLeptons)) {
230  const reco::GenParticleCollection& partsColl = *parts_;
231  const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons);
232  for (unsigned int i = 0; i < partsColl.size(); ++i) {
233  if (std::abs(partsColl[i].pdgId()) == TopDecayID::bID &&
234  reco::flavour(singleLep) != reco::flavour(partsColl[i])) {
235  cand = &partsColl[i];
236  }
237  }
238  }
239  return cand;
240 }

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

Referenced by TtSemiEvtSolution::getGenLepb().

◆ leptonicDecayTop()

const reco::GenParticle * TtGenEvent::leptonicDecayTop ( bool  excludeTauLeptons = false) const

get top of leptonic decay branch

Definition at line 258 of file TtGenEvent.cc.

258  {
259  const reco::GenParticle* cand = nullptr;
260  if (singleLepton(excludeTauLeptons)) {
261  const reco::GenParticleCollection& partsColl = *parts_;
262  const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons);
263  for (unsigned int i = 0; i < partsColl.size(); ++i) {
264  if (std::abs(partsColl[i].pdgId()) == TopDecayID::tID &&
265  reco::flavour(singleLep) != reco::flavour(partsColl[i])) {
266  cand = &partsColl[i];
267  }
268  }
269  }
270  return cand;
271 }

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

Referenced by TtSemiEvtSolution::getGenLept(), and leptonicDecayTopRadiation().

◆ leptonicDecayTopRadiation()

std::vector< const reco::GenParticle * > TtGenEvent::leptonicDecayTopRadiation ( bool  excludeTauLeptons = false) const

gluons as radiated from the leptonicly decaying top quark

Definition at line 273 of file TtGenEvent.cc.

273  {
274  if (leptonicDecayTop(excludeTauLeptons)) {
275  return (leptonicDecayTop(excludeTauLeptons)->pdgId() > 0 ? radiatedGluons(TopDecayID::tID)
277  }
278  std::vector<const reco::GenParticle*> rad;
279  return (rad);
280 }

References leptonicDecayTop(), EgammaValidation_cff::pdgId, TopGenEvent::radiatedGluons(), and TopDecayID::tID.

◆ leptonicDecayW()

const reco::GenParticle * TtGenEvent::leptonicDecayW ( bool  excludeTauLeptons = false) const

get W of leptonic decay branch

Definition at line 242 of file TtGenEvent.cc.

242  {
243  const reco::GenParticle* cand = nullptr;
244  if (singleLepton(excludeTauLeptons)) {
245  const reco::GenParticleCollection& partsColl = *parts_;
246  const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons);
247  for (unsigned int i = 0; i < partsColl.size(); ++i) {
248  if (std::abs(partsColl[i].pdgId()) == TopDecayID::WID &&
249  reco::flavour(singleLep) == -reco::flavour(partsColl[i])) {
250  // PDG Id:13=mu- 24=W+ (+24)->(-13) (-24)->(+13) opposite sign
251  cand = &partsColl[i];
252  }
253  }
254  }
255  return cand;
256 }

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

Referenced by TtSemiEvtSolution::getGenLepW().

◆ neutrino()

const reco::GenParticle * TtGenEvent::neutrino ( bool  excludeTauLeptons = false) const

get neutrino for semi-leptonic or full leptonic decays

Definition at line 111 of file TtGenEvent.cc.

111  {
112  const reco::GenParticle* cand = nullptr;
113  const reco::GenParticleCollection& partsColl = *parts_;
114  for (unsigned int i = 0; i < partsColl.size(); ++i) {
115  if (reco::isNeutrino(partsColl[i]) && partsColl[i].mother() &&
116  std::abs(partsColl[i].mother()->pdgId()) == TopDecayID::WID) {
117  if (reco::flavour(partsColl[i]) > 0) {
118  cand = &partsColl[i];
119  }
120  }
121  }
122  return cand;
123 }

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

Referenced by TtDilepEvtSolution::getGenN().

◆ neutrinoBar()

const reco::GenParticle * TtGenEvent::neutrinoBar ( bool  excludeTauLeptons = false) const

get anti-neutrino for semi-leptonic or full leptonic decays

Definition at line 125 of file TtGenEvent.cc.

125  {
126  const reco::GenParticle* cand = nullptr;
127  const reco::GenParticleCollection& partsColl = *parts_;
128  for (unsigned int i = 0; i < partsColl.size(); ++i) {
129  if (reco::isNeutrino(partsColl[i]) && partsColl[i].mother() &&
130  std::abs(partsColl[i].mother()->pdgId()) == TopDecayID::WID) {
131  if (reco::flavour(partsColl[i]) < 0) {
132  cand = &partsColl[i];
133  }
134  }
135  }
136  return cand;
137 }

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

Referenced by TtDilepEvtSolution::getGenNbar().

◆ semiLeptonicChannel()

WDecay::LeptonType TtGenEvent::semiLeptonicChannel ( ) const

return decay channel; all leptons including taus are allowed

Definition at line 33 of file TtGenEvent.cc.

33  {
35  if (isSemiLeptonic() && singleLepton()) {
42  }
43  return type;
44 }

References funct::abs(), TopDecayID::elecID, isSemiLeptonic(), WDecay::kElec, WDecay::kMuon, WDecay::kNone, WDecay::kTau, TopDecayID::muonID, EgammaValidation_cff::pdgId, singleLepton(), and TopDecayID::tauID.

Referenced by isSemiLeptonic().

◆ singleLepton()

const reco::GenParticle * TtGenEvent::singleLepton ( bool  excludeTauLeptons = false) const

return single lepton if available; 0 else

Definition at line 97 of file TtGenEvent.cc.

97  {
98  const reco::GenParticle* cand = nullptr;
99  if (isSemiLeptonic(excludeTauLeptons)) {
100  const reco::GenParticleCollection& partsColl = *parts_;
101  for (unsigned int i = 0; i < partsColl.size(); ++i) {
102  if (reco::isLepton(partsColl[i]) && partsColl[i].mother() &&
103  std::abs(partsColl[i].mother()->pdgId()) == TopDecayID::WID) {
104  cand = &partsColl[i];
105  }
106  }
107  }
108  return cand;
109 }

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

Referenced by TtSemiEvtSolution::getGenLepl(), hadronicDecayB(), hadronicDecayQuark(), hadronicDecayTop(), hadronicDecayW(), leptonicDecayB(), leptonicDecayTop(), leptonicDecayW(), and semiLeptonicChannel().

◆ singleNeutrino()

const reco::GenParticle * TtGenEvent::singleNeutrino ( bool  excludeTauLeptons = false) const

return single neutrino if available; 0 else

Definition at line 139 of file TtGenEvent.cc.

139  {
140  const reco::GenParticle* cand = nullptr;
141  if (isSemiLeptonic(excludeTauLeptons)) {
142  const reco::GenParticleCollection& partsColl = *parts_;
143  for (unsigned int i = 0; i < partsColl.size(); ++i) {
144  if (reco::isNeutrino(partsColl[i]) && partsColl[i].mother() &&
145  std::abs(partsColl[i].mother()->pdgId()) == TopDecayID::WID) {
146  cand = &partsColl[i];
147  }
148  }
149  }
150  return cand;
151 }

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

Referenced by TtSemiEvtSolution::getGenLepn().

◆ topPair()

const math::XYZTLorentzVector* TtGenEvent::topPair ( ) const
inline

return combined 4-vector of top and topBar

Definition at line 93 of file TtGenEvent.h.

93 { return isTtBar() ? &topPair_ : nullptr; };

Member Data Documentation

◆ topPair_

math::XYZTLorentzVector TtGenEvent::topPair_
protected

combined 4-vector of top and topBar

Definition at line 93 of file TtGenEvent.h.

Referenced by TtGenEvent().

mps_fire.i
i
Definition: mps_fire.py:428
TtGenEvent::leptonicDecayTop
const reco::GenParticle * leptonicDecayTop(bool excludeTauLeptons=false) const
get top of leptonic decay branch
Definition: TtGenEvent.cc:258
funct::false
false
Definition: Factorize.h:29
edm::errors::InvalidReference
Definition: EDMException.h:39
TtGenEvent::topPair_
math::XYZTLorentzVector topPair_
combined 4-vector of top and topBar
Definition: TtGenEvent.h:93
reco::GenParticle
Definition: GenParticle.h:21
reco::flavour
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:21
TtGenEvent::fullLeptonicChannel
std::pair< WDecay::LeptonType, WDecay::LeptonType > fullLeptonicChannel() const
Definition: TtGenEvent.cc:46
TopDecayID::bID
static const int bID
Definition: TopGenEvent.h:13
reco::GenParticleCollection
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
Definition: GenParticleFwd.h:13
reco::candidate::const_iterator
Definition: const_iterator.h:14
TopGenEvent::initPartons_
reco::GenParticleRefProd initPartons_
reference to the list of initial partons (has to be kept in the event!)
Definition: TopGenEvent.h:113
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
TtGenEvent::lepton
const reco::GenParticle * lepton(bool excludeTauLeptons=false) const
get lepton for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:69
TtGenEvent::hadronicDecayTop
const reco::GenParticle * hadronicDecayTop(bool excludeTauLeptons=false) const
get top of hadronic decay branch
Definition: TtGenEvent.cc:212
TopGenEvent::radiatedGluons
std::vector< const reco::GenParticle * > radiatedGluons(int pdgId) const
return radiated gluons from particle with pdgId
Definition: TopGenEvent.cc:177
TopDecayID::elecID
static const int elecID
Definition: TopGenEvent.h:18
TtGenEvent::isNumberOfLeptons
bool isNumberOfLeptons(bool excludeTauLeptons, int nlep) const
Definition: TtGenEvent.h:102
TopGenEvent::numberOfLeptons
int numberOfLeptons(bool fromWBoson=true) const
return number of leptons in the decay chain
Definition: TopGenEvent.cc:41
reco::isNeutrino
bool isNeutrino(const Candidate &part)
Definition: pdgIdUtils.h:17
reco::isLepton
bool isLepton(const Candidate &part)
Definition: pdgIdUtils.h:13
TopGenEvent::topBar
const reco::GenParticle * topBar() const
return anti-top if available; 0 else
Definition: TopGenEvent.h:103
TopDecayID::muonID
static const int muonID
Definition: TopGenEvent.h:19
TtGenEvent::semiLeptonicChannel
WDecay::LeptonType semiLeptonicChannel() const
return decay channel; all leptons including taus are allowed
Definition: TtGenEvent.cc:33
TtGenEvent::isSemiLeptonic
bool isSemiLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as semi-laptonic
Definition: TtGenEvent.h:38
TopDecaySubset_cfi.decaySubset
decaySubset
Definition: TopDecaySubset_cfi.py:7
w
const double w
Definition: UKUtility.cc:23
TopDecayID::tID
static const int tID
Definition: TopGenEvent.h:12
TtGenEvent::singleLepton
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:97
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
TopGenEvent::top
const reco::GenParticle * top() const
return top if available; 0 else
Definition: TopGenEvent.h:101
funct::true
true
Definition: Factorize.h:173
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
TtGenEvent::isFullLeptonic
bool isFullLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as full leptonic
Definition: TtGenEvent.h:42
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
cand
Definition: decayParser.h:32
p4
double p4[4]
Definition: TauolaWrapper.h:92
EgammaValidation_cff.pdgId
pdgId
Definition: EgammaValidation_cff.py:117
WDecay::kTau
Definition: TopGenEvent.h:27
TopDecayID::WID
static const int WID
Definition: TopGenEvent.h:17
TopDecayID::tauID
static const int tauID
Definition: TopGenEvent.h:20
WDecay::LeptonType
LeptonType
Definition: TopGenEvent.h:27
TtGenEvent::leptonBar
const reco::GenParticle * leptonBar(bool excludeTauLeptons=false) const
get anti-lepton for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:83
WDecay::kNone
Definition: TopGenEvent.h:27
TopInitSubset_cfi.initSubset
initSubset
Definition: TopInitSubset_cfi.py:7
WDecay::kMuon
Definition: TopGenEvent.h:27
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
Exception
Definition: hltDiff.cc:245
TtGenEvent::isTtBar
bool isTtBar() const
check if the event can be classified as ttbar
Definition: TtGenEvent.h:28
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
WDecay::kElec
Definition: TopGenEvent.h:27
TtGenEvent::hadronicDecayQuark
const reco::GenParticle * hadronicDecayQuark(bool invertFlavor=false) const
get light quark of hadronic decay branch
Definition: TtGenEvent.cc:153