GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TGRSITransition.cxx
Go to the documentation of this file.
1#include "TGRSITransition.h"
2
3#include <iostream>
4
5#include "TString.h"
6
8{
9 // Default constructor for TGRSITransition
10 Clear();
11}
12
13void TGRSITransition::Print(Option_t*) const
14{
15 // Prints information about the TGRSITransition
16 std::cout << "**************************" << std::endl;
17 std::cout << "TGRSITransition:" << std::endl;
18 std::cout << "Energy: " << fEnergy << " +/- " << fEnergyUncertainty << std::endl;
19 std::cout << "Intensity: " << fIntensity << " +/- " << fIntensityUncertainty << std::endl;
20 std::cout << "**************************" << std::endl;
21}
22
24{
25 // Writes transitions in a way that is nicer to ourput.
26 std::string buffer;
27 buffer.append(Form("%lf\t", fEnergy));
28 buffer.append(Form("%lf\t", fEnergyUncertainty));
29 buffer.append(Form("%lf\t", fIntensity));
30 buffer.append(Form("%lf\t", fIntensityUncertainty));
31 return buffer;
32}
33
35{
36 // Clears TGRSITransition
37 fEnergy = 0.;
39 fIntensity = 0.;
41}
42
43int TGRSITransition::Compare(const TObject* obj) const
44{
45 // Compares the intensities of the TGRSITransitions and returns
46 //-1 if this > obj
47 // 0 if this == obj
48 // 1 if this < obj
49 if(fIntensity > static_cast<const TGRSITransition*>(obj)->fIntensity) {
50 return -1;
51 }
52 if(fIntensity == static_cast<const TGRSITransition*>(obj)->fIntensity) {
53 return 0;
54 } //(fIntensity < static_cast<const TGRSITransition*>(obj)->fIntensity)
55 return 1;
56
57 std::cout << __PRETTY_FUNCTION__ << ": Error, intensity neither greater, nor equal, nor smaller than provided intensity!" << std::endl; // NOLINT(cppcoreguidelines-pro-type-const-cast, cppcoreguidelines-pro-bounds-array-to-pointer-decay)
58 return -9;
59}
void Clear(Option_t *opt="") override
int Compare(const TObject *obj) const override
void Print(Option_t *opt="") const override
double fIntensityUncertainty
std::string PrintToString() const