2 #include <fastjet/ClusterSequenceAreaBase.hh>
5 using namespace fastjet;
25 : _csa(csa), _range(range){
66 vector<double> pt_over_areas;
67 double total_area = 0.0;
77 bool excluded =
false;
78 int ref_idx = current_jet.cluster_hist_index();
83 if (
_range.is_in_range(current_jet)){
89 ?
_csa.area_4vector(current_jet).perp()
90 :
_csa.area(current_jet);
92 pt_over_areas.push_back(current_jet.perp()/this_area);
93 total_area += this_area;
100 if (pt_over_areas.size() == 0) {
110 sort(pt_over_areas.begin(), pt_over_areas.end());
115 if (
_csa.has_explicit_ghosts()) {
133 double posn[2] = {0.5, (1.0-0.6827)/2.0};
136 for (
int i = 0;
i < 2;
i++) {
137 double nj_median_pos = (total_njets-1)*posn[
i] - _n_empty_jets;
138 double nj_median_ratio;
139 if (nj_median_pos >= 0 && pt_over_areas.size() > 1) {
140 int int_nj_median = int(nj_median_pos);
142 pt_over_areas[int_nj_median] * (int_nj_median+1-nj_median_pos)
143 + pt_over_areas[int_nj_median+1] * (nj_median_pos - int_nj_median);
145 nj_median_ratio = 0.0;
147 res[
i] = nj_median_ratio;
151 double error = res[0] - res[1];
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