CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TtSemiLepJetComb.cc
Go to the documentation of this file.
3 
4 #include "Math/VectorUtil.h"
5 
7 
8 TtSemiLepJetComb::TtSemiLepJetComb(const std::vector<pat::Jet>& jets,
9  const std::vector<int>& combination,
10  const math::XYZTLorentzVector& lepton,
11  const pat::MET& neutrino) {
12  // receive right jet association
13  // from jet-parton matching
14  hadQJet_ = jets[combination[TtSemiLepEvtPartons::LightQ]];
15  hadQBarJet_ = jets[combination[TtSemiLepEvtPartons::LightQBar]];
16  hadBJet_ = jets[combination[TtSemiLepEvtPartons::HadB]];
17  lepBJet_ = jets[combination[TtSemiLepEvtPartons::LepB]];
18  lepton_ = lepton;
19  neutrino_ = neutrino;
20  // create mother candidates from
21  // final-state candidates
22  deduceMothers();
23 }
24 
26 
28  switch (var) {
29  case JetComb::kMass:
30  return top(decay).mass();
31  case JetComb::kPt:
32  return top(decay).pt();
33  case JetComb::kEta:
34  return top(decay).eta();
35  case JetComb::kPhi:
36  return top(decay).phi();
37  case JetComb::kTheta:
38  return top(decay).theta();
39  };
40  return -9999.;
41 }
42 
44  switch (var) {
45  case JetComb::kMass:
46  return wBoson(decay).mass();
47  case JetComb::kPt:
48  return wBoson(decay).pt();
49  case JetComb::kEta:
50  return wBoson(decay).eta();
51  case JetComb::kPhi:
52  return wBoson(decay).phi();
53  case JetComb::kTheta:
54  return wBoson(decay).theta();
55  };
56  return -9999.;
57 }
58 
60  switch (var) {
61  case JetComb::kMass:
62  return -9999.;
63  case JetComb::kPt:
64  return bQuark(decay).p4().pt();
65  case JetComb::kEta:
66  return bQuark(decay).p4().eta();
67  case JetComb::kPhi:
68  return bQuark(decay).p4().phi();
69  case JetComb::kTheta:
70  return bQuark(decay).p4().theta();
71  };
72  return -9999.;
73 }
74 
76  switch (var) {
77  case JetComb::kMass:
78  return -9999.;
79  case JetComb::kPt:
80  return lightQ(qbar).p4().pt();
81  case JetComb::kEta:
82  return lightQ(qbar).p4().eta();
83  case JetComb::kPhi:
84  return lightQ(qbar).p4().phi();
85  case JetComb::kTheta:
86  return lightQ(qbar).p4().theta();
87  };
88  return -9999.;
89 }
90 
92  switch (var) {
93  case JetComb::kMass:
94  return -9999.;
95  case JetComb::kPt:
96  return lepton_.pt();
97  case JetComb::kEta:
98  return lepton_.eta();
99  case JetComb::kPhi:
100  return lepton_.phi();
101  case JetComb::kTheta:
102  return lepton_.theta();
103  };
104  return -9999.;
105 }
106 
108  switch (var) {
109  case JetComb::kMass:
110  return -9999.;
111  case JetComb::kPt:
112  return neutrino_.p4().pt();
113  case JetComb::kEta:
114  return neutrino_.p4().eta();
115  case JetComb::kPhi:
116  return neutrino_.p4().phi();
117  case JetComb::kTheta:
118  return neutrino_.p4().theta();
119  };
120  return -9999.;
121 }
122 
124  switch (comp) {
125  case JetComb::kDeltaM:
126  return top(JetComb::kHad).mass() - top(JetComb::kLep).mass();
127  case JetComb::kDeltaR:
129  case JetComb::kDeltaPhi:
132  return ROOT::Math::VectorUtil::Angle(top(JetComb::kHad), top(JetComb::kLep));
133  };
134  return -9999.;
135 }
136 
138  switch (comp) {
139  case JetComb::kDeltaM:
140  return wBoson(JetComb::kHad).mass() - wBoson(JetComb::kLep).mass();
141  case JetComb::kDeltaR:
143  case JetComb::kDeltaPhi:
146  return ROOT::Math::VectorUtil::Angle(wBoson(JetComb::kHad), wBoson(JetComb::kLep));
147  };
148  return -9999.;
149 }
150 
152  switch (comp) {
153  case JetComb::kDeltaM:
154  return -9999.;
155  case JetComb::kDeltaR:
157  case JetComb::kDeltaPhi:
160  return ROOT::Math::VectorUtil::Angle(bQuark(JetComb::kHad).p4(), bQuark(JetComb::kLep).p4());
161  };
162  return -9999.;
163 }
164 
166  switch (comp) {
167  case JetComb::kDeltaM:
168  return -9999.;
169  case JetComb::kDeltaR:
170  return ROOT::Math::VectorUtil::DeltaR(lightQ().p4(), lightQ(true).p4());
171  case JetComb::kDeltaPhi:
172  return fabs(ROOT::Math::VectorUtil::DeltaPhi(lightQ().p4(), lightQ(true).p4()));
174  return ROOT::Math::VectorUtil::Angle(lightQ().p4(), lightQ(true).p4());
175  };
176  return -9999.;
177 }
178 
180  switch (comp) {
181  case JetComb::kDeltaM:
182  return -9999.;
183  case JetComb::kDeltaR:
185  case JetComb::kDeltaPhi:
188  return ROOT::Math::VectorUtil::Angle(lepton_, neutrino_.p4());
189  };
190  return -9999.;
191 }
192 
194  switch (comp) {
195  case JetComb::kDeltaM:
196  return top(dec1).mass() - wBoson(dec2).mass();
197  case JetComb::kDeltaR:
198  return ROOT::Math::VectorUtil::DeltaR(top(dec1), wBoson(dec2));
199  case JetComb::kDeltaPhi:
200  return fabs(ROOT::Math::VectorUtil::DeltaPhi(top(dec1), wBoson(dec2)));
202  return ROOT::Math::VectorUtil::Angle(top(dec1), wBoson(dec2));
203  };
204  return -9999.;
205 }
206 
208  switch (comp) {
209  case JetComb::kDeltaM:
210  return -9999.;
211  case JetComb::kDeltaR:
212  return ROOT::Math::VectorUtil::DeltaR(top(dec1), bQuark(dec2).p4());
213  case JetComb::kDeltaPhi:
214  return fabs(ROOT::Math::VectorUtil::DeltaPhi(top(dec1), bQuark(dec2).p4()));
216  return ROOT::Math::VectorUtil::Angle(top(dec1), bQuark(dec2).p4());
217  };
218  return -9999.;
219 }
220 
222  switch (comp) {
223  case JetComb::kDeltaM:
224  return -9999.;
225  case JetComb::kDeltaR:
226  return ROOT::Math::VectorUtil::DeltaR(wBoson(dec1), bQuark(dec2).p4());
227  case JetComb::kDeltaPhi:
228  return fabs(ROOT::Math::VectorUtil::DeltaPhi(wBoson(dec1), bQuark(dec2).p4()));
230  return ROOT::Math::VectorUtil::Angle(wBoson(dec1), bQuark(dec2).p4());
231  };
232  return -9999.;
233 }
234 
236  switch (comp) {
237  case JetComb::kDeltaM:
238  return -9999.;
239  case JetComb::kDeltaR:
241  case JetComb::kDeltaPhi:
242  return fabs(ROOT::Math::VectorUtil::DeltaPhi(top(decay), lepton_));
244  return ROOT::Math::VectorUtil::Angle(top(decay), lepton_);
245  };
246  return -9999.;
247 }
248 
250  switch (comp) {
251  case JetComb::kDeltaM:
252  return -9999.;
253  case JetComb::kDeltaR:
255  case JetComb::kDeltaPhi:
256  return fabs(ROOT::Math::VectorUtil::DeltaPhi(top(decay), neutrino_.p4()));
258  return ROOT::Math::VectorUtil::Angle(top(decay), neutrino_.p4());
259  };
260  return -9999.;
261 }
262 
264  switch (comp) {
265  case JetComb::kDeltaM:
266  return -9999.;
267  case JetComb::kDeltaR:
269  case JetComb::kDeltaPhi:
270  return fabs(ROOT::Math::VectorUtil::DeltaPhi(wBoson(decay), lepton_));
272  return ROOT::Math::VectorUtil::Angle(wBoson(decay), lepton_);
273  };
274  return -9999.;
275 }
276 
278  switch (comp) {
279  case JetComb::kDeltaM:
280  return -9999.;
281  case JetComb::kDeltaR:
283  case JetComb::kDeltaPhi:
284  return fabs(ROOT::Math::VectorUtil::DeltaPhi(wBoson(decay), neutrino_.p4()));
286  return ROOT::Math::VectorUtil::Angle(wBoson(decay), neutrino_.p4());
287  };
288  return -9999.;
289 }
290 
292  switch (comp) {
293  case JetComb::kDeltaM:
294  return -9999.;
295  case JetComb::kDeltaR:
296  return ROOT::Math::VectorUtil::DeltaR(bQuark(decay).p4(), lepton_);
297  case JetComb::kDeltaPhi:
298  return fabs(ROOT::Math::VectorUtil::DeltaPhi(bQuark(decay).p4(), lepton_));
300  return ROOT::Math::VectorUtil::Angle(bQuark(decay).p4(), lepton_);
301  };
302  return -9999.;
303 }
304 
306  switch (comp) {
307  case JetComb::kDeltaM:
308  return -9999.;
309  case JetComb::kDeltaR:
310  return ROOT::Math::VectorUtil::DeltaR(bQuark(decay).p4(), neutrino_.p4());
311  case JetComb::kDeltaPhi:
312  return fabs(ROOT::Math::VectorUtil::DeltaPhi(bQuark(decay).p4(), neutrino_.p4()));
314  return ROOT::Math::VectorUtil::Angle(bQuark(decay).p4(), neutrino_.p4());
315  };
316  return -9999.;
317 }
318 
320  return top(JetComb::kHad).pt() /
321  (top(JetComb::kHad).pt() + (lightQ().p4() + lightQ(true).p4() + bQuark(JetComb::kLep).p4()).pt() +
322  (lightQ().p4() + bQuark(JetComb::kHad).p4() + bQuark(JetComb::kLep).p4()).pt() +
323  (bQuark(JetComb::kHad).p4() + lightQ(true).p4() + bQuark(JetComb::kLep).p4()).pt());
324 }
325 
327  return (bQuark(JetComb::kHad).p4().pt() + bQuark(JetComb::kLep).p4().pt()) /
328  (lightQ().p4().pt() + lightQ(true).p4().pt());
329 }
330 
332  switch (op) {
333  case JetComb::kAdd:
334  return bTag(JetComb::kHad, algo) + bTag(JetComb::kLep, algo);
335  case JetComb::kMult:
336  return bTag(JetComb::kHad, algo) * bTag(JetComb::kLep, algo);
337  };
338  return -9999.;
339 }
340 
342  switch (op) {
343  case JetComb::kAdd:
344  return bTag(lightQ(), algo) + bTag(lightQ(true), algo);
345  case JetComb::kMult:
346  return bTag(lightQ(), algo) * bTag(lightQ(true), algo);
347  };
348  return -9999.;
349 }
350 
351 // ----------------------------------------------------------------------
352 // private methods
353 // ----------------------------------------------------------------------
354 
356  hadW_ = hadQJet_.p4() + hadQBarJet_.p4();
357  lepW_ = lepton_ + neutrino_.p4();
358  hadTop_ = hadW_ + hadBJet_.p4();
359  lepTop_ = lepW_ + lepBJet_.p4();
360 }
361 
363  switch (algo) {
365  return jet.bDiscriminator("trackCountingHighEffBJetTags");
367  return jet.bDiscriminator("trackCountingHighPurBJetTags");
368  case JetComb::kSoftMuon:
369  return jet.bDiscriminator("softMuonBJetTags");
371  return jet.bDiscriminator("softMuonByPtBJetTags");
373  return jet.bDiscriminator("softMuonByIP3dBJetTags");
374  case JetComb::kSoftElec:
375  return jet.bDiscriminator("softElectronBJetTags");
377  return jet.bDiscriminator("jetProbabilityBJetTags");
379  return jet.bDiscriminator("jetBProbabilityBJetTags");
381  return jet.bDiscriminator("simpleSecondaryVertexBJetTags");
383  return jet.bDiscriminator("combinedSecondaryVertexBJetTags");
385  return jet.bDiscriminator("combinedSecondaryVertexMVABJetTags");
386  };
387  return -9999.;
388 }
Analysis-level MET class.
Definition: MET.h:40
double relativePtHadronicTop() const
math::XYZTLorentzVector lepton_
lepton 4-vector
math::XYZTLorentzVector hadTop_
hadronic top 4-vector
CompType
supported comparison types
math::XYZTLorentzVector lepW_
leptonic W 4-vector
double combinedBTags(JetComb::BTagAlgo algo, JetComb::Operator op) const
combined b-tag values of the two b candidates
math::XYZTLorentzVector lepTop_
leptonic top 4-vector
double compareWB(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const
comparison between the W and the b candidate
double neutrinoVar(JetComb::VarType var) const
neutrino candidate variable
double compareHadBLepB(JetComb::CompType comp) const
comparison between the two b candidates
~TtSemiLepJetComb()
default destructor
double compareHadWLepW(JetComb::CompType comp) const
comparison between the two W candidates
TtSemiLepJetComb()
emtpy constructor
double bQuarkVar(JetComb::DecayType decay, JetComb::VarType var) const
b quark candidate variable
float bDiscriminator(const std::string &theLabel) const
-— methods for accessing b-tagging info -—
const math::XYZTLorentzVector & top(JetComb::DecayType decay) const
return leptonic or hadronic top candidate depending on argument
const LorentzVector & p4() const final
four-momentum Lorentz vector
double compareHadTopLepTop(JetComb::CompType comp) const
comparison between the two top candidates
double compareWLepton(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the W and the lepton candidate
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
double compareBLepton(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the b and the lepton candidate
double lightQVar(bool qbar, JetComb::VarType var) const
light quark candidate variable
double compareBNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the b and the neutrino candidate
double compareLightQuarks(JetComb::CompType comp) const
comparison between the lightQ and the lightQBar candidate
double compareLeptonNeutrino(JetComb::CompType comp) const
comparison between the lepton and the neutrino candidate
vector< PseudoJet > jets
Operator
operators for combining variables
double compareTopLepton(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the top and the lepton candidate
double compareTopW(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const
comparison between the top and the W candidate
double compareTopB(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const
comparison between the top and the b candidate
const pat::Jet & lightQ(bool qbar=false) const
return lightQ or lightQBar candidate depending on argument
pat::Jet hadBJet_
hadronic b jet
double topVar(JetComb::DecayType decay, JetComb::VarType var) const
top quark candidate variable
double leptonVar(JetComb::VarType var) const
lepton candidate variable
double wBosonVar(JetComb::DecayType decay, JetComb::VarType var) const
W boson candidate variable.
double combinedBTagsForLightQuarks(JetComb::BTagAlgo algo, JetComb::Operator op) const
combined b-tag values of the two light quark candidates
double compareWNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the W and the neutrino candidate
pat::Jet hadQJet_
lightQ jet
pat::Jet lepBJet_
leptonic b jet
math::XYZTLorentzVector hadW_
hadronic W 4-vector
Analysis-level calorimeter jet class.
Definition: Jet.h:77
VarType
supported std single variable types
pat::Jet hadQBarJet_
lightQBar jet
BTagAlgo
b-tagging algorithms
const math::XYZTLorentzVector & wBoson(JetComb::DecayType decay) const
return leptonic or hadronic W candidate depending on argument
double compareTopNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the top and the neutrino candidate
void deduceMothers()
reconstruct mother candidates from final state candidates
const pat::Jet & bQuark(JetComb::DecayType decay) const
return leptonic or hadronic b candidate depending on argument
double bTag(JetComb::DecayType decay, JetComb::BTagAlgo algo) const
b-tag value of a b candidate
double bOverLightQPt() const
pat::MET neutrino_
neutrino candidate