LDMX Software
ldmx::ClusterAlgoResult Class Reference

Contains details about the clustering algorithm. More...

#include <ClusterAlgoResult.h>

Public Member Functions

 ClusterAlgoResult ()=default
 Class constructor.
 
virtual ~ClusterAlgoResult ()
 Class destructor.
 
void clear ()
 Reset the ClusterAlgoResult object.
 
const TString & getName () const
 Return the name of the cluster algo.
 
double getAlgoVar (int element) const
 Return algorithm variable i (see algorithm code for details).
 
double getAlgoVar0 () const
 Return algorithm variable 0 (see algorithm code for details).
 
double getAlgoVar1 () const
 Return algorithm variable 1 (see algorithm code for details).
 
double getAlgoVar2 () const
 Return algorithm variable 2 (see algorithm code for details).
 
double getAlgoVar3 () const
 Return algorithm variable 3 (see algorithm code for details).
 
double getAlgoVar4 () const
 Return algorithm variable 4 (see algorithm code for details).
 
double getWeight (int nCluster) const
 Return the weight reached when cluster count reached n.
 
void set (const TString &name, int nvar)
 Set name and number of variables of cluster algo.
 
void set (const TString &name, int nvar, int nweights)
 Set name, number of variables and weights of cluster algo.
 
void setAlgoVar (int element, double value)
 Set an algorithm variable.
 
void setWeight (int nClusters, double weight)
 Set a weight when number of clusters reached.
 

Private Member Functions

 ClassDef (ClusterAlgoResult, 2)
 

Private Attributes

TString name_ {}
 Name of the clustering algorithm.
 
TArrayD variables_
 
TArrayD weights_
 

Friends

std::ostream & operator<< (std::ostream &o, const ClusterAlgoResult &d)
 Print a description of this object.
 

Detailed Description

Contains details about the clustering algorithm.

Definition at line 25 of file ClusterAlgoResult.h.

Constructor & Destructor Documentation

◆ ~ClusterAlgoResult()

ldmx::ClusterAlgoResult::~ClusterAlgoResult ( )
virtual

Class destructor.

Definition at line 7 of file ClusterAlgoResult.cxx.

7{ clear(); }
void clear()
Reset the ClusterAlgoResult object.

References clear().

Member Function Documentation

◆ clear()

void ldmx::ClusterAlgoResult::clear ( )

Reset the ClusterAlgoResult object.

Definition at line 17 of file ClusterAlgoResult.cxx.

17 {
18 name_ = "";
19
20 for (int i = 0; i < variables_.GetSize(); ++i) {
21 variables_[i] = 0;
22 }
23}
TString name_
Name of the clustering algorithm.

References name_.

Referenced by ~ClusterAlgoResult().

◆ getAlgoVar()

double ldmx::ClusterAlgoResult::getAlgoVar ( int element) const
inline

Return algorithm variable i (see algorithm code for details).

Parameters
elementThe index of the variable.
Returns
Algorithm variable at the index.

Definition at line 58 of file ClusterAlgoResult.h.

58{ return variables_[element]; }

◆ getAlgoVar0()

double ldmx::ClusterAlgoResult::getAlgoVar0 ( ) const
inline

Return algorithm variable 0 (see algorithm code for details).

Note
Provided for interactive ROOT use.
Returns
Algorithm variable 0.

Definition at line 65 of file ClusterAlgoResult.h.

65 {
66 return (variables_.GetSize() < 1) ? (0) : (variables_[0]);
67 }

◆ getAlgoVar1()

double ldmx::ClusterAlgoResult::getAlgoVar1 ( ) const
inline

Return algorithm variable 1 (see algorithm code for details).

Note
Provided for interactive ROOT use.
Returns
Algorithm variable 1.

Definition at line 74 of file ClusterAlgoResult.h.

74 {
75 return (variables_.GetSize() < 2) ? (0) : (variables_[1]);
76 }

◆ getAlgoVar2()

double ldmx::ClusterAlgoResult::getAlgoVar2 ( ) const
inline

Return algorithm variable 2 (see algorithm code for details).

Note
Provided for interactive ROOT use.
Returns
Algorithm variable 2.

Definition at line 83 of file ClusterAlgoResult.h.

83 {
84 return (variables_.GetSize() < 3) ? (0) : (variables_[2]);
85 }

◆ getAlgoVar3()

double ldmx::ClusterAlgoResult::getAlgoVar3 ( ) const
inline

Return algorithm variable 3 (see algorithm code for details).

Note
Provided for interactive ROOT use.
Returns
Algorithm variable 3.

Definition at line 92 of file ClusterAlgoResult.h.

92 {
93 return (variables_.GetSize() < 4) ? (0) : (variables_[3]);
94 }

◆ getAlgoVar4()

double ldmx::ClusterAlgoResult::getAlgoVar4 ( ) const
inline

Return algorithm variable 4 (see algorithm code for details).

Note
Provided for interactive ROOT use.
Returns
Algorithm variable 4.

Definition at line 101 of file ClusterAlgoResult.h.

101 {
102 return (variables_.GetSize() < 5) ? (0) : (variables_[4]);
103 }

◆ getName()

const TString & ldmx::ClusterAlgoResult::getName ( ) const
inline

Return the name of the cluster algo.

Returns
The name of the cluster algo.

Definition at line 51 of file ClusterAlgoResult.h.

51{ return name_; }

References name_.

◆ getWeight()

double ldmx::ClusterAlgoResult::getWeight ( int nCluster) const
inline

Return the weight reached when cluster count reached n.

Returns
The weight from the cluster algorithm.

Definition at line 109 of file ClusterAlgoResult.h.

109 {
110 return (nCluster < weights_.GetSize()) ? (0) : (weights_[nCluster]);
111 }

◆ set() [1/2]

void ldmx::ClusterAlgoResult::set ( const TString & name,
int nvar )

Set name and number of variables of cluster algo.

Parameters
nameThe name of the cluster algo.
nvarThe number of algorithm variables.

Definition at line 25 of file ClusterAlgoResult.cxx.

25 {
26 name_ = name;
27
28 if (nvar > variables_.GetSize()) {
29 variables_.Set(nvar);
30 }
31}

References name_.

Referenced by ecal::EcalClusterProducer::produce().

◆ set() [2/2]

void ldmx::ClusterAlgoResult::set ( const TString & name,
int nvar,
int nweights )

Set name, number of variables and weights of cluster algo.

Parameters
nameThe name of the cluster algo.
nvarThe number of algorithm variables.
nweightsThe number of transition weights.

Definition at line 33 of file ClusterAlgoResult.cxx.

33 {
34 name_ = name;
35
36 if (nvar > variables_.GetSize()) {
37 variables_.Set(nvar);
38 }
39
40 if (nweights > weights_.GetSize()) {
41 weights_.Set(nweights);
42 }
43}

References name_.

◆ setAlgoVar()

void ldmx::ClusterAlgoResult::setAlgoVar ( int element,
double value )

Set an algorithm variable.

Parameters
elementThe index of the variable.
valueThe variable's new value.

Definition at line 45 of file ClusterAlgoResult.cxx.

45 {
46 if (element >= 0 && element < variables_.GetSize()) {
47 variables_[element] = value;
48 }
49}

Referenced by ecal::EcalClusterProducer::produce().

◆ setWeight()

void ldmx::ClusterAlgoResult::setWeight ( int nClusters,
double weight )

Set a weight when number of clusters reached.

Parameters
nClustersThe number of clusters reached.
weightThe weight when number of clusters reached.

Definition at line 51 of file ClusterAlgoResult.cxx.

51 {
52 if (nCluster >= 0 && nCluster < weights_.GetSize()) {
53 weights_[nCluster] = weight;
54 }
55}

Referenced by ecal::EcalClusterProducer::produce().

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & o,
const ClusterAlgoResult & d )
friend

Print a description of this object.

Definition at line 9 of file ClusterAlgoResult.cxx.

9 {
10 return o << "ClusterAlgoResult { " << "name: " << c.name_ << " }";
11
12 for (int i = 0; i < c.variables_.GetSize(); ++i) {
13 o << "Element " << i << " : " << c.variables_[i];
14 }
15}

Member Data Documentation

◆ name_

TString ldmx::ClusterAlgoResult::name_ {}
private

Name of the clustering algorithm.

Definition at line 144 of file ClusterAlgoResult.h.

144{};

Referenced by clear(), getName(), set(), and set().

◆ variables_

TArrayD ldmx::ClusterAlgoResult::variables_
private

Definition at line 147 of file ClusterAlgoResult.h.

◆ weights_

TArrayD ldmx::ClusterAlgoResult::weights_
private

Definition at line 150 of file ClusterAlgoResult.h.


The documentation for this class was generated from the following files: