LDMX Software
ClusterAlgoResult.h
Go to the documentation of this file.
1
8#ifndef EVENT_CLUSTERALGORESULT_H_
9#define EVENT_CLUSTERALGORESULT_H_
10
11// ROOT
12#include "TArrayD.h"
13#include "TString.h"
14
15// STL
16#include <iostream>
17
18namespace ldmx {
19
25 public:
29 ClusterAlgoResult() = default;
30
34 virtual ~ClusterAlgoResult();
35
39 friend std::ostream& operator<<(std::ostream& o, const ClusterAlgoResult& d);
40
44 void clear();
45
50 const TString& getName() const { return name_; }
51
57 double getAlgoVar(int element) const { return variables_[element]; }
58
64 double getAlgoVar0() const {
65 return (variables_.GetSize() < 1) ? (0) : (variables_[0]);
66 }
67
73 double getAlgoVar1() const {
74 return (variables_.GetSize() < 2) ? (0) : (variables_[1]);
75 }
76
82 double getAlgoVar2() const {
83 return (variables_.GetSize() < 3) ? (0) : (variables_[2]);
84 }
85
91 double getAlgoVar3() const {
92 return (variables_.GetSize() < 4) ? (0) : (variables_[3]);
93 }
94
100 double getAlgoVar4() const {
101 return (variables_.GetSize() < 5) ? (0) : (variables_[4]);
102 }
103
108 double getWeight(int nCluster) const {
109 return (nCluster < weights_.GetSize()) ? (0) : (weights_[nCluster]);
110 }
111
117 void set(const TString& name, int nvar);
118
125 void set(const TString& name, int nvar, int nweights);
126
132 void setAlgoVar(int element, double value);
133
139 void setWeight(int nClusters, double weight);
140
141 private:
143 TString name_{};
144
145 /* Algorithm variable results from the cluster algo. */
146 TArrayD variables_;
147
148 /* Array of weights when a certain number of clusters is reached. */
149 TArrayD weights_;
150
151 ClassDef(ClusterAlgoResult, 2);
152};
153} // namespace ldmx
154
155#endif
Contains details about the clustering algorithm.
const TString & getName() const
Return the name of the cluster algo.
TString name_
Name of the clustering algorithm.
friend std::ostream & operator<<(std::ostream &o, const ClusterAlgoResult &d)
Print a description of this object.
double getWeight(int nCluster) const
Return the weight reached when cluster count reached n.
virtual ~ClusterAlgoResult()
Class destructor.
void setAlgoVar(int element, double value)
Set an algorithm variable.
void clear()
Reset the ClusterAlgoResult object.
double getAlgoVar1() const
Return algorithm variable 1 (see algorithm code for details).
double getAlgoVar3() const
Return algorithm variable 3 (see algorithm code for details).
void set(const TString &name, int nvar)
Set name and number of variables of cluster algo.
double getAlgoVar4() const
Return algorithm variable 4 (see algorithm code for details).
double getAlgoVar2() const
Return algorithm variable 2 (see algorithm code for details).
void setWeight(int nClusters, double weight)
Set a weight when number of clusters reached.
ClusterAlgoResult()=default
Class constructor.
double getAlgoVar0() const
Return algorithm variable 0 (see algorithm code for details).
double getAlgoVar(int element) const
Return algorithm variable i (see algorithm code for details).