CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::LeptonType
fullLeptonicChannel () 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::TtGenEvent ( )
inline

empty constructor

Definition at line 21 of file TtGenEvent.h.

21 {};
TtGenEvent::TtGenEvent ( reco::GenParticleRefProd decaySubset,
reco::GenParticleRefProd initSubset 
)

default constructor from decaySubset and initSubset

Definition at line 10 of file TtGenEvent.cc.

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

10  {
13  if (top() && topBar())
14  topPair_ = math::XYZTLorentzVector(top()->p4() + topBar()->p4());
15 }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111
math::XYZTLorentzVector topPair_
combined 4-vector of top and topBar
Definition: TtGenEvent.h:93
const reco::GenParticle * top() const
return top if available; 0 else
Definition: TopGenEvent.h:101
reco::GenParticleRefProd initPartons_
reference to the list of initial partons (has to be kept in the event!)
Definition: TopGenEvent.h:113
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
const reco::GenParticle * topBar() const
return anti-top if available; 0 else
Definition: TopGenEvent.h:103
TtGenEvent::~TtGenEvent ( )
inlineoverride

default destructor

Definition at line 25 of file TtGenEvent.h.

25 {};

Member Function Documentation

bool TtGenEvent::fromGluonFusion ( ) const

check if the tops were produced from a pair of gluons

Definition at line 17 of file TtGenEvent.cc.

References TopGenEvent::initPartons_.

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 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
reco::GenParticleRefProd initPartons_
reference to the list of initial partons (has to be kept in the event!)
Definition: TopGenEvent.h:113
bool TtGenEvent::fromQuarkAnnihilation ( ) const

check if the tops were produced from qqbar

Definition at line 25 of file TtGenEvent.cc.

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

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 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
reco::GenParticleRefProd initPartons_
reference to the list of initial partons (has to be kept in the event!)
Definition: TopGenEvent.h:113
static const int tID
Definition: TopGenEvent.h:12
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< WDecay::LeptonType, WDecay::LeptonType > TtGenEvent::fullLeptonicChannel ( ) const

Definition at line 46 of file TtGenEvent.cc.

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

Referenced by isFullLeptonic().

46  {
48  if (isFullLeptonic()) {
49  if (lepton()) {
50  if (std::abs(lepton()->pdgId()) == TopDecayID::elecID)
51  typeA = WDecay::kElec;
52  if (std::abs(lepton()->pdgId()) == TopDecayID::muonID)
53  typeA = WDecay::kMuon;
54  if (std::abs(lepton()->pdgId()) == TopDecayID::tauID)
55  typeA = WDecay::kTau;
56  }
57  if (leptonBar()) {
58  if (std::abs(leptonBar()->pdgId()) == TopDecayID::elecID)
59  typeB = WDecay::kElec;
60  if (std::abs(leptonBar()->pdgId()) == TopDecayID::muonID)
61  typeB = WDecay::kMuon;
62  if (std::abs(leptonBar()->pdgId()) == TopDecayID::tauID)
63  typeB = WDecay::kTau;
64  }
65  }
66  return (std::pair<WDecay::LeptonType, WDecay::LeptonType>(typeA, typeB));
67 }
const reco::GenParticle * lepton(bool excludeTauLeptons=false) const
get lepton for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:69
static const int tauID
Definition: TopGenEvent.h:20
bool isFullLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as full leptonic
Definition: TtGenEvent.h:42
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int muonID
Definition: TopGenEvent.h:19
static const int elecID
Definition: TopGenEvent.h:18
const reco::GenParticle * leptonBar(bool excludeTauLeptons=false) const
get anti-lepton for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:83
const reco::GenParticle * TtGenEvent::hadronicDecayB ( bool  excludeTauLeptons = false) const

get b of hadronic decay branch

Definition at line 181 of file TtGenEvent.cc.

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

Referenced by TtSemiLepEvtPartons::vec().

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 }
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
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:21
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:97
const reco::GenParticle * TtGenEvent::hadronicDecayQuark ( bool  invertFlavor = false) const

get light quark of hadronic decay branch

Definition at line 153 of file TtGenEvent.cc.

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

Referenced by hadronicDecayQuarkBar(), and TtSemiLepEvtPartons::vec().

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 }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111
const double w
Definition: UKUtility.cc:23
static const int tID
Definition: TopGenEvent.h:12
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
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:97
const reco::GenParticle* TtGenEvent::hadronicDecayQuarkBar ( ) const
inline

get light anti-quark of hadronic decay branch

Definition at line 78 of file TtGenEvent.h.

References hadronicDecayQuark().

Referenced by TtSemiLepEvtPartons::vec().

78 { return hadronicDecayQuark(true); };
const reco::GenParticle * hadronicDecayQuark(bool invertFlavor=false) const
get light quark of hadronic decay branch
Definition: TtGenEvent.cc:153
const reco::GenParticle * TtGenEvent::hadronicDecayTop ( bool  excludeTauLeptons = false) const

get top of hadronic decay branch

Definition at line 212 of file TtGenEvent.cc.

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

Referenced by hadronicDecayTopRadiation().

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 }
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 tID
Definition: TopGenEvent.h:12
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:21
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:97
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.

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

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 }
static const int tID
Definition: TopGenEvent.h:12
const reco::GenParticle * hadronicDecayTop(bool excludeTauLeptons=false) const
get top of hadronic decay branch
Definition: TtGenEvent.cc:212
std::vector< const reco::GenParticle * > radiatedGluons(int pdgId) const
return radiated gluons from particle with pdgId
Definition: TopGenEvent.cc:177
const reco::GenParticle * TtGenEvent::hadronicDecayW ( bool  excludeTauLeptons = false) const

get W of hadronic decay branch

Definition at line 196 of file TtGenEvent.cc.

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

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 }
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
static const int WID
Definition: TopGenEvent.h:17
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:21
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:97
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.

References isNumberOfLeptons(), and isTtBar().

Referenced by TtFullHadEvtPartons::vec().

34  {
35  return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 0) : false;
36  }
bool isNumberOfLeptons(bool excludeTauLeptons, int nlep) const
Definition: TtGenEvent.h:102
bool isTtBar() const
check if the event can be classified as ttbar
Definition: TtGenEvent.h:28
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.

References isNumberOfLeptons(), and isTtBar().

Referenced by fullLeptonicChannel(), and TtFullLepEvtPartons::vec().

42  {
43  return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 2) : false;
44  }
bool isNumberOfLeptons(bool excludeTauLeptons, int nlep) const
Definition: TtGenEvent.h:102
bool isTtBar() const
check if the event can be classified as ttbar
Definition: TtGenEvent.h:28
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.

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

107  {
108  return ((fullLeptonicChannel().first == typeA && fullLeptonicChannel().second == typeB) ||
109  (fullLeptonicChannel().first == typeB && fullLeptonicChannel().second == typeA));
110 }
U second(std::pair< T, U > const &p)
std::pair< WDecay::LeptonType, WDecay::LeptonType > fullLeptonicChannel() const
Definition: TtGenEvent.cc:46
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.

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

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

102  {
103  return excludeTauLeptons ? (numberOfLeptons() - numberOfLeptons(WDecay::kTau)) == nlep : numberOfLeptons() == nlep;
104  }
int numberOfLeptons(bool fromWBoson=true) const
return number of leptons in the decay chain
Definition: TopGenEvent.cc:41
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.

References isNumberOfLeptons(), and isTtBar().

Referenced by semiLeptonicChannel(), singleLepton(), singleNeutrino(), and TtSemiLepEvtPartons::vec().

38  {
39  return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 1) : false;
40  }
bool isNumberOfLeptons(bool excludeTauLeptons, int nlep) const
Definition: TtGenEvent.h:102
bool isTtBar() const
check if the event can be classified as ttbar
Definition: TtGenEvent.h:28
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.

References semiLeptonicChannel().

49 { return semiLeptonicChannel() == typeA ? true : false; };
WDecay::LeptonType semiLeptonicChannel() const
return decay channel; all leptons including taus are allowed
Definition: TtGenEvent.cc:33
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.

References semiLeptonicChannel().

51  {
52  return (semiLeptonicChannel() == typeA || semiLeptonicChannel() == typeB) ? true : false;
53  };
WDecay::LeptonType semiLeptonicChannel() const
return decay channel; all leptons including taus are allowed
Definition: TtGenEvent.cc:33
bool TtGenEvent::isTtBar ( ) const
inline

check if the event can be classified as ttbar

Definition at line 28 of file TtGenEvent.h.

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

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

28 { return (top() && topBar()); }
const reco::GenParticle * top() const
return top if available; 0 else
Definition: TopGenEvent.h:101
const reco::GenParticle * topBar() const
return anti-top if available; 0 else
Definition: TopGenEvent.h:103
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.

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

Referenced by fullLeptonicChannel().

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 }
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
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:21
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.

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

Referenced by fullLeptonicChannel().

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 }
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
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:21
const reco::GenParticle * TtGenEvent::leptonicDecayB ( bool  excludeTauLeptons = false) const

get b of leptonic decay branch

Definition at line 227 of file TtGenEvent.cc.

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

Referenced by TtSemiLepEvtPartons::vec().

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 }
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
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:21
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:97
const reco::GenParticle * TtGenEvent::leptonicDecayTop ( bool  excludeTauLeptons = false) const

get top of leptonic decay branch

Definition at line 258 of file TtGenEvent.cc.

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

Referenced by leptonicDecayTopRadiation().

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 }
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 tID
Definition: TopGenEvent.h:12
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:21
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:97
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.

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

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 }
const reco::GenParticle * leptonicDecayTop(bool excludeTauLeptons=false) const
get top of leptonic decay branch
Definition: TtGenEvent.cc:258
static const int tID
Definition: TopGenEvent.h:12
std::vector< const reco::GenParticle * > radiatedGluons(int pdgId) const
return radiated gluons from particle with pdgId
Definition: TopGenEvent.cc:177
const reco::GenParticle * TtGenEvent::leptonicDecayW ( bool  excludeTauLeptons = false) const

get W of leptonic decay branch

Definition at line 242 of file TtGenEvent.cc.

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

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 }
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
static const int WID
Definition: TopGenEvent.h:17
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:21
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:97
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.

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

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 }
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 isNeutrino(const Candidate &part)
Definition: pdgIdUtils.h:17
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
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.

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

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 }
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 isNeutrino(const Candidate &part)
Definition: pdgIdUtils.h:17
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
WDecay::LeptonType TtGenEvent::semiLeptonicChannel ( ) const

return decay channel; all leptons including taus are allowed

Definition at line 33 of file TtGenEvent.cc.

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

Referenced by isSemiLeptonic().

33  {
35  if (isSemiLeptonic() && singleLepton()) {
36  if (std::abs(singleLepton()->pdgId()) == TopDecayID::elecID)
37  type = WDecay::kElec;
38  if (std::abs(singleLepton()->pdgId()) == TopDecayID::muonID)
39  type = WDecay::kMuon;
40  if (std::abs(singleLepton()->pdgId()) == TopDecayID::tauID)
41  type = WDecay::kTau;
42  }
43  return type;
44 }
bool isSemiLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as semi-laptonic
Definition: TtGenEvent.h:38
static const int tauID
Definition: TopGenEvent.h:20
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int muonID
Definition: TopGenEvent.h:19
static const int elecID
Definition: TopGenEvent.h:18
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:97
const reco::GenParticle * TtGenEvent::singleLepton ( bool  excludeTauLeptons = false) const

return single lepton if available; 0 else

Definition at line 97 of file TtGenEvent.cc.

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

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

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 }
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 isSemiLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as semi-laptonic
Definition: TtGenEvent.h:38
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
const reco::GenParticle * TtGenEvent::singleNeutrino ( bool  excludeTauLeptons = false) const

return single neutrino if available; 0 else

Definition at line 139 of file TtGenEvent.cc.

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

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 }
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 isSemiLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as semi-laptonic
Definition: TtGenEvent.h:38
bool isNeutrino(const Candidate &part)
Definition: pdgIdUtils.h:17
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int WID
Definition: TopGenEvent.h:17
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; };
math::XYZTLorentzVector topPair_
combined 4-vector of top and topBar
Definition: TtGenEvent.h:93
bool isTtBar() const
check if the event can be classified as ttbar
Definition: TtGenEvent.h:28

Member Data Documentation

math::XYZTLorentzVector TtGenEvent::topPair_
protected

combined 4-vector of top and topBar

Definition at line 93 of file TtGenEvent.h.

Referenced by TtGenEvent().