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