CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | 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

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...
 
 TtGenEvent ()
 empty constructor More...
 
 TtGenEvent (reco::GenParticleRefProd &decaySubset, reco::GenParticleRefProd &initSubset)
 default constructor from decaySubset and initSubset More...
 
virtual ~TtGenEvent ()
 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...
 

Private Member Functions

bool isNumberOfLeptons (bool excludeTauLeptons, int nlep) const
 

Additional Inherited Members

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

Detailed Description

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

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

default constructor from decaySubset and initSubset

default contructor from decaySubset and initSubset

Definition at line 12 of file TtGenEvent.cc.

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

13 {
16 }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
reco::GenParticleRefProd initPartons_
reference to the list of initial partons (has to be kept in the event!)
Definition: TopGenEvent.h:117
virtual TtGenEvent::~TtGenEvent ( )
inlinevirtual

default destructor

Definition at line 27 of file TtGenEvent.h.

27 {};

Member Function Documentation

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

Definition at line 31 of file TtGenEvent.cc.

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

Referenced by isFullLeptonic().

32 {
34  if( isFullLeptonic() ){
35  if( lepton() ){
39  }
40  if( leptonBar() ){
44  }
45  }
46  return ( std::pair<WDecay::LeptonType,WDecay::LeptonType>(typeA, typeB) );
47 }
const reco::GenParticle * lepton(bool excludeTauLeptons=false) const
get lepton for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:50
#define abs(x)
Definition: mlp_lapack.h:159
static const int tauID
Definition: TopGenEvent.h:21
bool isFullLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as full leptonic
Definition: TtGenEvent.h:36
static const int muonID
Definition: TopGenEvent.h:20
static const int elecID
Definition: TopGenEvent.h:19
const reco::GenParticle * leptonBar(bool excludeTauLeptons=false) const
get anti-lepton for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:66
const reco::GenParticle * TtGenEvent::hadronicDecayB ( bool  excludeTauLeptons = false) const

get b of hadronic decay branch

Definition at line 176 of file TtGenEvent.cc.

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

Referenced by TtSemiLepEvtPartons::vec().

177 {
178  const reco::GenParticle* cand=0;
179  if( singleLepton(excludeTauLeptons) ){
180  const reco::GenParticleCollection& partsColl = *parts_;
181  const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons);
182  for (unsigned int i = 0; i < partsColl.size(); ++i) {
183  if (std::abs(partsColl[i].pdgId())==TopDecayID::bID &&
184  reco::flavour(singleLep)==reco::flavour(partsColl[i])) {
185  cand = &partsColl[i];
186  }
187  }
188  }
189  return cand;
190 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
static const int bID
Definition: TopGenEvent.h:14
#define abs(x)
Definition: mlp_lapack.h:159
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:82
const reco::GenParticle * TtGenEvent::hadronicDecayQuark ( bool  invertFlavor = false) const

get light quark of hadronic decay branch

Definition at line 146 of file TtGenEvent.cc.

References abs, reco::Candidate::begin(), reco::Candidate::end(), edm::hlt::Exception, reco::flavour(), edm::errors::InvalidReference, TopGenEvent::parts_, singleLepton(), TopDecayID::tID, and TopDecayID::WID.

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

147 {
148  const reco::GenParticle* cand=0;
149  // catch W boson and check its daughters for a quark;
150  // make sure the decay is semi-leptonic first; this
151  // only makes sense if taus are not excluded from the
152  // decision
153  if( singleLepton(false) ){
154  for(reco::GenParticleCollection::const_iterator w=parts_->begin(); w!=parts_->end(); ++w){
155  if( std::abs( w->pdgId() )==TopDecayID::WID ){
156  // make sure that the particle is a W daughter
157  for(reco::GenParticle::const_iterator wd=w->begin(); wd!=w->end(); ++wd){
158  // make sure that the parton is a quark
159  if( std::abs(wd->pdgId())<TopDecayID::tID ){
160  if( invertFlavor?reco::flavour(*wd)<0:reco::flavour(*wd)>0 ){
161  cand = dynamic_cast<const reco::GenParticle* > (&(*wd));
162  if(cand == 0){
163  throw edm::Exception( edm::errors::InvalidReference, "Not a GenParticle" );
164  }
165  break;
166  }
167  }
168  }
169  }
170  }
171  }
172  return cand;
173 }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
#define abs(x)
Definition: mlp_lapack.h:159
static const int tID
Definition: TopGenEvent.h:13
virtual const_iterator end() const =0
last daughter const_iterator
static const int WID
Definition: TopGenEvent.h:18
virtual const_iterator begin() const =0
first daughter const_iterator
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:82
const reco::GenParticle* TtGenEvent::hadronicDecayQuarkBar ( ) const
inline

get light anti-quark of hadronic decay branch

Definition at line 68 of file TtGenEvent.h.

References hadronicDecayQuark().

Referenced by TtSemiLepEvtPartons::vec().

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

get top of hadronic decay branch

Definition at line 211 of file TtGenEvent.cc.

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

Referenced by hadronicDecayTopRadiation().

212 {
213  const reco::GenParticle* cand=0;
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
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
#define abs(x)
Definition: mlp_lapack.h:159
static const int tID
Definition: TopGenEvent.h:13
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:82
std::vector< const reco::GenParticle * > TtGenEvent::hadronicDecayTopRadiation ( bool  excludeTauLeptons = false) const

gluons as radiated from the hadronicly decaying top quark

Definition at line 287 of file TtGenEvent.cc.

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

287  {
288  if( hadronicDecayTop(excludeTauLeptons) ){
289  return (hadronicDecayTop(excludeTauLeptons)->pdgId()>0 ? radiatedGluons(TopDecayID::tID) : radiatedGluons(-TopDecayID::tID));
290  }
291  std::vector<const reco::GenParticle*> rad;
292  return (rad);
293 }
static const int tID
Definition: TopGenEvent.h:13
const reco::GenParticle * hadronicDecayTop(bool excludeTauLeptons=false) const
get top of hadronic decay branch
Definition: TtGenEvent.cc:211
std::vector< const reco::GenParticle * > radiatedGluons(int pdgId) const
return radiated gluons from particle with pdgId
Definition: TopGenEvent.cc:199
const reco::GenParticle * TtGenEvent::hadronicDecayW ( bool  excludeTauLeptons = false) const

get W of hadronic decay branch

Definition at line 193 of file TtGenEvent.cc.

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

194 {
195  const reco::GenParticle* cand=0;
196  if( singleLepton(excludeTauLeptons) ){
197  const reco::GenParticleCollection& partsColl = *parts_;
198  const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons);
199  for (unsigned int i = 0; i < partsColl.size(); ++i) {
200  if (std::abs(partsColl[i].pdgId())==TopDecayID::WID &&
201  reco::flavour(singleLep) != -reco::flavour(partsColl[i])) {
202  // PDG Id:13=mu- 24=W+ (+24)->(-13) (-24)->(+13) opposite sign
203  cand = &partsColl[i];
204  }
205  }
206  }
207  return cand;
208 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
#define abs(x)
Definition: mlp_lapack.h:159
static const int WID
Definition: TopGenEvent.h:18
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:82
bool TtGenEvent::isFullHadronic ( bool  excludeTauLeptons = false) const
inline

check if the event can be classified as full hadronic

Definition at line 32 of file TtGenEvent.h.

References isNumberOfLeptons(), and isTtBar().

Referenced by TtFullHadEvtPartons::vec().

32 { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 0) : false;}
bool isNumberOfLeptons(bool excludeTauLeptons, int nlep) const
Definition: TtGenEvent.h:86
bool isTtBar() const
check if the event can be classified as ttbar
Definition: TtGenEvent.h:30
bool TtGenEvent::isFullLeptonic ( bool  excludeTauLeptons = false) const
inline

check if the event can be classified as full leptonic

Definition at line 36 of file TtGenEvent.h.

References isNumberOfLeptons(), and isTtBar().

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

36 { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 2) : false;}
bool isNumberOfLeptons(bool excludeTauLeptons, int nlep) const
Definition: TtGenEvent.h:86
bool isTtBar() const
check if the event can be classified as ttbar
Definition: TtGenEvent.h:30
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 90 of file TtGenEvent.h.

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

91 {
92  return ( (fullLeptonicChannel().first==typeA && fullLeptonicChannel().second==typeB)||
93  (fullLeptonicChannel().first==typeB && fullLeptonicChannel().second==typeA));
94 }
U second(std::pair< T, U > const &p)
bool first
Definition: L1TdeRCT.cc:79
std::pair< WDecay::LeptonType, WDecay::LeptonType > fullLeptonicChannel() const
Definition: TtGenEvent.cc:31
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 86 of file TtGenEvent.h.

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

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

86 {return excludeTauLeptons ? (numberOfLeptons()-numberOfLeptons(WDecay::kTau))==nlep : numberOfLeptons()==nlep;}
int numberOfLeptons(bool fromWBoson=true) const
return number of leptons in the decay chain
Definition: TopGenEvent.cc:48
bool TtGenEvent::isSemiLeptonic ( bool  excludeTauLeptons = false) const
inline

check if the event can be classified as semi-laptonic

Definition at line 34 of file TtGenEvent.h.

References isNumberOfLeptons(), and isTtBar().

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

34 { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 1) : false;}
bool isNumberOfLeptons(bool excludeTauLeptons, int nlep) const
Definition: TtGenEvent.h:86
bool isTtBar() const
check if the event can be classified as ttbar
Definition: TtGenEvent.h:30
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 41 of file TtGenEvent.h.

References semiLeptonicChannel().

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

References semiLeptonicChannel().

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

check if the event can be classified as ttbar

Definition at line 30 of file TtGenEvent.h.

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

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

30 {return (top() && topBar());}
const reco::GenParticle * top() const
return top if available; 0 else
Definition: TopGenEvent.h:104
const reco::GenParticle * topBar() const
return anti-top if available; 0 else
Definition: TopGenEvent.h:106
const reco::GenParticle * TtGenEvent::lepton ( bool  excludeTauLeptons = false) const

get lepton for semi-leptonic or full leptonic decays

Definition at line 50 of file TtGenEvent.cc.

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

Referenced by fullLeptonicChannel().

51 {
52  const reco::GenParticle* cand = 0;
53  const reco::GenParticleCollection& partsColl = *parts_;
54  for (unsigned int i = 0; i < partsColl.size(); ++i) {
55  if (reco::isLepton(partsColl[i]) && partsColl[i].mother() &&
56  std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) {
57  if(reco::flavour(partsColl[i])>0){
58  cand = &partsColl[i];
59  }
60  }
61  }
62  return cand;
63 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
#define abs(x)
Definition: mlp_lapack.h:159
bool isLepton(const Candidate &part)
Definition: pdgIdUtils.h:19
static const int WID
Definition: TopGenEvent.h:18
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
const reco::GenParticle * TtGenEvent::leptonBar ( bool  excludeTauLeptons = false) const

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

Definition at line 66 of file TtGenEvent.cc.

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

Referenced by fullLeptonicChannel().

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

get b of leptonic decay branch

Definition at line 228 of file TtGenEvent.cc.

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

Referenced by TtSemiLepEvtPartons::vec().

229 {
230  const reco::GenParticle* cand=0;
231  if( singleLepton(excludeTauLeptons) ){
232  const reco::GenParticleCollection& partsColl = *parts_;
233  const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons);
234  for (unsigned int i = 0; i < partsColl.size(); ++i) {
235  if (std::abs(partsColl[i].pdgId())==TopDecayID::bID &&
236  reco::flavour(singleLep)!=reco::flavour(partsColl[i])) {
237  cand = &partsColl[i];
238  }
239  }
240  }
241  return cand;
242 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
static const int bID
Definition: TopGenEvent.h:14
#define abs(x)
Definition: mlp_lapack.h:159
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:82
const reco::GenParticle * TtGenEvent::leptonicDecayTop ( bool  excludeTauLeptons = false) const

get top of leptonic decay branch

Definition at line 263 of file TtGenEvent.cc.

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

Referenced by leptonicDecayTopRadiation().

264 {
265  const reco::GenParticle* cand=0;
266  if( singleLepton(excludeTauLeptons) ){
267  const reco::GenParticleCollection& partsColl = *parts_;
268  const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons);
269  for( unsigned int i = 0; i < partsColl.size(); ++i ){
270  if( std::abs(partsColl[i].pdgId())==TopDecayID::tID &&
271  reco::flavour(singleLep)!=reco::flavour(partsColl[i]) ){
272  cand = &partsColl[i];
273  }
274  }
275  }
276  return cand;
277 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
#define abs(x)
Definition: mlp_lapack.h:159
static const int tID
Definition: TopGenEvent.h:13
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:82
std::vector< const reco::GenParticle * > TtGenEvent::leptonicDecayTopRadiation ( bool  excludeTauLeptons = false) const

gluons as radiated from the leptonicly decaying top quark

Definition at line 279 of file TtGenEvent.cc.

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

279  {
280  if( leptonicDecayTop(excludeTauLeptons) ){
281  return (leptonicDecayTop(excludeTauLeptons)->pdgId()>0 ? radiatedGluons(TopDecayID::tID) : radiatedGluons(-TopDecayID::tID));
282  }
283  std::vector<const reco::GenParticle*> rad;
284  return (rad);
285 }
const reco::GenParticle * leptonicDecayTop(bool excludeTauLeptons=false) const
get top of leptonic decay branch
Definition: TtGenEvent.cc:263
static const int tID
Definition: TopGenEvent.h:13
std::vector< const reco::GenParticle * > radiatedGluons(int pdgId) const
return radiated gluons from particle with pdgId
Definition: TopGenEvent.cc:199
const reco::GenParticle * TtGenEvent::leptonicDecayW ( bool  excludeTauLeptons = false) const

get W of leptonic decay branch

Definition at line 245 of file TtGenEvent.cc.

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

246 {
247  const reco::GenParticle* cand=0;
248  if( singleLepton(excludeTauLeptons) ){
249  const reco::GenParticleCollection& partsColl = *parts_;
250  const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons);
251  for (unsigned int i = 0; i < partsColl.size(); ++i) {
252  if (std::abs(partsColl[i].pdgId())==TopDecayID::WID &&
253  reco::flavour(singleLep) == - reco::flavour(partsColl[i])) {
254  // PDG Id:13=mu- 24=W+ (+24)->(-13) (-24)->(+13) opposite sign
255  cand = &partsColl[i];
256  }
257  }
258  }
259  return cand;
260 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
#define abs(x)
Definition: mlp_lapack.h:159
static const int WID
Definition: TopGenEvent.h:18
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:82
const reco::GenParticle * TtGenEvent::neutrino ( bool  excludeTauLeptons = false) const

get neutrino for semi-leptonic or full leptonic decays

Definition at line 98 of file TtGenEvent.cc.

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

99 {
100  const reco::GenParticle* cand=0;
101  const reco::GenParticleCollection & partsColl = *parts_;
102  for (unsigned int i = 0; i < partsColl.size(); ++i) {
103  if (reco::isNeutrino(partsColl[i]) && partsColl[i].mother() &&
104  std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) {
105  if(reco::flavour(partsColl[i])>0){
106  cand = &partsColl[i];
107  }
108  }
109  }
110  return cand;
111 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
#define abs(x)
Definition: mlp_lapack.h:159
bool isNeutrino(const Candidate &part)
Definition: pdgIdUtils.h:25
static const int WID
Definition: TopGenEvent.h:18
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
const reco::GenParticle * TtGenEvent::neutrinoBar ( bool  excludeTauLeptons = false) const

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

Definition at line 114 of file TtGenEvent.cc.

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

115 {
116  const reco::GenParticle* cand=0;
117  const reco::GenParticleCollection & partsColl = *parts_;
118  for (unsigned int i = 0; i < partsColl.size(); ++i) {
119  if (reco::isNeutrino(partsColl[i]) && partsColl[i].mother() &&
120  std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) {
121  if(reco::flavour(partsColl[i])<0){
122  cand = &partsColl[i];
123  }
124  }
125  }
126  return cand;
127 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
#define abs(x)
Definition: mlp_lapack.h:159
bool isNeutrino(const Candidate &part)
Definition: pdgIdUtils.h:25
static const int WID
Definition: TopGenEvent.h:18
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
WDecay::LeptonType TtGenEvent::semiLeptonicChannel ( ) const

return decay channel; all leptons including taus are allowed

Definition at line 19 of file TtGenEvent.cc.

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

Referenced by isSemiLeptonic().

20 {
22  if( isSemiLeptonic() && singleLepton() ){
26  }
27  return type;
28 }
type
Definition: HCALResponse.h:22
bool isSemiLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as semi-laptonic
Definition: TtGenEvent.h:34
#define abs(x)
Definition: mlp_lapack.h:159
static const int tauID
Definition: TopGenEvent.h:21
static const int muonID
Definition: TopGenEvent.h:20
static const int elecID
Definition: TopGenEvent.h:19
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:82
const reco::GenParticle * TtGenEvent::singleLepton ( bool  excludeTauLeptons = false) const

return single lepton if available; 0 else

Definition at line 82 of file TtGenEvent.cc.

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

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

83 {
84  const reco::GenParticle* cand = 0;
85  if( isSemiLeptonic(excludeTauLeptons) ){
86  const reco::GenParticleCollection& partsColl = *parts_;
87  for (unsigned int i = 0; i < partsColl.size(); ++i) {
88  if (reco::isLepton(partsColl[i]) && partsColl[i].mother() &&
89  std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) {
90  cand = &partsColl[i];
91  }
92  }
93  }
94  return cand;
95 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
bool isSemiLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as semi-laptonic
Definition: TtGenEvent.h:34
#define abs(x)
Definition: mlp_lapack.h:159
bool isLepton(const Candidate &part)
Definition: pdgIdUtils.h:19
static const int WID
Definition: TopGenEvent.h:18
const reco::GenParticle * TtGenEvent::singleNeutrino ( bool  excludeTauLeptons = false) const

return single neutrino if available; 0 else

Definition at line 130 of file TtGenEvent.cc.

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

131 {
132  const reco::GenParticle* cand=0;
133  if( isSemiLeptonic(excludeTauLeptons) ) {
134  const reco::GenParticleCollection & partsColl = *parts_;
135  for (unsigned int i = 0; i < partsColl.size(); ++i) {
136  if (reco::isNeutrino(partsColl[i]) && partsColl[i].mother() &&
137  std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) {
138  cand = &partsColl[i];
139  }
140  }
141  }
142  return cand;
143 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
bool isSemiLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as semi-laptonic
Definition: TtGenEvent.h:34
#define abs(x)
Definition: mlp_lapack.h:159
bool isNeutrino(const Candidate &part)
Definition: pdgIdUtils.h:25
static const int WID
Definition: TopGenEvent.h:18