CMS 3D CMS Logo

Public Member Functions

StGenEvent Class Reference

Class derived from the TopGenEvent for single-top events. More...

#include <AnalysisDataFormats/TopObjects/interface/StGenEvent.h>

Inheritance diagram for StGenEvent:
TopGenEvent

List of all members.

Public Member Functions

const reco::GenParticleassociatedB () const
 return associated b
const reco::GenParticledecayB () const
 return decay b
const reco::GenParticlesingleLepton () const
 return single lepton if available; 0 else
const reco::GenParticlesingleNeutrino () const
 return single neutrino if available; 0 else
const reco::GenParticlesingleTop () const
 return single Top
const reco::GenParticlesingleW () const
 return single W
 StGenEvent (reco::GenParticleRefProd &, reco::GenParticleRefProd &)
 default constructor
 StGenEvent ()
 empty constructor
virtual ~StGenEvent ()
 default destructor

Detailed Description

Class derived from the TopGenEvent for single-top 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 17 of file StGenEvent.h.


Constructor & Destructor Documentation

StGenEvent::StGenEvent ( )

empty constructor

Definition at line 10 of file StGenEvent.cc.

{
}
StGenEvent::StGenEvent ( reco::GenParticleRefProd parts,
reco::GenParticleRefProd inits 
)

default constructor

Definition at line 14 of file StGenEvent.cc.

References TopGenEvent::initPartons_, CfgNavigationSchool_cfi::parts, and TopGenEvent::parts_.

{
  parts_ = parts;
  initPartons_= inits;
}
StGenEvent::~StGenEvent ( ) [virtual]

default destructor

Definition at line 20 of file StGenEvent.cc.

{
}

Member Function Documentation

const reco::GenParticle * StGenEvent::associatedB ( ) const

return associated b

Definition at line 43 of file StGenEvent.cc.

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

{
  const reco::GenParticle* cand=0;
  if (singleLepton()) {
    const reco::GenParticleCollection & partsColl = *parts_;
    const reco::GenParticle & singleLep = *singleLepton();
    for (unsigned int i = 0; i < parts_->size(); ++i) {
      if (std::abs(partsColl[i].pdgId())==TopDecayID::bID && 
          reco::flavour(singleLep)== reco::flavour(partsColl[i])) { 
        // ... but it should be the opposite!
        cand = &partsColl[i];
      }
    }
  }
  return cand;
}
const reco::GenParticle * StGenEvent::decayB ( ) const

return decay b

Definition at line 25 of file StGenEvent.cc.

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

{
  const reco::GenParticle* cand=0;
  if (singleLepton()) {
    const reco::GenParticleCollection & partsColl = *parts_;
    const reco::GenParticle & singleLep = *singleLepton();
    for (unsigned int i = 0; i < parts_->size(); ++i) {
      if (std::abs(partsColl[i].pdgId())==TopDecayID::bID && 
          reco::flavour(singleLep)== - reco::flavour(partsColl[i])) { 
        // ... but it should be the opposite!
        cand = &partsColl[i];
      }
    }
  }
  return cand;
}
const reco::GenParticle * StGenEvent::singleLepton ( ) const

return single lepton if available; 0 else

Definition at line 61 of file StGenEvent.cc.

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

Referenced by associatedB(), decayB(), singleTop(), and singleW().

{
  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) {
      cand = &partsColl[i];
    }
  }
  return cand;
}
const reco::GenParticle * StGenEvent::singleNeutrino ( ) const

return single neutrino if available; 0 else

Definition at line 75 of file StGenEvent.cc.

References abs, 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) {
      cand = &partsColl[i];
    }
  }
  return cand;
}
const reco::GenParticle * StGenEvent::singleTop ( ) const

return single Top

Definition at line 107 of file StGenEvent.cc.

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

{
  const reco::GenParticle* cand=0;
  if (singleLepton()) {
    const reco::GenParticleCollection & partsColl = *parts_;
    const reco::GenParticle & singleLep = *singleLepton();
    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;
}
const reco::GenParticle * StGenEvent::singleW ( ) const

return single W

Definition at line 89 of file StGenEvent.cc.

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

{
  const reco::GenParticle* cand=0;
  if (singleLepton()) {
    const reco::GenParticleCollection & partsColl = *parts_;
    const reco::GenParticle & singleLep = *singleLepton();
    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;
}