CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TtSemiEvtSolution.h
Go to the documentation of this file.
1 //
2 // $Id: TtSemiEvtSolution.h,v 1.30 2011/05/26 10:14:37 mseidel Exp $
3 //
4 
5 #ifndef TopObjects_TtSemiEvtSolution_h
6 #define TopObjects_TtSemiEvtSolution_h
7 
8 #include <vector>
9 #include <string>
10 
14 
18 
25 
28 
29 // FIXME: make the decay member an enumerable
30 // FIXME: Can we generalize all the muon and electron to lepton?
31 
33 
34  friend class TtSemiEvtSolutionMaker;
35  friend class TtSemiLepKinFitter;
36  friend class TtSemiLepHitFit;
38  friend class TtSemiLRSignalSelCalc;
40  friend class TtSemiLRJetCombCalc;
41 
42  public:
43 
44 
46  virtual ~TtSemiEvtSolution();
47 
48  //-------------------------------------------
49  // get calibrated base objects
50  //-------------------------------------------
51  pat::Jet getHadb() const;
52  pat::Jet getHadp() const;
53  pat::Jet getHadq() const;
54  pat::Jet getLepb() const;
55  pat::Muon getMuon() const { return *muon_; };
56  pat::Electron getElectron() const { return *electron_; };
57  pat::MET getNeutrino() const { return *neutrino_; };
58 
59  //-------------------------------------------
60  // get the matched gen particles
61  //-------------------------------------------
62  const edm::RefProd<TtGenEvent> & getGenEvent() const { return theGenEvt_; };
63  const reco::GenParticle * getGenHadt() const { if (!theGenEvt_) return 0; else return this->getGenEvent()->hadronicDecayTop(); };
64  const reco::GenParticle * getGenHadW() const { if (!theGenEvt_) return 0; else return this->getGenEvent()->hadronicDecayW(); };
65  const reco::GenParticle * getGenHadb() const { if (!theGenEvt_) return 0; else return this->getGenEvent()->hadronicDecayB(); };
66  const reco::GenParticle * getGenHadp() const { if (!theGenEvt_) return 0; else return this->getGenEvent()->hadronicDecayQuark(); };
67  const reco::GenParticle * getGenHadq() const { if (!theGenEvt_) return 0; else return this->getGenEvent()->hadronicDecayQuarkBar(); };
68  const reco::GenParticle * getGenLept() const { if (!theGenEvt_) return 0; else return this->getGenEvent()->leptonicDecayTop(); };
69  const reco::GenParticle * getGenLepW() const { if (!theGenEvt_) return 0; else return this->getGenEvent()->leptonicDecayW(); };
70  const reco::GenParticle * getGenLepb() const { if (!theGenEvt_) return 0; else return this->getGenEvent()->leptonicDecayB(); };
71  const reco::GenParticle * getGenLepl() const { if (!theGenEvt_) return 0; else return this->getGenEvent()->singleLepton(); };
72  const reco::GenParticle * getGenLepn() const { if (!theGenEvt_) return 0; else return this->getGenEvent()->singleNeutrino(); };
73 
74  //-------------------------------------------
75  // get (un-)/calibrated reco objects
76  //-------------------------------------------
77  reco::Particle getRecHadt() const;
78  reco::Particle getRecHadW() const;
79  pat::Jet getRecHadb() const { return this->getHadb().correctedJet("RAW"); };
80  pat::Jet getRecHadp() const { return this->getHadp().correctedJet("RAW"); };
81  pat::Jet getRecHadq() const { return this->getHadq().correctedJet("RAW"); };
82  reco::Particle getRecLept() const;
83  reco::Particle getRecLepW() const;
84  pat::Jet getRecLepb() const { return this->getLepb().correctedJet("RAW"); };
85  pat::Muon getRecLepm() const { return this->getMuon(); };
86  pat::Electron getRecLepe() const { return this->getElectron(); };
87  pat::MET getRecLepn() const { return this->getNeutrino(); };
88  // FIXME: Why these functions??? Not needed!
89  // methods to get calibrated objects
90  reco::Particle getCalHadt() const;
91  reco::Particle getCalHadW() const;
92  pat::Jet getCalHadb() const { return this->getHadb(); };
93  pat::Jet getCalHadp() const { return this->getHadp(); };
94  pat::Jet getCalHadq() const { return this->getHadq(); };
95  reco::Particle getCalLept() const;
96  reco::Particle getCalLepW() const;
97  pat::Jet getCalLepb() const { return this->getLepb(); };
98  pat::Muon getCalLepm() const { return this->getMuon(); };
99  pat::Electron getCalLepe() const { return this->getElectron(); };
100  pat::MET getCalLepn() const { return this->getNeutrino(); };
101 
102  //-------------------------------------------
103  // get objects from kinematic fit
104  //-------------------------------------------
105  reco::Particle getFitHadt() const;
106  reco::Particle getFitHadW() const;
107  pat::Particle getFitHadb() const { return (fitHadb_.size()>0 ? fitHadb_.front() : pat::Particle()); };
108  pat::Particle getFitHadp() const { return (fitHadp_.size()>0 ? fitHadp_.front() : pat::Particle()); };
109  pat::Particle getFitHadq() const { return (fitHadq_.size()>0 ? fitHadq_.front() : pat::Particle()); };
110  reco::Particle getFitLept() const;
111  reco::Particle getFitLepW() const;
112  pat::Particle getFitLepb() const { return (fitLepb_.size()>0 ? fitLepb_.front() : pat::Particle()); };
113  pat::Particle getFitLepl() const { return (fitLepl_.size()>0 ? fitLepl_.front() : pat::Particle()); };
114  pat::Particle getFitLepn() const { return (fitLepn_.size()>0 ? fitLepn_.front() : pat::Particle()); };
115 
116  //-------------------------------------------
117  // get the selected semileptonic decay chain
118  //-------------------------------------------
119  std::string getDecay() const { return decay_; }
120 
121  //-------------------------------------------
122  // get info on the matching
123  //-------------------------------------------
124  double getMCBestSumAngles() const { return sumAnglejp_;};
125  double getMCBestAngleHadp() const { return angleHadp_; };
126  double getMCBestAngleHadq() const { return angleHadq_; };
127  double getMCBestAngleHadb() const { return angleHadb_; };
128  double getMCBestAngleLepb() const { return angleLepb_; };
129  int getMCChangeWQ() const { return changeWQ_; };
130 
131  //-------------------------------------------
132  // get the selected kinfit parametrisations
133  // of each type of object
134  //-------------------------------------------
135  int getJetParametrisation() const { return jetParam_; }
136  int getLeptonParametrisation() const { return leptonParam_; }
138 
139  //-------------------------------------------
140  // get the prob of the chi2 value resulting
141  // from the kinematic fit
142  //-------------------------------------------
143  double getProbChi2() const { return probChi2_; }
144 
145  //-------------------------------------------
146  // get info on the outcome of the signal
147  // selection LR
148  //-------------------------------------------
149  double getLRSignalEvtObsVal(unsigned int) const;
150  double getLRSignalEvtLRval() const { return lrSignalEvtLRval_; }
151  double getLRSignalEvtProb() const { return lrSignalEvtProb_; }
152 
153  //-------------------------------------------
154  // get info on the outcome of the different
155  // jet combination methods
156  //-------------------------------------------
157  int getMCBestJetComb() const { return mcBestJetComb_; }
158  int getSimpleBestJetComb() const { return simpleBestJetComb_; }
159  int getLRBestJetComb() const { return lrBestJetComb_; }
160  double getLRJetCombObsVal(unsigned int) const;
161  double getLRJetCombLRval() const { return lrJetCombLRval_; }
162  double getLRJetCombProb() const { return lrJetCombProb_; }
163 
164 
165 
166  //-------------------------------------------
167  // get the various event hypotheses
168  //-------------------------------------------
169  const reco::CompositeCandidate & getRecoHyp() const { return recoHyp_; }
170  const reco::CompositeCandidate & getFitHyp () const { return fitHyp_; }
171  const reco::CompositeCandidate & getMCHyp () const { return mcHyp_; }
172 
173  protected:
174 
175  //-------------------------------------------
176  // set the generated event
177  //-------------------------------------------
178  void setGenEvt(const edm::Handle<TtGenEvent> & aGenEvt);
179 
180  //-------------------------------------------
181  // set the basic objects
182  //-------------------------------------------
183  void setJetCorrectionScheme(int scheme) { jetCorrScheme_ = scheme; };
184  void setHadp(const edm::Handle<std::vector<pat::Jet> > & jet, int i)
185  { hadp_ = edm::Ptr<pat::Jet>(jet, i); };
186  void setHadq(const edm::Handle<std::vector<pat::Jet> > & jet, int i)
187  { hadq_ = edm::Ptr<pat::Jet>(jet, i); };
188  void setHadb(const edm::Handle<std::vector<pat::Jet> > & jet, int i)
189  { hadb_ = edm::Ptr<pat::Jet>(jet, i); };
190  void setLepb(const edm::Handle<std::vector<pat::Jet> > & jet, int i)
191  { lepb_ = edm::Ptr<pat::Jet>(jet, i); };
192  void setMuon(const edm::Handle<std::vector<pat::Muon> > & muon, int i)
193  { muon_ = edm::Ptr<pat::Muon>(muon, i); decay_ = "muon"; };
194  void setElectron(const edm::Handle<std::vector<pat::Electron> > & elec, int i)
195  { electron_ = edm::Ptr<pat::Electron>(elec, i); decay_ = "electron"; };
196  void setNeutrino(const edm::Handle<std::vector<pat::MET> > & met, int i)
198 
199  //-------------------------------------------
200  // set the fitted objects
201  //-------------------------------------------
202  void setFitHadb(const pat::Particle & aFitHadb) { fitHadb_.clear(); fitHadb_.push_back(aFitHadb); };
203  void setFitHadp(const pat::Particle & aFitHadp) { fitHadp_.clear(); fitHadp_.push_back(aFitHadp); };
204  void setFitHadq(const pat::Particle & aFitHadq) { fitHadq_.clear(); fitHadq_.push_back(aFitHadq); };
205  void setFitLepb(const pat::Particle & aFitLepb) { fitLepb_.clear(); fitLepb_.push_back(aFitLepb); };
206  void setFitLepl(const pat::Particle & aFitLepl) { fitLepl_.clear(); fitLepl_.push_back(aFitLepl); };
207  void setFitLepn(const pat::Particle & aFitLepn) { fitLepn_.clear(); fitLepn_.push_back(aFitLepn); };
208 
209  //-------------------------------------------
210  // set the info on the matching
211  //-------------------------------------------
212  void setMCBestSumAngles(double sdr) { sumAnglejp_= sdr; };
213  void setMCBestAngleHadp(double adr) { angleHadp_ = adr; };
214  void setMCBestAngleHadq(double adr) { angleHadq_ = adr; };
215  void setMCBestAngleHadb(double adr) { angleHadb_ = adr; };
216  void setMCBestAngleLepb(double adr) { angleLepb_ = adr; };
217  void setMCChangeWQ(int wq) { changeWQ_ = wq; };
218 
219  //-------------------------------------------
220  // set the kinfit parametrisations of each
221  // type of object
222  //-------------------------------------------
223  void setJetParametrisation(int jp) { jetParam_ = jp; };
224  void setLeptonParametrisation(int lp) { leptonParam_ = lp; };
226 
227  //-------------------------------------------
228  // set the prob. of the chi2 value resulting
229  // from the kinematic fit
230  //-------------------------------------------
231  void setProbChi2(double c) { probChi2_ = c; };
232 
233  //-------------------------------------------
234  // set the outcome of the different jet
235  // combination methods
236  //-------------------------------------------
237  void setMCBestJetComb(int mcbs) { mcBestJetComb_ = mcbs; };
238  void setSimpleBestJetComb(int sbs) { simpleBestJetComb_ = sbs; };
239  void setLRBestJetComb(int lrbs) { lrBestJetComb_ = lrbs; };
240  void setLRJetCombObservables(std::vector<std::pair<unsigned int, double> > varval);
241  void setLRJetCombLRval(double clr) {lrJetCombLRval_ = clr;};
242  void setLRJetCombProb(double plr) {lrJetCombProb_ = plr;};
243 
244  //-------------------------------------------
245  // set the outcome of the signal selection LR
246  //-------------------------------------------
247  void setLRSignalEvtObservables(std::vector<std::pair<unsigned int, double> > varval);
248  void setLRSignalEvtLRval(double clr) {lrSignalEvtLRval_ = clr;};
249  void setLRSignalEvtProb(double plr) {lrSignalEvtProb_ = plr;};
250 
251 
252 
253  private:
254 
255  //-------------------------------------------
256  // particle content
257  //-------------------------------------------
263  std::vector<pat::Particle> fitHadb_, fitHadp_, fitHadq_;
264  std::vector<pat::Particle> fitLepb_, fitLepl_, fitLepn_;
265 
269 
270  void setupHyp();
271 
272  std::string decay_;
277  double probChi2_;
281  std::vector<std::pair<unsigned int, double> > lrJetCombVarVal_;
282  std::vector<std::pair<unsigned int, double> > lrSignalEvtVarVal_;
283 };
284 
285 #endif
Analysis-level MET class.
Definition: MET.h:42
void setFitHadq(const pat::Particle &aFitHadq)
int i
Definition: DBlmapReader.cc:9
void setLepb(const edm::Handle< std::vector< pat::Jet > > &jet, int i)
void setMCBestSumAngles(double sdr)
void setFitHadb(const pat::Particle &aFitHadb)
reco::Particle getCalHadW() const
int getLeptonParametrisation() const
void setMCBestAngleHadb(double adr)
void setMCBestAngleHadp(double adr)
pat::Jet getLepb() const
int getSimpleBestJetComb() const
pat::Jet getRecLepb() const
void setLRSignalEvtLRval(double clr)
void setMCChangeWQ(int wq)
reco::Particle getRecLept() const
pat::Jet getHadq() const
void setMCBestAngleHadq(double adr)
void setLRBestJetComb(int lrbs)
pat::Jet getCalHadq() const
double getLRJetCombLRval() const
std::vector< std::pair< unsigned int, double > > lrJetCombVarVal_
Jet correctedJet(const std::string &level, const std::string &flavor="none", const std::string &set="") const
Definition: Jet.cc:271
const reco::GenParticle * getGenLept() const
reco::CompositeCandidate fitHyp_
pat::Particle getFitLepn() const
int getMCChangeWQ() const
pat::MET getCalLepn() const
void setGenEvt(const edm::Handle< TtGenEvent > &aGenEvt)
const reco::GenParticle * getGenLepW() const
pat::Particle getFitHadq() const
double getLRSignalEvtObsVal(unsigned int) const
reco::Particle getFitHadt() const
std::string getDecay() const
const reco::CompositeCandidate & getMCHyp() const
std::vector< pat::Particle > fitLepb_
const reco::CompositeCandidate & getRecoHyp() const
const reco::GenParticle * getGenHadq() const
reco::Particle getRecHadW() const
const reco::GenParticle * getGenLepb() const
void setHadp(const edm::Handle< std::vector< pat::Jet > > &jet, int i)
pat::Muon getMuon() const
pat::Jet getHadb() const
reco::Particle getRecHadt() const
double getMCBestAngleHadp() const
void setLeptonParametrisation(int lp)
void setMuon(const edm::Handle< std::vector< pat::Muon > > &muon, int i)
Class to calculate the jet combination LR value and purity from a root-file with fit functions...
int getLRBestJetComb() const
edm::Ptr< pat::Jet > hadb_
pat::Electron getRecLepe() const
const reco::GenParticle * getGenHadp() const
pat::Electron getCalLepe() const
pat::Particle getFitHadp() const
reco::Particle getFitLepW() const
double getLRJetCombObsVal(unsigned int) const
std::vector< pat::Particle > fitLepn_
edm::Ptr< pat::Jet > hadp_
std::vector< std::pair< unsigned int, double > > lrSignalEvtVarVal_
void setJetCorrectionScheme(int scheme)
void setFitLepb(const pat::Particle &aFitLepb)
pat::Jet getRecHadp() const
const reco::GenParticle * getGenHadb() const
pat::Jet getHadp() const
void setFitHadp(const pat::Particle &aFitHadp)
const reco::GenParticle * getGenLepl() const
reco::Particle getCalLept() const
double getLRSignalEvtProb() const
reco::CompositeCandidate mcHyp_
void setLRJetCombProb(double plr)
int getMCBestJetComb() const
pat::Electron getElectron() const
void setJetParametrisation(int jp)
void setSimpleBestJetComb(int sbs)
Class to calculate the jet combination LR value and purity from a root-file with fit functions...
const edm::RefProd< TtGenEvent > & getGenEvent() const
void setLRJetCombObservables(std::vector< std::pair< unsigned int, double > > varval)
void setElectron(const edm::Handle< std::vector< pat::Electron > > &elec, int i)
pat::Jet getRecHadb() const
pat::Muon getCalLepm() const
reco::Particle getFitHadW() const
pat::Jet getCalHadb() const
const reco::GenParticle * getGenHadW() const
double getMCBestSumAngles() const
double getMCBestAngleLepb() const
edm::Ptr< pat::Muon > muon_
const reco::GenParticle * getGenHadt() const
edm::Ptr< pat::Electron > electron_
int getJetParametrisation() const
void setLRSignalEvtObservables(std::vector< std::pair< unsigned int, double > > varval)
reco::CompositeCandidate recoHyp_
edm::RefProd< TtGenEvent > theGenEvt_
edm::Ptr< pat::Jet > lepb_
double getLRSignalEvtLRval() const
std::vector< pat::Particle > fitHadb_
Steering class for the overall top-lepton likelihood.
pat::Particle getFitLepb() const
edm::Ptr< pat::MET > neutrino_
void setFitLepn(const pat::Particle &aFitLepn)
double getMCBestAngleHadb() const
Analysis-level particle class.
Definition: Particle.h:34
pat::Particle getFitHadb() const
pat::Jet getRecHadq() const
Analysis-level electron class.
Definition: Electron.h:52
Analysis-level calorimeter jet class.
Definition: Jet.h:71
void setLRSignalEvtProb(double plr)
const reco::GenParticle * getGenLepn() const
void setMCBestAngleLepb(double adr)
void setMCBestJetComb(int mcbs)
pat::MET getNeutrino() const
void setNeutrinoParametrisation(int mp)
pat::Particle getFitLepl() const
pat::Muon getRecLepm() const
void setProbChi2(double c)
void setNeutrino(const edm::Handle< std::vector< pat::MET > > &met, int i)
pat::Jet getCalLepb() const
int getNeutrinoParametrisation() const
void setLRJetCombLRval(double clr)
edm::Ptr< pat::Jet > hadq_
const reco::CompositeCandidate & getFitHyp() const
pat::MET getRecLepn() const
double getLRJetCombProb() const
std::vector< pat::Particle > fitHadp_
std::vector< pat::Particle > fitHadq_
void setFitLepl(const pat::Particle &aFitLepl)
reco::Particle getCalHadt() const
virtual ~TtSemiEvtSolution()
reco::Particle getRecLepW() const
double getProbChi2() const
friend class TtSemiLepHitFit
void setHadb(const edm::Handle< std::vector< pat::Jet > > &jet, int i)
double getMCBestAngleHadq() const
Analysis-level muon class.
Definition: Muon.h:51
reco::Particle getCalLepW() const
void setHadq(const edm::Handle< std::vector< pat::Jet > > &jet, int i)
reco::Particle getFitLept() const
pat::Jet getCalHadp() const
std::vector< pat::Particle > fitLepl_