CMS 3D CMS Logo

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