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
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
fastjet::BackgroundEstimator::empty_area
double empty_area()
Definition: BackgroundEstimator.h:98
fastjet::BackgroundEstimator::set_excluded_jets
void set_excluded_jets(const std::vector< PseudoJet > &excluded_jets)
Definition: BackgroundEstimator.h:130
fastjet
Definition: BackgroundEstimator.h:8
fastjet::BackgroundEstimator::_n_jets_used
unsigned int _n_jets_used
number of jets used to estimate the background
Definition: BackgroundEstimator.h:159
fastjet::BackgroundEstimator::_sigma
double _sigma
background estimated fluctuations
Definition: BackgroundEstimator.h:157
fastjet::BackgroundEstimator::n_empty_jets
double n_empty_jets()
Definition: BackgroundEstimator.h:91
fastjet::BackgroundEstimator::set_use_area_4vector
void set_use_area_4vector(bool use_it=true)
Definition: BackgroundEstimator.h:112
fastjet::BackgroundEstimator::_use_area_4vector
bool _use_area_4vector
Definition: BackgroundEstimator.h:153
fastjet::BackgroundEstimator
Definition: BackgroundEstimator.h:41
fastjet::BackgroundEstimator::n_jets_used
unsigned int n_jets_used()
get the number of jets used to actually compute the background properties
Definition: BackgroundEstimator.h:76
fastjet::BackgroundEstimator::_median_rho
double _median_rho
background estimated density per unit area
Definition: BackgroundEstimator.h:156
fastjet::BackgroundEstimator::_csa
const ClusterSequenceAreaBase & _csa
cluster sequence to get jets and areas from
Definition: BackgroundEstimator.h:148
fastjet::BackgroundEstimator::_excluded_jets
std::vector< PseudoJet > _excluded_jets
jets to be excluded
Definition: BackgroundEstimator.h:151
fastjet::BackgroundEstimator::_all_from_inclusive
bool _all_from_inclusive
when true, we'll assume that the incl jets are the complete set
Definition: BackgroundEstimator.h:152
fastjet::BackgroundEstimator::mean_area
double mean_area()
get the median area of the jets used to actually compute the background properties
Definition: BackgroundEstimator.h:70
fastjet::BackgroundEstimator::set_included_jets
void set_included_jets(const std::vector< PseudoJet > &included_jets, bool all_from_inclusive=true)
Definition: BackgroundEstimator.h:122
fastjet::BackgroundEstimator::_recompute_if_needed
void _recompute_if_needed()
Definition: BackgroundEstimator.h:141
fastjet::BackgroundEstimator::_compute
void _compute()
do the actual job
Definition: BackgroundEstimator.cc:55
fastjet::BackgroundEstimator::_included_jets
std::vector< PseudoJet > _included_jets
jets to be used
Definition: BackgroundEstimator.h:150
fastjet::BackgroundEstimator::sigma
double sigma()
get the sigma
Definition: BackgroundEstimator.h:64
fastjet::BackgroundEstimator::reset
void reset()
Definition: BackgroundEstimator.cc:34
fastjet::BackgroundEstimator::_range
const RangeDefinition & _range
range to compute the background in
Definition: BackgroundEstimator.h:149
fastjet::BackgroundEstimator::_n_jets_excluded
unsigned int _n_jets_excluded
number of jets that have explicitly been excluded
Definition: BackgroundEstimator.h:160
fastjet::BackgroundEstimator::median_rho
double median_rho()
get the median rho
Definition: BackgroundEstimator.h:55
fastjet::BackgroundEstimator::_n_empty_jets
double _n_empty_jets
number of empty (pure-ghost) jets
Definition: BackgroundEstimator.h:161
fastjet::BackgroundEstimator::_empty_area
double _empty_area
the empty (pure-ghost/unclustered) area!
Definition: BackgroundEstimator.h:162
fastjet::BackgroundEstimator::_uptodate
bool _uptodate
true when the background computation is up-to-date
Definition: BackgroundEstimator.h:165
fastjet::BackgroundEstimator::BackgroundEstimator
BackgroundEstimator(const ClusterSequenceAreaBase &csa, const RangeDefinition &range)
Definition: BackgroundEstimator.cc:24
fastjet::BackgroundEstimator::n_jets_excluded
unsigned int n_jets_excluded()
Definition: BackgroundEstimator.h:83
fastjet::BackgroundEstimator::~BackgroundEstimator
~BackgroundEstimator()
default dtor
Definition: BackgroundEstimator.cc:30
fastjet::BackgroundEstimator::rho
double rho()
synonym for median rho [[do we have this? Both?]]
Definition: BackgroundEstimator.h:61
fastjet::BackgroundEstimator::_mean_area
double _mean_area
mean area of the jets used to estimate the background
Definition: BackgroundEstimator.h:158