CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TtGenEvent.h
Go to the documentation of this file.
1 #ifndef TopObjects_TtGenEvent_h
2 #define TopObjects_TtGenEvent_h
3 
6 
18 class TtGenEvent: public TopGenEvent {
19 
20  public:
21 
23  TtGenEvent() {};
27  virtual ~TtGenEvent() {};
28 
30  bool isTtBar() const {return (top() && topBar());}
32  bool isFullHadronic(bool excludeTauLeptons=false) const { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 0) : false;}
34  bool isSemiLeptonic(bool excludeTauLeptons=false) const { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 1) : false;}
36  bool isFullLeptonic(bool excludeTauLeptons=false) const { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 2) : false;}
37 
41  bool isSemiLeptonic(WDecay::LeptonType typeA) const { return semiLeptonicChannel()==typeA ? true : false; };
43  bool isSemiLeptonic(WDecay::LeptonType typeA, WDecay::LeptonType typeB) const { return (semiLeptonicChannel()==typeA || semiLeptonicChannel()==typeB)? true : false; };
44  // return decay channel (as a std::pair of LeptonType's); all leptons including taus are allowed
45  std::pair<WDecay::LeptonType, WDecay::LeptonType> fullLeptonicChannel() const;
47  bool isFullLeptonic(WDecay::LeptonType typeA, WDecay::LeptonType typeB) const;
48 
50  const reco::GenParticle* singleLepton(bool excludeTauLeptons=false) const;
52  const reco::GenParticle* singleNeutrino(bool excludeTauLeptons=false) const;
54  const reco::GenParticle* leptonicDecayW(bool excludeTauLeptons=false) const;
56  const reco::GenParticle* leptonicDecayB(bool excludeTauLeptons=false) const;
58  const reco::GenParticle* leptonicDecayTop(bool excludeTauLeptons=false) const;
60  const reco::GenParticle* hadronicDecayW(bool excludeTauLeptons=false) const;
62  const reco::GenParticle* hadronicDecayB(bool excludeTauLeptons=false) const;
64  const reco::GenParticle* hadronicDecayTop(bool excludeTauLeptons=false) const;
66  const reco::GenParticle* hadronicDecayQuark(bool invertFlavor=false) const;
70  std::vector<const reco::GenParticle*> leptonicDecayTopRadiation(bool excludeTauLeptons=false) const;
72  std::vector<const reco::GenParticle*> hadronicDecayTopRadiation(bool excludeTauLeptons=false) const;
74  const reco::GenParticle* lepton(bool excludeTauLeptons=false) const;
76  const reco::GenParticle* leptonBar(bool excludeTauLeptons=false) const;
78  const reco::GenParticle* neutrino(bool excludeTauLeptons=false) const;
80  const reco::GenParticle* neutrinoBar(bool excludeTauLeptons=false) const;
81 
82  private:
83 
86  bool isNumberOfLeptons(bool excludeTauLeptons, int nlep) const {return excludeTauLeptons ? (numberOfLeptons()-numberOfLeptons(WDecay::kTau))==nlep : numberOfLeptons()==nlep;}
87 };
88 
89 inline bool
91 {
92  return ( (fullLeptonicChannel().first==typeA && fullLeptonicChannel().second==typeB)||
93  (fullLeptonicChannel().first==typeB && fullLeptonicChannel().second==typeA));
94 }
95 
96 #endif
const reco::GenParticle * leptonicDecayTop(bool excludeTauLeptons=false) const
get top of leptonic decay branch
Definition: TtGenEvent.cc:263
const reco::GenParticle * hadronicDecayB(bool excludeTauLeptons=false) const
get b of hadronic decay branch
Definition: TtGenEvent.cc:176
bool isSemiLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as semi-laptonic
Definition: TtGenEvent.h:34
const reco::GenParticle * hadronicDecayQuarkBar() const
get light anti-quark of hadronic decay branch
Definition: TtGenEvent.h:68
const reco::GenParticle * lepton(bool excludeTauLeptons=false) const
get lepton for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:50
std::vector< const reco::GenParticle * > leptonicDecayTopRadiation(bool excludeTauLeptons=false) const
gluons as radiated from the leptonicly decaying top quark
Definition: TtGenEvent.cc:279
const reco::GenParticle * hadronicDecayW(bool excludeTauLeptons=false) const
get W of hadronic decay branch
Definition: TtGenEvent.cc:193
const reco::GenParticle * top() const
return top if available; 0 else
Definition: TopGenEvent.h:104
bool isFullHadronic(bool excludeTauLeptons=false) const
check if the event can be classified as full hadronic
Definition: TtGenEvent.h:32
U second(std::pair< T, U > const &p)
bool isFullLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as full leptonic
Definition: TtGenEvent.h:36
Class derived from the TopGenEvent for ttbar events.
Definition: TtGenEvent.h:18
WDecay::LeptonType semiLeptonicChannel() const
return decay channel; all leptons including taus are allowed
Definition: TtGenEvent.cc:19
std::vector< const reco::GenParticle * > hadronicDecayTopRadiation(bool excludeTauLeptons=false) const
gluons as radiated from the hadronicly decaying top quark
Definition: TtGenEvent.cc:287
bool isNumberOfLeptons(bool excludeTauLeptons, int nlep) const
Definition: TtGenEvent.h:86
TtGenEvent()
empty constructor
Definition: TtGenEvent.h:23
const reco::GenParticle * hadronicDecayTop(bool excludeTauLeptons=false) const
get top of hadronic decay branch
Definition: TtGenEvent.cc:211
const reco::GenParticle * hadronicDecayQuark(bool invertFlavor=false) const
get light quark of hadronic decay branch
Definition: TtGenEvent.cc:146
bool first
Definition: L1TdeRCT.cc:79
std::pair< WDecay::LeptonType, WDecay::LeptonType > fullLeptonicChannel() const
Definition: TtGenEvent.cc:31
bool isSemiLeptonic(WDecay::LeptonType typeA) const
check if the event is semi-leptonic with the lepton being of typeA; all leptons including taus are al...
Definition: TtGenEvent.h:41
const reco::GenParticle * singleNeutrino(bool excludeTauLeptons=false) const
return single neutrino if available; 0 else
Definition: TtGenEvent.cc:130
bool isSemiLeptonic(WDecay::LeptonType typeA, WDecay::LeptonType typeB) const
check if the event is semi-leptonic with the lepton being of typeA or typeB; all leptons including ta...
Definition: TtGenEvent.h:43
Base class to hold information for reduced top generator information.
Definition: TopGenEvent.h:41
const reco::GenParticle * leptonicDecayB(bool excludeTauLeptons=false) const
get b of leptonic decay branch
Definition: TtGenEvent.cc:228
const reco::GenParticle * neutrino(bool excludeTauLeptons=false) const
get neutrino for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:98
virtual ~TtGenEvent()
default destructor
Definition: TtGenEvent.h:27
const reco::GenParticle * neutrinoBar(bool excludeTauLeptons=false) const
get anti-neutrino for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:114
const reco::GenParticle * leptonicDecayW(bool excludeTauLeptons=false) const
get W of leptonic decay branch
Definition: TtGenEvent.cc:245
const reco::GenParticle * topBar() const
return anti-top if available; 0 else
Definition: TopGenEvent.h:106
bool isTtBar() const
check if the event can be classified as ttbar
Definition: TtGenEvent.h:30
const reco::GenParticle * leptonBar(bool excludeTauLeptons=false) const
get anti-lepton for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:66
int numberOfLeptons(bool fromWBoson=true) const
return number of leptons in the decay chain
Definition: TopGenEvent.cc:48
const reco::GenParticle * singleLepton(bool excludeTauLeptons=false) const
return single lepton if available; 0 else
Definition: TtGenEvent.cc:82