Belle II Software development
MCVXDPurityInfo Class Reference

The MC VXD Purity info container class. More...

#include <MCVXDPurityInfo.h>

Public Member Functions

 MCVXDPurityInfo ()
 empty constructor
 
 MCVXDPurityInfo (int iD, unsigned int nPXDClustersTotal, unsigned int nSVDUClustersTotal, unsigned int nSVDVClustersTotal, unsigned int nPXDClusters, unsigned int nSVDUClusters, unsigned int nSVDVClusters)
 constructor parameters: iD, the particleID nPXDClustersTotal, the number of PXDClusters the TrackCandidate container had (no matter which particleID was connected to the clusters) nSVDUClustersTotal, the number of SVDClusters for u-strips the TrackCandidate container had (no matter which particleID was connected to the clusters) nSVDVClustersTotal, the number of SVDClusters for v-strips the TrackCandidate container had (no matter which particleID was connected to the clusters) nPXDClusters, the number of PXDClusters connected to iD nSVDUClusters, the number of SVDClusters for u-strips connected to iD nSVDVClusters, the number of SVDClusters for v-strips connected to iD
 
 MCVXDPurityInfo (int iD, std::array< unsigned int, 3 > nClustersTotal, std::array< unsigned int, 3 > nMCClusters)
 constructor
 
bool operator> (const MCVXDPurityInfo &b) const
 operator for sorting.
 
bool operator< (const MCVXDPurityInfo &b) const
 operator for sorting.
 
std::pair< int, float > getPurity () const
 getter - returns overall purity (.second) for this particleID (.first).
 
std::pair< int, float > getPurityPXD () const
 getter - returns purity for PXDClusters (.second) for this particleID (.first)
 
std::pair< int, float > getPuritySVD () const
 getter - returns purity for SVDClusters (.second) for this particleID (.first)
 
std::pair< int, float > getPuritySVDU () const
 getter - returns purity for SVDClusters of u-type (.second) for this particleID (.first)
 
std::pair< int, float > getPuritySVDV () const
 getter - returns purity for SVDClusters of v-type (.second) for this particleID (.first)
 
int getParticleID () const
 getter - returns the ID of the particle, if value is -1 no particle has been able to be found for it
 
unsigned int getNClustersTotal () const
 returns total number of clusters the trackCandidate had
 
unsigned int getNPXDClustersTotal () const
 getter - returns total number of PXDClusters in the TrackCandidate
 
unsigned int getNSVDUClustersTotal () const
 getter - returns total number of u-type SVDClustes in the TrackCandidate
 
unsigned int getNSVDVClustersTotal () const
 getter - returns total number of v-type SVDClustes in the TrackCandidate
 
unsigned int getNClustersFound () const
 returns number of clusters the trackCandidate had assigned to this iD
 
unsigned int getNPXDClusters () const
 getter - returns number of PXDClusters found to this iD
 
unsigned int getNSVDUClusters () const
 getter - returns number of u-type SVDClustes found to this iD
 
unsigned int getNSVDVClusters () const
 getter - returns number of v-type SVDClustes found to this iD
 
unsigned int getNDFTotal () const
 getter - returns number of degrees of freedom for all Clusters in TC total
 
unsigned int getNDFFound () const
 getter - returns number of degrees of freedom for all Clusters in TC found
 
unsigned int getNDFPXDTotal () const
 getter - returns number of degrees of freedom for PXD Clusters in TC total
 
unsigned int getNDFPXDFound () const
 getter - returns number of degrees of freedom for PXD Clusters in TC found
 
unsigned int getNDFSVDTotal () const
 getter - returns number of degrees of freedom for SVD Clusters in TC total
 
unsigned int getNDFSVDFound () const
 getter - returns number of degrees of freedom for SVD Clusters in TC found
 
unsigned int getNDFSVDUTotal () const
 getter - returns number of degrees of freedom for u-type SVDClustes in the TrackCandidate
 
unsigned int getNDFSVDVTotal () const
 getter - returns number of degrees of freedom for v-type SVDClustes in the TrackCandidate
 
unsigned int getNDFSVDUFound () const
 getter - returns number of degrees of freedom for u-type SVDClustes found to this iD
 
unsigned int getNDFSVDVFound () const
 getter - returns number of degrees of freedom for v-type SVDClustes found to this iD
 
std::string dumpToString () const
 dump the contents to a string (for easier debugging)
 

Protected Attributes

int m_iD
 stores the particleID
 
std::array< unsigned int, 3 > m_nTotalClusters
 stores the number of clusters the TrackCandidate container had.
 
std::array< unsigned int, 3 > m_nFoundClusters
 stores the number for each ClusterType, PXD in [0], SVD-U in [1], and SVD-V in [2]
 

Detailed Description

The MC VXD Purity info container class.

This class stores for a particleID the number of clusters found in a TrackCandidate container.

Definition at line 27 of file MCVXDPurityInfo.h.

Constructor & Destructor Documentation

◆ MCVXDPurityInfo() [1/3]

MCVXDPurityInfo ( )
inline

empty constructor

Definition at line 43 of file MCVXDPurityInfo.h.

43 :
44 m_iD(-1),
45 m_nTotalClusters{0, 0, 0},
46 m_nFoundClusters{0, 0, 0} {}
std::array< unsigned int, 3 > m_nFoundClusters
stores the number for each ClusterType, PXD in [0], SVD-U in [1], and SVD-V in [2]
std::array< unsigned int, 3 > m_nTotalClusters
stores the number of clusters the TrackCandidate container had.
int m_iD
stores the particleID

◆ MCVXDPurityInfo() [2/3]

MCVXDPurityInfo ( int  iD,
unsigned int  nPXDClustersTotal,
unsigned int  nSVDUClustersTotal,
unsigned int  nSVDVClustersTotal,
unsigned int  nPXDClusters,
unsigned int  nSVDUClusters,
unsigned int  nSVDVClusters 
)
inline

constructor parameters: iD, the particleID nPXDClustersTotal, the number of PXDClusters the TrackCandidate container had (no matter which particleID was connected to the clusters) nSVDUClustersTotal, the number of SVDClusters for u-strips the TrackCandidate container had (no matter which particleID was connected to the clusters) nSVDVClustersTotal, the number of SVDClusters for v-strips the TrackCandidate container had (no matter which particleID was connected to the clusters) nPXDClusters, the number of PXDClusters connected to iD nSVDUClusters, the number of SVDClusters for u-strips connected to iD nSVDVClusters, the number of SVDClusters for v-strips connected to iD

Definition at line 58 of file MCVXDPurityInfo.h.

64 :
65 m_iD(iD),
66 m_nTotalClusters({ {nPXDClustersTotal, nSVDUClustersTotal, nSVDVClustersTotal} }),
67 m_nFoundClusters({ {nPXDClusters, nSVDUClusters, nSVDVClusters} }) {}

◆ MCVXDPurityInfo() [3/3]

MCVXDPurityInfo ( int  iD,
std::array< unsigned int, 3 >  nClustersTotal,
std::array< unsigned int, 3 >  nMCClusters 
)
inline

constructor

Parameters
iDparticle Id
nClustersTotalthe total number of Clusters in the container as array ([0] is PXDClusters, [1]/[2] are SVD U-/V- Clusters)
nMCClustersthe number of Clusters in the container connectoed to iD as array

Definition at line 75 of file MCVXDPurityInfo.h.

75 :
76 m_iD(iD), m_nTotalClusters(nClustersTotal), m_nFoundClusters(nMCClusters) { }

Member Function Documentation

◆ dumpToString()

std::string dumpToString ( ) const
inline

dump the contents to a string (for easier debugging)

Definition at line 219 of file MCVXDPurityInfo.h.

220 {
221 std::stringstream s;
222 s << "iD: " << m_iD << "\n";
223 for (size_t i = 0; i < m_nTotalClusters.size(); ++i) {
224 s << "totalClusters[" << i << "]: " << m_nTotalClusters[i] << ", foundClusters[" << i << "]: " << m_nFoundClusters[i] << "\n";
225 }
226 return s.str();
227 }

◆ getNClustersFound()

unsigned int getNClustersFound ( ) const
inline

returns number of clusters the trackCandidate had assigned to this iD

Definition at line 163 of file MCVXDPurityInfo.h.

163{ return std::accumulate(m_nFoundClusters.begin(), m_nFoundClusters.end(), 0); }

◆ getNClustersTotal()

unsigned int getNClustersTotal ( ) const
inline

returns total number of clusters the trackCandidate had

Definition at line 147 of file MCVXDPurityInfo.h.

147{ return std::accumulate(m_nTotalClusters.begin(), m_nTotalClusters.end(), 0); }

◆ getNDFFound()

unsigned int getNDFFound ( ) const
inline

getter - returns number of degrees of freedom for all Clusters in TC found

Definition at line 183 of file MCVXDPurityInfo.h.

183{ return std::accumulate(m_nFoundClusters.begin() + 1, m_nFoundClusters.end(), 0) + 2 * m_nFoundClusters[0]; }

◆ getNDFPXDFound()

unsigned int getNDFPXDFound ( ) const
inline

getter - returns number of degrees of freedom for PXD Clusters in TC found

Definition at line 191 of file MCVXDPurityInfo.h.

191{ return 2 * m_nFoundClusters[0]; }

◆ getNDFPXDTotal()

unsigned int getNDFPXDTotal ( ) const
inline

getter - returns number of degrees of freedom for PXD Clusters in TC total

Definition at line 187 of file MCVXDPurityInfo.h.

187{ return 2 * m_nTotalClusters[0]; }

◆ getNDFSVDFound()

unsigned int getNDFSVDFound ( ) const
inline

getter - returns number of degrees of freedom for SVD Clusters in TC found

Definition at line 199 of file MCVXDPurityInfo.h.

199{ return std::accumulate(m_nFoundClusters.begin() + 1, m_nFoundClusters.end(), 0); }

◆ getNDFSVDTotal()

unsigned int getNDFSVDTotal ( ) const
inline

getter - returns number of degrees of freedom for SVD Clusters in TC total

Definition at line 195 of file MCVXDPurityInfo.h.

195{ return std::accumulate(m_nTotalClusters.begin() + 1, m_nTotalClusters.end(), 0); }

◆ getNDFSVDUFound()

unsigned int getNDFSVDUFound ( ) const
inline

getter - returns number of degrees of freedom for u-type SVDClustes found to this iD

Definition at line 211 of file MCVXDPurityInfo.h.

211{ return getNSVDUClusters(); }
unsigned int getNSVDUClusters() const
getter - returns number of u-type SVDClustes found to this iD

◆ getNDFSVDUTotal()

unsigned int getNDFSVDUTotal ( ) const
inline

getter - returns number of degrees of freedom for u-type SVDClustes in the TrackCandidate

Definition at line 203 of file MCVXDPurityInfo.h.

203{ return getNSVDUClustersTotal(); }
unsigned int getNSVDUClustersTotal() const
getter - returns total number of u-type SVDClustes in the TrackCandidate

◆ getNDFSVDVFound()

unsigned int getNDFSVDVFound ( ) const
inline

getter - returns number of degrees of freedom for v-type SVDClustes found to this iD

Definition at line 215 of file MCVXDPurityInfo.h.

215{ return getNSVDVClusters(); }
unsigned int getNSVDVClusters() const
getter - returns number of v-type SVDClustes found to this iD

◆ getNDFSVDVTotal()

unsigned int getNDFSVDVTotal ( ) const
inline

getter - returns number of degrees of freedom for v-type SVDClustes in the TrackCandidate

Definition at line 207 of file MCVXDPurityInfo.h.

207{ return getNSVDVClustersTotal(); }
unsigned int getNSVDVClustersTotal() const
getter - returns total number of v-type SVDClustes in the TrackCandidate

◆ getNDFTotal()

unsigned int getNDFTotal ( ) const
inline

getter - returns number of degrees of freedom for all Clusters in TC total

Definition at line 179 of file MCVXDPurityInfo.h.

179{ return std::accumulate(m_nTotalClusters.begin() + 1, m_nTotalClusters.end(), 0) + 2 * m_nTotalClusters[0]; }

◆ getNPXDClusters()

unsigned int getNPXDClusters ( ) const
inline

getter - returns number of PXDClusters found to this iD

Definition at line 167 of file MCVXDPurityInfo.h.

167{ return m_nFoundClusters[0]; }

◆ getNPXDClustersTotal()

unsigned int getNPXDClustersTotal ( ) const
inline

getter - returns total number of PXDClusters in the TrackCandidate

Definition at line 151 of file MCVXDPurityInfo.h.

151{ return m_nTotalClusters[0]; }

◆ getNSVDUClusters()

unsigned int getNSVDUClusters ( ) const
inline

getter - returns number of u-type SVDClustes found to this iD

Definition at line 171 of file MCVXDPurityInfo.h.

171{ return m_nFoundClusters[1]; }

◆ getNSVDUClustersTotal()

unsigned int getNSVDUClustersTotal ( ) const
inline

getter - returns total number of u-type SVDClustes in the TrackCandidate

Definition at line 155 of file MCVXDPurityInfo.h.

155{ return m_nTotalClusters[1]; }

◆ getNSVDVClusters()

unsigned int getNSVDVClusters ( ) const
inline

getter - returns number of v-type SVDClustes found to this iD

Definition at line 175 of file MCVXDPurityInfo.h.

175{ return m_nFoundClusters[2]; }

◆ getNSVDVClustersTotal()

unsigned int getNSVDVClustersTotal ( ) const
inline

getter - returns total number of v-type SVDClustes in the TrackCandidate

Definition at line 159 of file MCVXDPurityInfo.h.

159{ return m_nTotalClusters[2]; }

◆ getParticleID()

int getParticleID ( ) const
inline

getter - returns the ID of the particle, if value is -1 no particle has been able to be found for it

Definition at line 143 of file MCVXDPurityInfo.h.

143{ return m_iD; }

◆ getPurity()

std::pair< int, float > getPurity ( ) const
inline

getter - returns overall purity (.second) for this particleID (.first).

since PXD-Clusters are counting as two measurements, they count twice.

Definition at line 104 of file MCVXDPurityInfo.h.

105 {
106 unsigned int nTotal = std::accumulate(m_nTotalClusters.begin() + 1, m_nTotalClusters.end(), 0) + 2 * m_nTotalClusters[0];
107 unsigned int nFound = std::accumulate(m_nFoundClusters.begin() + 1, m_nFoundClusters.end(), 0) + 2 * m_nFoundClusters[0];
108 return {m_iD, (nTotal == 0 ? 0.f : float(nFound) / float(nTotal)) };
109 }

◆ getPurityPXD()

std::pair< int, float > getPurityPXD ( ) const
inline

getter - returns purity for PXDClusters (.second) for this particleID (.first)

Definition at line 113 of file MCVXDPurityInfo.h.

114 {
115 return {m_iD, (m_nTotalClusters[0] == 0 ? 0.f : float(m_nFoundClusters[0]) / float(m_nTotalClusters[0])) };
116 }

◆ getPuritySVD()

std::pair< int, float > getPuritySVD ( ) const
inline

getter - returns purity for SVDClusters (.second) for this particleID (.first)

Definition at line 120 of file MCVXDPurityInfo.h.

121 {
122 unsigned int nTotal = std::accumulate(m_nTotalClusters.begin() + 1, m_nTotalClusters.end(), 0);
123 unsigned int nFound = std::accumulate(m_nFoundClusters.begin() + 1, m_nFoundClusters.end(), 0);
124 return {m_iD, (nTotal == 0 ? 0.f : float(nFound) / float(nTotal)) };
125 }

◆ getPuritySVDU()

std::pair< int, float > getPuritySVDU ( ) const
inline

getter - returns purity for SVDClusters of u-type (.second) for this particleID (.first)

Definition at line 129 of file MCVXDPurityInfo.h.

130 {
131 return {m_iD, (m_nTotalClusters[1] == 0 ? 0.f : float(m_nFoundClusters[1]) / float(m_nTotalClusters[1])) };
132 }

◆ getPuritySVDV()

std::pair< int, float > getPuritySVDV ( ) const
inline

getter - returns purity for SVDClusters of v-type (.second) for this particleID (.first)

Definition at line 136 of file MCVXDPurityInfo.h.

137 {
138 return {m_iD, (m_nTotalClusters[2] == 0 ? 0.f : float(m_nFoundClusters[2]) / float(m_nTotalClusters[2])) };
139 }

◆ operator<()

bool operator< ( const MCVXDPurityInfo b) const
inline

operator for sorting.

will be compared using overall purity NOTE: only the purity will be compared (i.e. .second), the iD is not used!

Definition at line 94 of file MCVXDPurityInfo.h.

95 {
96 return getPurity().second < b.getPurity().second;
97 }
std::pair< int, float > getPurity() const
getter - returns overall purity (.second) for this particleID (.first).

◆ operator>()

bool operator> ( const MCVXDPurityInfo b) const
inline

operator for sorting.

will be compared using overall purity NOTE: only the purity will be compared (i.e. .second), the iD is not used!

Definition at line 83 of file MCVXDPurityInfo.h.

84 {
85 return getPurity().second > b.getPurity().second;
86 }

Member Data Documentation

◆ m_iD

int m_iD
protected

stores the particleID

Definition at line 30 of file MCVXDPurityInfo.h.

◆ m_nFoundClusters

std::array<unsigned int, 3> m_nFoundClusters
protected

stores the number for each ClusterType, PXD in [0], SVD-U in [1], and SVD-V in [2]

Definition at line 38 of file MCVXDPurityInfo.h.

◆ m_nTotalClusters

std::array<unsigned int, 3> m_nTotalClusters
protected

stores the number of clusters the TrackCandidate container had.

(no matter which particleID was connected to the clusters) for each ClusterType, PXD in [0], SVD-U in [1], and SVD-V in [2]

Definition at line 35 of file MCVXDPurityInfo.h.


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