LDMX Software
ClusterAlgoResult.cxx
2
4
5 namespace ldmx {
7
9
10 void ClusterAlgoResult::Print() const {
11 std::cout << "ClusterAlgoResult { "
12 << "name: " << name_ << " }" << std::endl;
13
14 for (int i = 0; i < variables_.GetSize(); ++i) {
15 std::cout << "Element " << i << " : " << variables_[i] << std::endl;
16 }
17 }
18
20 name_ = "";
21
22 for (int i = 0; i < variables_.GetSize(); ++i) {
23 variables_[i] = 0;
24 }
25 }
26
27 void ClusterAlgoResult::set(const TString &name, int nvar) {
28 name_ = name;
29
30 if (nvar > variables_.GetSize()) {
31 variables_.Set(nvar);
32 }
33 }
34
35 void ClusterAlgoResult::set(const TString &name, int nvar, int nweights) {
36 name_ = name;
37
38 if (nvar > variables_.GetSize()) {
39 variables_.Set(nvar);
40 }
41
42 if (nweights > weights_.GetSize()) {
43 weights_.Set(nweights);
44 }
45 }
46
47 void ClusterAlgoResult::setAlgoVar(int element, double value) {
48 if (element >= 0 && element < variables_.GetSize()) {
49 variables_[element] = value;
50 }
51 }
52
53 void ClusterAlgoResult::setWeight(int nCluster, double weight) {
54 if (nCluster >= 0 && nCluster < weights_.GetSize()) {
55 weights_[nCluster] = weight;
56 }
57 }
58} // namespace ldmx
Class that holds details about the clustering algorithm as a whole.
Contains details about the clustering algorithm.
TString name_
Name of the clustering algorithm.
void setAlgoVar(int element, double value)
Set an algorithm variable.
virtual ~ClusterAlgoResult()
Class destructor.
ClusterAlgoResult()
Class constructor.
void set(const TString &name, int nvar)
Set name and number of variables of cluster algo.
void setWeight(int nClusters, double weight)
Set a weight when number of clusters reached.
void Clear()
Reset the ClusterAlgoResult object.
void Print() const
Print a description of this object.