test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MassWindow.h
Go to the documentation of this file.
1 #ifndef MassWindow_h
2 #define MassWindow_h
3 
5 #include <vector>
6 
19 {
20 public:
21  MassWindow(const double & centralMass, const double & lowerBound, const double & upperBound,
22  const std::vector<unsigned int> & indexes, backgroundFunctionBase * backgroundFunction) :
23  centralMass_(centralMass), lowerBound_(lowerBound), upperBound_(upperBound), weightedEvents_(0.),
24  indexes_(indexes), backgroundFunction_(backgroundFunction)
25  {}
26  // Used to count the number of events in the window
27  void count(const double & mass, const double & weight = 1.)
28  {
29  if( mass > lowerBound_ && mass < upperBound_ ) {
31  }
32  }
33  inline void resetCounter() { weightedEvents_ = 0; }
34  inline bool isIn(const double & mass) { return( mass > lowerBound_ && mass < upperBound_ ); }
35  inline double mass() const {return centralMass_;}
36  inline double lowerBound() const {return lowerBound_;}
37  inline double upperBound() const {return upperBound_;}
38  inline double events() const {return weightedEvents_;}
40  inline const std::vector<unsigned int> * indexes() const {return &indexes_;}
41 protected:
42  double centralMass_;
43  double lowerBound_;
44  double upperBound_;
45  // Number of events in the window
47  // Indexes of the resonances in this window
48  std::vector<unsigned int> indexes_;
50 };
51 
52 #endif
bool isIn(const double &mass)
Definition: MassWindow.h:34
double centralMass_
Definition: MassWindow.h:42
double mass() const
Definition: MassWindow.h:35
double upperBound_
Definition: MassWindow.h:44
backgroundFunctionBase * backgroundFunction_
Definition: MassWindow.h:49
double upperBound() const
Definition: MassWindow.h:37
MassWindow(const double &centralMass, const double &lowerBound, const double &upperBound, const std::vector< unsigned int > &indexes, backgroundFunctionBase *backgroundFunction)
Definition: MassWindow.h:21
double events() const
Definition: MassWindow.h:38
void count(const double &mass, const double &weight=1.)
Definition: MassWindow.h:27
double weightedEvents_
Definition: MassWindow.h:46
double lowerBound() const
Definition: MassWindow.h:36
std::vector< unsigned int > indexes_
Definition: MassWindow.h:48
const std::vector< unsigned int > * indexes() const
Definition: MassWindow.h:40
void resetCounter()
Definition: MassWindow.h:33
backgroundFunctionBase * backgroundFunction() const
Definition: MassWindow.h:39
double lowerBound_
Definition: MassWindow.h:43