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
6{
7 // Default constructor for TGRSITransition
8 Clear();
9}
10
11void TGRSITransition::Print(Option_t*) const
12{
13 // Prints information about the TGRSITransition
14 std::cout << "**************************" << std::endl;
15 std::cout << "TGRSITransition:" << std::endl;
16 std::cout << "Energy: " << fEnergy << " +/- " << fEnergyUncertainty << std::endl;
17 std::cout << "Intensity: " << fIntensity << " +/- " << fIntensityUncertainty << std::endl;
18 std::cout << "**************************" << std::endl;
19}
20
22{
23 // Writes transitions in a way that is nicer to ourput.
24 std::string buffer;
25 buffer.append(Form("%lf\t", fEnergy));
26 buffer.append(Form("%lf\t", fEnergyUncertainty));
27 buffer.append(Form("%lf\t", fIntensity));
28 buffer.append(Form("%lf\t", fIntensityUncertainty));
29 return buffer;
30}
31
33{
34 // Clears TGRSITransition
35 fEnergy = 0.;
37 fIntensity = 0.;
39}
40
41int TGRSITransition::Compare(const TObject* obj) const
42{
43 // Compares the intensities of the TGRSITransitions and returns
44 //-1 if this > obj
45 // 0 if this == obj
46 // 1 if this < obj
47 if(fIntensity > static_cast<const TGRSITransition*>(obj)->fIntensity) {
48 return -1;
49 }
50 if(fIntensity == static_cast<const TGRSITransition*>(obj)->fIntensity) {
51 return 0;
52 } //(fIntensity < static_cast<const TGRSITransition*>(obj)->fIntensity)
53 return 1;
54
55 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)
56 return -9;
57}
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