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 
36  HistPlotVar::HistPlotVar() : RFBase()
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 
53  HistPlotVar& HistPlotVar::Empty(){
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 }
std::string GetName() const
Returns object name.
Definition: RFBase.cc:104