CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TtHadEvtSolution.cc
Go to the documentation of this file.
1 //
2 // adapted TtSemiEvtSolution.cc,v 1.13 2007/07/05 23:43:08 lowette Exp
3 // for fully hadronic channel
4 
7 
9  jetCorrScheme_ = 0;
10  sumAnglejp_ = -999.;
11  angleHadp_ = -999.;
12  angleHadq_ = -999.;
13  angleHadb_ = -999.;
14  angleHadj_ = -999.;
15  angleHadk_ = -999.;
16  angleHadbbar_ = -999.;
17  changeW1Q_ = -999;
18  changeW2Q_ = -999;
19  probChi2_ = -999.;
20  mcBestJetComb_ = -999;
21  simpleBestJetComb_ = -999;
22  lrBestJetComb_ = -999;
23  lrJetCombLRval_ = -999.;
24  lrJetCombProb_ = -999.;
25  lrSignalEvtLRval_ = -999.;
26  lrSignalEvtProb_ = -999.;
27 }
28 
30 
31 //-------------------------------------------
32 // get calibrated base objects
33 //-------------------------------------------
35  // WARNING this is obsolete and only
36  // kept for backwards compatibility
37  if (jetCorrScheme_ == 1) {
38  //jet calibrated according to MC truth
39  return hadb_->correctedJet("HAD", "B");
40  } else if (jetCorrScheme_ == 2) {
41  return hadb_->correctedJet("HAD", "B");
42  } else {
43  return *hadb_;
44  }
45 }
46 
48  // WARNING this is obsolete and only
49  // kept for backwards compatibility
50  if (jetCorrScheme_ == 1) {
51  //jet calibrated according to MC truth
52  return hadp_->correctedJet("HAD", "UDS");
53  } else if (jetCorrScheme_ == 2) {
54  return hadp_->correctedJet("HAD", "UDS");
55  } else {
56  return *hadp_;
57  }
58 }
59 
61  // WARNING this is obsolete and only
62  // kept for backwards compatibility
63  if (jetCorrScheme_ == 1) {
64  //jet calibrated according to MC truth
65  return hadq_->correctedJet("HAD", "UDS");
66  } else if (jetCorrScheme_ == 2) {
67  return hadq_->correctedJet("HAD", "UDS");
68  } else {
69  return *hadq_;
70  }
71 }
72 
74  // WARNING this is obsolete and only
75  // kept for backwards compatibility
76  if (jetCorrScheme_ == 1) {
77  //jet calibrated according to MC truth
78  return hadbbar_->correctedJet("HAD", "B");
79  } else if (jetCorrScheme_ == 2) {
80  return hadbbar_->correctedJet("HAD", "B");
81  } else {
82  return *hadbbar_;
83  }
84 }
85 
87  // WARNING this is obsolete and only
88  // kept for backwards compatibility
89  if (jetCorrScheme_ == 1) {
90  //jet calibrated according to MC truth
91  return hadj_->correctedJet("HAD", "UDS");
92  } else if (jetCorrScheme_ == 2) {
93  return hadj_->correctedJet("HAD", "UDS");
94  } else {
95  return *hadj_;
96  }
97 }
98 
100  // WARNING this is obsolete and only
101  // kept for backwards compatibility
102  if (jetCorrScheme_ == 1) {
103  //jet calibrated according to MC truth
104  return hadk_->correctedJet("HAD", "UDS");
105  } else if (jetCorrScheme_ == 2) {
106  return hadk_->correctedJet("HAD", "UDS");
107  } else {
108  return *hadk_;
109  }
110 }
111 
112 //-------------------------------------------
113 // get (un-)/calibrated reco objects
114 //-------------------------------------------
115 // By definition pq and b are the top quark,
116 // jk and bbar the anti-top - check if it
117 // makes sense ....
119  // FIXME: the charge from the genevent
120  return reco::Particle(0, this->getRecHadp().p4() + this->getRecHadq().p4() + this->getRecHadb().p4());
121 }
122 
124  // FIXME: the charge from the genevent
125  return reco::Particle(0, this->getRecHadj().p4() + this->getRecHadk().p4() + this->getRecHadbbar().p4());
126 }
127 
129  // FIXME: the charge from the genevent
130  return reco::Particle(0, this->getRecHadp().p4() + this->getRecHadq().p4());
131 }
132 
134  // FIXME: the charge from the genevent
135  return reco::Particle(0, this->getRecHadj().p4() + this->getRecHadk().p4());
136 }
137 
139  return reco::Particle(0, this->getCalHadp().p4() + this->getCalHadq().p4() + this->getCalHadb().p4());
140 }
141 
143  return reco::Particle(0, this->getCalHadj().p4() + this->getCalHadk().p4() + this->getCalHadbbar().p4());
144 }
145 
147  return reco::Particle(0, this->getCalHadp().p4() + this->getCalHadq().p4());
148 }
149 
151  return reco::Particle(0, this->getCalHadj().p4() + this->getCalHadk().p4());
152 }
153 
154 //-------------------------------------------
155 // get objects from kinematic fit
156 //-------------------------------------------
158  // FIXME: provide the correct charge from generated event
159  return reco::Particle(0, this->getFitHadp().p4() + this->getFitHadq().p4() + this->getFitHadb().p4());
160 }
161 
163  // FIXME: provide the correct charge from generated event
164  return reco::Particle(0, this->getFitHadj().p4() + this->getFitHadk().p4() + this->getFitHadbbar().p4());
165 }
166 
168  // FIXME: provide the correct charge from generated event
169  return reco::Particle(0, this->getFitHadp().p4() + this->getFitHadq().p4());
170 }
171 
173  // FIXME: provide the correct charge from generated event
174  return reco::Particle(0, this->getFitHadj().p4() + this->getFitHadk().p4());
175 }
176 
177 //-------------------------------------------
178 // get info on the outcome of the signal
179 // selection LR
180 //-------------------------------------------
181 double TtHadEvtSolution::getLRSignalEvtObsVal(unsigned int selObs) const {
182  double val = -999.;
183  for (size_t o = 0; o < lrSignalEvtVarVal_.size(); o++) {
184  if (lrSignalEvtVarVal_[o].first == selObs)
185  val = lrSignalEvtVarVal_[o].second;
186  }
187  return val;
188 }
189 
190 //-------------------------------------------
191 // get info on the outcome of the signal
192 // selection LR
193 //-------------------------------------------
194 double TtHadEvtSolution::getLRJetCombObsVal(unsigned int selObs) const {
195  double val = -999.;
196  for (size_t o = 0; o < lrJetCombVarVal_.size(); o++) {
197  if (lrJetCombVarVal_[o].first == selObs)
198  val = lrJetCombVarVal_[o].second;
199  }
200  return val;
201 }
202 
203 //-------------------------------------------
204 // set the generated event
205 //-------------------------------------------
207  if (!aGenEvt->isFullHadronic()) {
208  edm::LogWarning("TtGenEventNotFilled") << "genEvt is not fully hadronic; TtGenEvent is not filled";
209  return;
210  }
212 }
213 
214 //-------------------------------------------
215 // methods to set the outcome of the different
216 // jet combination methods
217 //-------------------------------------------
218 void TtHadEvtSolution::setLRJetCombObservables(const std::vector<std::pair<unsigned int, double> >& varval) {
219  lrJetCombVarVal_.clear();
220  for (size_t ijc = 0; ijc < varval.size(); ijc++)
221  lrJetCombVarVal_.push_back(varval[ijc]);
222 }
223 
224 //-------------------------------------------
225 // methods to set the outcome of the signal
226 // selection LR
227 //-------------------------------------------
228 void TtHadEvtSolution::setLRSignalEvtObservables(const std::vector<std::pair<unsigned int, double> >& varval) {
229  lrSignalEvtVarVal_.clear();
230  for (size_t ise = 0; ise < varval.size(); ise++)
231  lrSignalEvtVarVal_.push_back(varval[ise]);
232 }
edm::Ref< std::vector< pat::Jet > > hadk_
edm::RefProd< TtGenEvent > theGenEvt_
pat::Jet getCalHadj() const
edm::Ref< std::vector< pat::Jet > > hadj_
double getLRSignalEvtObsVal(unsigned int) const
reco::Particle getFitHadW_plus() const
pat::Particle getFitHadp() const
pat::Jet getCalHadq() const
pat::Jet getHadbbar() const
reco::Particle getFitHadW_minus() const
void setLRSignalEvtObservables(const std::vector< std::pair< unsigned int, double > > &varval)
pat::Jet getCalHadp() const
pat::Jet getHadb() const
pat::Jet getHadq() const
pat::Jet getHadj() const
reco::Particle getCalHadW_minus() const
reco::Particle getCalHadW_plus() const
reco::Particle getCalHadtbar() const
void setGenEvt(const edm::Handle< TtGenEvent > &aGenEvt)
pat::Jet getRecHadq() const
reco::Particle getFitHadt() const
reco::Particle getRecHadW_plus() const
void setLRJetCombObservables(const std::vector< std::pair< unsigned int, double > > &varval)
pat::Particle getFitHadk() const
double getLRJetCombObsVal(unsigned int) const
pat::Jet getRecHadbbar() const
pat::Particle getFitHadj() const
reco::Particle getRecHadt() const
pat::Jet getHadp() const
pat::Jet getCalHadb() const
pat::Jet getRecHadb() const
pat::Jet getCalHadk() const
virtual ~TtHadEvtSolution()
edm::Ref< std::vector< pat::Jet > > hadb_
pat::Jet getHadk() const
pat::Particle getFitHadb() const
std::vector< std::pair< unsigned int, double > > lrSignalEvtVarVal_
reco::Particle getRecHadW_minus() const
edm::Ref< std::vector< pat::Jet > > hadbbar_
pat::Particle getFitHadbbar() const
reco::Particle getCalHadt() const
pat::Jet getRecHadk() const
Analysis-level calorimeter jet class.
Definition: Jet.h:77
pat::Particle getFitHadq() const
pat::Jet getRecHadp() const
pat::Jet getRecHadj() const
edm::Ref< std::vector< pat::Jet > > hadp_
reco::Particle getFitHadtbar() const
Log< level::Warning, false > LogWarning
reco::Particle getRecHadtbar() const
pat::Jet getCalHadbbar() const
edm::Ref< std::vector< pat::Jet > > hadq_
std::vector< std::pair< unsigned int, double > > lrJetCombVarVal_