CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
10 
43 public:
47  BackgroundEstimator(const ClusterSequenceAreaBase &csa, const RangeDefinition &range);
48 
51 
52  // retrieving information
53  //-----------------------
54 
56  double median_rho(){
58  return _median_rho;
59  }
60 
62  double rho() {return median_rho();}
63 
65  double sigma() {
67  return _sigma;
68  }
69 
71  double mean_area(){
73  return _mean_area;
74  }
75 
77  unsigned int n_jets_used(){
79  return _n_jets_used;
80  }
81 
84  unsigned int n_jets_excluded(){
86  return _n_jets_excluded;
87  }
88 
92  double n_empty_jets(){
94  return _n_empty_jets;
95  }
96 
99  double empty_area(){
101  return _empty_area;
102  }
103 
104  // configuring behaviour
105  //----------------------
106 
109  void reset();
110 
113  void set_use_area_4vector(bool use_it = true){
114  _use_area_4vector = use_it;
115  }
116 
125  void set_included_jets(const std::vector<PseudoJet> &included_jets, bool all_from_inclusive = true){
126  _included_jets = included_jets;
127  _all_from_inclusive = all_from_inclusive;
128  _uptodate = false;
129  }
130 
133  void set_excluded_jets(const std::vector<PseudoJet> &excluded_jets){
134  _excluded_jets = excluded_jets;
135  _uptodate = false;
136  }
137 
138 private:
140  void _compute();
141 
145  if (!_uptodate)
146  _compute();
147  _uptodate = true;
148  }
149 
150  // the information needed to do the computation
151  const ClusterSequenceAreaBase &_csa;
152  const RangeDefinition &_range;
153  std::vector<PseudoJet> _included_jets;
154  std::vector<PseudoJet> _excluded_jets;
157 
158  // the actual results of the computation
159  double _median_rho;
160  double _sigma;
161  double _mean_area;
162  unsigned int _n_jets_used;
163  unsigned int _n_jets_excluded;
164  double _n_empty_jets;
165  double _empty_area;
166 
167  // internal variables
168  bool _uptodate;
169 };
170 
171 } // namespace
172 
173 #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