GamR  0.0.0
GammaROOT
Loading...
Searching...
No Matches
State.hh
Go to the documentation of this file.
1#ifndef GAMR_NUCLEUS_STATE_HH
2#define GAMR_NUCLEUS_STATE_HH
3
4/* ROOT */
5#include <Rtypes.h>
6#include <TNamed.h>
7
8namespace GamR {
9namespace Nucleus {
10
11class State : public TNamed {
12private:
13 Float_t fEnergy;
14 Float_t fMeanlife;
15 Char_t fSpin2;
16 Bool_t fParity;
17
18public:
19 // Constructors
20 State(Float_t E = 0, Char_t J2 = 0, Bool_t P = 0, Float_t T = 0)
21 : fEnergy(E), fMeanlife(T), fSpin2(J2), fParity(P){};
22
23 // Setters
24 void SetEnergy(Float_t E) { fEnergy = E; };
25 void SetSpin(Float_t J) { fSpin2 = static_cast<Char_t>(2 * J); };
26 void SetSpin(Char_t J) { fSpin2 = 2 * J; }
27 void SetPositive() { fParity = kFALSE; };
28 void SetNegative() { fParity = kTRUE; };
29
30 // Getters
31 Float_t GetEnergy() { return fEnergy; }
32 Char_t Get2J() { return fSpin2; };
33 Double_t GetMeanlife() { return fMeanlife; };
34
35 // Functions
36 Bool_t IsNegative() { return fParity; };
37 Bool_t IsPositive() { return !fParity; };
38
39 // Operators
40 Bool_t operator==(const State &o) const
41 {
42 return (fEnergy == o.fEnergy) && (fSpin2 == o.fSpin2) && (fParity == o.fParity);
43 };
44 Bool_t operator!=(const State &other) const { return !(*this == other); };
45 Bool_t operator<(const State &other) const { return fEnergy < other.fEnergy; };
46 Bool_t operator>(const State &other) const { return !(*this < other); };
47
49};
50
51} // namespace Nucleus
52} // namespace GamR
53
54#endif
void SetSpin(Float_t J)
Definition State.hh:25
State(Float_t E=0, Char_t J2=0, Bool_t P=0, Float_t T=0)
Definition State.hh:20
Double_t GetMeanlife()
Definition State.hh:33
Bool_t operator<(const State &other) const
Definition State.hh:45
Bool_t IsPositive()
Definition State.hh:37
Bool_t operator>(const State &other) const
Definition State.hh:46
void SetEnergy(Float_t E)
Definition State.hh:24
Bool_t operator!=(const State &other) const
Definition State.hh:44
Float_t GetEnergy()
Definition State.hh:31
Bool_t operator==(const State &o) const
Definition State.hh:40
void SetSpin(Char_t J)
Definition State.hh:26
Bool_t IsNegative()
Definition State.hh:36
Definition Gain.cc:19