Base class to hold information for reduced top generator information. More...
#include <AnalysisDataFormats/TopObjects/interface/TopGenEvent.h>
Public Member Functions | |
const reco::GenParticle * | b () const |
return b quark if available; 0 else | |
const reco::GenParticle * | bBar () const |
return anti-b quark if available; 0 else | |
const reco::GenParticle * | candidate (int id, unsigned int parentId=0) const |
get candidate with given pdg id if available; 0 else | |
const reco::GenParticle * | daughterQuarkBarOfWMinus () const |
return anti-quark daughter of anti-W boson | |
const reco::GenParticle * | daughterQuarkBarOfWPlus () const |
return anti-quark daughter of W boson | |
const reco::GenParticle * | daughterQuarkOfTop (bool invertCharge=false) const |
return daughter quark of top quark (which can have flavor b, s or d) | |
const reco::GenParticle * | daughterQuarkOfTopBar () const |
return daughter quark of anti-top quark (which can have flavor b, s or d) | |
const reco::GenParticle * | daughterQuarkOfWMinus () const |
return quark daughter of anti-W boson | |
const reco::GenParticle * | daughterQuarkOfWPlus (bool invertQuarkCharge=false, bool invertBosonCharge=false) const |
return quark daughter quark of W boson | |
const reco::GenParticle * | eMinus () const |
return electron if available; 0 else | |
const reco::GenParticle * | ePlus () const |
return positron if available; 0 else | |
const reco::GenParticleCollection & | initialPartons () const |
return particles of initial partons | |
std::vector< const reco::GenParticle * > | lightQuarks (bool includingBQuarks=false) const |
return all light quarks or all quarks including b's | |
const reco::GenParticle * | muMinus () const |
return muon if available; 0 else | |
const reco::GenParticle * | muPlus () const |
return anti-muon if available; 0 else | |
int | numberOfBQuarks (bool fromTopQuark=true) const |
return number of b quarks in the decay chain | |
int | numberOfLeptons (WDecay::LeptonType type, bool fromWBoson=true) const |
return number of leptons in the decay chain | |
int | numberOfLeptons (bool fromWBoson=true) const |
return number of leptons in the decay chain | |
const reco::GenParticleCollection & | particles () const |
return particles of decay chain | |
void | print () const |
std::vector< const reco::GenParticle * > | radiatedGluons (int pdgId) const |
return radiated gluons from particle with pdgId | |
const reco::GenParticle * | tauMinus () const |
return tau if available; 0 else | |
const reco::GenParticle * | tauPlus () const |
return anti-tau if available; 0 else | |
const reco::GenParticle * | top () const |
return top if available; 0 else | |
const reco::GenParticle * | topBar () const |
return anti-top if available; 0 else | |
TopGenEvent (reco::GenParticleRefProd &decaySubset, reco::GenParticleRefProd &iniSubset) | |
default constructor | |
TopGenEvent () | |
empty constructor | |
std::vector< const reco::GenParticle * > | topSisters () const |
return number of top anti-top sisters | |
const reco::GenParticle * | wMinus () const |
return W minus if available; 0 else | |
const reco::GenParticle * | wPlus () const |
return W plus if available; 0 else | |
virtual | ~TopGenEvent () |
default destructor | |
Protected Attributes | |
reco::GenParticleRefProd | initPartons_ |
reference to the list of initial partons (has to be kept in the event!) | |
reco::GenParticleRefProd | parts_ |
reference to the top decay chain (has to be kept in the event!) |
Base class to hold information for reduced top generator information.
The structure holds reference information to the generator particles of the decay chains for each top quark and of the initial partons. It provides access and administration.
Definition at line 41 of file TopGenEvent.h.
TopGenEvent::TopGenEvent | ( | ) | [inline] |
TopGenEvent::TopGenEvent | ( | reco::GenParticleRefProd & | decaySubset, |
reco::GenParticleRefProd & | iniSubset | ||
) |
default constructor
default contructor
Definition at line 9 of file TopGenEvent.cc.
References TopDecaySubset_cfi::decaySubset, initPartons_, TopInitSubset_cfi::initSubset, and parts_.
{ parts_ = decaySubset; initPartons_= initSubset; }
virtual TopGenEvent::~TopGenEvent | ( | ) | [inline, virtual] |
const reco::GenParticle* TopGenEvent::b | ( | ) | const [inline] |
return b quark if available; 0 else
Definition at line 100 of file TopGenEvent.h.
References TopDecayID::bID, candidate(), and TopDecayID::tID.
Referenced by TtFullLepEvtPartons::vec(), and TtFullHadEvtPartons::vec().
{ return candidate( TopDecayID::bID, TopDecayID::tID );}
const reco::GenParticle* TopGenEvent::bBar | ( | ) | const [inline] |
return anti-b quark if available; 0 else
Definition at line 102 of file TopGenEvent.h.
References TopDecayID::bID, candidate(), and TopDecayID::tID.
Referenced by TtFullHadEvtPartons::vec(), and TtFullLepEvtPartons::vec().
{ return candidate(-TopDecayID::bID, TopDecayID::tID );}
const reco::GenParticle * TopGenEvent::candidate | ( | int | id, |
unsigned int | parentId = 0 |
||
) | const |
get candidate with given pdg id if available; 0 else
Definition at line 16 of file TopGenEvent.cc.
References abs, i, parts_, and benchmark_cfg::pdgId.
Referenced by b(), bBar(), eMinus(), ePlus(), muMinus(), muPlus(), tauMinus(), tauPlus(), top(), topBar(), wMinus(), and wPlus().
{ const reco::GenParticle* cand=0; const reco::GenParticleCollection & partsColl = *parts_; for( unsigned int i = 0; i < partsColl.size(); ++i ) { if( partsColl[i].pdgId()==id ){ if(parentId==0?true:partsColl[i].mother()&&std::abs(partsColl[i].mother()->pdgId())==(int)parentId){ cand = &partsColl[i]; } } } return cand; }
const reco::GenParticle* TopGenEvent::daughterQuarkBarOfWMinus | ( | ) | const [inline] |
return anti-quark daughter of anti-W boson
Definition at line 79 of file TopGenEvent.h.
References daughterQuarkOfWPlus().
Referenced by TtFullHadEvtPartons::vec().
{ return daughterQuarkOfWPlus(true, true); };
const reco::GenParticle* TopGenEvent::daughterQuarkBarOfWPlus | ( | ) | const [inline] |
return anti-quark daughter of W boson
Definition at line 77 of file TopGenEvent.h.
References daughterQuarkOfWPlus().
Referenced by TtFullHadEvtPartons::vec().
{ return daughterQuarkOfWPlus(true, false); };
const reco::GenParticle * TopGenEvent::daughterQuarkOfTop | ( | bool | invertCharge = false | ) | const |
return daughter quark of top quark (which can have flavor b, s or d)
Definition at line 150 of file TopGenEvent.cc.
References abs, reco::CompositeRefCandidateT< D >::begin(), TopDecayID::bID, reco::CompositeRefCandidateT< D >::end(), Exception, edm::errors::InvalidReference, parts_, reco::LeafCandidate::pdgId(), TopDecayID::tID, and top().
Referenced by daughterQuarkOfTopBar().
{ const reco::GenParticle* cand=0; for(reco::GenParticleCollection::const_iterator top = parts_->begin(); top<parts_->end(); ++top){ if( top->pdgId()==(invertCharge?-TopDecayID::tID:TopDecayID::tID) ){ for(reco::GenParticle::const_iterator quark = top->begin(); quark<top->end(); ++quark){ if( std::abs(quark->pdgId())<= TopDecayID::bID ){ cand = dynamic_cast<const reco::GenParticle* > (&(*quark)); if(cand == 0){ throw edm::Exception( edm::errors::InvalidReference, "Not a GenParticle" ); } break; } } } } return cand; }
const reco::GenParticle* TopGenEvent::daughterQuarkOfTopBar | ( | ) | const [inline] |
return daughter quark of anti-top quark (which can have flavor b, s or d)
Definition at line 71 of file TopGenEvent.h.
References daughterQuarkOfTop().
{ return daughterQuarkOfTop(true); };
const reco::GenParticle* TopGenEvent::daughterQuarkOfWMinus | ( | ) | const [inline] |
return quark daughter of anti-W boson
Definition at line 75 of file TopGenEvent.h.
References daughterQuarkOfWPlus().
Referenced by TtFullHadEvtPartons::vec().
{ return daughterQuarkOfWPlus(false, true); };
const reco::GenParticle * TopGenEvent::daughterQuarkOfWPlus | ( | bool | invertQuarkCharge = false , |
bool | invertBosonCharge = false |
||
) | const |
return quark daughter quark of W boson
Definition at line 170 of file TopGenEvent.cc.
References abs, TopDecayID::bID, reco::flavour(), i, parts_, benchmark_cfg::pdgId, and TopDecayID::WID.
Referenced by daughterQuarkBarOfWMinus(), daughterQuarkBarOfWPlus(), daughterQuarkOfWMinus(), and TtFullHadEvtPartons::vec().
{ const reco::GenParticle* cand=0; const reco::GenParticleCollection & partsColl = *parts_; for (unsigned int i = 0; i < partsColl.size(); ++i) { if(partsColl[i].mother() && partsColl[i].mother()->pdgId()==(invertBosonCharge?-TopDecayID::WID:TopDecayID::WID) && std::abs(partsColl[i].pdgId())<=TopDecayID::bID && (invertQuarkCharge?reco::flavour(partsColl[i])<0:reco::flavour(partsColl[i])>0)){ cand = &partsColl[i]; } } return cand; }
const reco::GenParticle* TopGenEvent::eMinus | ( | ) | const [inline] |
return electron if available; 0 else
Definition at line 84 of file TopGenEvent.h.
References candidate(), TopDecayID::elecID, and TopDecayID::WID.
{ return candidate( TopDecayID::elecID, TopDecayID::WID );}
const reco::GenParticle* TopGenEvent::ePlus | ( | ) | const [inline] |
return positron if available; 0 else
Definition at line 86 of file TopGenEvent.h.
References candidate(), TopDecayID::elecID, and TopDecayID::WID.
{ return candidate(-TopDecayID::elecID, TopDecayID::WID );}
const reco::GenParticleCollection& TopGenEvent::initialPartons | ( | ) | const [inline] |
return particles of initial partons
Definition at line 55 of file TopGenEvent.h.
References initPartons_.
{ return *initPartons_;}
std::vector< const reco::GenParticle * > TopGenEvent::lightQuarks | ( | bool | includingBQuarks = false | ) | const |
return all light quarks or all quarks including b's
Definition at line 184 of file TopGenEvent.cc.
References abs, TopDecayID::bID, Exception, edm::errors::InvalidReference, and parts_.
{ std::vector<const reco::GenParticle*> lightQuarks; for (reco::GenParticleCollection::const_iterator part = parts_->begin(); part < parts_->end(); ++part) { if( (includingBQuarks && std::abs(part->pdgId())==TopDecayID::bID) || std::abs(part->pdgId())<TopDecayID::bID ) { if( dynamic_cast<const reco::GenParticle*>( &(*part) ) == 0){ throw edm::Exception( edm::errors::InvalidReference, "Not a GenParticle" ); } lightQuarks.push_back( part->clone() ); } } return lightQuarks; }
const reco::GenParticle* TopGenEvent::muMinus | ( | ) | const [inline] |
return muon if available; 0 else
Definition at line 88 of file TopGenEvent.h.
References candidate(), TopDecayID::muonID, and TopDecayID::WID.
{ return candidate( TopDecayID::muonID, TopDecayID::WID );}
const reco::GenParticle* TopGenEvent::muPlus | ( | ) | const [inline] |
return anti-muon if available; 0 else
Definition at line 90 of file TopGenEvent.h.
References candidate(), TopDecayID::muonID, and TopDecayID::WID.
{ return candidate(-TopDecayID::muonID, TopDecayID::WID );}
int TopGenEvent::numberOfBQuarks | ( | bool | fromTopQuark = true | ) | const |
return number of b quarks in the decay chain
Definition at line 112 of file TopGenEvent.cc.
References abs, TopDecayID::bID, i, parts_, benchmark_cfg::pdgId, and TopDecayID::tID.
{ int bq=0; const reco::GenParticleCollection & partsColl = *parts_; for (unsigned int i = 0; i < partsColl.size(); ++i) { //depend if radiation qqbar are included or not if(std::abs(partsColl[i].pdgId())==TopDecayID::bID){ if(fromTopQuark){ if(partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId())==TopDecayID::tID){ ++bq; } } else{ ++bq; } } } return bq; }
int TopGenEvent::numberOfLeptons | ( | bool | fromWBoson = true | ) | const |
return number of leptons in the decay chain
Definition at line 48 of file TopGenEvent.cc.
References abs, i, reco::isLepton(), parts_, benchmark_cfg::pdgId, and TopDecayID::WID.
Referenced by TtGenEvent::isNumberOfLeptons().
{ int lep=0; const reco::GenParticleCollection& partsColl = *parts_; for(unsigned int i = 0; i < partsColl.size(); ++i) { if(reco::isLepton(partsColl[i])) { if(fromWBoson){ if(partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID){ ++lep; } } else{ ++lep; } } } return lep; }
int TopGenEvent::numberOfLeptons | ( | WDecay::LeptonType | type, |
bool | fromWBoson = true |
||
) | const |
return number of leptons in the decay chain
Definition at line 68 of file TopGenEvent.cc.
References abs, TopDecayID::elecID, i, reco::isLepton(), WDecay::kElec, WDecay::kMuon, WDecay::kNone, WDecay::kTau, TopDecayID::muonID, parts_, benchmark_cfg::pdgId, TopDecayID::tauID, and TopDecayID::WID.
{ int leptonType=-1; switch(typeRestriction){ // resolve whether or not there is // any restriction in lepton types case WDecay::kElec: leptonType=TopDecayID::elecID; break; case WDecay::kMuon: leptonType=TopDecayID::muonID; break; case WDecay::kTau: leptonType=TopDecayID::tauID; break; case WDecay::kNone: break; } int lep=0; const reco::GenParticleCollection & partsColl = *parts_; for(unsigned int i = 0; i < partsColl.size(); ++i) { if(fromWBoson){ // restrict to particles originating from the W boson if( !(partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) ){ continue; } } if(leptonType>0){ // in case of lepton type restriction if( std::abs(partsColl[i].pdgId())==leptonType ){ ++lep; } } else{ // take any lepton type into account else if( reco::isLepton(partsColl[i]) ){ ++lep; } } } return lep; }
const reco::GenParticleCollection& TopGenEvent::particles | ( | ) | const [inline] |
return particles of decay chain
Definition at line 53 of file TopGenEvent.h.
References parts_.
{ return *parts_; }
void TopGenEvent::print | ( | void | ) | const |
print content of the top decay chain as formated LogInfo to the MessageLogger output for debugging
Definition at line 31 of file TopGenEvent.cc.
References funct::log(), and parts_.
{ edm::LogVerbatim log("TopGenEvent"); log << "\n" << "--------------------------------------\n" << "- Dump TopGenEvent Content -\n" << "--------------------------------------\n"; for (reco::GenParticleCollection::const_iterator part = parts_->begin(); part<parts_->end(); ++part) { log << "pdgId:" << std::setw(5) << part->pdgId() << ", " << "mass:" << std::setw(11) << part->p4().mass() << ", " << "energy:" << std::setw(11) << part->energy() << ", " << "pt:" << std::setw(11) << part->pt() << "\n"; } }
std::vector< const reco::GenParticle * > TopGenEvent::radiatedGluons | ( | int | pdgId | ) | const |
return radiated gluons from particle with pdgId
Definition at line 199 of file TopGenEvent.cc.
References Exception, TopDecayID::glueID, edm::errors::InvalidReference, parts_, and benchmark_cfg::pdgId.
Referenced by TtGenEvent::hadronicDecayTopRadiation(), and TtGenEvent::leptonicDecayTopRadiation().
{ std::vector<const reco::GenParticle*> rads; for (reco::GenParticleCollection::const_iterator part = parts_->begin(); part < parts_->end(); ++part) { if ( part->mother() && part->mother()->pdgId()==pdgId ){ if(part->pdgId()==TopDecayID::glueID){ if( dynamic_cast<const reco::GenParticle*>( &(*part) ) == 0){ throw edm::Exception( edm::errors::InvalidReference, "Not a GenParticle" ); } } rads.push_back( part->clone() ); } } return rads; }
const reco::GenParticle* TopGenEvent::tauMinus | ( | ) | const [inline] |
return tau if available; 0 else
Definition at line 92 of file TopGenEvent.h.
References candidate(), TopDecayID::tauID, and TopDecayID::WID.
{ return candidate( TopDecayID::tauID, TopDecayID::WID );}
const reco::GenParticle* TopGenEvent::tauPlus | ( | ) | const [inline] |
return anti-tau if available; 0 else
Definition at line 94 of file TopGenEvent.h.
References candidate(), TopDecayID::tauID, and TopDecayID::WID.
{ return candidate(-TopDecayID::tauID, TopDecayID::WID );}
const reco::GenParticle* TopGenEvent::top | ( | ) | const [inline] |
return top if available; 0 else
Definition at line 104 of file TopGenEvent.h.
References candidate(), and TopDecayID::tID.
Referenced by daughterQuarkOfTop(), and TtGenEvent::isTtBar().
{ return candidate( TopDecayID::tID );}
const reco::GenParticle* TopGenEvent::topBar | ( | ) | const [inline] |
return anti-top if available; 0 else
Definition at line 106 of file TopGenEvent.h.
References candidate(), and TopDecayID::tID.
Referenced by TtGenEvent::isTtBar().
{ return candidate(-TopDecayID::tID );}
std::vector< const reco::GenParticle * > TopGenEvent::topSisters | ( | ) | const |
return number of top anti-top sisters
Definition at line 133 of file TopGenEvent.cc.
References abs, Exception, edm::errors::InvalidReference, parts_, and TopDecayID::tID.
{ std::vector<const reco::GenParticle*> sisters; for(reco::GenParticleCollection::const_iterator part = parts_->begin(); part<parts_->end(); ++part){ if( part->numberOfMothers()==0 && std::abs(part->pdgId())!= TopDecayID::tID){ // choose top sister which do not have a // mother and are whether top nor anti-top if( dynamic_cast<const reco::GenParticle*>( &(*part) ) == 0){ throw edm::Exception( edm::errors::InvalidReference, "Not a GenParticle" ); } sisters.push_back( part->clone() ); } } return sisters; }
const reco::GenParticle* TopGenEvent::wMinus | ( | ) | const [inline] |
return W minus if available; 0 else
Definition at line 96 of file TopGenEvent.h.
References candidate(), TopDecayID::tID, and TopDecayID::WID.
{ return candidate(-TopDecayID::WID, TopDecayID::tID );}
const reco::GenParticle* TopGenEvent::wPlus | ( | ) | const [inline] |
return W plus if available; 0 else
Definition at line 98 of file TopGenEvent.h.
References candidate(), TopDecayID::tID, and TopDecayID::WID.
{ return candidate( TopDecayID::WID, TopDecayID::tID );}
reco::GenParticleRefProd TopGenEvent::initPartons_ [protected] |
reference to the list of initial partons (has to be kept in the event!)
Definition at line 117 of file TopGenEvent.h.
Referenced by initialPartons(), StGenEvent::StGenEvent(), TopGenEvent(), and TtGenEvent::TtGenEvent().
reco::GenParticleRefProd TopGenEvent::parts_ [protected] |
reference to the top decay chain (has to be kept in the event!)
Definition at line 115 of file TopGenEvent.h.
Referenced by StGenEvent::associatedB(), candidate(), daughterQuarkOfTop(), daughterQuarkOfWPlus(), StGenEvent::decayB(), TtGenEvent::hadronicDecayB(), TtGenEvent::hadronicDecayQuark(), TtGenEvent::hadronicDecayTop(), TtGenEvent::hadronicDecayW(), TtGenEvent::lepton(), TtGenEvent::leptonBar(), TtGenEvent::leptonicDecayB(), TtGenEvent::leptonicDecayTop(), TtGenEvent::leptonicDecayW(), lightQuarks(), TtGenEvent::neutrino(), TtGenEvent::neutrinoBar(), numberOfBQuarks(), numberOfLeptons(), particles(), print(), radiatedGluons(), TtGenEvent::singleLepton(), StGenEvent::singleLepton(), TtGenEvent::singleNeutrino(), StGenEvent::singleNeutrino(), StGenEvent::singleTop(), StGenEvent::singleW(), StGenEvent::StGenEvent(), TopGenEvent(), topSisters(), and TtGenEvent::TtGenEvent().