CMS 3D CMS Logo

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::RefProd< TtGenEvent >
TtHadEvtSolution::mcBestJetComb_
int mcBestJetComb_
Definition: TtHadEvtSolution.h:292
TtHadEvtSolution::getHadq
pat::Jet getHadq() const
Definition: TtHadEvtSolution.cc:60
MessageLogger.h
TtHadEvtSolution::getLRJetCombObsVal
double getLRJetCombObsVal(unsigned int) const
Definition: TtHadEvtSolution.cc:194
TtHadEvtSolution::angleHadk_
double angleHadk_
Definition: TtHadEvtSolution.h:288
TtHadEvtSolution::getHadb
pat::Jet getHadb() const
Definition: TtHadEvtSolution.cc:34
TtHadEvtSolution::angleHadj_
double angleHadj_
Definition: TtHadEvtSolution.h:288
reco::Particle
Definition: Particle.h:16
TtHadEvtSolution::getFitHadj
pat::Particle getFitHadj() const
Definition: TtHadEvtSolution.h:123
TtHadEvtSolution::getHadbbar
pat::Jet getHadbbar() const
Definition: TtHadEvtSolution.cc:73
TtHadEvtSolution::getRecHadt
reco::Particle getRecHadt() const
Definition: TtHadEvtSolution.cc:118
TtHadEvtSolution::~TtHadEvtSolution
virtual ~TtHadEvtSolution()
Definition: TtHadEvtSolution.cc:29
TtHadEvtSolution::getFitHadq
pat::Particle getFitHadq() const
Definition: TtHadEvtSolution.h:122
TtHadEvtSolution::hadb_
edm::Ref< std::vector< pat::Jet > > hadb_
Definition: TtHadEvtSolution.h:283
TtHadEvtSolution.h
TtHadEvtSolution::getFitHadb
pat::Particle getFitHadb() const
Definition: TtHadEvtSolution.h:119
TtHadEvtSolution::sumAnglejp_
double sumAnglejp_
Definition: TtHadEvtSolution.h:288
TtHadEvtSolution::hadp_
edm::Ref< std::vector< pat::Jet > > hadp_
Definition: TtHadEvtSolution.h:283
TtHadEvtSolution::getFitHadtbar
reco::Particle getFitHadtbar() const
Definition: TtHadEvtSolution.cc:162
TtHadEvtSolution::getRecHadW_plus
reco::Particle getRecHadW_plus() const
Definition: TtHadEvtSolution.cc:128
TtHadEvtSolution::hadbbar_
edm::Ref< std::vector< pat::Jet > > hadbbar_
Definition: TtHadEvtSolution.h:283
TtHadEvtSolution::getCalHadb
pat::Jet getCalHadb() const
Definition: TtHadEvtSolution.h:105
edm::Handle
Definition: AssociativeIterator.h:50
TtHadEvtSolution::lrJetCombLRval_
double lrJetCombLRval_
Definition: TtHadEvtSolution.h:293
TtHadEvtSolution::getRecHadtbar
reco::Particle getRecHadtbar() const
Definition: TtHadEvtSolution.cc:123
dqmdumpme.first
first
Definition: dqmdumpme.py:55
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
TtHadEvtSolution::getHadj
pat::Jet getHadj() const
Definition: TtHadEvtSolution.cc:86
TtHadEvtSolution::lrSignalEvtVarVal_
std::vector< std::pair< unsigned int, double > > lrSignalEvtVarVal_
Definition: TtHadEvtSolution.h:296
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
TtHadEvtSolution::getCalHadk
pat::Jet getCalHadk() const
Definition: TtHadEvtSolution.h:110
TtHadEvtSolution::lrJetCombVarVal_
std::vector< std::pair< unsigned int, double > > lrJetCombVarVal_
Definition: TtHadEvtSolution.h:295
pat::Jet
Analysis-level calorimeter jet class.
Definition: Jet.h:77
TtHadEvtSolution::lrSignalEvtProb_
double lrSignalEvtProb_
Definition: TtHadEvtSolution.h:294
TtHadEvtSolution::lrBestJetComb_
int lrBestJetComb_
Definition: TtHadEvtSolution.h:292
TtHadEvtSolution::getCalHadW_plus
reco::Particle getCalHadW_plus() const
Definition: TtHadEvtSolution.cc:146
TtHadEvtSolution::getRecHadp
pat::Jet getRecHadp() const
Definition: TtHadEvtSolution.h:96
TtHadEvtSolution::hadk_
edm::Ref< std::vector< pat::Jet > > hadk_
Definition: TtHadEvtSolution.h:283
TtHadEvtSolution::getRecHadk
pat::Jet getRecHadk() const
Definition: TtHadEvtSolution.h:99
TtHadEvtSolution::getCalHadbbar
pat::Jet getCalHadbbar() const
Definition: TtHadEvtSolution.h:106
TtHadEvtSolution::getFitHadt
reco::Particle getFitHadt() const
Definition: TtHadEvtSolution.cc:157
TtHadEvtSolution::probChi2_
double probChi2_
Definition: TtHadEvtSolution.h:291
TtHadEvtSolution::getFitHadbbar
pat::Particle getFitHadbbar() const
Definition: TtHadEvtSolution.h:120
TtHadEvtSolution::getCalHadq
pat::Jet getCalHadq() const
Definition: TtHadEvtSolution.h:108
TtHadEvtSolution::angleHadq_
double angleHadq_
Definition: TtHadEvtSolution.h:288
TtHadEvtSolution::getCalHadW_minus
reco::Particle getCalHadW_minus() const
Definition: TtHadEvtSolution.cc:150
TtHadEvtSolution::getFitHadp
pat::Particle getFitHadp() const
Definition: TtHadEvtSolution.h:121
TtHadEvtSolution::hadj_
edm::Ref< std::vector< pat::Jet > > hadj_
Definition: TtHadEvtSolution.h:283
TtHadEvtSolution::getHadp
pat::Jet getHadp() const
Definition: TtHadEvtSolution.cc:47
TtHadEvtSolution::getHadk
pat::Jet getHadk() const
Definition: TtHadEvtSolution.cc:99
TtHadEvtSolution::getCalHadtbar
reco::Particle getCalHadtbar() const
Definition: TtHadEvtSolution.cc:142
TtHadEvtSolution::getRecHadj
pat::Jet getRecHadj() const
Definition: TtHadEvtSolution.h:98
TtHadEvtSolution::theGenEvt_
edm::RefProd< TtGenEvent > theGenEvt_
Definition: TtHadEvtSolution.h:276
TtHadEvtSolution::hadq_
edm::Ref< std::vector< pat::Jet > > hadq_
Definition: TtHadEvtSolution.h:283
TtHadEvtSolution::getRecHadb
pat::Jet getRecHadb() const
Definition: TtHadEvtSolution.h:94
p4
double p4[4]
Definition: TauolaWrapper.h:92
TtHadEvtSolution::simpleBestJetComb_
int simpleBestJetComb_
Definition: TtHadEvtSolution.h:292
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
TtHadEvtSolution::getCalHadt
reco::Particle getCalHadt() const
Definition: TtHadEvtSolution.cc:138
TtHadEvtSolution::getRecHadW_minus
reco::Particle getRecHadW_minus() const
Definition: TtHadEvtSolution.cc:133
TtHadEvtSolution::getRecHadbbar
pat::Jet getRecHadbbar() const
Definition: TtHadEvtSolution.h:95
TtHadEvtSolution::angleHadbbar_
double angleHadbbar_
Definition: TtHadEvtSolution.h:288
TtHadEvtSolution::setLRSignalEvtObservables
void setLRSignalEvtObservables(const std::vector< std::pair< unsigned int, double > > &varval)
Definition: TtHadEvtSolution.cc:228
heppy_batch.val
val
Definition: heppy_batch.py:351
TtHadEvtSolution::getFitHadk
pat::Particle getFitHadk() const
Definition: TtHadEvtSolution.h:124
TtHadEvtSolution::getFitHadW_plus
reco::Particle getFitHadW_plus() const
Definition: TtHadEvtSolution.cc:167
TtHadEvtSolution::angleHadp_
double angleHadp_
Definition: TtHadEvtSolution.h:288
TtHadEvtSolution::getCalHadp
pat::Jet getCalHadp() const
Definition: TtHadEvtSolution.h:107
TtHadEvtSolution::jetCorrScheme_
int jetCorrScheme_
Definition: TtHadEvtSolution.h:287
TtHadEvtSolution::changeW1Q_
int changeW1Q_
Definition: TtHadEvtSolution.h:289
TtHadEvtSolution::lrJetCombProb_
double lrJetCombProb_
Definition: TtHadEvtSolution.h:293
TtHadEvtSolution::getCalHadj
pat::Jet getCalHadj() const
Definition: TtHadEvtSolution.h:109
TtGenEvent::isFullHadronic
bool isFullHadronic(bool excludeTauLeptons=false) const
check if the event can be classified as full hadronic
Definition: TtGenEvent.h:34
TtHadEvtSolution::changeW2Q_
int changeW2Q_
Definition: TtHadEvtSolution.h:289
TtHadEvtSolution::lrSignalEvtLRval_
double lrSignalEvtLRval_
Definition: TtHadEvtSolution.h:294
TtHadEvtSolution::setLRJetCombObservables
void setLRJetCombObservables(const std::vector< std::pair< unsigned int, double > > &varval)
Definition: TtHadEvtSolution.cc:218
TtHadEvtSolution::getFitHadW_minus
reco::Particle getFitHadW_minus() const
Definition: TtHadEvtSolution.cc:172
TtHadEvtSolution::TtHadEvtSolution
TtHadEvtSolution()
Definition: TtHadEvtSolution.cc:8
TtHadEvtSolution::setGenEvt
void setGenEvt(const edm::Handle< TtGenEvent > &aGenEvt)
Definition: TtHadEvtSolution.cc:206
TtHadEvtSolution::getLRSignalEvtObsVal
double getLRSignalEvtObsVal(unsigned int) const
Definition: TtHadEvtSolution.cc:181
TtHadEvtSolution::getRecHadq
pat::Jet getRecHadq() const
Definition: TtHadEvtSolution.h:97
TtHadEvtSolution::angleHadb_
double angleHadb_
Definition: TtHadEvtSolution.h:288