/home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/io/include/RAT/ObjDbl.hh Source File

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/io/include/RAT/ObjDbl.hh Source File
Ratpac-two
ObjDbl.hh
1 #ifndef __RAT_ObjDbl__
2 #define __RAT_ObjDbl__
3 
4 #include <TObject.h>
5 
6 namespace RAT {
7 
8 // TObject wrapper for a double so you can write it to a file
9 class ObjDbl : public TObject {
10  public:
11  ObjDbl() : TObject() { fVal = 0; };
12  ObjDbl(double val) : TObject() { fVal = val; };
13  ObjDbl(const ObjDbl &other) : TObject() { fVal = other.fVal; };
14  ObjDbl &operator=(const ObjDbl &rhs) {
15  fVal = rhs.fVal;
16  return *this;
17  };
18 
19  double GetDbl() const { return fVal; };
20  void SetDbl(double val) { fVal = val; };
21 
22  ObjDbl &operator=(const double &val) {
23  fVal = val;
24  return *this;
25  };
26  operator double() const { return fVal; };
27 
28  ClassDef(ObjDbl, 1);
29 
30  protected:
31  double fVal;
32 };
33 
34 } // namespace RAT
35 
36 #endif
Definition: ObjDbl.hh:9
Definition: CCCrossSecMessenger.hh:29