CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/AnalysisDataFormats/TopObjects/interface/TtGenEvent.h

Go to the documentation of this file.
00001 #ifndef TopObjects_TtGenEvent_h
00002 #define TopObjects_TtGenEvent_h
00003 
00004 #include "CommonTools/CandUtils/interface/pdgIdUtils.h"
00005 #include "AnalysisDataFormats/TopObjects/interface/TopGenEvent.h"
00006 
00018 class TtGenEvent: public TopGenEvent {
00019 
00020  public:
00021 
00023   TtGenEvent() {};
00025   TtGenEvent(reco::GenParticleRefProd& decaySubset, reco::GenParticleRefProd& initSubset);
00027   virtual ~TtGenEvent() {};
00028 
00030   bool isTtBar() const {return (top() && topBar());}
00032   bool isFullHadronic(bool excludeTauLeptons=false) const { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 0) : false;}
00034   bool isSemiLeptonic(bool excludeTauLeptons=false) const { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 1) : false;}
00036   bool isFullLeptonic(bool excludeTauLeptons=false) const { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 2) : false;}
00037 
00039   WDecay::LeptonType semiLeptonicChannel() const;
00041   bool isSemiLeptonic(WDecay::LeptonType typeA) const { return semiLeptonicChannel()==typeA ? true : false; };
00043   bool isSemiLeptonic(WDecay::LeptonType typeA, WDecay::LeptonType typeB) const { return (semiLeptonicChannel()==typeA || semiLeptonicChannel()==typeB)? true : false; };
00044   // return decay channel (as a std::pair of LeptonType's); all leptons including taus are allowed
00045   std::pair<WDecay::LeptonType, WDecay::LeptonType> fullLeptonicChannel() const;
00047   bool isFullLeptonic(WDecay::LeptonType typeA, WDecay::LeptonType typeB) const;
00048 
00050   const reco::GenParticle* singleLepton(bool excludeTauLeptons=false) const;
00052   const reco::GenParticle* singleNeutrino(bool excludeTauLeptons=false) const;
00054   const reco::GenParticle* leptonicDecayW(bool excludeTauLeptons=false) const;
00056   const reco::GenParticle* leptonicDecayB(bool excludeTauLeptons=false) const;
00058   const reco::GenParticle* leptonicDecayTop(bool excludeTauLeptons=false) const;
00060   const reco::GenParticle* hadronicDecayW(bool excludeTauLeptons=false) const;
00062   const reco::GenParticle* hadronicDecayB(bool excludeTauLeptons=false) const;
00064   const reco::GenParticle* hadronicDecayTop(bool excludeTauLeptons=false) const;
00066   const reco::GenParticle* hadronicDecayQuark(bool invertFlavor=false) const;
00068   const reco::GenParticle* hadronicDecayQuarkBar() const {return hadronicDecayQuark(true); };
00070   std::vector<const reco::GenParticle*> leptonicDecayTopRadiation(bool excludeTauLeptons=false) const;
00072   std::vector<const reco::GenParticle*> hadronicDecayTopRadiation(bool excludeTauLeptons=false) const;
00074   const reco::GenParticle* lepton(bool excludeTauLeptons=false) const;
00076   const reco::GenParticle* leptonBar(bool excludeTauLeptons=false) const;
00078   const reco::GenParticle* neutrino(bool excludeTauLeptons=false) const;
00080   const reco::GenParticle* neutrinoBar(bool excludeTauLeptons=false) const;
00081 
00082  private:
00083 
00086   bool isNumberOfLeptons(bool excludeTauLeptons, int nlep) const {return excludeTauLeptons ? (numberOfLeptons()-numberOfLeptons(WDecay::kTau))==nlep : numberOfLeptons()==nlep;}
00087 };
00088 
00089 inline bool
00090 TtGenEvent::isFullLeptonic(WDecay::LeptonType typeA, WDecay::LeptonType typeB) const
00091 {
00092   return ( (fullLeptonicChannel().first==typeA && fullLeptonicChannel().second==typeB)||
00093            (fullLeptonicChannel().first==typeB && fullLeptonicChannel().second==typeA));
00094 }
00095 
00096 #endif