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