test
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 fromGluonFusion() const;
34  bool fromQuarkAnnihilation() const;
36  bool isFullHadronic(bool excludeTauLeptons=false) const { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 0) : false;}
38  bool isSemiLeptonic(bool excludeTauLeptons=false) const { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 1) : false;}
40  bool isFullLeptonic(bool excludeTauLeptons=false) const { return isTtBar() ? isNumberOfLeptons(excludeTauLeptons, 2) : false;}
41 
45  bool isSemiLeptonic(WDecay::LeptonType typeA) const { return semiLeptonicChannel()==typeA ? true : false; };
47  bool isSemiLeptonic(WDecay::LeptonType typeA, WDecay::LeptonType typeB) const { return (semiLeptonicChannel()==typeA || semiLeptonicChannel()==typeB)? true : false; };
48  // return decay channel (as a std::pair of LeptonType's); all leptons including taus are allowed
49  std::pair<WDecay::LeptonType, WDecay::LeptonType> fullLeptonicChannel() const;
51  bool isFullLeptonic(WDecay::LeptonType typeA, WDecay::LeptonType typeB) const;
52 
54  const reco::GenParticle* singleLepton(bool excludeTauLeptons=false) const;
56  const reco::GenParticle* singleNeutrino(bool excludeTauLeptons=false) const;
58  const reco::GenParticle* leptonicDecayW(bool excludeTauLeptons=false) const;
60  const reco::GenParticle* leptonicDecayB(bool excludeTauLeptons=false) const;
62  const reco::GenParticle* leptonicDecayTop(bool excludeTauLeptons=false) const;
64  const reco::GenParticle* hadronicDecayW(bool excludeTauLeptons=false) const;
66  const reco::GenParticle* hadronicDecayB(bool excludeTauLeptons=false) const;
68  const reco::GenParticle* hadronicDecayTop(bool excludeTauLeptons=false) const;
70  const reco::GenParticle* hadronicDecayQuark(bool invertFlavor=false) const;
74  std::vector<const reco::GenParticle*> leptonicDecayTopRadiation(bool excludeTauLeptons=false) const;
76  std::vector<const reco::GenParticle*> hadronicDecayTopRadiation(bool excludeTauLeptons=false) const;
78  const reco::GenParticle* lepton(bool excludeTauLeptons=false) const;
80  const reco::GenParticle* leptonBar(bool excludeTauLeptons=false) const;
82  const reco::GenParticle* neutrino(bool excludeTauLeptons=false) const;
84  const reco::GenParticle* neutrinoBar(bool excludeTauLeptons=false) const;
85 
87  const math::XYZTLorentzVector* topPair() const { return isTtBar() ? &topPair_ : 0; };
88 
89  protected:
90 
93 
94  private:
95 
98  bool isNumberOfLeptons(bool excludeTauLeptons, int nlep) const {return excludeTauLeptons ? (numberOfLeptons()-numberOfLeptons(WDecay::kTau))==nlep : numberOfLeptons()==nlep;}
99 };
100 
101 inline bool
103 {
104  return ( (fullLeptonicChannel().first==typeA && fullLeptonicChannel().second==typeB)||
105  (fullLeptonicChannel().first==typeB && fullLeptonicChannel().second==typeA));
106 }
107 
108 #endif
const reco::GenParticle * leptonicDecayTop(bool excludeTauLeptons=false) const
get top of leptonic decay branch
Definition: TtGenEvent.cc:283
const reco::GenParticle * hadronicDecayB(bool excludeTauLeptons=false) const
get b of hadronic decay branch
Definition: TtGenEvent.cc:196
bool isSemiLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as semi-laptonic
Definition: TtGenEvent.h:38
bool fromQuarkAnnihilation() const
check if the tops were produced from qqbar
Definition: TtGenEvent.cc:29
const reco::GenParticle * hadronicDecayQuarkBar() const
get light anti-quark of hadronic decay branch
Definition: TtGenEvent.h:72
const reco::GenParticle * lepton(bool excludeTauLeptons=false) const
get lepton for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:70
math::XYZTLorentzVector topPair_
combined 4-vector of top and topBar
Definition: TtGenEvent.h:87
std::vector< const reco::GenParticle * > leptonicDecayTopRadiation(bool excludeTauLeptons=false) const
gluons as radiated from the leptonicly decaying top quark
Definition: TtGenEvent.cc:299
const reco::GenParticle * hadronicDecayW(bool excludeTauLeptons=false) const
get W of hadronic decay branch
Definition: TtGenEvent.cc:213
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:36
U second(std::pair< T, U > const &p)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
bool isFullLeptonic(bool excludeTauLeptons=false) const
check if the event can be classified as full leptonic
Definition: TtGenEvent.h:40
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:39
bool fromGluonFusion() const
check if the tops were produced from a pair of gluons
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:307
bool isNumberOfLeptons(bool excludeTauLeptons, int nlep) const
Definition: TtGenEvent.h:98
TtGenEvent()
empty constructor
Definition: TtGenEvent.h:23
const reco::GenParticle * hadronicDecayTop(bool excludeTauLeptons=false) const
get top of hadronic decay branch
Definition: TtGenEvent.cc:231
const reco::GenParticle * hadronicDecayQuark(bool invertFlavor=false) const
get light quark of hadronic decay branch
Definition: TtGenEvent.cc:166
std::pair< WDecay::LeptonType, WDecay::LeptonType > fullLeptonicChannel() const
Definition: TtGenEvent.cc:51
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:45
const reco::GenParticle * singleNeutrino(bool excludeTauLeptons=false) const
return single neutrino if available; 0 else
Definition: TtGenEvent.cc:150
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:47
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:248
const reco::GenParticle * neutrino(bool excludeTauLeptons=false) const
get neutrino for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:118
virtual ~TtGenEvent()
default destructor
Definition: TtGenEvent.h:27
const math::XYZTLorentzVector * topPair() const
return combined 4-vector of top and topBar
Definition: TtGenEvent.h:87
const reco::GenParticle * neutrinoBar(bool excludeTauLeptons=false) const
get anti-neutrino for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:134
const reco::GenParticle * leptonicDecayW(bool excludeTauLeptons=false) const
get W of leptonic decay branch
Definition: TtGenEvent.cc:265
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:86
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:102