Changeset 35cdc46 in git for external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh
- Timestamp:
- Sep 3, 2014, 3:18:54 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- be2222c
- Parents:
- 5b5a56b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh
r5b5a56b r35cdc46 1 // $Id$2 //3 1 // Nsubjettiness Package 4 2 // Questions/Comments? jthaler@jthaler.net … … 7 5 // Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason 8 6 // 7 // $Id: NjettinessPlugin.hh 671 2014-06-10 17:47:52Z jthaler $ 9 8 //---------------------------------------------------------------------- 10 9 // This file is part of FastJet contrib. … … 49 48 // to similar information 50 49 class NjettinessExtras : public ClusterSequence::Extras { 51 private: 52 53 TauComponents _tau_components; 54 std::vector<fastjet::PseudoJet> _jets; 55 std::vector<fastjet::PseudoJet> _axes; 56 57 int labelOf(const fastjet::PseudoJet& jet) const { 58 int thisJet = -1; 59 for (unsigned int i = 0; i < _jets.size(); i++) { 60 if (_jets[i].cluster_hist_index() == jet.cluster_hist_index()) { 61 thisJet = i; 62 break; 63 } 64 } 65 return thisJet; 66 } 67 50 68 51 public: 69 52 NjettinessExtras(TauComponents tau_components, std::vector<fastjet::PseudoJet> jets, std::vector<fastjet::PseudoJet> axes) : _tau_components(tau_components), _jets(jets), _axes(axes) {} … … 74 57 std::vector<fastjet::PseudoJet> axes() const {return _axes;} 75 58 76 double totalTau(const fastjet::PseudoJet& jet) const {59 double totalTau(const fastjet::PseudoJet& /*jet*/) const { 77 60 return _tau_components.tau(); 78 61 } 62 79 63 double subTau(const fastjet::PseudoJet& jet) const { 80 if (labelOf(jet) == -1) return NAN;64 if (labelOf(jet) == -1) return std::numeric_limits<double>::quiet_NaN(); // nonsense 81 65 return _tau_components.jet_pieces()[labelOf(jet)]; 82 66 } … … 93 77 return (labelOf(jet) >= 0); 94 78 } 95 79 80 private: 81 82 TauComponents _tau_components; 83 std::vector<fastjet::PseudoJet> _jets; 84 std::vector<fastjet::PseudoJet> _axes; 85 86 int labelOf(const fastjet::PseudoJet& jet) const { 87 int thisJet = -1; 88 for (unsigned int i = 0; i < _jets.size(); i++) { 89 if (_jets[i].cluster_hist_index() == jet.cluster_hist_index()) { 90 thisJet = i; 91 break; 92 } 93 } 94 return thisJet; 95 } 96 96 }; 97 97 … … 122 122 * onepass_wta_kt_axes : one-pass minimization seeded by wta_kt 123 123 * 124 * For the unnormalized_measure, N-jettiness is defined as:124 * For the UnnormalizedMeasure(beta), N-jettiness is defined as: 125 125 * 126 126 * tau_N = Sum_{all particles i} p_T^i min((DR_i1)^beta, (DR_i2)^beta, ...) … … 129 129 * and jet j. 130 130 * 131 * The normalized_meausure include an extra parameter R0, and the various cutoff131 * The NormalizedMeausure include an extra parameter R0, and the various cutoff 132 132 * measures include an Rcutoff, which effectively defines an angular cutoff 133 133 * similar in effect to a cone-jet radius. … … 138 138 public: 139 139 140 NjettinessPlugin(int N, 141 Njettiness::AxesMode axes_mode, 142 Njettiness::MeasureMode measure_mode, 143 double para1 = NAN, 144 double para2 = NAN, 145 double para3 = NAN, 146 double para4 = NAN); 140 // Constructor with same arguments as Nsubjettiness. 141 NjettinessPlugin(int N, 142 const AxesDefinition & axes_def, 143 const MeasureDefinition & measure_def) 144 : _njettinessFinder(axes_def, measure_def), _N(N) {} 145 146 147 // Alternative constructors that define the measure via enums and parameters 148 // These constructors are likely be removed 149 NjettinessPlugin(int N, 150 Njettiness::AxesMode axes_mode, 151 Njettiness::MeasureMode measure_mode) 152 : _njettinessFinder(axes_mode, measure_mode, 0), _N(N) {} 153 154 155 NjettinessPlugin(int N, 156 Njettiness::AxesMode axes_mode, 157 Njettiness::MeasureMode measure_mode, 158 double para1) 159 : _njettinessFinder(axes_mode, measure_mode, 1, para1), _N(N) {} 160 161 162 NjettinessPlugin(int N, 163 Njettiness::AxesMode axes_mode, 164 Njettiness::MeasureMode measure_mode, 165 double para1, 166 double para2) 167 : _njettinessFinder(axes_mode, measure_mode, 2, para1, para2), _N(N) {} 168 169 170 NjettinessPlugin(int N, 171 Njettiness::AxesMode axes_mode, 172 Njettiness::MeasureMode measure_mode, 173 double para1, 174 double para2, 175 double para3) 176 : _njettinessFinder(axes_mode, measure_mode, 3, para1, para2, para3), _N(N) {} 177 147 178 148 179 // Old constructor for backwards compatibility with v1.0, 149 // where normalized_cutoff_measure was the only option180 // where NormalizedCutoffMeasure was the only option 150 181 NjettinessPlugin(int N, 151 182 Njettiness::AxesMode mode, 152 183 double beta, 153 184 double R0, 154 double Rcutoff=std::numeric_limits<double>::max()); 185 double Rcutoff=std::numeric_limits<double>::max()) 186 : _njettinessFinder(mode, NormalizedCutoffMeasure(beta, R0, Rcutoff)), _N(N) {} 187 155 188 156 189 … … 164 197 private: 165 198 199 Njettiness _njettinessFinder; 166 200 int _N; 167 mutable Njettiness _njettinessFinder; // TODO: should muck with this so run_clustering can be const without this mutable168 201 169 202 };
Note:
See TracChangeset
for help on using the changeset viewer.