Rivet API documentation

Rivet 4.1.3
RivetHTT.hh
1// -*- C++ -*-
2#ifndef RIVET_RIVETHTT_HH
3#define RIVET_RIVETHTT_HH
4
5#include "Rivet/Jet.hh"
6#include "HEPTopTagger/HEPTopTagger.hh"
7
8namespace Rivet {
9
10
12 enum class HTTMode {
13 EARLY_MASSRATIO_SORT_MASS, // applies 2D mass plane requirements then select the candidate which minimizes |m_cand-mt|
14 LATE_MASSRATIO_SORT_MASS, // selects the candidate which minimizes |m_cand-mt|
15 EARLY_MASSRATIO_SORT_MODDJADE, // applies the 2D mass plane requirements then select the candidate with highest jade distance
16 LATE_MASSRATIO_SORT_MODDJADE, // selects the candidate with highest modified jade distance
17 TWO_STEP_FILTER // only analyzes the candidate built with the highest pT(t) after unclustering
18 };
19
20
22 class HTT {
23 public:
24
26
28 Mode mode = HTTMode::EARLY_MASSRATIO_SORT_MASS;
29
33 bool do_optimalR = true;
34 double optimalR_min = 0.5; // min jet size
35 double optimalR_step = 0.1; // step size
36 double optimalR_threshold = 0.2; // step size
38
41 double mass_drop = 0.8;
42 double max_subjet_mass = 30 * GeV;
44
47 unsigned int filt_N = 5; // set_nfilt
48 double filtering_R = 0.3; // max subjet distance for filtering
49 double filtering_minpt = 0.; // min subjet pt for filtering
51
53 JetAlg filtering_algorithm = JetAlg::CA;
54
56 JetAlg reclustering_algorithm = JetAlg::CA;
57
61 double top_mass = 172.3 * GeV;
63 double W_mass = 80.4 * GeV;
64 double Mtop_min = 150 * GeV;
65 double Mtop_max = 200 * GeV; //set_top_range(min,max)
67
70 double fw = 0.15;
71 double mass_ratio_range_min = (1. - fw) * W_mass / top_mass;
72 double mass_ratio_range_max = (1. + fw) * W_mass / top_mass;
74
77 double m23cut = 0.35;
78 double m13cutmin = 0.2;
79 double m13cutmax = 1.3;
81
84 double prune_zcut = 0.1;
85 double prune_rcut = 0.5;
87 };
88
89
91 HTT() { }
92
95 setParams(params);
96 }
97
98 // /// Destructor
99 // ~HTT() {}
100
102 void setParams(HTT::InputParameters& params);
103
105 void calc(Jet& jet);
106
108 const Jet topJet() const;
110 const Jet bJet() const;
112 const Jet wJet() const;
114 const Jet w1Jet() const;
116 const Jet w2Jet() const;
117
119 const PseudoJet& topJet() const;
121 const PseudoJet& bJet() const;
123 const PseudoJet& wJet() const;
125 const PseudoJet& w1Jet() const;
127 const PseudoJet& w2Jet() const;
128
130 const Jets& subjets() const;
131
132 // /// Print tagger information
133 // void info() const;
134 // /// Print tagger settings
135 // void settings() const;
136
138 double prunedMass() const;
139
140 // The unfiltered mass
141 double unfilteredMass() const;
142
144 double deltaTopMass() const;
145
147 bool isTopTagged() const;
148
150 bool passedMassCutTop() const;
151
153 bool passedMassCut2D() const;
154
155
156 private:
157
158 fastjet::HEPTopTagger::HEPTopTagger _tagger;
159 };
160
161
163
165 _tagger = fastjet::HEPTopTagger::HEPTopTagger();
166
167 // Optimal R
168 _tagger.do_optimalR(params.do_optimalR);
169 _tagger.set_optimalR_min(params.optimalR_min);
170 _tagger.set_optimalR_step(params.optimalR_step);
171 _tagger.set_optimalR_threshold(params.optimalR_threshold);
172
173 // Candidate selection
174 fastjet::HEPTopTagger::Mode mode;
175 if (params.mode == HTTMode::EARLY_MASSRATIO_SORT_MASS) {
176 mode = fastjet::HEPTopTagger::EARLY_MASSRATIO_SORT_MASS;
177 }
178 else if (params.mode == HTTMode::LATE_MASSRATIO_SORT_MASS) {
179 mode = fastjet::HEPTopTagger::LATE_MASSRATIO_SORT_MASS;
180 }
181 else if (params.mode == HTTMode::EARLY_MASSRATIO_SORT_MODDJADE) {
182 mode = fastjet::HEPTopTagger::EARLY_MASSRATIO_SORT_MODDJADE;
183 }
184 else if (params.mode == HTTMode::LATE_MASSRATIO_SORT_MODDJADE) {
185 mode = fastjet::HEPTopTagger::LATE_MASSRATIO_SORT_MODDJADE;
186 }
187 else {
188 mode = fastjet::HEPTopTagger::TWO_STEP_FILTER;
189 }
190 _tagger.set_mode(mode);
191 _tagger.set_mt(params.top_mass);
192 _tagger.set_mw(params.W_mass);
193 _tagger.set_top_mass_range(params.Mtop_min, params.Mtop_max);
194 _tagger.set_fw(params.fw);
195 _tagger.set_mass_ratio_range(params.mass_ratio_range_min, params.mass_ratio_range_max);
196 _tagger.set_mass_ratio_cut(params.m23cut, params.m13cutmin, params.m13cutmax);
197
198 // Filtering
199 _tagger.set_filtering_n(params.filt_N);
200 _tagger.set_filtering_R(params.filtering_R);
201 _tagger.set_filtering_minpt_subjet(params.filtering_minpt);
202
203 fastjet::JetAlgorithm algo = fastjet::antikt_algorithm;
204 if (params.filtering_algorithm == Algo::CA)
205 algo = fastjet::cambridge_algorithm;
206 else if (params.filtering_algorithm == Algo::KT)
207 algo = fastjet::kt_algorithm;
208 _tagger.set_filtering_jetalgorithm(algo);
209
210 // Reclustering
211 algo = fastjet::antikt_algorithm;
212 if (params.reclustering_algorithm == Algo::CA)
213 algo = fastjet::cambridge_algorithm;
214 else if (params.reclustering_algorithm == Algo::KT)
215 algo = fastjet::kt_algorithm;
216 _tagger.set_reclustering_jetalgorithm(algo);
217
218 // Mass-drop
219 _tagger.set_mass_drop_threshold(params.mass_drop);
220 _tagger.set_mass_drop_threshold(params.mass_drop);
221
222 // Pruning
223 _tagger.set_pruning_rcut_factor(params.prune_rcut);
224 _tagger.set_pruning_zcut(params.prune_zcut);
225 }
226
227
228 void HTT::calc(Jet& jet) {
229 _tagger.run(jet.pseudojet());
230 }
231
232
233 const Jet HTT::topJet() const {
234 return Jet(topPjet());
235 }
236 const Jet HTT::bJet() const {
237 return Jet(bPjet());
238 }
239 const Jet HTT::wJet() const {
240 return Jet(wPjet());
241 }
242 const Jet HTT::w1Jet() const {
243 return Jet(w1Pjet());
244 }
245 const Jet HTT::w2Jet() const {
246 return Jet(w2Pjet());
247 }
248
249
250 const PseudoJet& HTT::topPjet() const {
251 return _tagger.t();
252 }
253 const PseudoJet& HTT::bPjet() const {
254 return _tagger.b();
255 }
256 const PseudoJet& HTT::wPjet() const {
257 return _tagger.W();
258 }
259 const PseudoJet& HTT::w1Pjet() const {
260 return _tagger.W1();
261 }
262 const PseudoJet& HTT::w2Pjet() const {
263 return _tagger.W2();
264 }
265
266
268 Jets rtn;
269 rtn.reserve(3);
270 rtn.emplace_back(_tagger.j1());
271 rtn.emplace_back(_tagger.j2());
272 rtn.emplace_back(_tagger.j3());
273 return rtn;
274 }
275
276
277 // void HTT::info() const { _tagger.get_info(); }
278 // void HTT::settings() const { _tagger.get_setting(); }
279
280 double HTT::prunedMass() const {
281 return _tagger.pruned_mass();
282 }
283
284 double HTT::unfilteredMass() const {
285 return _tagger.unfiltered_mass();
286 }
287
288 double HTT::deltaTopMass() const {
289 return _tagger.delta_top();
290 }
291
292 bool HTT::isTopTagged() const {
293 return _tagger.is_tagged();
294 }
295
297 return _tagger.is_maybe_top();
298 }
299
300 bool HTT::passedMassCut2D() const {
301 return _tagger.is_masscut_passed();
302 }
303
305
306
307}
308
309#endif
void calc(Jet &jet)
Run the top tagger on a given jet.
Definition RivetHTT.hh:228
bool passedMassCut2D() const
2D mass plane requirements passed?
Definition RivetHTT.hh:300
const PseudoJet & topJet() const
Top jet, as a pseudojet.
HTT(HTT::InputParameters &params)
Constructor with arguments.
Definition RivetHTT.hh:94
const Jet bJet() const
The bottom jet inside the top.
Definition RivetHTT.hh:236
const PseudoJet & w1Jet() const
Leading subjet from W, as a pseudojet.
const Jet w2Jet() const
Second leading subjet from W.
Definition RivetHTT.hh:245
const Jet wJet() const
The W jet inside the top.
Definition RivetHTT.hh:239
bool isTopTagged() const
Is the jet tagged?
Definition RivetHTT.hh:292
double deltaTopMass() const
Difference between the reco top mass and the true top mass.
Definition RivetHTT.hh:288
const PseudoJet & bJet() const
The bottom jet inside the top, as a pseudojet.
const Jet topJet() const
Top jet.
Definition RivetHTT.hh:233
bool passedMassCutTop() const
Was the top-mass window requirement passed?
Definition RivetHTT.hh:296
const Jets & subjets() const
pT-ordered subjets
Definition RivetHTT.hh:267
const PseudoJet & w2Jet() const
Second leading subjet from W, as a pseudojet.
HTT()
Constructor without arguments.
Definition RivetHTT.hh:91
const PseudoJet & wJet() const
The W jet inside the top, as a pseudojet.
const Jet w1Jet() const
Leading subjet from W.
Definition RivetHTT.hh:242
void setParams(HTT::InputParameters &params)
Set the tagging parameters.
Definition RivetHTT.hh:164
double prunedMass() const
The pruned mass.
Definition RivetHTT.hh:280
Representation of a clustered jet of particles.
Definition Jet.hh:47
const fastjet::PseudoJet & pseudojet() const
Access the internal FastJet3 PseudoJet (as a const reference).
Definition Jet.hh:292
Specialised vector of Jet objects.
Definition Jet.hh:21
Definition LHCbCommon.hh:9
HTTMode
HTT operating mode.
Definition RivetHTT.hh:12
Definition RivetHTT.hh:25
Mode mode
HTT execution mode.
Definition RivetHTT.hh:28
JetAlg filtering_algorithm
Jet algorithm used for filtering.
Definition RivetHTT.hh:53
JetAlg reclustering_algorithm
Reclustering jet algorithm.
Definition RivetHTT.hh:56
double W_mass
Definition RivetHTT.hh:63