CMS 3D CMS Logo

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
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:
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:
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:
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:
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:
297  case JetComb::kDeltaPhi:
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:
311  case JetComb::kDeltaPhi:
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:
335  case JetComb::kMult:
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 }
TtSemiLepEvtPartons::LightQBar
Definition: TtSemiLepEvtPartons.h:25
JetComb::kDeltaTheta
Definition: TtSemiLepJetComb.h:19
TtSemiLepJetComb::~TtSemiLepJetComb
~TtSemiLepJetComb()
default destructor
Definition: TtSemiLepJetComb.cc:25
JetComb::kBProbability
Definition: TtSemiLepJetComb.h:28
TtSemiLepJetComb::relativePtHadronicTop
double relativePtHadronicTop() const
Definition: TtSemiLepJetComb.cc:319
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
TtSemiLepEvtPartons::LepB
Definition: TtSemiLepEvtPartons.h:25
JetComb::kAdd
Definition: TtSemiLepJetComb.h:35
JetComb::kSoftMuon
Definition: TtSemiLepJetComb.h:24
TtSemiLepJetComb::combinedBTags
double combinedBTags(JetComb::BTagAlgo algo, JetComb::Operator op) const
combined b-tag values of the two b candidates
Definition: TtSemiLepJetComb.cc:331
TtSemiLepJetComb::compareTopLepton
double compareTopLepton(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the top and the lepton candidate
Definition: TtSemiLepJetComb.cc:235
JetComb::kTheta
Definition: TtSemiLepJetComb.h:17
TtSemiLepJetComb::lepton_
math::XYZTLorentzVector lepton_
lepton 4-vector
Definition: TtSemiLepJetComb.h:156
JetComb::CompType
CompType
supported comparison types
Definition: TtSemiLepJetComb.h:19
TtSemiLepJetComb::compareTopNeutrino
double compareTopNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the top and the neutrino candidate
Definition: TtSemiLepJetComb.cc:249
TtSemiLepJetComb::compareWNeutrino
double compareWNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the W and the neutrino candidate
Definition: TtSemiLepJetComb.cc:277
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
TtSemiLepJetComb::compareTopW
double compareTopW(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const
comparison between the top and the W candidate
Definition: TtSemiLepJetComb.cc:193
TtSemiLepEvtPartons.h
JetComb::kCombSecondVtxMVA
Definition: TtSemiLepJetComb.h:32
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
JetComb::kHad
Definition: TtSemiLepJetComb.h:15
TtSemiLepJetComb::wBosonVar
double wBosonVar(JetComb::DecayType decay, JetComb::VarType var) const
W boson candidate variable.
Definition: TtSemiLepJetComb.cc:43
HLT_FULL_cff.DeltaPhi
DeltaPhi
Definition: HLT_FULL_cff.py:465
JetComb::kLep
Definition: TtSemiLepJetComb.h:15
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
JetComb::kTrackCountHighPur
Definition: TtSemiLepJetComb.h:23
cmsdt::algo
algo
Definition: constants.h:164
pat::Jet
Analysis-level calorimeter jet class.
Definition: Jet.h:77
TtSemiLepJetComb::wBoson
const math::XYZTLorentzVector & wBoson(JetComb::DecayType decay) const
return leptonic or hadronic W candidate depending on argument
Definition: TtSemiLepJetComb.h:136
JetComb::kSoftMuonByPt
Definition: TtSemiLepJetComb.h:25
JetComb::Operator
Operator
operators for combining variables
Definition: TtSemiLepJetComb.h:35
TtSemiLepJetComb::compareBLepton
double compareBLepton(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the b and the lepton candidate
Definition: TtSemiLepJetComb.cc:291
TtSemiLepJetComb::combinedBTagsForLightQuarks
double combinedBTagsForLightQuarks(JetComb::BTagAlgo algo, JetComb::Operator op) const
combined b-tag values of the two light quark candidates
Definition: TtSemiLepJetComb.cc:341
TtSemiLepJetComb::topVar
double topVar(JetComb::DecayType decay, JetComb::VarType var) const
top quark candidate variable
Definition: TtSemiLepJetComb.cc:27
JetComb::kSimpleSecondVtx
Definition: TtSemiLepJetComb.h:30
JetComb::kTrackCountHighEff
Definition: TtSemiLepJetComb.h:22
TtSemiLepJetComb::lightQVar
double lightQVar(bool qbar, JetComb::VarType var) const
light quark candidate variable
Definition: TtSemiLepJetComb.cc:75
JetComb::kMass
Definition: TtSemiLepJetComb.h:17
TtSemiLepEvtPartons::HadB
Definition: TtSemiLepEvtPartons.h:25
JetComb::kPhi
Definition: TtSemiLepJetComb.h:17
JetComb::DecayType
DecayType
Definition: TtSemiLepJetComb.h:15
TtSemiLepJetComb::bQuark
const pat::Jet & bQuark(JetComb::DecayType decay) const
return leptonic or hadronic b candidate depending on argument
Definition: TtSemiLepJetComb.h:134
TtSemiLepJetComb::lightQ
const pat::Jet & lightQ(bool qbar=false) const
return lightQ or lightQBar candidate depending on argument
Definition: TtSemiLepJetComb.h:132
JetComb::kSoftElec
Definition: TtSemiLepJetComb.h:27
TtSemiLepEvtPartons::LightQ
Definition: TtSemiLepEvtPartons.h:25
TtSemiLepJetComb::compareLightQuarks
double compareLightQuarks(JetComb::CompType comp) const
comparison between the lightQ and the lightQBar candidate
Definition: TtSemiLepJetComb.cc:165
TtSemiLepJetComb::hadBJet_
pat::Jet hadBJet_
hadronic b jet
Definition: TtSemiLepJetComb.h:150
TtSemiLepJetComb::compareTopB
double compareTopB(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const
comparison between the top and the b candidate
Definition: TtSemiLepJetComb.cc:207
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
p4
double p4[4]
Definition: TauolaWrapper.h:92
pat::MET
Analysis-level MET class.
Definition: MET.h:40
JetComb::kDeltaM
Definition: TtSemiLepJetComb.h:19
electronAnalyzer_cfi.DeltaR
DeltaR
Definition: electronAnalyzer_cfi.py:33
TtSemiLepJetComb::neutrinoVar
double neutrinoVar(JetComb::VarType var) const
neutrino candidate variable
Definition: TtSemiLepJetComb.cc:107
TtSemiLepJetComb::hadTop_
math::XYZTLorentzVector hadTop_
hadronic top 4-vector
Definition: TtSemiLepJetComb.h:158
TtSemiLepJetComb::hadW_
math::XYZTLorentzVector hadW_
hadronic W 4-vector
Definition: TtSemiLepJetComb.h:160
JetComb::kDeltaPhi
Definition: TtSemiLepJetComb.h:19
JetComb::kMult
Definition: TtSemiLepJetComb.h:35
TtSemiLepJetComb::compareWLepton
double compareWLepton(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the W and the lepton candidate
Definition: TtSemiLepJetComb.cc:263
TtSemiLepJetComb::deduceMothers
void deduceMothers()
reconstruct mother candidates from final state candidates
Definition: TtSemiLepJetComb.cc:355
PA_ZEESkim_cff.decay
decay
Definition: PA_ZEESkim_cff.py:26
TtSemiLepJetComb::compareWB
double compareWB(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const
comparison between the W and the b candidate
Definition: TtSemiLepJetComb.cc:221
TtSemiLepJetComb::hadQBarJet_
pat::Jet hadQBarJet_
lightQBar jet
Definition: TtSemiLepJetComb.h:148
TtSemiLepJetComb::bOverLightQPt
double bOverLightQPt() const
Definition: TtSemiLepJetComb.cc:326
JetComb::kProbability
Definition: TtSemiLepJetComb.h:29
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
TtSemiLepJetComb::top
const math::XYZTLorentzVector & top(JetComb::DecayType decay) const
return leptonic or hadronic top candidate depending on argument
Definition: TtSemiLepJetComb.h:140
metsig::jet
Definition: SignAlgoResolutions.h:47
JetComb::kPt
Definition: TtSemiLepJetComb.h:17
TtSemiLepJetComb::hadQJet_
pat::Jet hadQJet_
lightQ jet
Definition: TtSemiLepJetComb.h:146
TtSemiLepJetComb::bTag
double bTag(JetComb::DecayType decay, JetComb::BTagAlgo algo) const
b-tag value of a b candidate
Definition: TtSemiLepJetComb.h:111
JetComb::kDeltaR
Definition: TtSemiLepJetComb.h:19
TtSemiLepJetComb::bQuarkVar
double bQuarkVar(JetComb::DecayType decay, JetComb::VarType var) const
b quark candidate variable
Definition: TtSemiLepJetComb.cc:59
JetComb::VarType
VarType
supported std single variable types
Definition: TtSemiLepJetComb.h:17
JetComb::kCombSecondVtx
Definition: TtSemiLepJetComb.h:31
JetComb::BTagAlgo
BTagAlgo
b-tagging algorithms
Definition: TtSemiLepJetComb.h:21
TtSemiLepJetComb::compareHadTopLepTop
double compareHadTopLepTop(JetComb::CompType comp) const
comparison between the two top candidates
Definition: TtSemiLepJetComb.cc:123
TtSemiLepJetComb::lepTop_
math::XYZTLorentzVector lepTop_
leptonic top 4-vector
Definition: TtSemiLepJetComb.h:162
TtSemiLepJetComb.h
JetComb::kEta
Definition: TtSemiLepJetComb.h:17
TtSemiLepJetComb::neutrino_
pat::MET neutrino_
neutrino candidate
Definition: TtSemiLepJetComb.h:154
TtSemiLepJetComb::lepBJet_
pat::Jet lepBJet_
leptonic b jet
Definition: TtSemiLepJetComb.h:152
TtSemiLepJetComb::compareHadWLepW
double compareHadWLepW(JetComb::CompType comp) const
comparison between the two W candidates
Definition: TtSemiLepJetComb.cc:137
TtSemiLepJetComb::TtSemiLepJetComb
TtSemiLepJetComb()
emtpy constructor
Definition: TtSemiLepJetComb.cc:6
TtSemiLepJetComb::leptonVar
double leptonVar(JetComb::VarType var) const
lepton candidate variable
Definition: TtSemiLepJetComb.cc:91
TtSemiLepJetComb::lepW_
math::XYZTLorentzVector lepW_
leptonic W 4-vector
Definition: TtSemiLepJetComb.h:164
TtSemiLepJetComb::compareBNeutrino
double compareBNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the b and the neutrino candidate
Definition: TtSemiLepJetComb.cc:305
JetComb::kSofMuonByIP3d
Definition: TtSemiLepJetComb.h:26
TtSemiLepJetComb::compareLeptonNeutrino
double compareLeptonNeutrino(JetComb::CompType comp) const
comparison between the lepton and the neutrino candidate
Definition: TtSemiLepJetComb.cc:179
TtSemiLepJetComb::compareHadBLepB
double compareHadBLepB(JetComb::CompType comp) const
comparison between the two b candidates
Definition: TtSemiLepJetComb.cc:151