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;
double _median_rho
background estimated density per unit area
void _compute()
do the actual job
unsigned int _n_jets_excluded
number of jets that have explicitly been excluded
double _empty_area
the empty (pure-ghost/unclustered) area!
const RangeDefinition & _range
range to compute the background in
unsigned int _n_jets_used
number of jets used to estimate the background
bool _uptodate
true when the background computation is up-to-date
~BackgroundEstimator()
default dtor
std::vector< PseudoJet > _excluded_jets
jets to be excluded
bool _all_from_inclusive
when true, we'll assume that the incl jets are the complete set
BackgroundEstimator(const ClusterSequenceAreaBase &csa, const RangeDefinition &range)
double _sigma
background estimated fluctuations
double _mean_area
mean area of the jets used to estimate the background
const ClusterSequenceAreaBase & _csa
cluster sequence to get jets and areas from
std::vector< PseudoJet > _included_jets
jets to be used
void set_use_area_4vector(bool use_it=true)
double _n_empty_jets
number of empty (pure-ghost) jets