CMS 3D CMS Logo

BackgroundEstimator.h
Go to the documentation of this file.
1 #ifndef __FASTJET_BACKGROUND_EXTRACTOR_HH__
2 #define __FASTJET_BACKGROUND_EXTRACTOR_HH__
3 
4 #include <fastjet/ClusterSequenceAreaBase.hh>
5 #include <fastjet/RangeDefinition.hh>
6 #include <iostream>
7 
8 namespace fastjet {
9 
42  public:
46  BackgroundEstimator(const ClusterSequenceAreaBase &csa, const RangeDefinition &range);
47 
50 
51  // retrieving information
52  //-----------------------
53 
55  double median_rho() {
57  return _median_rho;
58  }
59 
61  double rho() { return median_rho(); }
62 
64  double sigma() {
66  return _sigma;
67  }
68 
70  double mean_area() {
72  return _mean_area;
73  }
74 
76  unsigned int n_jets_used() {
78  return _n_jets_used;
79  }
80 
83  unsigned int n_jets_excluded() {
85  return _n_jets_excluded;
86  }
87 
91  double n_empty_jets() {
93  return _n_empty_jets;
94  }
95 
98  double empty_area() {
100  return _empty_area;
101  }
102 
103  // configuring behaviour
104  //----------------------
105 
108  void reset();
109 
112  void set_use_area_4vector(bool use_it = true) { _use_area_4vector = use_it; }
113 
122  void set_included_jets(const std::vector<PseudoJet> &included_jets, bool all_from_inclusive = true) {
123  _included_jets = included_jets;
124  _all_from_inclusive = all_from_inclusive;
125  _uptodate = false;
126  }
127 
130  void set_excluded_jets(const std::vector<PseudoJet> &excluded_jets) {
131  _excluded_jets = excluded_jets;
132  _uptodate = false;
133  }
134 
135  private:
137  void _compute();
138 
142  if (!_uptodate)
143  _compute();
144  _uptodate = true;
145  }
146 
147  // the information needed to do the computation
148  const ClusterSequenceAreaBase &_csa;
149  const RangeDefinition &_range;
150  std::vector<PseudoJet> _included_jets;
151  std::vector<PseudoJet> _excluded_jets;
154 
155  // the actual results of the computation
156  double _median_rho;
157  double _sigma;
158  double _mean_area;
159  unsigned int _n_jets_used;
160  unsigned int _n_jets_excluded;
161  double _n_empty_jets;
162  double _empty_area;
163 
164  // internal variables
165  bool _uptodate;
166  };
167 
168 } // namespace fastjet
169 
170 #endif
double _median_rho
background estimated density per unit area
double median_rho()
get the median rho
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
void set_excluded_jets(const std::vector< PseudoJet > &excluded_jets)
std::vector< PseudoJet > _excluded_jets
jets to be excluded
bool _all_from_inclusive
when true, we&#39;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
unsigned int n_jets_used()
get the number of jets used to actually compute the background properties
void set_included_jets(const std::vector< PseudoJet > &included_jets, bool all_from_inclusive=true)
double rho()
synonym for median rho [[do we have this? Both?]]
double mean_area()
get the median area of the jets used to actually compute the background properties ...
double sigma()
get the sigma
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