Class derived from the TopGenEvent for ttbar events. More...
#include <AnalysisDataFormats/TopObjects/interface/TtGenEvent.h>
Public Member Functions | |
std::pair< WDecay::LeptonType, WDecay::LeptonType > | fullLeptonicChannel () const |
const reco::GenParticle * | hadronicDecayB (bool excludeTauLeptons=false) const |
get b of hadronic decay branch | |
const reco::GenParticle * | hadronicDecayQuark (bool invertFlavor=false) const |
get light quark of hadronic decay branch | |
const reco::GenParticle * | hadronicDecayQuarkBar () const |
get light anti-quark of hadronic decay branch | |
const reco::GenParticle * | hadronicDecayTop (bool excludeTauLeptons=false) const |
get top of hadronic decay branch | |
std::vector< const reco::GenParticle * > | hadronicDecayTopRadiation (bool excludeTauLeptons=false) const |
gluons as radiated from the hadronicly decaying top quark | |
const reco::GenParticle * | hadronicDecayW (bool excludeTauLeptons=false) const |
get W of hadronic decay branch | |
bool | isFullHadronic (bool excludeTauLeptons=false) const |
check if the event can be classified as full hadronic | |
bool | isFullLeptonic (bool excludeTauLeptons=false) const |
check if the event can be classified as full leptonic | |
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 | |
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 | |
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 | |
bool | isSemiLeptonic (bool excludeTauLeptons=false) const |
check if the event can be classified as semi-laptonic | |
bool | isTtBar () const |
check if the event can be classified as ttbar | |
const reco::GenParticle * | lepton (bool excludeTauLeptons=false) const |
get lepton for semi-leptonic or full leptonic decays | |
const reco::GenParticle * | leptonBar (bool excludeTauLeptons=false) const |
get anti-lepton for semi-leptonic or full leptonic decays | |
const reco::GenParticle * | leptonicDecayB (bool excludeTauLeptons=false) const |
get b of leptonic decay branch | |
const reco::GenParticle * | leptonicDecayTop (bool excludeTauLeptons=false) const |
get top of leptonic decay branch | |
std::vector< const reco::GenParticle * > | leptonicDecayTopRadiation (bool excludeTauLeptons=false) const |
gluons as radiated from the leptonicly decaying top quark | |
const reco::GenParticle * | leptonicDecayW (bool excludeTauLeptons=false) const |
get W of leptonic decay branch | |
const reco::GenParticle * | neutrino (bool excludeTauLeptons=false) const |
get neutrino for semi-leptonic or full leptonic decays | |
const reco::GenParticle * | neutrinoBar (bool excludeTauLeptons=false) const |
get anti-neutrino for semi-leptonic or full leptonic decays | |
WDecay::LeptonType | semiLeptonicChannel () const |
return decay channel; all leptons including taus are allowed | |
const reco::GenParticle * | singleLepton (bool excludeTauLeptons=false) const |
return single lepton if available; 0 else | |
const reco::GenParticle * | singleNeutrino (bool excludeTauLeptons=false) const |
return single neutrino if available; 0 else | |
TtGenEvent () | |
empty constructor | |
TtGenEvent (reco::GenParticleRefProd &decaySubset, reco::GenParticleRefProd &initSubset) | |
default constructor from decaySubset and initSubset | |
virtual | ~TtGenEvent () |
default destructor | |
Private Member Functions | |
bool | isNumberOfLeptons (bool excludeTauLeptons, int nlep) const |
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.
TtGenEvent::TtGenEvent | ( | ) | [inline] |
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_.
{ parts_ = decaySubset; initPartons_= initSubset; }
virtual TtGenEvent::~TtGenEvent | ( | ) | [inline, virtual] |
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().
{ WDecay::LeptonType typeA=WDecay::kNone, typeB=WDecay::kNone; if( isFullLeptonic() ){ if( lepton() ){ if( std::abs(lepton()->pdgId())==TopDecayID::elecID ) typeA=WDecay::kElec; if( std::abs(lepton()->pdgId())==TopDecayID::muonID ) typeA=WDecay::kMuon; if( std::abs(lepton()->pdgId())==TopDecayID::tauID ) typeA=WDecay::kTau; } if( leptonBar() ){ if( std::abs(leptonBar()->pdgId())==TopDecayID::elecID ) typeB=WDecay::kElec; if( std::abs(leptonBar()->pdgId())==TopDecayID::muonID ) typeB=WDecay::kMuon; if( std::abs(leptonBar()->pdgId())==TopDecayID::tauID ) typeB=WDecay::kTau; } } return ( std::pair<WDecay::LeptonType,WDecay::LeptonType>(typeA, typeB) ); }
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().
{ const reco::GenParticle* cand=0; if( singleLepton(excludeTauLeptons) ){ const reco::GenParticleCollection& partsColl = *parts_; const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons); for (unsigned int i = 0; i < partsColl.size(); ++i) { if (std::abs(partsColl[i].pdgId())==TopDecayID::bID && reco::flavour(singleLep)==reco::flavour(partsColl[i])) { cand = &partsColl[i]; } } } return cand; }
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, Exception, reco::flavour(), edm::errors::InvalidReference, TopGenEvent::parts_, singleLepton(), TopDecayID::tID, and TopDecayID::WID.
Referenced by hadronicDecayQuarkBar(), and TtSemiLepEvtPartons::vec().
{ const reco::GenParticle* cand=0; // catch W boson and check its daughters for a quark; // make sure the decay is semi-leptonic first; this // only makes sense if taus are not excluded from the // decision if( singleLepton(false) ){ for(reco::GenParticleCollection::const_iterator w=parts_->begin(); w!=parts_->end(); ++w){ if( std::abs( w->pdgId() )==TopDecayID::WID ){ // make sure that the particle is a W daughter for(reco::GenParticle::const_iterator wd=w->begin(); wd!=w->end(); ++wd){ // make sure that the parton is a quark if( std::abs(wd->pdgId())<TopDecayID::tID ){ if( invertFlavor?reco::flavour(*wd)<0:reco::flavour(*wd)>0 ){ cand = dynamic_cast<const reco::GenParticle* > (&(*wd)); if(cand == 0){ throw edm::Exception( edm::errors::InvalidReference, "Not a GenParticle" ); } break; } } } } } } return cand; }
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().
{return hadronicDecayQuark(true); };
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().
{ const reco::GenParticle* cand=0; if( singleLepton(excludeTauLeptons) ){ const reco::GenParticleCollection& partsColl = *parts_; const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons); for (unsigned int i = 0; i < partsColl.size(); ++i) { if (std::abs(partsColl[i].pdgId())==TopDecayID::tID && reco::flavour(singleLep)==reco::flavour(partsColl[i])) { cand = &partsColl[i]; } } } return cand; }
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.
{ if( hadronicDecayTop(excludeTauLeptons) ){ return (hadronicDecayTop(excludeTauLeptons)->pdgId()>0 ? radiatedGluons(TopDecayID::tID) : radiatedGluons(-TopDecayID::tID)); } std::vector<const reco::GenParticle*> rad; return (rad); }
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.
{ const reco::GenParticle* cand=0; if( singleLepton(excludeTauLeptons) ){ const reco::GenParticleCollection& partsColl = *parts_; const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons); for (unsigned int i = 0; i < partsColl.size(); ++i) { if (std::abs(partsColl[i].pdgId())==TopDecayID::WID && reco::flavour(singleLep) != -reco::flavour(partsColl[i])) { // PDG Id:13=mu- 24=W+ (+24)->(-13) (-24)->(+13) opposite sign cand = &partsColl[i]; } } } return cand; }
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().
{ return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 0) : false;}
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().
{ return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 2) : false;}
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().
{ return ( (fullLeptonicChannel().first==typeA && fullLeptonicChannel().second==typeB)|| (fullLeptonicChannel().first==typeB && fullLeptonicChannel().second==typeA)); }
bool TtGenEvent::isNumberOfLeptons | ( | bool | excludeTauLeptons, |
int | nlep | ||
) | const [inline, private] |
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().
{return excludeTauLeptons ? (numberOfLeptons()-numberOfLeptons(WDecay::kTau))==nlep : numberOfLeptons()==nlep;}
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().
{ return semiLeptonicChannel()==typeA ? true : false; };
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().
{ return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 1) : false;}
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().
{ return (semiLeptonicChannel()==typeA || semiLeptonicChannel()==typeB)? true : false; };
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().
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().
{ const reco::GenParticle* cand = 0; const reco::GenParticleCollection& partsColl = *parts_; for (unsigned int i = 0; i < partsColl.size(); ++i) { if (reco::isLepton(partsColl[i]) && partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) { if(reco::flavour(partsColl[i])>0){ cand = &partsColl[i]; } } } return cand; }
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().
{ const reco::GenParticle* cand = 0; const reco::GenParticleCollection& partsColl = *parts_; for (unsigned int i = 0; i < partsColl.size(); ++i) { if (reco::isLepton(partsColl[i]) && partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) { if(reco::flavour(partsColl[i])<0){ cand = &partsColl[i]; } } } return cand; }
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().
{ const reco::GenParticle* cand=0; if( singleLepton(excludeTauLeptons) ){ const reco::GenParticleCollection& partsColl = *parts_; const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons); for (unsigned int i = 0; i < partsColl.size(); ++i) { if (std::abs(partsColl[i].pdgId())==TopDecayID::bID && reco::flavour(singleLep)!=reco::flavour(partsColl[i])) { cand = &partsColl[i]; } } } return cand; }
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().
{ const reco::GenParticle* cand=0; if( singleLepton(excludeTauLeptons) ){ const reco::GenParticleCollection& partsColl = *parts_; const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons); for( unsigned int i = 0; i < partsColl.size(); ++i ){ if( std::abs(partsColl[i].pdgId())==TopDecayID::tID && reco::flavour(singleLep)!=reco::flavour(partsColl[i]) ){ cand = &partsColl[i]; } } } return cand; }
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.
{ if( leptonicDecayTop(excludeTauLeptons) ){ return (leptonicDecayTop(excludeTauLeptons)->pdgId()>0 ? radiatedGluons(TopDecayID::tID) : radiatedGluons(-TopDecayID::tID)); } std::vector<const reco::GenParticle*> rad; return (rad); }
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.
{ const reco::GenParticle* cand=0; if( singleLepton(excludeTauLeptons) ){ const reco::GenParticleCollection& partsColl = *parts_; const reco::GenParticle& singleLep = *singleLepton(excludeTauLeptons); for (unsigned int i = 0; i < partsColl.size(); ++i) { if (std::abs(partsColl[i].pdgId())==TopDecayID::WID && reco::flavour(singleLep) == - reco::flavour(partsColl[i])) { // PDG Id:13=mu- 24=W+ (+24)->(-13) (-24)->(+13) opposite sign cand = &partsColl[i]; } } } return cand; }
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.
{ const reco::GenParticle* cand=0; const reco::GenParticleCollection & partsColl = *parts_; for (unsigned int i = 0; i < partsColl.size(); ++i) { if (reco::isNeutrino(partsColl[i]) && partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) { if(reco::flavour(partsColl[i])>0){ cand = &partsColl[i]; } } } return cand; }
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.
{ const reco::GenParticle* cand=0; const reco::GenParticleCollection & partsColl = *parts_; for (unsigned int i = 0; i < partsColl.size(); ++i) { if (reco::isNeutrino(partsColl[i]) && partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) { if(reco::flavour(partsColl[i])<0){ cand = &partsColl[i]; } } } return cand; }
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().
{ WDecay::LeptonType type=WDecay::kNone; if( isSemiLeptonic() && singleLepton() ){ if( std::abs(singleLepton()->pdgId())==TopDecayID::elecID ) type=WDecay::kElec; if( std::abs(singleLepton()->pdgId())==TopDecayID::muonID ) type=WDecay::kMuon; if( std::abs(singleLepton()->pdgId())==TopDecayID::tauID ) type=WDecay::kTau; } return type; }
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().
{ const reco::GenParticle* cand = 0; if( isSemiLeptonic(excludeTauLeptons) ){ const reco::GenParticleCollection& partsColl = *parts_; for (unsigned int i = 0; i < partsColl.size(); ++i) { if (reco::isLepton(partsColl[i]) && partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) { cand = &partsColl[i]; } } } return cand; }
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.
{ const reco::GenParticle* cand=0; if( isSemiLeptonic(excludeTauLeptons) ) { const reco::GenParticleCollection & partsColl = *parts_; for (unsigned int i = 0; i < partsColl.size(); ++i) { if (reco::isNeutrino(partsColl[i]) && partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) { cand = &partsColl[i]; } } } return cand; }