CMS 3D CMS Logo

TtDilepEvtSolution.h
Go to the documentation of this file.
1 //
2 //
3 
4 #ifndef TopObjects_TtDilepEvtSolution_h
5 #define TopObjects_TtDilepEvtSolution_h
6 
7 #include <vector>
8 #include <string>
9 
13 
17 
24 
26  friend class TtFullLepKinSolver;
29  friend class TtLRSignalSelCalc;
30 
31 public:
33  virtual ~TtDilepEvtSolution();
34 
35  //-------------------------------------------
36  // get calibrated base objects
37  //-------------------------------------------
38  pat::Jet getJetB() const;
39  pat::Jet getJetBbar() const;
40  pat::Electron getElectronp() const { return *elecp_; };
41  pat::Electron getElectronm() const { return *elecm_; };
42  pat::Muon getMuonp() const { return *muonp_; };
43  pat::Muon getMuonm() const { return *muonm_; };
44  pat::Tau getTaup() const { return *taup_; };
45  pat::Tau getTaum() const { return *taum_; };
46  pat::MET getMET() const { return *met_; };
47 
48  //-------------------------------------------
49  // get the matched gen particles
50  //-------------------------------------------
51  const edm::RefProd<TtGenEvent>& getGenEvent() const { return theGenEvt_; };
52  const reco::GenParticle* getGenT() const {
53  if (!theGenEvt_)
54  return nullptr;
55  else
56  return theGenEvt_->top();
57  };
58  const reco::GenParticle* getGenWp() const {
59  if (!theGenEvt_)
60  return nullptr;
61  else
62  return theGenEvt_->wPlus();
63  };
64  const reco::GenParticle* getGenB() const {
65  if (!theGenEvt_)
66  return nullptr;
67  else
68  return theGenEvt_->b();
69  };
70  const reco::GenParticle* getGenLepp() const {
71  if (!theGenEvt_)
72  return nullptr;
73  else
74  return theGenEvt_->leptonBar();
75  };
76  const reco::GenParticle* getGenN() const {
77  if (!theGenEvt_)
78  return nullptr;
79  else
80  return theGenEvt_->neutrino();
81  };
82  const reco::GenParticle* getGenTbar() const {
83  if (!theGenEvt_)
84  return nullptr;
85  else
86  return theGenEvt_->topBar();
87  };
88  const reco::GenParticle* getGenWm() const {
89  if (!theGenEvt_)
90  return nullptr;
91  else
92  return theGenEvt_->wMinus();
93  };
94  const reco::GenParticle* getGenBbar() const {
95  if (!theGenEvt_)
96  return nullptr;
97  else
98  return theGenEvt_->bBar();
99  };
100  const reco::GenParticle* getGenLepm() const {
101  if (!theGenEvt_)
102  return nullptr;
103  else
104  return theGenEvt_->lepton();
105  };
106  const reco::GenParticle* getGenNbar() const {
107  if (!theGenEvt_)
108  return nullptr;
109  else
110  return theGenEvt_->neutrinoBar();
111  };
112 
113  //-------------------------------------------
114  // get (un-)/calibrated reco objects
115  //-------------------------------------------
116  pat::Jet getRecJetB() const { return this->getJetB().correctedJet("RAW"); };
117  pat::Jet getCalJetB() const { return this->getJetB(); };
118  pat::Jet getRecJetBbar() const { return this->getJetBbar().correctedJet("RAW"); };
119  pat::Jet getCalJetBbar() const { return this->getJetBbar(); };
120 
121  //-------------------------------------------
122  // get info on the W decays
123  //-------------------------------------------
124  std::string getWpDecay() const { return wpDecay_; }
125  std::string getWmDecay() const { return wmDecay_; }
126 
127  //-------------------------------------------
128  // miscellaneous
129  //-------------------------------------------
130  double getJetResidual() const;
131  double getLeptonResidual() const;
132  double getFullResidual() const { return getJetResidual() + getLeptonResidual(); }
133  bool getBestSol() const { return bestSol_; }
134  double getRecTopMass() const { return topmass_; }
135  double getRecWeightMax() const { return weightmax_; }
136 
137  //-------------------------------------------
138  // returns the 4-vector of the positive
139  // lepton, with the charge and the pdgId
140  //-------------------------------------------
141  reco::Particle getLeptPos() const;
142 
143  //-------------------------------------------
144  // returns the 4-vector of the negative
145  // lepton, with the charge and the pdgId
146  //-------------------------------------------
147  reco::Particle getLeptNeg() const;
148 
149  //-------------------------------------------
150  // get info on the outcome of the signal
151  // selection LR
152  //-------------------------------------------
153  double getLRSignalEvtObsVal(unsigned int) const;
154  double getLRSignalEvtLRval() const { return lrSignalEvtLRval_; }
155  double getLRSignalEvtProb() const { return lrSignalEvtProb_; }
156 
157 protected:
158  //-------------------------------------------
159  // set the generated event
160  //-------------------------------------------
161  void setGenEvt(const edm::Handle<TtGenEvent>&);
162 
163  //-------------------------------------------
164  // set the basic objects
165  //-------------------------------------------
166  void setJetCorrectionScheme(int jetCorrScheme) { jetCorrScheme_ = jetCorrScheme; };
167  void setB(const edm::Handle<std::vector<pat::Jet> >& jet, int i) {
169  };
170  void setBbar(const edm::Handle<std::vector<pat::Jet> >& jet, int i) {
172  };
173  void setMuonp(const edm::Handle<std::vector<pat::Muon> >& muon, int i) {
175  wpDecay_ = "muon";
176  };
177  void setMuonm(const edm::Handle<std::vector<pat::Muon> >& muon, int i) {
179  wmDecay_ = "muon";
180  }
181  void setTaup(const edm::Handle<std::vector<pat::Tau> >& tau, int i) {
183  wpDecay_ = "tau";
184  }
185  void setTaum(const edm::Handle<std::vector<pat::Tau> >& tau, int i) {
187  wmDecay_ = "tau";
188  }
189  void setElectronp(const edm::Handle<std::vector<pat::Electron> >& elec, int i) {
191  wpDecay_ = "electron";
192  };
193  void setElectronm(const edm::Handle<std::vector<pat::Electron> >& elec, int i) {
195  wmDecay_ = "electron";
196  };
197  void setMET(const edm::Handle<std::vector<pat::MET> >& met, int i) {
199  };
200 
201  //-------------------------------------------
202  // miscellaneous
203  //-------------------------------------------
204  void setBestSol(bool bs) { bestSol_ = bs; };
205  void setRecTopMass(double mass) { topmass_ = mass; };
206  void setRecWeightMax(double wgt) { weightmax_ = wgt; };
207 
208  //-------------------------------------------
209  // set the outcome of the signal selection LR
210  //-------------------------------------------
211  void setLRSignalEvtObservables(const std::vector<std::pair<unsigned int, double> >&);
212  void setLRSignalEvtLRval(double clr) { lrSignalEvtLRval_ = clr; };
213  void setLRSignalEvtProb(double plr) { lrSignalEvtProb_ = plr; };
214 
215 private:
216  //-------------------------------------------
217  // particle content
218  //-------------------------------------------
225 
226  //-------------------------------------------
227  // miscellaneous
228  //-------------------------------------------
232  bool bestSol_;
233  double topmass_;
234  double weightmax_;
235 
237  std::vector<std::pair<unsigned int, double> > lrSignalEvtVarVal_;
238 };
239 
240 #endif
pat::Jet getRecJetBbar() const
Analysis-level MET class.
Definition: MET.h:40
void setRecWeightMax(double wgt)
const reco::GenParticle * getGenN() const
const reco::GenParticle * b() const
return b quark if available; 0 else
Definition: TopGenEvent.h:97
void setLRSignalEvtLRval(double clr)
const reco::GenParticle * getGenWp() const
pat::Jet getRecJetB() const
pat::Jet getCalJetBbar() const
edm::Ref< std::vector< pat::MET > > met_
edm::Ref< std::vector< pat::Jet > > jetB_
const reco::GenParticle * wMinus() const
return W minus if available; 0 else
Definition: TopGenEvent.h:93
double getLRSignalEvtLRval() const
void setElectronm(const edm::Handle< std::vector< pat::Electron > > &elec, int i)
edm::Ref< std::vector< pat::Tau > > taum_
void setElectronp(const edm::Handle< std::vector< pat::Electron > > &elec, int i)
void setB(const edm::Handle< std::vector< pat::Jet > > &jet, int i)
pat::Jet getJetB() const
const reco::GenParticle * getGenB() const
void setBestSol(bool bs)
const reco::GenParticle * topBar() const
return anti-top if available; 0 else
Definition: TopGenEvent.h:103
const reco::GenParticle * bBar() const
return anti-b quark if available; 0 else
Definition: TopGenEvent.h:99
double getLRSignalEvtProb() const
reco::Particle getLeptNeg() const
pat::Electron getElectronp() const
const reco::GenParticle * getGenTbar() const
void setMuonm(const edm::Handle< std::vector< pat::Muon > > &muon, int i)
const reco::GenParticle * getGenBbar() const
pat::Jet getJetBbar() const
edm::Ref< std::vector< pat::Electron > > elecp_
void setLRSignalEvtObservables(const std::vector< std::pair< unsigned int, double > > &)
edm::Ref< std::vector< pat::Muon > > muonm_
void setMET(const edm::Handle< std::vector< pat::MET > > &met, int i)
edm::Ref< std::vector< pat::Jet > > jetBbar_
Jet correctedJet(const std::string &level, const std::string &flavor="none", const std::string &set="") const
const reco::GenParticle * top() const
return top if available; 0 else
Definition: TopGenEvent.h:101
const reco::GenParticle * wPlus() const
return W plus if available; 0 else
Definition: TopGenEvent.h:95
const reco::GenParticle * leptonBar(bool excludeTauLeptons=false) const
get anti-lepton for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:83
friend class TtLRSignalSelCalc
void setTaup(const edm::Handle< std::vector< pat::Tau > > &tau, int i)
double getRecWeightMax() const
Analysis-level tau class.
Definition: Tau.h:53
void setJetCorrectionScheme(int jetCorrScheme)
double getLRSignalEvtObsVal(unsigned int) const
edm::RefProd< TtGenEvent > theGenEvt_
pat::Tau getTaup() const
pat::Muon getMuonm() const
pat::Muon getMuonp() const
const reco::GenParticle * getGenWm() const
const reco::GenParticle * neutrino(bool excludeTauLeptons=false) const
get neutrino for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:111
void setGenEvt(const edm::Handle< TtGenEvent > &)
void setMuonp(const edm::Handle< std::vector< pat::Muon > > &muon, int i)
std::vector< std::pair< unsigned int, double > > lrSignalEvtVarVal_
Analysis-level electron class.
Definition: Electron.h:51
double getLeptonResidual() const
Analysis-level calorimeter jet class.
Definition: Jet.h:77
const reco::GenParticle * lepton(bool excludeTauLeptons=false) const
get lepton for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:69
const reco::GenParticle * neutrinoBar(bool excludeTauLeptons=false) const
get anti-neutrino for semi-leptonic or full leptonic decays
Definition: TtGenEvent.cc:125
edm::Ref< std::vector< pat::Tau > > taup_
pat::MET getMET() const
std::string getWpDecay() const
std::string getWmDecay() const
double getFullResidual() const
const edm::RefProd< TtGenEvent > & getGenEvent() const
reco::Particle getLeptPos() const
void setTaum(const edm::Handle< std::vector< pat::Tau > > &tau, int i)
const reco::GenParticle * getGenNbar() const
void setLRSignalEvtProb(double plr)
double getJetResidual() const
pat::Jet getCalJetB() const
const reco::GenParticle * getGenLepm() const
void setRecTopMass(double mass)
Analysis-level muon class.
Definition: Muon.h:51
const reco::GenParticle * getGenLepp() const
pat::Electron getElectronm() const
pat::Tau getTaum() const
const reco::GenParticle * getGenT() const
double getRecTopMass() const
edm::Ref< std::vector< pat::Muon > > muonp_
edm::Ref< std::vector< pat::Electron > > elecm_
void setBbar(const edm::Handle< std::vector< pat::Jet > > &jet, int i)