ATLAS Offline Software
Loading...
Searching...
No Matches
HGTD::Cluster< T > Class Template Reference

#include <Clustering.h>

Collaboration diagram for HGTD::Cluster< T >:

Public Member Functions

 Cluster ()
 Cluster (const std::vector< double > &v, const std::vector< double > &v_sigma)
 Cluster (const std::vector< double > &v, const std::vector< double > &v_sigma, const T &entry)
void addEntry (const T &entry)
 Add an object of type T to the Cluster.
void addEntryVector (const std::vector< T > &entry_vector)
 This can be used to combine the subsets stored in two vertices all in once while merging.
const std::vector< T > & getEntries () const
 Return the objects that are part of the Cluster.
void setClusterValue (const std::vector< double > &v, const std::vector< double > &v_sigma)
 The value of a vertex has to be set manually.
std::vector< double > getValues () const
 Return the N-dimensional value of the Cluster.
const std::vector< double > & getSigmas () const
 Return the N-dimensional resolution of the Cluster.
int getNEntries () const
 Return the number of objects stored in the Cluster.
bool mergeStatus () const
 Return true if the Cluster is the result of a merge.
void setMergeStatus (bool status)
int getMergeIteration () const
void setMergeIteration (int iteration)
bool containsUnknowns () const
void setUnknownStatus (bool status)

Private Attributes

int m_debug_level = 0
std::vector< T > m_entries { }
double m_combined_value { }
double m_combined_sigma { }
std::vector< double > m_combined_value_vector { }
std::vector< double > m_combined_sigma_vector { }
bool m_was_merged = false
int m_merge_iteration = 0
bool m_contains_unknowns = false

Detailed Description

template<typename T>
class HGTD::Cluster< T >

Definition at line 30 of file Clustering.h.

Constructor & Destructor Documentation

◆ Cluster() [1/3]

template<class T>
HGTD::Cluster< T >::Cluster ( )

Definition at line 172 of file Clustering.h.

173 : m_combined_value(-999.), m_combined_sigma(-999.) {}
double m_combined_value
Definition Clustering.h:108
double m_combined_sigma
Definition Clustering.h:109

◆ Cluster() [2/3]

template<typename T>
HGTD::Cluster< T >::Cluster ( const std::vector< double > & v,
const std::vector< double > & v_sigma )

Definition at line 176 of file Clustering.h.

179
180 for (const auto &s : v_sigma) {
181 if (s < 0) {
182 m_contains_unknowns = true;
183 }
184 }
185}
std::vector< double > m_combined_sigma_vector
Definition Clustering.h:111
std::vector< double > m_combined_value_vector
Definition Clustering.h:110
bool m_contains_unknowns
Definition Clustering.h:114

◆ Cluster() [3/3]

template<typename T>
HGTD::Cluster< T >::Cluster ( const std::vector< double > & v,
const std::vector< double > & v_sigma,
const T & entry )

Definition at line 188 of file Clustering.h.

192
193 m_entries.push_back(entry);
194
195 for (const auto &s : v_sigma) {
196 if (s < 0) {
197 m_contains_unknowns = true;
198 }
199 }
200}
std::vector< T > m_entries
Definition Clustering.h:107

Member Function Documentation

◆ addEntry()

template<class T>
void HGTD::Cluster< T >::addEntry ( const T & entry)

Add an object of type T to the Cluster.

Parameters
[in]entryObject that should be added to the Cluster.

Definition at line 206 of file Clustering.h.

206 {
207 m_entries.push_back(entry);
208}

◆ addEntryVector()

template<class T>
void HGTD::Cluster< T >::addEntryVector ( const std::vector< T > & entry_vector)

This can be used to combine the subsets stored in two vertices all in once while merging.

Parameters
[in]entry_vectorVector of objects (usually extracted from vertex to be merged with).

Definition at line 215 of file Clustering.h.

215 {
216 if (not entry_vector.empty()) {
217 m_entries.insert(m_entries.end(), entry_vector.begin(), entry_vector.end());
218 }
219}

◆ containsUnknowns()

template<class T>
bool HGTD::Cluster< T >::containsUnknowns ( ) const

Definition at line 258 of file Clustering.h.

258 {
259 return m_contains_unknowns;
260}

◆ getEntries()

template<class T>
const std::vector< T > & HGTD::Cluster< T >::getEntries ( ) const

Return the objects that are part of the Cluster.

Definition at line 210 of file Clustering.h.

210 {
211 return m_entries;
212}

◆ getMergeIteration()

template<class T>
int HGTD::Cluster< T >::getMergeIteration ( ) const

Definition at line 250 of file Clustering.h.

250 {
251 return m_merge_iteration;
252}
int m_merge_iteration
Definition Clustering.h:113

◆ getNEntries()

template<class T>
int HGTD::Cluster< T >::getNEntries ( ) const

Return the number of objects stored in the Cluster.

Definition at line 202 of file Clustering.h.

202 {
203 return m_entries.size();
204}

◆ getSigmas()

template<class T>
const std::vector< double > & HGTD::Cluster< T >::getSigmas ( ) const

Return the N-dimensional resolution of the Cluster.

Definition at line 240 of file Clustering.h.

240 {
242}

◆ getValues()

template<class T>
std::vector< double > HGTD::Cluster< T >::getValues ( ) const

Return the N-dimensional value of the Cluster.

Definition at line 228 of file Clustering.h.

228 {
229 // return a warning when this value is a default value
230 if (m_combined_value_vector.size() == 0) {
231 if (m_debug_level > 0) {
233 << "Cluster::getTime: ATTENTION, combi values are not initialized!"
234 << std::endl;
235 }
236 }
238}

◆ mergeStatus()

template<class T>
bool HGTD::Cluster< T >::mergeStatus ( ) const

Return true if the Cluster is the result of a merge.

Definition at line 248 of file Clustering.h.

248{ return m_was_merged; }

◆ setClusterValue()

template<class T>
void HGTD::Cluster< T >::setClusterValue ( const std::vector< double > & v,
const std::vector< double > & v_sigma )

The value of a vertex has to be set manually.

This is because we use a weighted time after vertex fusion, so this has to be accounted for (also gives the option to use different methods).

Parameters
[in]vGlobal position of this Cluster.
[in]v_sigmaGlobal resolution of the position of this vertex.

Definition at line 222 of file Clustering.h.

◆ setMergeIteration()

template<class T>
void HGTD::Cluster< T >::setMergeIteration ( int iteration)

Definition at line 254 of file Clustering.h.

254 {
256}

◆ setMergeStatus()

template<class T>
void HGTD::Cluster< T >::setMergeStatus ( bool status)

Definition at line 244 of file Clustering.h.

244 {
246}

◆ setUnknownStatus()

template<class T>
void HGTD::Cluster< T >::setUnknownStatus ( bool status)

Definition at line 262 of file Clustering.h.

262 {
264}

Member Data Documentation

◆ m_combined_sigma

template<typename T>
double HGTD::Cluster< T >::m_combined_sigma { }
private

Definition at line 109 of file Clustering.h.

109{ };

◆ m_combined_sigma_vector

template<typename T>
std::vector<double> HGTD::Cluster< T >::m_combined_sigma_vector { }
private

Definition at line 111 of file Clustering.h.

111{ };

◆ m_combined_value

template<typename T>
double HGTD::Cluster< T >::m_combined_value { }
private

Definition at line 108 of file Clustering.h.

108{ };

◆ m_combined_value_vector

template<typename T>
std::vector<double> HGTD::Cluster< T >::m_combined_value_vector { }
private

Definition at line 110 of file Clustering.h.

110{ };

◆ m_contains_unknowns

template<typename T>
bool HGTD::Cluster< T >::m_contains_unknowns = false
private

Definition at line 114 of file Clustering.h.

◆ m_debug_level

template<typename T>
int HGTD::Cluster< T >::m_debug_level = 0
private

Definition at line 106 of file Clustering.h.

◆ m_entries

template<typename T>
std::vector<T> HGTD::Cluster< T >::m_entries { }
private

Definition at line 107 of file Clustering.h.

107{ }; // Stores raw objects that are part of this Cluster

◆ m_merge_iteration

template<typename T>
int HGTD::Cluster< T >::m_merge_iteration = 0
private

Definition at line 113 of file Clustering.h.

◆ m_was_merged

template<typename T>
bool HGTD::Cluster< T >::m_was_merged = false
private

Definition at line 112 of file Clustering.h.


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