00001 #ifndef TopObjects_TtEvent_h
00002 #define TopObjects_TtEvent_h
00003
00004 #include <vector>
00005 #include <string>
00006
00007 #include "DataFormats/Common/interface/Handle.h"
00008 #include "DataFormats/Common/interface/RefProd.h"
00009 #include "DataFormats/Candidate/interface/CompositeCandidate.h"
00010 #include "AnalysisDataFormats/TopObjects/interface/TtGenEvent.h"
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 class TtEvent {
00026
00027 public:
00028
00030 enum HypoClassKey {kGeom, kWMassMaxSumPt, kMaxSumPtWMass, kGenMatch, kMVADisc, kKinFit};
00032 typedef std::pair<reco::CompositeCandidate, std::vector<int> > HypoCombPair;
00033
00034 public:
00035
00037 TtEvent(){};
00039 virtual ~TtEvent(){};
00040
00042 std::pair<WDecay::LeptonType, WDecay::LeptonType> lepDecays() const { return lepDecays_; }
00045 const reco::CompositeCandidate& eventHypo(const HypoClassKey& key, const unsigned& cmb=0) const { return (evtHyp_.find(key)->second)[cmb].first; };
00047 const edm::RefProd<TtGenEvent>& genEvent() const { return genEvt_; };
00048
00050 bool isHypoClassAvailable(const HypoClassKey& key) const { return (evtHyp_.find(key)!=evtHyp_.end()); };
00052 bool isHypoAvailable(const HypoClassKey& key, const unsigned& cmb=0) const { return isHypoClassAvailable(key) ? (cmb<evtHyp_.find(key)->second.size()) : false; };
00055 bool isHypoValid(const HypoClassKey& key, const unsigned& cmb=0) const { return isHypoAvailable(key,cmb) ? !eventHypo(key,cmb).roles().empty() : false; };
00057 unsigned int numberOfAvailableHypoClasses() const { return evtHyp_.size();};
00059 unsigned int numberOfAvailableHypos(const HypoClassKey& key) const { return isHypoAvailable(key) ? evtHyp_.find(key)->second.size() : 0;};
00061 std::vector<int> jetLepComb(const HypoClassKey& key, const unsigned& cmb=0) const { return (evtHyp_.find(key)->second)[cmb].second; };
00063 double genMatchSumPt(const unsigned& cmb=0) const { return (cmb<genMatchSumPt_.size() ? genMatchSumPt_[cmb] : -1.); };
00065 double genMatchSumDR(const unsigned& cmb=0) const { return (cmb<genMatchSumDR_.size() ? genMatchSumDR_[cmb] : -1.); };
00068 std::string mvaMethod() const { return mvaMethod_; }
00070 double mvaDisc(const unsigned& cmb=0) const { return (cmb<mvaDisc_.size() ? mvaDisc_[cmb] : -1.); }
00072 double fitChi2(const unsigned& cmb=0) const { return (cmb<fitChi2_.size() ? fitChi2_[cmb] : -1.); }
00074 double fitProb(const unsigned& cmb=0) const { return (cmb<fitProb_.size() ? fitProb_[cmb] : -1.); }
00077 int correspondingHypo(const HypoClassKey& key1, const unsigned& hyp1, const HypoClassKey& key2) const;
00078
00080 void setLepDecays(const WDecay::LeptonType& lepDecTop1, const WDecay::LeptonType& lepDecTop2) { lepDecays_=std::make_pair(lepDecTop1, lepDecTop2); };
00082 void setGenEvent(const edm::Handle<TtGenEvent>& evt) { genEvt_=edm::RefProd<TtGenEvent>(evt); };
00084 void addEventHypo(const HypoClassKey& key, HypoCombPair hyp) { evtHyp_[key].push_back(hyp); };
00086 void setGenMatchSumPt(const std::vector<double>& val) {genMatchSumPt_=val;};
00088 void setGenMatchSumDR(const std::vector<double>& val) {genMatchSumDR_=val;};
00090 void setMvaMethod(const std::string& name) { mvaMethod_=name; };
00092 void setMvaDiscriminators(const std::vector<double>& val) { mvaDisc_=val; };
00094 void setFitChi2(const std::vector<double>& val) { fitChi2_=val; };
00096 void setFitProb(const std::vector<double>& val) { fitProb_=val; };
00097
00098 protected:
00099
00101 std::pair<WDecay::LeptonType, WDecay::LeptonType> lepDecays_;
00103 edm::RefProd<TtGenEvent> genEvt_;
00106 std::map<HypoClassKey, std::vector<HypoCombPair> > evtHyp_;
00107
00109 std::vector<double> fitChi2_;
00111 std::vector<double> fitProb_;
00113 std::vector<double> genMatchSumPt_;
00115 std::vector<double> genMatchSumDR_;
00117 std::string mvaMethod_;
00119 std::vector<double> mvaDisc_;
00120 };
00121
00122 #endif