LOGO

RestFrames  v1.0.1
RestFrames HEP Event Analysis Software Library
HistPlotVar.hh
Go to the documentation of this file.
1 // RestFrames: particle physics event analysis library
3 // --------------------------------------------------------------------
4 // Copyright (c) 2014-2019, Christopher Rogan
14 // This file is part of RestFrames.
15 //
16 // RestFrames is free software; you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation; either version 2 of the License, or
19 // (at your option) any later version.
20 //
21 // RestFrames is distributed in the hope that it will be useful,
22 // but WITHOUT ANY WARRANTY; without even the implied warranty of
23 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 // GNU General Public License for more details.
25 //
26 // You should have received a copy of the GNU General Public License
27 // along with RestFrames. If not, see <http://www.gnu.org/licenses/>.
29 
30 #ifndef HistPlotVar_HH
31 #define HistPlotVar_HH
32 
33 #include "RestFrames/RFBase.hh"
34 
35 namespace RestFrames {
36 
38  // HistPlotVar class
40  class HistPlotVar : public RFBase {
41 
42  public:
43 
51  HistPlotVar(const std::string& name,
52  const std::string& title,
53  double minval, double maxval,
54  const std::string& unit);
55 
57  HistPlotVar();
58  ~HistPlotVar();
59 
63  void operator = (double val) const;
64 
70  void operator += (double val) const;
71 
77  void operator -= (double val) const;
78 
84  void operator *= (double val) const;
85 
91  void operator /= (double val) const;
92 
94  operator double() const;
95 
99  double GetVal() const;
100 
104  double GetMin() const;
105 
109  double GetMax() const;
110 
114  std::string GetUnit() const;
115 
119  static HistPlotVar& Empty();
120 
121  private:
123  static int m_class_key;
124 
125  std::string m_Unit;
126  double m_Min;
127  double m_Max;
128  mutable double m_Val;
129 
130  static HistPlotVar m_Empty;
131 
132  };
133 
134 }
135 
136 #endif
137 
RestFrames::HistPlotVar::operator*=
void operator*=(double val) const
Operator to multiply val to this object's value.
Definition: HistPlotVar.cc:69
RestFrames::HistPlotVar::GetVal
double GetVal() const
Returns this object's value.
Definition: HistPlotVar.cc:81
RestFrames::HistPlotVar::GetMin
double GetMin() const
Returns minimum value of histogram.
Definition: HistPlotVar.cc:89
RestFrames::RFBase
Base class for all RestFrame package objects.
Definition: RFBase.hh:53
RestFrames::HistPlotVar::operator-=
void operator-=(double val) const
Operator to substract val from this object's value.
Definition: HistPlotVar.cc:65
RestFrames::HistPlotVar::Empty
static HistPlotVar & Empty()
Returns empty HistPlotVar.
Definition: HistPlotVar.cc:53
RestFrames::HistPlotVar::HistPlotVar
HistPlotVar()
Empty constructor.
Definition: HistPlotVar.cc:36
RFBase.hh
RestFrames::HistPlotVar::GetUnit
std::string GetUnit() const
Returns unit of x-axis.
Definition: HistPlotVar.cc:85
RestFrames::HistPlotVar::operator/=
void operator/=(double val) const
Operator to divide val from object's value.
Definition: HistPlotVar.cc:73
RestFrames::HistPlotVar::operator+=
void operator+=(double val) const
Operator to add val to this object's value.
Definition: HistPlotVar.cc:61
RestFrames::HistPlotVar::GetMax
double GetMax() const
Returns maximum value of histogram.
Definition: HistPlotVar.cc:93
RestFrames::HistPlotVar
Definition: HistPlotVar.hh:40
RestFrames::HistPlotVar::operator=
void operator=(double val) const
Tests whether val is the same as this object's value.
Definition: HistPlotVar.cc:57