File indexing completed on 2024-09-07 04:34:44
0001 #ifndef TopObjects_TtSemiLeptonicEvent_h
0002 #define TopObjects_TtSemiLeptonicEvent_h
0003
0004 #include "AnalysisDataFormats/TopObjects/interface/TtEvent.h"
0005
0006 namespace TtSemiLepDaughter {
0007
0008
0009 static const std::string Nu = "Nu", Lep = "Lep", LepW = "LepW", LepB = "LepB", LepTop = "LepTop";
0010 static const std::string HadQ = "HadQ", HadP = "HadP", HadW = "HadW", HadB = "HadB", HadTop = "HadTop";
0011 }
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 class TtSemiLeptonicEvent : public TtEvent {
0025 public:
0026
0027 TtSemiLeptonicEvent() {}
0028
0029 ~TtSemiLeptonicEvent() override {}
0030
0031
0032 const reco::Candidate* hadronicDecayTop(const std::string& key, const unsigned& cmb = 0) const {
0033 return hadronicDecayTop(hypoClassKeyFromString(key), cmb);
0034 };
0035
0036 const reco::Candidate* hadronicDecayTop(const HypoClassKey& key, const unsigned& cmb = 0) const {
0037 return !isHypoValid(key, cmb) ? nullptr : eventHypo(key, cmb).daughter(TtSemiLepDaughter::HadTop);
0038 };
0039
0040 const reco::Candidate* hadronicDecayB(const std::string& key, const unsigned& cmb = 0) const {
0041 return hadronicDecayB(hypoClassKeyFromString(key), cmb);
0042 };
0043
0044 const reco::Candidate* hadronicDecayB(const HypoClassKey& key, const unsigned& cmb = 0) const {
0045 return !isHypoValid(key, cmb) ? nullptr : hadronicDecayTop(key, cmb)->daughter(TtSemiLepDaughter::HadB);
0046 };
0047
0048 const reco::Candidate* hadronicDecayW(const std::string& key, const unsigned& cmb = 0) const {
0049 return hadronicDecayW(hypoClassKeyFromString(key), cmb);
0050 };
0051
0052 const reco::Candidate* hadronicDecayW(const HypoClassKey& key, const unsigned& cmb = 0) const {
0053 return !isHypoValid(key, cmb) ? nullptr : hadronicDecayTop(key, cmb)->daughter(TtSemiLepDaughter::HadW);
0054 };
0055
0056 const reco::Candidate* hadronicDecayQuark(const std::string& key, const unsigned& cmb = 0) const {
0057 return hadronicDecayQuark(hypoClassKeyFromString(key), cmb);
0058 };
0059
0060 const reco::Candidate* hadronicDecayQuark(const HypoClassKey& key, const unsigned& cmb = 0) const {
0061 return !isHypoValid(key, cmb) ? nullptr : hadronicDecayW(key, cmb)->daughter(TtSemiLepDaughter::HadP);
0062 };
0063
0064 const reco::Candidate* hadronicDecayQuarkBar(const std::string& key, const unsigned& cmb = 0) const {
0065 return hadronicDecayQuarkBar(hypoClassKeyFromString(key), cmb);
0066 };
0067
0068 const reco::Candidate* hadronicDecayQuarkBar(const HypoClassKey& key, const unsigned& cmb = 0) const {
0069 return !isHypoValid(key, cmb) ? nullptr : hadronicDecayW(key, cmb)->daughter(TtSemiLepDaughter::HadQ);
0070 };
0071
0072 const reco::Candidate* leptonicDecayTop(const std::string& key, const unsigned& cmb = 0) const {
0073 return leptonicDecayTop(hypoClassKeyFromString(key), cmb);
0074 };
0075
0076 const reco::Candidate* leptonicDecayTop(const HypoClassKey& key, const unsigned& cmb = 0) const {
0077 return !isHypoValid(key, cmb) ? nullptr : eventHypo(key, cmb).daughter(TtSemiLepDaughter::LepTop);
0078 };
0079
0080 const reco::Candidate* leptonicDecayB(const std::string& key, const unsigned& cmb = 0) const {
0081 return leptonicDecayB(hypoClassKeyFromString(key), cmb);
0082 };
0083
0084 const reco::Candidate* leptonicDecayB(const HypoClassKey& key, const unsigned& cmb = 0) const {
0085 return !isHypoValid(key, cmb) ? nullptr : leptonicDecayTop(key, cmb)->daughter(TtSemiLepDaughter::LepB);
0086 };
0087
0088 const reco::Candidate* leptonicDecayW(const std::string& key, const unsigned& cmb = 0) const {
0089 return leptonicDecayW(hypoClassKeyFromString(key), cmb);
0090 };
0091
0092 const reco::Candidate* leptonicDecayW(const HypoClassKey& key, const unsigned& cmb = 0) const {
0093 return !isHypoValid(key, cmb) ? nullptr : leptonicDecayTop(key, cmb)->daughter(TtSemiLepDaughter::LepW);
0094 };
0095
0096 const reco::Candidate* singleNeutrino(const std::string& key, const unsigned& cmb = 0) const {
0097 return singleNeutrino(hypoClassKeyFromString(key), cmb);
0098 };
0099
0100 const reco::Candidate* singleNeutrino(const HypoClassKey& key, const unsigned& cmb = 0) const {
0101 return !isHypoValid(key, cmb) ? nullptr : leptonicDecayW(key, cmb)->daughter(TtSemiLepDaughter::Nu);
0102 };
0103
0104 const reco::Candidate* singleLepton(const std::string& key, const unsigned& cmb = 0) const {
0105 return singleLepton(hypoClassKeyFromString(key), cmb);
0106 };
0107
0108 const reco::Candidate* singleLepton(const HypoClassKey& key, const unsigned& cmb = 0) const {
0109 return !isHypoValid(key, cmb) ? nullptr : leptonicDecayW(key, cmb)->daughter(TtSemiLepDaughter::Lep);
0110 };
0111
0112
0113 const reco::GenParticle* hadronicDecayTop() const {
0114 return (!genEvt_ ? nullptr : this->genEvent()->hadronicDecayTop());
0115 };
0116
0117 const reco::GenParticle* hadronicDecayB() const { return (!genEvt_ ? nullptr : this->genEvent()->hadronicDecayB()); };
0118
0119 const reco::GenParticle* hadronicDecayW() const { return (!genEvt_ ? nullptr : this->genEvent()->hadronicDecayW()); };
0120
0121 const reco::GenParticle* hadronicDecayQuark() const {
0122 return (!genEvt_ ? nullptr : this->genEvent()->hadronicDecayQuark());
0123 };
0124
0125 const reco::GenParticle* hadronicDecayQuarkBar() const {
0126 return (!genEvt_ ? nullptr : this->genEvent()->hadronicDecayQuarkBar());
0127 };
0128
0129 const reco::GenParticle* leptonicDecayTop() const {
0130 return (!genEvt_ ? nullptr : this->genEvent()->leptonicDecayTop());
0131 };
0132
0133 const reco::GenParticle* leptonicDecayB() const { return (!genEvt_ ? nullptr : this->genEvent()->leptonicDecayB()); };
0134
0135 const reco::GenParticle* leptonicDecayW() const { return (!genEvt_ ? nullptr : this->genEvent()->leptonicDecayW()); };
0136
0137 const reco::GenParticle* singleLepton() const { return (!genEvt_ ? nullptr : this->genEvent()->singleLepton()); };
0138
0139 const reco::GenParticle* singleNeutrino() const { return (!genEvt_ ? nullptr : this->genEvent()->singleNeutrino()); };
0140
0141
0142
0143 void print(const int verbosity = 1) const;
0144
0145
0146 const int numberOfRealNeutrinoSolutions(const HypoClassKey& key) const {
0147 return (numberOfRealNeutrinoSolutions_.find(key) == numberOfRealNeutrinoSolutions_.end()
0148 ? -999
0149 : numberOfRealNeutrinoSolutions_.find(key)->second);
0150 };
0151
0152 const int numberOfRealNeutrinoSolutions(const std::string& key) const {
0153 return numberOfRealNeutrinoSolutions(hypoClassKeyFromString(key));
0154 };
0155
0156
0157 void setNumberOfRealNeutrinoSolutions(const HypoClassKey& key, const int& nr) {
0158 numberOfRealNeutrinoSolutions_[key] = nr;
0159 };
0160
0161 protected:
0162
0163 std::map<HypoClassKey, int> numberOfRealNeutrinoSolutions_;
0164 };
0165
0166 #endif