00001 #ifndef TopObjects_TtGenEvent_h
00002 #define TopObjects_TtGenEvent_h
00003
00004 #include "PhysicsTools/CandUtils/interface/pdgIdUtils.h"
00005 #include "AnalysisDataFormats/TopObjects/interface/TopGenEvent.h"
00006
00007
00008 namespace TtFullLepEvtPartons{
00012 enum { B, BBar, Lepton, LeptonBar };
00013 }
00014
00015 namespace TtSemiLepEvtPartons{
00019 enum { LightQ, LightQBar, HadB, LepB, Lepton };
00020 }
00021
00022 namespace TtFullHadEvtPartons{
00026 enum { LightQTop, LightQBarTop, B, LightQTopBar, LightQBarTopBar, BBar};
00027 }
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 class TtGenEvent: public TopGenEvent {
00042
00043 public:
00044
00046 TtGenEvent() {};
00048 TtGenEvent(reco::GenParticleRefProd&, reco::GenParticleRefProd&);
00050 virtual ~TtGenEvent() {};
00051
00053 bool isTtBar() const {return (top() && topBar());}
00055 bool isFullHadronic(bool excludeTauLeptons=false) const { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 0) : false;}
00057 bool isSemiLeptonic(bool excludeTauLeptons=false) const { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 1) : false;}
00059 bool isFullLeptonic(bool excludeTauLeptons=false) const { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 2) : false;}
00060
00062 WDecay::LeptonType semiLeptonicChannel() const;
00064 bool isSemiLeptonic(WDecay::LeptonType typeA) const { return semiLeptonicChannel()==typeA ? true : false; };
00066 bool isSemiLeptonic(WDecay::LeptonType typeA, WDecay::LeptonType typeB) const { return (semiLeptonicChannel()==typeA || semiLeptonicChannel()==typeB)? true : false; };
00067
00068 std::pair<WDecay::LeptonType, WDecay::LeptonType> fullLeptonicChannel() const;
00070 bool isFullLeptonic(WDecay::LeptonType typeA, WDecay::LeptonType typeB) const;
00071
00073 const reco::GenParticle* singleLepton(bool excludeTauLeptons=false) const;
00075 const reco::GenParticle* singleNeutrino(bool excludeTauLeptons=false) const;
00077 const reco::GenParticle* leptonicDecayW(bool excludeTauLeptons=false) const;
00079 const reco::GenParticle* leptonicDecayB(bool excludeTauLeptons=false) const;
00081 const reco::GenParticle* leptonicDecayTop(bool excludeTauLeptons=false) const;
00083 const reco::GenParticle* hadronicDecayW(bool excludeTauLeptons=false) const;
00085 const reco::GenParticle* hadronicDecayB(bool excludeTauLeptons=false) const;
00087 const reco::GenParticle* hadronicDecayTop(bool excludeTauLeptons=false) const;
00089 const reco::GenParticle* hadronicDecayQuark(bool invert=false) const;
00091 const reco::GenParticle* hadronicDecayQuarkBar() const {return hadronicDecayQuark(true); };
00093 std::vector<const reco::GenParticle*> leptonicDecayTopRadiation(bool excludeTauLeptons=false) const;
00095 std::vector<const reco::GenParticle*> hadronicDecayTopRadiation(bool excludeTauLeptons=false) const;
00097 const reco::GenParticle* lepton(bool excludeTauLeptons=false) const;
00099 const reco::GenParticle* leptonBar(bool excludeTauLeptons=false) const;
00101 const reco::GenParticle* neutrino(bool excludeTauLeptons=false) const;
00103 const reco::GenParticle* neutrinoBar(bool excludeTauLeptons=false) const;
00105 const reco::GenParticle* lightQFromTop() const;
00107 const reco::GenParticle* lightQBarFromTop() const;
00109 const reco::GenParticle* lightQFromTopBar() const;
00111 const reco::GenParticle* lightQBarFromTopBar() const;
00112
00113 private:
00114
00117 bool isNumberOfLeptons(bool excludeTauLeptons, int nlep) const {return excludeTauLeptons ? (numberOfLeptons()-numberOfLeptons(WDecay::kTau))==nlep : numberOfLeptons()==nlep;}
00118 };
00119
00120 inline bool
00121 TtGenEvent::isFullLeptonic(WDecay::LeptonType typeA, WDecay::LeptonType typeB) const
00122 {
00123 return ( (fullLeptonicChannel().first==typeA && fullLeptonicChannel().second==typeB)||
00124 (fullLeptonicChannel().first==typeB && fullLeptonicChannel().second==typeA));
00125 }
00126
00127 #endif