2 #include <fastjet/ClusterSequenceAreaBase.hh>
25 : _csa(csa), _range(
range) {
63 vector<double> pt_over_areas;
64 double total_area = 0.0;
74 bool excluded =
false;
75 int ref_idx = current_jet.cluster_hist_index();
80 if (
_range.is_in_range(current_jet)) {
87 pt_over_areas.push_back(current_jet.perp() / this_area);
88 total_area += this_area;
95 if (pt_over_areas.empty()) {
105 sort(pt_over_areas.begin(), pt_over_areas.end());
110 if (
_csa.has_explicit_ghosts()) {
127 double posn[2] = {0.5, (1.0 - 0.6827) / 2.0};
130 for (
int i = 0;
i < 2;
i++) {
131 double nj_median_pos = (total_njets - 1) * posn[
i] -
_n_empty_jets;
132 double nj_median_ratio;
133 if (nj_median_pos >= 0 && pt_over_areas.size() > 1) {
134 int int_nj_median =
int(nj_median_pos);
135 nj_median_ratio = pt_over_areas[int_nj_median] * (int_nj_median + 1 - nj_median_pos) +
136 pt_over_areas[int_nj_median + 1] * (nj_median_pos - int_nj_median);
138 nj_median_ratio = 0.0;
140 res[
i] = nj_median_ratio;