BmnRoot
Loading...
Searching...
No Matches
BmnCentralityClass.cxx
Go to the documentation of this file.
1
7
8#include <utility>
9
10// Constructor
12 : index(0)
13 , probability(0.0)
14 , method(Method::FHCalHodo)
15{}
16
17// Constructor with parameters
18BmnCentralityClass::BmnCentralityClass(int index_, float probability_, Method method_)
19 : index(index_)
20 , probability(probability_)
21 , method(method_)
22{}
23
24// Copy constructor
26 : index(other.index)
27 , probability(other.probability)
28 , method(other.method)
29{}
30
31// Move constructor
33 : index(std::move(other.index))
34 , probability(std::move(other.probability))
35 , method(std::move(other.method))
36{}
37
38// Copy assignment operator
40{
41 if (this != &other) {
42 index = other.index;
43 probability = other.probability;
44 method = other.method;
45 }
46 return *this;
47}
48
49// Move assignment operator
51{
52 if (this != &other) {
53 index = std::move(other.index);
54 probability = std::move(other.probability);
55 method = std::move(other.method);
56 }
57 return *this;
58}
59
61{
62 if (this->GetIndex() != other.GetIndex()) {
63 return this->GetIndex() < other.GetIndex();
64 }
65 return static_cast<int>(this->GetMethod()) < static_cast<int>(other.GetMethod());
66}
67
68// Destructor
70
71// Getter for index
73{
74 return index;
75}
76
77// Setter for index
79{
80 this->index = index_;
81}
82
83// Getter for probability
85{
86 return probability;
87}
88
89// Setter for probability
90void BmnCentralityClass::SetProbability(float probability_)
91{
92 this->probability = probability_;
93}
94
95// Getter for method
100
101// Setter for method
103{
104 this->method = method_;
105}
106
107// Reset method
109{
110 index = 0;
111 probability = 0.0;
112 method = Method::FHCalHodo;
113}
BmnCentralityClass & operator=(const BmnCentralityClass &other)
bool operator<(const BmnCentralityClass &other) const
void SetMethod(Method method)
void SetProbability(float probability)
STL namespace.