CMS 3D CMS Logo

MassWindow.h
Go to the documentation of this file.
1 #ifndef MassWindow_h
2 #define MassWindow_h
3 
5 #include <vector>
6 
18 class MassWindow {
19 public:
20  MassWindow(const double& centralMass,
21  const double& lowerBound,
22  const double& upperBound,
23  const std::vector<unsigned int>& indexes,
25  : centralMass_(centralMass),
28  weightedEvents_(0.),
31  // Used to count the number of events in the window
32  void count(const double& mass, const double& weight = 1.) {
33  if (mass > lowerBound_ && mass < upperBound_) {
35  }
36  }
37  inline void resetCounter() { weightedEvents_ = 0; }
38  inline bool isIn(const double& mass) { return (mass > lowerBound_ && mass < upperBound_); }
39  inline double mass() const { return centralMass_; }
40  inline double lowerBound() const { return lowerBound_; }
41  inline double upperBound() const { return upperBound_; }
42  inline double events() const { return weightedEvents_; }
44  inline const std::vector<unsigned int>* indexes() const { return &indexes_; }
45 
46 protected:
47  double centralMass_;
48  double lowerBound_;
49  double upperBound_;
50  // Number of events in the window
52  // Indexes of the resonances in this window
53  std::vector<unsigned int> indexes_;
55 };
56 
57 #endif
bool isIn(const double &mass)
Definition: MassWindow.h:38
double centralMass_
Definition: MassWindow.h:47
double upperBound_
Definition: MassWindow.h:49
backgroundFunctionBase * backgroundFunction_
Definition: MassWindow.h:54
double events() const
Definition: MassWindow.h:42
Definition: weight.py:1
MassWindow(const double &centralMass, const double &lowerBound, const double &upperBound, const std::vector< unsigned int > &indexes, backgroundFunctionBase *backgroundFunction)
Definition: MassWindow.h:20
void count(const double &mass, const double &weight=1.)
Definition: MassWindow.h:32
const std::vector< unsigned int > * indexes() const
Definition: MassWindow.h:44
double weightedEvents_
Definition: MassWindow.h:51
double upperBound() const
Definition: MassWindow.h:41
double lowerBound() const
Definition: MassWindow.h:40
backgroundFunctionBase * backgroundFunction() const
Definition: MassWindow.h:43
std::vector< unsigned int > indexes_
Definition: MassWindow.h:53
void resetCounter()
Definition: MassWindow.h:37
double lowerBound_
Definition: MassWindow.h:48
double mass() const
Definition: MassWindow.h:39