LOGO

RestFrames  v1.0.1
RestFrames HEP Event Analysis Software Library
HistPlotVar.cc
Go to the documentation of this file.
1 // RestFrames: particle physics event analysis library
3 // --------------------------------------------------------------------
4 // Copyright (c) 2014-2016, 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 
31 
32 namespace RestFrames {
33 
34  int HistPlotVar::m_class_key = 0;
35 
37  {
38  m_Log.SetSource("HistPlotVar "+GetName());
39  }
40 
41  HistPlotVar::HistPlotVar(const std::string& name,
42  const std::string& title,
43  double minval, double maxval,
44  const std::string& unit = "")
45  : RFBase(name, title, HistPlotVar::m_class_key++),
46  m_Min(minval), m_Max(maxval), m_Unit(unit), m_Val(0.)
47  {
48  m_Log.SetSource("HistPlotVar "+GetName());
49  }
50 
51  HistPlotVar::~HistPlotVar() {}
52 
54  return HistPlotVar::m_Empty;
55  }
56 
57  void HistPlotVar::operator = (double val) const {
58  m_Val = val;
59  }
60 
61  void HistPlotVar::operator += (double val) const {
62  m_Val += val;
63  }
64 
65  void HistPlotVar::operator -= (double val) const {
66  m_Val -= val;
67  }
68 
69  void HistPlotVar::operator *= (double val) const {
70  m_Val *= val;
71  }
72 
73  void HistPlotVar::operator /= (double val) const {
74  m_Val /= val;
75  }
76 
77  HistPlotVar::operator double() const {
78  return m_Val;
79  }
80 
81  double HistPlotVar::GetVal() const {
82  return m_Val;
83  }
84 
85  std::string HistPlotVar::GetUnit() const {
86  return m_Unit;
87  }
88 
89  double HistPlotVar::GetMin() const {
90  return m_Min;
91  }
92 
93  double HistPlotVar::GetMax() const {
94  return m_Max;
95  }
96 
97  HistPlotVar HistPlotVar::m_Empty;
98 
99 }
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
RestFrames::RFBase::GetName
std::string GetName() const
Returns object name.
Definition: RFBase.cc:104
RestFrames::RFLog::SetSource
void SetSource(const std::string &source)
Sets name of instance that is associated with.
Definition: RFLog.cc:182
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
HistPlotVar.hh
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