BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnEventCentrality.h
Go to the documentation of this file.
1#ifndef BMNEVENTCENRALITY_H
2#define BMNEVENTCENRALITY_H
3
5#include <TNamed.h>
6#include <set>
7#include <vector>
8
9class BmnEventCentrality : public TNamed
10{
11 public:
12 // Comparison operator for Class
13 struct Comparator
14 {
15 bool operator()(const BmnCentralityClass& lhs, const BmnCentralityClass& rhs) const
16 {
17 if (lhs.GetIndex() != rhs.GetIndex()) {
18 return lhs.GetIndex() < rhs.GetIndex();
19 }
20 return static_cast<int>(lhs.GetMethod()) < static_cast<int>(rhs.GetMethod());
21 }
22 };
23
28
29 int GetClass() const; // Return index of most probable class with default method
30 float GetProbability() const; // Return index of most probable class with default method
31 const std::vector<float>& GetSoftCentrality()
32 const; // Return vector of probabilities of all classes with default method
33
34 int GetClass(BmnCentralityClass::Method method) const; // Return index of most probable class with selected method
36 BmnCentralityClass::Method method) const; // Return index of most probable class with selected method
37 const std::vector<float>& GetSoftCentrality(BmnCentralityClass::Method method)
38 const; // Return vector of probabilities of all classes with selected method
39
40 void SetCentrality(int cluster_id, float probability, BmnCentralityClass::Method method);
41
42 void Reset();
43
44 private:
45 std::set<BmnCentralityClass, Comparator> fClassProbability;
46 std::pair<int, float> GetClassProbabilityPair(
47 BmnCentralityClass::Method method) const; // Return pair of most probable class with selected method
48
50};
51
52#endif // BMNEVENTCENRALITY_H
#define ClassDef(name, id)
const std::vector< float > & GetSoftCentrality() const
const std::vector< float > & GetSoftCentrality(BmnCentralityClass::Method method) const
float GetProbability(BmnCentralityClass::Method method) const
void SetCentrality(int cluster_id, float probability, BmnCentralityClass::Method method)
int GetClass(BmnCentralityClass::Method method) const
int GetClass() const
std::pair< int, float > GetClassProbabilityPair(BmnCentralityClass::Method method) const
BmnEventCentrality(const BmnEventCentrality &other)
virtual ~BmnEventCentrality()
BmnEventCentrality & operator=(const BmnEventCentrality &other)
float GetProbability() const
std::set< BmnCentralityClass, Comparator > fClassProbability
bool operator()(const BmnCentralityClass &lhs, const BmnCentralityClass &rhs) const