test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 {
10  jetCorrScheme_ = 0;
11  sumAnglejp_ = -999.;
12  angleHadp_ = -999.;
13  angleHadq_ = -999.;
14  angleHadb_ = -999.;
15  angleHadj_ = -999.;
16  angleHadk_ = -999.;
17  angleHadbbar_ = -999.;
18  changeW1Q_ = -999;
19  changeW2Q_ = -999;
20  probChi2_ = -999.;
21  mcBestJetComb_ = -999;
22  simpleBestJetComb_ = -999;
23  lrBestJetComb_ = -999;
24  lrJetCombLRval_ = -999.;
25  lrJetCombProb_ = -999.;
26  lrSignalEvtLRval_ = -999.;
27  lrSignalEvtProb_ = -999.;
28 }
29 
31 {
32 }
33 
34 //-------------------------------------------
35 // get calibrated base objects
36 //-------------------------------------------
38 {
39  // WARNING this is obsolete and only
40  // kept for backwards compatibility
41  if(jetCorrScheme_==1){
42  //jet calibrated according to MC truth
43  return hadb_->correctedJet("HAD", "B");
44  }
45  else if(jetCorrScheme_==2){
46  return hadb_->correctedJet("HAD", "B");
47  }
48  else{
49  return *hadb_;
50  }
51 }
52 
54 {
55  // WARNING this is obsolete and only
56  // kept for backwards compatibility
57  if(jetCorrScheme_==1){
58  //jet calibrated according to MC truth
59  return hadp_->correctedJet("HAD", "UDS");
60  }
61  else if(jetCorrScheme_==2){
62  return hadp_->correctedJet("HAD", "UDS");
63  }
64  else{
65  return *hadp_;
66  }
67 }
68 
70 {
71  // WARNING this is obsolete and only
72  // kept for backwards compatibility
73  if(jetCorrScheme_==1){
74  //jet calibrated according to MC truth
75  return hadq_->correctedJet("HAD", "UDS");
76  }
77  else if(jetCorrScheme_==2){
78  return hadq_->correctedJet("HAD", "UDS");
79  }
80  else{
81  return *hadq_;
82  }
83 }
84 
86 {
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 hadbbar_->correctedJet("HAD", "B");
92  }
93  else if(jetCorrScheme_==2){
94  return hadbbar_->correctedJet("HAD", "B");
95  }
96  else{
97  return *hadbbar_;
98  }
99 }
100 
102 {
103  // WARNING this is obsolete and only
104  // kept for backwards compatibility
105  if(jetCorrScheme_==1){
106  //jet calibrated according to MC truth
107  return hadj_->correctedJet("HAD", "UDS");
108  }
109  else if(jetCorrScheme_==2){
110  return hadj_->correctedJet("HAD", "UDS");
111  }
112  else{
113  return *hadj_;
114  }
115 }
116 
118 {
119  // WARNING this is obsolete and only
120  // kept for backwards compatibility
121  if(jetCorrScheme_==1){
122  //jet calibrated according to MC truth
123  return hadk_->correctedJet("HAD", "UDS");
124  }
125  else if(jetCorrScheme_==2){
126  return hadk_->correctedJet("HAD", "UDS");
127  }
128  else{
129  return *hadk_;
130  }
131 }
132 
133 //-------------------------------------------
134 // get (un-)/calibrated reco objects
135 //-------------------------------------------
136 // By definition pq and b are the top quark,
137 // jk and bbar the anti-top - check if it
138 // makes sense ....
140 {
141  // FIXME: the charge from the genevent
142  return reco::Particle(0,this->getRecHadp().p4()+this->getRecHadq().p4()+this->getRecHadb().p4());
143 }
144 
146 {
147  // FIXME: the charge from the genevent
148  return reco::Particle(0,this->getRecHadj().p4()+this->getRecHadk().p4()+this->getRecHadbbar().p4());
149 }
150 
152 {
153  // FIXME: the charge from the genevent
154  return reco::Particle(0,this->getRecHadp().p4()+this->getRecHadq().p4());
155 }
156 
158 {
159  // FIXME: the charge from the genevent
160  return reco::Particle(0,this->getRecHadj().p4()+this->getRecHadk().p4());
161 }
162 
164 {
165  return reco::Particle(0,this->getCalHadp().p4()+this->getCalHadq().p4()+this->getCalHadb().p4());
166 }
167 
169 {
170  return reco::Particle(0,this->getCalHadj().p4()+this->getCalHadk().p4()+this->getCalHadbbar().p4());
171 }
172 
174 {
175  return reco::Particle(0,this->getCalHadp().p4()+this->getCalHadq().p4());
176 }
177 
179 {
180  return reco::Particle(0,this->getCalHadj().p4()+this->getCalHadk().p4());
181 }
182 
183 //-------------------------------------------
184 // get objects from kinematic fit
185 //-------------------------------------------
187 {
188  // FIXME: provide the correct charge from generated event
189  return reco::Particle(0, this->getFitHadp().p4()+this->getFitHadq().p4()+this->getFitHadb().p4());
190 }
191 
193 {
194  // FIXME: provide the correct charge from generated event
195  return reco::Particle(0, this->getFitHadj().p4()+this->getFitHadk().p4()+this->getFitHadbbar().p4());
196 }
197 
199 {
200  // FIXME: provide the correct charge from generated event
201  return reco::Particle(0, this->getFitHadp().p4()+this->getFitHadq().p4());
202 }
203 
205 {
206  // FIXME: provide the correct charge from generated event
207  return reco::Particle(0, this->getFitHadj().p4()+this->getFitHadk().p4());
208 }
209 
210 //-------------------------------------------
211 // get info on the outcome of the signal
212 // selection LR
213 //-------------------------------------------
214 double TtHadEvtSolution::getLRSignalEvtObsVal(unsigned int selObs) const
215 {
216  double val = -999.;
217  for(size_t o=0; o<lrSignalEvtVarVal_.size(); o++){
218  if(lrSignalEvtVarVal_[o].first == selObs) val = lrSignalEvtVarVal_[o].second;
219  }
220  return val;
221 }
222 
223 //-------------------------------------------
224 // get info on the outcome of the signal
225 // selection LR
226 //-------------------------------------------
227 double TtHadEvtSolution::getLRJetCombObsVal(unsigned int selObs) const
228 {
229  double val = -999.;
230  for(size_t o=0; o<lrJetCombVarVal_.size(); o++){
231  if(lrJetCombVarVal_[o].first == selObs) val = lrJetCombVarVal_[o].second;
232  }
233  return val;
234 }
235 
236 //-------------------------------------------
237 // set the generated event
238 //-------------------------------------------
240 {
241  if( !aGenEvt->isFullHadronic() ){
242  edm::LogWarning( "TtGenEventNotFilled" ) << "genEvt is not fully hadronic; TtGenEvent is not filled";
243  return;
244  }
246 }
247 
248 //-------------------------------------------
249 // methods to set the outcome of the different
250 // jet combination methods
251 //-------------------------------------------
252 void TtHadEvtSolution::setLRJetCombObservables(const std::vector<std::pair<unsigned int, double> >& varval)
253 {
254  lrJetCombVarVal_.clear();
255  for(size_t ijc = 0; ijc<varval.size(); ijc++) lrJetCombVarVal_.push_back(varval[ijc]);
256 }
257 
258 //-------------------------------------------
259 // methods to set the outcome of the signal
260 // selection LR
261 //-------------------------------------------
262 void TtHadEvtSolution::setLRSignalEvtObservables(const std::vector<std::pair<unsigned int, double> >& varval)
263 {
264  lrSignalEvtVarVal_.clear();
265  for(size_t ise = 0; ise<varval.size(); ise++) lrSignalEvtVarVal_.push_back(varval[ise]);
266 }
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
double p4[4]
Definition: TauolaWrapper.h:92
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
reco::Particle getRecHadtbar() const
pat::Jet getCalHadbbar() const
edm::Ref< std::vector< pat::Jet > > hadq_
std::vector< std::pair< unsigned int, double > > lrJetCombVarVal_