rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.0
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
90
91
93 HTT() {}
94
97 setParams(params);
98 }
99
100 // /// Destructor
101 // ~HTT() {}
102
104 void setParams(HTT::InputParameters& params);
105
107 void calc(Jet& jet);
108
110 const Jet topJet() const;
112 const Jet bJet() const;
114 const Jet wJet() const;
116 const Jet w1Jet() const;
118 const Jet w2Jet() const;
119
121 const PseudoJet& topJet() const;
123 const PseudoJet& bJet() const;
125 const PseudoJet& wJet() const;
127 const PseudoJet& w1Jet() const;
129 const PseudoJet& w2Jet() const;
130
132 const Jets& subjets() const;
133
134 // /// Print tagger information
135 // void info() const;
136 // /// Print tagger settings
137 // void settings() const;
138
140 double prunedMass() const;
141
142 // The unfiltered mass
143 double unfilteredMass() const;
144
146 double deltaTopMass() const;
147
149 bool isTopTagged() const;
150
152 bool passedMassCutTop() const;
153
155 bool passedMassCut2D() const;
156
157
158 private:
159
160 fastjet::HEPTopTagger::HEPTopTagger _tagger;
161
162 };
163
164
166
168 _tagger = fastjet::HEPTopTagger::HEPTopTagger();
169
170 // Optimal R
171 _tagger.do_optimalR(params.do_optimalR);
172 _tagger.set_optimalR_min(params.optimalR_min);
173 _tagger.set_optimalR_step(params.optimalR_step);
174 _tagger.set_optimalR_threshold(params.optimalR_threshold);
175
176 // Candidate selection
177 fastjet::HEPTopTagger::Mode mode;
178 if (params.mode == HTTMode::EARLY_MASSRATIO_SORT_MASS) {
179 mode = fastjet::HEPTopTagger::EARLY_MASSRATIO_SORT_MASS;
180 } else if (params.mode == HTTMode::LATE_MASSRATIO_SORT_MASS) {
181 mode = fastjet::HEPTopTagger::LATE_MASSRATIO_SORT_MASS;
182 } else if (params.mode == HTTMode::EARLY_MASSRATIO_SORT_MODDJADE) {
183 mode = fastjet::HEPTopTagger::EARLY_MASSRATIO_SORT_MODDJADE;
184 } else if (params.mode == HTTMode::LATE_MASSRATIO_SORT_MODDJADE) {
185 mode = fastjet::HEPTopTagger::LATE_MASSRATIO_SORT_MODDJADE;
186 } else {
187 mode = fastjet::HEPTopTagger::TWO_STEP_FILTER;
188 }
189 _tagger.set_mode(mode);
190 _tagger.set_mt(params.top_mass);
191 _tagger.set_mw(params.W_mass);
192 _tagger.set_top_mass_range(params.Mtop_min, params.Mtop_max);
193 _tagger.set_fw(params.fw);
194 _tagger.set_mass_ratio_range(params.mass_ratio_range_min, params.mass_ratio_range_max);
195 _tagger.set_mass_ratio_cut(params.m23cut, params.m13cutmin, params.m13cutmax);
196
197 // Filtering
198 _tagger.set_filtering_n(params.filt_N);
199 _tagger.set_filtering_R(params.filtering_R);
200 _tagger.set_filtering_minpt_subjet(params.filtering_minpt);
201
202 fastjet::JetAlgorithm algo = fastjet::antikt_algorithm;
203 if (params.filtering_algorithm == Algo::CA) algo = fastjet::cambridge_algorithm;
204 else if (params.filtering_algorithm == Algo::KT) algo = fastjet::kt_algorithm;
205 _tagger.set_filtering_jetalgorithm(algo);
206
207 // Reclustering
208 algo = fastjet::antikt_algorithm;
209 if (params.reclustering_algorithm == Algo::CA) algo = fastjet::cambridge_algorithm;
210 else if (params.reclustering_algorithm == Algo::KT) algo = fastjet::kt_algorithm;
211 _tagger.set_reclustering_jetalgorithm(algo);
212
213 // Mass-drop
214 _tagger.set_mass_drop_threshold(params.mass_drop);
215 _tagger.set_mass_drop_threshold(params.mass_drop);
216
217 // Pruning
218 _tagger.set_pruning_rcut_factor(params.prune_rcut);
219 _tagger.set_pruning_zcut(params.prune_zcut);
220 }
221
222
223 void HTT::calc(Jet& jet) {
224 _tagger.run(jet.pseudojet());
225 }
226
227
228 const Jet HTT::topJet() const { return Jet(topPjet()); }
229 const Jet HTT::bJet() const { return Jet(bPjet()); }
230 const Jet HTT::wJet() const { return Jet(wPjet()); }
231 const Jet HTT::w1Jet() const { return Jet(w1Pjet()); }
232 const Jet HTT::w2Jet() const { return Jet(w2Pjet()); }
233
234
235 const PseudoJet& HTT::topPjet() const { return _tagger.t(); }
236 const PseudoJet& HTT::bPjet() const { return _tagger.b(); }
237 const PseudoJet& HTT::wPjet() const { return _tagger.W(); }
238 const PseudoJet& HTT::w1Pjet() const { return _tagger.W1(); }
239 const PseudoJet& HTT::w2Pjet() const { return _tagger.W2(); }
240
241
243 Jets rtn;
244 rtn.reserve(3);
245 rtn.emplace_back(_tagger.j1());
246 rtn.emplace_back(_tagger.j2());
247 rtn.emplace_back(_tagger.j3());
248 return rtn;
249 }
250
251
252 // void HTT::info() const { _tagger.get_info(); }
253 // void HTT::settings() const { _tagger.get_setting(); }
254
255 double HTT::prunedMass() const { return _tagger.pruned_mass(); }
256
257 double HTT::unfilteredMass() const { return _tagger.unfiltered_mass(); }
258
259 double HTT::deltaTopMass() const { return _tagger.delta_top(); }
260
261 bool HTT::isTopTagged() const { return _tagger.is_tagged(); }
262
263 bool HTT::passedMassCutTop() const { return _tagger.is_maybe_top(); }
264
265 bool HTT::passedMassCut2D() const { return _tagger.is_masscut_passed(); }
266
268
269
270}
271
272#endif
Wrapper class for configuring use of HEPTopTagger.
Definition RivetHTT.hh:22
void calc(Jet &jet)
Run the top tagger on a given jet.
Definition RivetHTT.hh:223
bool passedMassCut2D() const
2D mass plane requirements passed?
Definition RivetHTT.hh:265
const PseudoJet & topJet() const
Top jet, as a pseudojet.
HTT(HTT::InputParameters &params)
Constructor with arguments.
Definition RivetHTT.hh:96
const Jet bJet() const
The bottom jet inside the top.
Definition RivetHTT.hh:229
const PseudoJet & w1Jet() const
Leading subjet from W, as a pseudojet.
const Jet w2Jet() const
Second leading subjet from W.
Definition RivetHTT.hh:232
const Jet wJet() const
The W jet inside the top.
Definition RivetHTT.hh:230
bool isTopTagged() const
Is the jet tagged?
Definition RivetHTT.hh:261
double deltaTopMass() const
Difference between the reco top mass and the true top mass.
Definition RivetHTT.hh:259
const PseudoJet & bJet() const
The bottom jet inside the top, as a pseudojet.
const Jet topJet() const
Top jet.
Definition RivetHTT.hh:228
bool passedMassCutTop() const
Was the top-mass window requirement passed?
Definition RivetHTT.hh:263
const Jets & subjets() const
pT-ordered subjets
Definition RivetHTT.hh:242
const PseudoJet & w2Jet() const
Second leading subjet from W, as a pseudojet.
HTT()
Constructor without arguments.
Definition RivetHTT.hh:93
const PseudoJet & wJet() const
The W jet inside the top, as a pseudojet.
const Jet w1Jet() const
Leading subjet from W.
Definition RivetHTT.hh:231
void setParams(HTT::InputParameters &params)
Set the tagging parameters.
Definition RivetHTT.hh:167
double prunedMass() const
The pruned mass.
Definition RivetHTT.hh:255
Representation of a clustered jet of particles.
Definition Jet.hh:42
const fastjet::PseudoJet & pseudojet() const
Access the internal FastJet3 PseudoJet (as a const reference)
Definition Jet.hh:194
Specialised vector of Jet objects.
Definition Jet.hh:21
Definition MC_CENT_PPB_Projections.hh:10
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