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