File indexing completed on 2024-09-07 04:34:44
0001 #ifndef TopObjects_TtFullLeptonicEvent_h
0002 #define TopObjects_TtFullLeptonicEvent_h
0003
0004 #include "AnalysisDataFormats/TopObjects/interface/TtEvent.h"
0005
0006 namespace TtFullLepDaughter {
0007
0008
0009 static const std::string Nu = "Nu", LepBar = "LepBar", WPlus = "WPlus", B = "B", Top = "Top";
0010 static const std::string NuBar = "NuBar", Lep = "Lep", WMinus = "WMinus", BBar = "BBar", TopBar = "TopBar";
0011 }
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 class TtFullLeptonicEvent : public TtEvent {
0025 public:
0026
0027 TtFullLeptonicEvent() {}
0028
0029 ~TtFullLeptonicEvent() override {}
0030
0031
0032 const reco::Candidate* top(const std::string& key, const unsigned& cmb = 0) const {
0033 return top(hypoClassKeyFromString(key), cmb);
0034 };
0035
0036 const reco::Candidate* top(const HypoClassKey& key, const unsigned& cmb = 0) const {
0037 return !isHypoValid(key, cmb) ? nullptr : eventHypo(key, cmb).daughter(TtFullLepDaughter::Top);
0038 };
0039
0040 const reco::Candidate* b(const std::string& key, const unsigned& cmb = 0) const {
0041 return b(hypoClassKeyFromString(key), cmb);
0042 };
0043
0044 const reco::Candidate* b(const HypoClassKey& key, const unsigned& cmb = 0) const {
0045 return !isHypoValid(key, cmb) ? nullptr : top(key, cmb)->daughter(TtFullLepDaughter::B);
0046 };
0047
0048 const reco::Candidate* wPlus(const std::string& key, const unsigned& cmb = 0) const {
0049 return wPlus(hypoClassKeyFromString(key), cmb);
0050 };
0051
0052 const reco::Candidate* wPlus(const HypoClassKey& key, const unsigned& cmb = 0) const {
0053 return !isHypoValid(key, cmb) ? nullptr : top(key, cmb)->daughter(TtFullLepDaughter::WPlus);
0054 };
0055
0056 const reco::Candidate* leptonBar(const std::string& key, const unsigned& cmb = 0) const {
0057 return leptonBar(hypoClassKeyFromString(key), cmb);
0058 };
0059
0060 const reco::Candidate* leptonBar(const HypoClassKey& key, const unsigned& cmb = 0) const {
0061 return !isHypoValid(key, cmb) ? nullptr : wPlus(key, cmb)->daughter(TtFullLepDaughter::LepBar);
0062 };
0063
0064 const reco::Candidate* neutrino(const std::string& key, const unsigned& cmb = 0) const {
0065 return neutrino(hypoClassKeyFromString(key), cmb);
0066 };
0067
0068 const reco::Candidate* neutrino(const HypoClassKey& key, const unsigned& cmb = 0) const {
0069 return !isHypoValid(key, cmb) ? nullptr : wPlus(key, cmb)->daughter(TtFullLepDaughter::Nu);
0070 };
0071
0072 const reco::Candidate* topBar(const std::string& key, const unsigned& cmb = 0) const {
0073 return topBar(hypoClassKeyFromString(key), cmb);
0074 };
0075
0076 const reco::Candidate* topBar(const HypoClassKey& key, const unsigned& cmb = 0) const {
0077 return !isHypoValid(key, cmb) ? nullptr : eventHypo(key, cmb).daughter(TtFullLepDaughter::TopBar);
0078 };
0079
0080 const reco::Candidate* bBar(const std::string& key, const unsigned& cmb = 0) const {
0081 return bBar(hypoClassKeyFromString(key), cmb);
0082 };
0083
0084 const reco::Candidate* bBar(const HypoClassKey& key, const unsigned& cmb = 0) const {
0085 return !isHypoValid(key, cmb) ? nullptr : topBar(key, cmb)->daughter(TtFullLepDaughter::BBar);
0086 };
0087
0088 const reco::Candidate* wMinus(const std::string& key, const unsigned& cmb = 0) const {
0089 return wMinus(hypoClassKeyFromString(key), cmb);
0090 };
0091
0092 const reco::Candidate* wMinus(const HypoClassKey& key, const unsigned& cmb = 0) const {
0093 return !isHypoValid(key, cmb) ? nullptr : topBar(key, cmb)->daughter(TtFullLepDaughter::WMinus);
0094 };
0095
0096 const reco::Candidate* lepton(const std::string& key, const unsigned& cmb = 0) const {
0097 return lepton(hypoClassKeyFromString(key), cmb);
0098 };
0099
0100 const reco::Candidate* lepton(const HypoClassKey& key, const unsigned& cmb = 0) const {
0101 return !isHypoValid(key, cmb) ? nullptr : wMinus(key, cmb)->daughter(TtFullLepDaughter::Lep);
0102 };
0103
0104 const reco::Candidate* neutrinoBar(const std::string& key, const unsigned& cmb = 0) const {
0105 return neutrinoBar(hypoClassKeyFromString(key), cmb);
0106 };
0107
0108 const reco::Candidate* neutrinoBar(const HypoClassKey& key, const unsigned& cmb = 0) const {
0109 return !isHypoValid(key, cmb) ? nullptr : wMinus(key, cmb)->daughter(TtFullLepDaughter::NuBar);
0110 };
0111
0112
0113 const reco::GenParticle* genTop() const { return (!genEvt_ ? nullptr : this->genEvent()->top()); };
0114
0115 const reco::GenParticle* genB() const { return (!genEvt_ ? nullptr : this->genEvent()->b()); };
0116
0117 const reco::GenParticle* genWPlus() const { return (!genEvt_ ? nullptr : this->genEvent()->wPlus()); };
0118
0119 const reco::GenParticle* genLeptonBar() const { return (!genEvt_ ? nullptr : this->genEvent()->leptonBar()); };
0120
0121 const reco::GenParticle* genNeutrino() const { return (!genEvt_ ? nullptr : this->genEvent()->neutrino()); };
0122
0123 const reco::GenParticle* genTopBar() const { return (!genEvt_ ? nullptr : this->genEvent()->topBar()); };
0124
0125 const reco::GenParticle* genBBar() const { return (!genEvt_ ? nullptr : this->genEvent()->bBar()); };
0126
0127 const reco::GenParticle* genWMinus() const { return (!genEvt_ ? nullptr : this->genEvent()->wMinus()); };
0128
0129 const reco::GenParticle* genLepton() const { return (!genEvt_ ? nullptr : this->genEvent()->lepton()); };
0130
0131 const reco::GenParticle* genNeutrinoBar() const { return (!genEvt_ ? nullptr : this->genEvent()->neutrinoBar()); };
0132
0133
0134 double solWeight(const unsigned& cmb = 0) const { return (cmb < solWeight_.size() ? solWeight_[cmb] : -1.); }
0135
0136 bool isWrongCharge() const { return wrongCharge_; }
0137
0138
0139 void setSolWeight(const std::vector<double>& val) { solWeight_ = val; };
0140
0141 void setWrongCharge(const bool& val) { wrongCharge_ = val; };
0142
0143
0144
0145 void print(const int verbosity = 1) const;
0146
0147 protected:
0148
0149 std::vector<double> solWeight_;
0150
0151 bool wrongCharge_;
0152 };
0153
0154 #endif