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
MassWindow::weightedEvents_
double weightedEvents_
Definition: MassWindow.h:51
MassWindow::count
void count(const double &mass, const double &weight=1.)
Definition: MassWindow.h:32
MassWindow::upperBound
double upperBound() const
Definition: MassWindow.h:41
MassWindow::mass
double mass() const
Definition: MassWindow.h:39
mps_merge.weight
weight
Definition: mps_merge.py:88
backgroundFunctionBase
Definition: Functions.h:1368
MassWindow::lowerBound
double lowerBound() const
Definition: MassWindow.h:40
MassWindow::backgroundFunction
backgroundFunctionBase * backgroundFunction() const
Definition: MassWindow.h:43
MassWindow::upperBound_
double upperBound_
Definition: MassWindow.h:49
MassWindow::events
double events() const
Definition: MassWindow.h:42
MassWindow::indexes_
std::vector< unsigned int > indexes_
Definition: MassWindow.h:53
MassWindow::MassWindow
MassWindow(const double &centralMass, const double &lowerBound, const double &upperBound, const std::vector< unsigned int > &indexes, backgroundFunctionBase *backgroundFunction)
Definition: MassWindow.h:20
MassWindow::backgroundFunction_
backgroundFunctionBase * backgroundFunction_
Definition: MassWindow.h:54
MassWindow::centralMass_
double centralMass_
Definition: MassWindow.h:47
MassWindow::isIn
bool isIn(const double &mass)
Definition: MassWindow.h:38
MassWindow
Definition: MassWindow.h:18
Functions.h
MassWindow::indexes
const std::vector< unsigned int > * indexes() const
Definition: MassWindow.h:44
MassWindow::resetCounter
void resetCounter()
Definition: MassWindow.h:37
weight
Definition: weight.py:1
MassWindow::lowerBound_
double lowerBound_
Definition: MassWindow.h:48