Rivet: /Users/chrisg/software/rivet/include/Rivet/Tools/RivetHTT.hh Source File

| Rivet 3.1.9

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
11 class HTT {
12 public:
13
17 enum Algo { KT=0, AKT=1, ANTIKT=1, CA=2, CAMBRIDGE=2, CAMBRIDGE_AACHEN=2 };
18
19
21 enum Mode {
22 EARLY_MASSRATIO_SORT_MASS, // applies 2D mass plane requirements then select the candidate which minimizes |m_cand-mt|
23 LATE_MASSRATIO_SORT_MASS, // selects the candidate which minimizes |m_cand-mt|
24 EARLY_MASSRATIO_SORT_MODDJADE, // applies the 2D mass plane requirements then select the candidate with highest jade distance
25 LATE_MASSRATIO_SORT_MODDJADE, // selects the candidate with highest modified jade distance
26 TWO_STEP_FILTER // only analyzes the candidate built with the highest pT(t) after unclustering
27 };
28
29
30 struct InputParameters {
31
33 Mode mode = Mode::EARLY_MASSRATIO_SORT_MASS;
34
38 bool do_optimalR = true;
39 double optimalR_min = 0.5; // min jet size
40 double optimalR_step = 0.1; // step size
41 double optimalR_threshold = 0.2; // step size
43
46 double mass_drop = 0.8;
47 double max_subjet_mass = 30*GeV;
49
52 unsigned int filt_N = 5; // set_nfilt
53 double filtering_R = 0.3; // max subjet distance for filtering
54 double filtering_minpt = 0.; // min subjet pt for filtering
56
58 Algo filtering_algorithm = Algo::CA;
59
61 Algo reclustering_algorithm = Algo::CA;
62
66 double top_mass = 172.3*GeV;
68 double W_mass = 80.4*GeV;
69 double Mtop_min = 150*GeV;
70 double Mtop_max = 200*GeV; //set_top_range(min,max)
72
75 double fw = 0.15;
76 double mass_ratio_range_min = (1.-fw)*W_mass/top_mass;
77 double mass_ratio_range_max = (1.+fw)*W_mass/top_mass;
79
82 double m23cut = 0.35;
83 double m13cutmin = 0.2;
84 double m13cutmax = 1.3;
86
89 double prune_zcut = 0.1;
90 double prune_rcut = 0.5;
92
93 };
94
95
96
98 HTT() {}
99
101 HTT(HTT::InputParameters& params) {
102 setParams(params);
103 }
104
105 // /// Destructor
106 // ~HTT() {}
107
109 void setParams(HTT::InputParameters& params);
110
112 void calc(Jet& jet);
113
115 const Jet topJet() const;
117 const Jet bJet() const;
119 const Jet wJet() const;
121 const Jet w1Jet() const;
123 const Jet w2Jet() const;
124
126 const PseudoJet& topJet() const;
128 const PseudoJet& bJet() const;
130 const PseudoJet& wJet() const;
132 const PseudoJet& w1Jet() const;
134 const PseudoJet& w2Jet() const;
135
137 const Jets& subjets() const;
138
139 // /// Print tagger information
140 // void info() const;
141 // /// Print tagger settings
142 // void settings() const;
143
145 double prunedMass() const;
146
147 // The unfiltered mass
148 double unfilteredMass() const;
149
151 double deltaTopMass() const;
152
154 bool isTopTagged() const;
155
157 bool passedMassCutTop() const;
158
160 bool passedMassCut2D() const;
161
162
163 private:
164
165 fastjet::HEPTopTagger::HEPTopTagger _tagger;
166
167 };
168
169
171
172 void HTT::setParams(HTT::InputParameters& params) {
173 _tagger = fastjet::HEPTopTagger::HEPTopTagger();
174
175 // Optimal R
176 _tagger.do_optimalR(params.do_optimalR);
177 _tagger.set_optimalR_min(params.optimalR_min);
178 _tagger.set_optimalR_step(params.optimalR_step);
179 _tagger.set_optimalR_threshold(params.optimalR_threshold);
180
181 // Candidate selection
182 fastjet::HEPTopTagger::Mode mode;
183 if (params.mode == HTT::EARLY_MASSRATIO_SORT_MASS) {
184 mode = fastjet::HEPTopTagger::EARLY_MASSRATIO_SORT_MASS;
185 } else if (params.mode == HTT::LATE_MASSRATIO_SORT_MASS) {
186 mode = fastjet::HEPTopTagger::LATE_MASSRATIO_SORT_MASS;
187 } else if (params.mode == HTT::EARLY_MASSRATIO_SORT_MODDJADE) {
188 mode = fastjet::HEPTopTagger::EARLY_MASSRATIO_SORT_MODDJADE;
189 } else if (params.mode == HTT::LATE_MASSRATIO_SORT_MODDJADE) {
190 mode = fastjet::HEPTopTagger::LATE_MASSRATIO_SORT_MODDJADE;
191 } else {
192 mode = fastjet::HEPTopTagger::TWO_STEP_FILTER;
193 }
194 _tagger.set_mode(mode);
195 _tagger.set_mt(params.top_mass);
196 _tagger.set_mw(params.W_mass);
197 _tagger.set_top_mass_range(params.Mtop_min, params.Mtop_max);
198 _tagger.set_fw(params.fw);
199 _tagger.set_mass_ratio_range(params.mass_ratio_range_min, params.mass_ratio_range_max);
200 _tagger.set_mass_ratio_cut(params.m23cut, params.m13cutmin, params.m13cutmax);
201
202 // Filtering
203 _tagger.set_filtering_n(params.filt_N);
204 _tagger.set_filtering_R(params.filtering_R);
205 _tagger.set_filtering_minpt_subjet(params.filtering_minpt);
206
207 fastjet::JetAlgorithm algo = fastjet::antikt_algorithm;
208 if (params.filtering_algorithm == Algo::CA) algo = fastjet::cambridge_algorithm;
209 else if (params.filtering_algorithm == Algo::KT) algo = fastjet::kt_algorithm;
210 _tagger.set_filtering_jetalgorithm(algo);
211
212 // Reclustering
213 algo = fastjet::antikt_algorithm;
214 if (params.reclustering_algorithm == Algo::CA) algo = fastjet::cambridge_algorithm;
215 else if (params.reclustering_algorithm == Algo::KT) 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 { return Jet(topPjet()); }
234 const Jet HTT::bJet() const { return Jet(bPjet()); }
235 const Jet HTT::wJet() const { return Jet(wPjet()); }
236 const Jet HTT::w1Jet() const { return Jet(w1Pjet()); }
237 const Jet HTT::w2Jet() const { return Jet(w2Pjet()); }
238
239
240 const PseudoJet& HTT::topPjet() const { return _tagger.t(); }
241 const PseudoJet& HTT::bPjet() const { return _tagger.b(); }
242 const PseudoJet& HTT::wPjet() const { return _tagger.W(); }
243 const PseudoJet& HTT::w1Pjet() const { return _tagger.W1(); }
244 const PseudoJet& HTT::w2Pjet() const { return _tagger.W2(); }
245
246
247 Jets HTT::subjets() const {
248 Jets rtn;
249 rtn.reserve(3);
250 rtn.emplace_back(_tagger.j1());
251 rtn.emplace_back(_tagger.j2());
252 rtn.emplace_back(_tagger.j3());
253 return rtn;
254 }
255
256
257 // void HTT::info() const { _tagger.get_info(); }
258 // void HTT::settings() const { _tagger.get_setting(); }
259
260 double HTT::prunedMass() const { return _tagger.pruned_mass(); }
261
262 double HTT::unfilteredMass() const { return _tagger.unfiltered_mass(); }
263
264 double HTT::deltaTopMass() const { return _tagger.delta_top(); }
265
266 bool HTT::isTopTagged() const { return _tagger.is_tagged(); }
267
268 bool HTT::passedMassCutTop() const { return _tagger.is_maybe_top(); }
269
270 bool HTT::passedMassCut2D() const { return _tagger.is_masscut_passed(); }
271
273
274
275}
276
277#endif
Rivet::HTT
Definition RivetHTT.hh:11
Rivet::HTT::calc
void calc(Jet &jet)
Run the top tagger on a given jet.
Definition RivetHTT.hh:228
Rivet::HTT::passedMassCut2D
bool passedMassCut2D() const
2D mass plane requirements passed?
Definition RivetHTT.hh:270
Rivet::HTT::topJet
const PseudoJet & topJet() const
Top jet, as a pseudojet.
Rivet::HTT::HTT
HTT(HTT::InputParameters &params)
Constructor with arguments.
Definition RivetHTT.hh:101
Rivet::HTT::bJet
const Jet bJet() const
The bottom jet inside the top.
Definition RivetHTT.hh:234
Rivet::HTT::w1Jet
const PseudoJet & w1Jet() const
Leading subjet from W, as a pseudojet.
Rivet::HTT::w2Jet
const Jet w2Jet() const
Second leading subjet from W.
Definition RivetHTT.hh:237
Rivet::HTT::wJet
const Jet wJet() const
The W jet inside the top.
Definition RivetHTT.hh:235
Rivet::HTT::Algo
Algo
Definition RivetHTT.hh:17
Rivet::HTT::isTopTagged
bool isTopTagged() const
Is the jet tagged?
Definition RivetHTT.hh:266
Rivet::HTT::deltaTopMass
double deltaTopMass() const
Difference between the reco top mass and the true top mass.
Definition RivetHTT.hh:264
Rivet::HTT::bJet
const PseudoJet & bJet() const
The bottom jet inside the top, as a pseudojet.
Rivet::HTT::topJet
const Jet topJet() const
Top jet.
Definition RivetHTT.hh:233
Rivet::HTT::passedMassCutTop
bool passedMassCutTop() const
Was the top-mass window requirement passed?
Definition RivetHTT.hh:268
Rivet::HTT::subjets
const Jets & subjets() const
pT-ordered subjets
Definition RivetHTT.hh:247
Rivet::HTT::w2Jet
const PseudoJet & w2Jet() const
Second leading subjet from W, as a pseudojet.
Rivet::HTT::HTT
HTT()
Constructor without arguments.
Definition RivetHTT.hh:98
Rivet::HTT::wJet
const PseudoJet & wJet() const
The W jet inside the top, as a pseudojet.
Rivet::HTT::Mode
Mode
HTT operating mode.
Definition RivetHTT.hh:21
Rivet::HTT::w1Jet
const Jet w1Jet() const
Leading subjet from W.
Definition RivetHTT.hh:236
Rivet::HTT::setParams
void setParams(HTT::InputParameters &params)
Set the tagging parameters.
Definition RivetHTT.hh:172
Rivet::HTT::prunedMass
double prunedMass() const
The pruned mass.
Definition RivetHTT.hh:260
Rivet::Jet
Representation of a clustered jet of particles.
Definition Jet.hh:48
Rivet::Jet::pseudojet
const fastjet::PseudoJet & pseudojet() const
Access the internal FastJet3 PseudoJet (as a const reference)
Definition Jet.hh:200
Rivet::Jets
Specialised vector of Jet objects.
Definition Jet.hh:23
Rivet
Definition MC_Cent_pPb.hh:10
Rivet::HTT::InputParameters
Definition RivetHTT.hh:30
Rivet::HTT::InputParameters::filtering_algorithm
Algo filtering_algorithm
Jet algorithm used for filtering.
Definition RivetHTT.hh:58
Rivet::HTT::InputParameters::mode
Mode mode
HTT execution mode.
Definition RivetHTT.hh:33
Rivet::HTT::InputParameters::reclustering_algorithm
Algo reclustering_algorithm
Reclustering jet algorithm.
Definition RivetHTT.hh:61
Rivet::HTT::InputParameters::W_mass
double W_mass
Definition RivetHTT.hh:68