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 fromGluonFusion() const; 00034 bool fromQuarkAnnihilation() const; 00036 bool isFullHadronic(bool excludeTauLeptons=false) const { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 0) : false;} 00038 bool isSemiLeptonic(bool excludeTauLeptons=false) const { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 1) : false;} 00040 bool isFullLeptonic(bool excludeTauLeptons=false) const { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 2) : false;} 00041 00043 WDecay::LeptonType semiLeptonicChannel() const; 00045 bool isSemiLeptonic(WDecay::LeptonType typeA) const { return semiLeptonicChannel()==typeA ? true : false; }; 00047 bool isSemiLeptonic(WDecay::LeptonType typeA, WDecay::LeptonType typeB) const { return (semiLeptonicChannel()==typeA || semiLeptonicChannel()==typeB)? true : false; }; 00048 // return decay channel (as a std::pair of LeptonType's); all leptons including taus are allowed 00049 std::pair<WDecay::LeptonType, WDecay::LeptonType> fullLeptonicChannel() const; 00051 bool isFullLeptonic(WDecay::LeptonType typeA, WDecay::LeptonType typeB) const; 00052 00054 const reco::GenParticle* singleLepton(bool excludeTauLeptons=false) const; 00056 const reco::GenParticle* singleNeutrino(bool excludeTauLeptons=false) const; 00058 const reco::GenParticle* leptonicDecayW(bool excludeTauLeptons=false) const; 00060 const reco::GenParticle* leptonicDecayB(bool excludeTauLeptons=false) const; 00062 const reco::GenParticle* leptonicDecayTop(bool excludeTauLeptons=false) const; 00064 const reco::GenParticle* hadronicDecayW(bool excludeTauLeptons=false) const; 00066 const reco::GenParticle* hadronicDecayB(bool excludeTauLeptons=false) const; 00068 const reco::GenParticle* hadronicDecayTop(bool excludeTauLeptons=false) const; 00070 const reco::GenParticle* hadronicDecayQuark(bool invertFlavor=false) const; 00072 const reco::GenParticle* hadronicDecayQuarkBar() const {return hadronicDecayQuark(true); }; 00074 std::vector<const reco::GenParticle*> leptonicDecayTopRadiation(bool excludeTauLeptons=false) const; 00076 std::vector<const reco::GenParticle*> hadronicDecayTopRadiation(bool excludeTauLeptons=false) const; 00078 const reco::GenParticle* lepton(bool excludeTauLeptons=false) const; 00080 const reco::GenParticle* leptonBar(bool excludeTauLeptons=false) const; 00082 const reco::GenParticle* neutrino(bool excludeTauLeptons=false) const; 00084 const reco::GenParticle* neutrinoBar(bool excludeTauLeptons=false) const; 00085 00087 const math::XYZTLorentzVector* topPair() const { return isTtBar() ? &topPair_ : 0; }; 00088 00089 protected: 00090 00092 math::XYZTLorentzVector topPair_; 00093 00094 private: 00095 00098 bool isNumberOfLeptons(bool excludeTauLeptons, int nlep) const {return excludeTauLeptons ? (numberOfLeptons()-numberOfLeptons(WDecay::kTau))==nlep : numberOfLeptons()==nlep;} 00099 }; 00100 00101 inline bool 00102 TtGenEvent::isFullLeptonic(WDecay::LeptonType typeA, WDecay::LeptonType typeB) const 00103 { 00104 return ( (fullLeptonicChannel().first==typeA && fullLeptonicChannel().second==typeB)|| 00105 (fullLeptonicChannel().first==typeB && fullLeptonicChannel().second==typeA)); 00106 } 00107 00108 #endif