ATLAS Offline Software
Loading...
Searching...
No Matches
TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster Class Reference

Stores the result of vertex clustering performed in VtxMap. More...

#include <VtxMap.h>

Inheritance diagram for TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster:
Collaboration diagram for TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster:

Public Member Functions

 CellCluster (std::vector< Cell * > &&v)
 Constructor.
void emplace_back (const WrkVrt *)=delete
 Vertex cannot be added after initialization.
size_t nCells () const
CellgetPoint (size_t ipt) const
size_t nPoints () const
std::vector< Cell * > & Points ()
const std::vector< Cell * > & getPoints () const
void updateLists ()
 Update set of tracks and incompatible track pair list.
Position in specific coordinate
double x1 () const
double x2 () const
double x3 () const
const KDPoint< double, 3 > & PosCoord () const
Position in cartesian coordinate
double x () const
double y () const
double z () const
TVector3 PosVect () const
Accessors

Return copy of selected track indices list.

std::unordered_set< size_t > getSelectedTrackIndices ()
const std::unordered_set< size_t > & selectedTrackIndices ()
 Return reference to selected track indices list.
std::vector< std::pair< size_t, size_t > > getIncompIndices ()
 Return copy of incompatible track pair list.
const std::vector< std::pair< size_t, size_t > > & incompIndices ()
 Return reference to incompatible track pair list.
std::vector< const WrkVrt * > getVtxList ()
 Return a copy of vertex list.
const std::vector< const WrkVrt * > & vtxList ()
 Return a reference to vertex list.
const WrkVrt * getVtx (size_t ivtx)
 Return a copy of i-th vertex.
size_t nVtx ()
 Return the number of vertices.
double getWeight ()
 Return the weight of the container.

Protected Member Functions

void checkUpdate ()
 Check if lists are up to date. If not, update them.

Protected Attributes

std::vector< Cell * > m_points
bool m_isUpToDate = false
std::vector< const WrkVrt * > m_vtxLists
std::unordered_set< size_t > m_selTrkIndices
std::unordered_set< std::pair< size_t, size_t >, PairHash< size_t, size_t > > m_compIndices
std::vector< std::pair< size_t, size_t > > m_incompIndices

Private Attributes

KDPoint< double, 3 > m_posAvr
TVector3 m_posAvrVec

Detailed Description

template<typename WrkVrt, typename Cord>
class TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster

Stores the result of vertex clustering performed in VtxMap.

The class of a cell cluster. Provides average position and other vertex pack related objects. Designed for readout usage.

Definition at line 95 of file VtxMap.h.

Constructor & Destructor Documentation

◆ CellCluster()

template<typename WrkVrt, typename Cord>
TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster::CellCluster ( std::vector< Cell * > && v)
inline

Constructor.

Parameters
[in]vList of cells in the cluster.

Cells can't be added after construction.

Definition at line 103 of file VtxMap.h.

104 {
105 size_t n_vtx = 0;
106 for ( auto& cell_ptr : v ) n_vtx += cell_ptr->nVtx();
108 tmp_vtx_cls.reserve(n_vtx);
109
110 double w = 0.;
111 TVector3 tmp_vec(0.,0.,0.);
112 for ( auto& cell_ptr : v ) {
114 tmp_vtx_cls.insert( tmp_vtx_cls.end(), tmp_vtx_cell.begin(), tmp_vtx_cell.end() );
115
116 tmp_vec += cell_ptr->getWeight() * cell_ptr->getPosVect();
117 w += cell_ptr->getWeight();
118 }
120 this->updateLists();
121
122 this->m_posAvrVec = (1. / w) * tmp_vec;
123 this->m_posAvr = Cord::XYZtoX123(this->m_posAvrVec);
124 this->m_posAvr.setWeight(w);
125 };
KDPoint< double, 3 > m_posAvr
Definition VtxMap.h:149
The vertex map class to be used to find multi-track vertices.
Definition VtxMap.h:38
std::vector< const WrkVrt * > m_vtxLists
Definition IWrkVrt.h:100
void updateLists()
Update set of tracks and incompatible track pair list.
Definition IWrkVrt.h:117

Member Function Documentation

◆ checkUpdate()

template<typename WrkVrt>
void TrigVSI::VtxPack< WrkVrt >::checkUpdate ( )
inlineprotectedinherited

Check if lists are up to date. If not, update them.

Definition at line 106 of file IWrkVrt.h.

106{ if( !m_isUpToDate ) updateLists(); return; };
bool m_isUpToDate
Definition IWrkVrt.h:99

◆ emplace_back()

template<typename WrkVrt, typename Cord>
void TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster::emplace_back ( const WrkVrt * )
inlinedelete

Vertex cannot be added after initialization.

◆ getIncompIndices()

template<typename WrkVrt>
std::vector< std::pair< size_t, size_t > > TrigVSI::VtxPack< WrkVrt >::getIncompIndices ( )
inlineinherited

Return copy of incompatible track pair list.

Definition at line 80 of file IWrkVrt.h.

80{ checkUpdate(); return m_incompIndices; };
std::vector< std::pair< size_t, size_t > > m_incompIndices
Definition IWrkVrt.h:103
void checkUpdate()
Check if lists are up to date. If not, update them.
Definition IWrkVrt.h:106

◆ getPoint()

Cell * TrigVSI::Cluster< Cell * >::getPoint ( size_t ipt) const
inlineinherited

Definition at line 30 of file DBScan.h.

30{ return m_points[ipt]; };
Base class for clusters.
Definition DBScan.h:24

◆ getPoints()

const std::vector< Cell * > & TrigVSI::Cluster< Cell * >::getPoints ( ) const
inlineinherited

Definition at line 34 of file DBScan.h.

34{ return m_points; };

◆ getSelectedTrackIndices()

template<typename WrkVrt>
std::unordered_set< size_t > TrigVSI::VtxPack< WrkVrt >::getSelectedTrackIndices ( )
inlineinherited

Definition at line 76 of file IWrkVrt.h.

76{ checkUpdate(); return m_selTrkIndices; };
std::unordered_set< size_t > m_selTrkIndices
Definition IWrkVrt.h:101

◆ getVtx()

template<typename WrkVrt>
const WrkVrt * TrigVSI::VtxPack< WrkVrt >::getVtx ( size_t ivtx)
inlineinherited

Return a copy of i-th vertex.

Definition at line 89 of file IWrkVrt.h.

89{ checkUpdate(); return m_vtxLists[ivtx]; };
Base class of local vertex container in VtxMap.
Definition IWrkVrt.h:56

◆ getVtxList()

template<typename WrkVrt>
std::vector< const WrkVrt * > TrigVSI::VtxPack< WrkVrt >::getVtxList ( )
inlineinherited

Return a copy of vertex list.

Definition at line 85 of file IWrkVrt.h.

85{ checkUpdate(); return m_vtxLists; };

◆ getWeight()

template<typename WrkVrt>
double TrigVSI::VtxPack< WrkVrt >::getWeight ( )
inlineinherited

Return the weight of the container.

Definition at line 93 of file IWrkVrt.h.

93{ checkUpdate(); return static_cast<double>(m_vtxLists.size()); };

◆ incompIndices()

template<typename WrkVrt>
const std::vector< std::pair< size_t, size_t > > & TrigVSI::VtxPack< WrkVrt >::incompIndices ( )
inlineinherited

Return reference to incompatible track pair list.

Definition at line 82 of file IWrkVrt.h.

82{ checkUpdate(); return m_incompIndices; };

◆ nCells()

template<typename WrkVrt, typename Cord>
size_t TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster::nCells ( ) const
inline

Definition at line 130 of file VtxMap.h.

130{ return this->nPoints(); };
size_t nPoints() const
Definition DBScan.h:31

◆ nPoints()

size_t TrigVSI::Cluster< Cell * >::nPoints ( ) const
inlineinherited

Definition at line 31 of file DBScan.h.

31{ return m_points.size(); };

◆ nVtx()

template<typename WrkVrt>
size_t TrigVSI::VtxPack< WrkVrt >::nVtx ( )
inlineinherited

Return the number of vertices.

Definition at line 91 of file IWrkVrt.h.

91{ checkUpdate(); return m_vtxLists.size(); };

◆ Points()

std::vector< Cell * > & TrigVSI::Cluster< Cell * >::Points ( )
inlineinherited

Definition at line 33 of file DBScan.h.

33{ return m_points; };

◆ PosCoord()

template<typename WrkVrt, typename Cord>
const KDPoint< double, 3 > & TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster::PosCoord ( ) const
inline

Definition at line 137 of file VtxMap.h.

137{ return m_posAvr; };

◆ PosVect()

template<typename WrkVrt, typename Cord>
TVector3 TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster::PosVect ( ) const
inline

Definition at line 145 of file VtxMap.h.

145{ return m_posAvrVec; };

◆ selectedTrackIndices()

template<typename WrkVrt>
const std::unordered_set< size_t > & TrigVSI::VtxPack< WrkVrt >::selectedTrackIndices ( )
inlineinherited

Return reference to selected track indices list.

Definition at line 78 of file IWrkVrt.h.

78{ checkUpdate(); return m_selTrkIndices; };

◆ updateLists()

template<typename WrkVrt>
void TrigVSI::VtxPack< WrkVrt >::updateLists ( )
inherited

Update set of tracks and incompatible track pair list.

Everytime accessors are called, this function will be called automatically if lists are not up to date. Also can be called explicitly.

Definition at line 117 of file IWrkVrt.h.

118{
119 // Update Selected Track list
120 m_selTrkIndices.clear();
121 m_compIndices.clear();
122 for (const WrkVrt* vrt : m_vtxLists) {
123 m_selTrkIndices.emplace( vrt->selectedTrackIndices().at(0) );
124 m_selTrkIndices.emplace( vrt->selectedTrackIndices().at(1) );
126 m_compIndices.emplace( std::move(p_tmp_) );
127 }
128
129 // Update incompatible track pair lists
130 m_incompIndices.clear();
131 for ( auto i_itr = m_selTrkIndices.begin(); i_itr != m_selTrkIndices.end(); ++i_itr ) {
132 for ( auto j_itr = std::next(i_itr); j_itr != m_selTrkIndices.end(); ++j_itr ) {
134 auto tmp_itr = std::find(m_compIndices.begin(), m_compIndices.end(), p_tmp_ );
135 if ( tmp_itr != m_compIndices.end() ) continue; // When the pair found in compatible pair list, skip and continue loop
136 m_incompIndices.emplace_back( std::make_pair(*i_itr, *j_itr) );
137 }
138 }
139 //
140 m_isUpToDate = true; // Set up to date flag true
141}
const std::unordered_set< size_t > & selectedTrackIndices()
Return reference to selected track indices list.
Definition IWrkVrt.h:78
std::unordered_set< std::pair< size_t, size_t >, PairHash< size_t, size_t > > m_compIndices
Definition IWrkVrt.h:102

◆ vtxList()

template<typename WrkVrt>
const std::vector< const WrkVrt * > & TrigVSI::VtxPack< WrkVrt >::vtxList ( )
inlineinherited

Return a reference to vertex list.

Definition at line 87 of file IWrkVrt.h.

87{ checkUpdate(); return m_vtxLists; };

◆ x()

template<typename WrkVrt, typename Cord>
double TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster::x ( ) const
inline

Definition at line 142 of file VtxMap.h.

142{ return m_posAvrVec.x(); };

◆ x1()

template<typename WrkVrt, typename Cord>
double TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster::x1 ( ) const
inline

Definition at line 134 of file VtxMap.h.

134{ return m_posAvr.at(0); };

◆ x2()

template<typename WrkVrt, typename Cord>
double TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster::x2 ( ) const
inline

Definition at line 135 of file VtxMap.h.

135{ return m_posAvr.at(1); };

◆ x3()

template<typename WrkVrt, typename Cord>
double TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster::x3 ( ) const
inline

Definition at line 136 of file VtxMap.h.

136{ return m_posAvr.at(2); };

◆ y()

template<typename WrkVrt, typename Cord>
double TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster::y ( ) const
inline

Definition at line 143 of file VtxMap.h.

143{ return m_posAvrVec.y(); };

◆ z()

template<typename WrkVrt, typename Cord>
double TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster::z ( ) const
inline

Definition at line 144 of file VtxMap.h.

144{ return m_posAvrVec.z(); };

Member Data Documentation

◆ m_compIndices

template<typename WrkVrt>
std::unordered_set<std::pair<size_t, size_t>, PairHash<size_t,size_t> > TrigVSI::VtxPack< WrkVrt >::m_compIndices
protectedinherited

Definition at line 102 of file IWrkVrt.h.

◆ m_incompIndices

template<typename WrkVrt>
std::vector<std::pair<size_t, size_t> > TrigVSI::VtxPack< WrkVrt >::m_incompIndices
protectedinherited

Definition at line 103 of file IWrkVrt.h.

◆ m_isUpToDate

template<typename WrkVrt>
bool TrigVSI::VtxPack< WrkVrt >::m_isUpToDate = false
protectedinherited

Definition at line 99 of file IWrkVrt.h.

◆ m_points

std::vector<Cell *> TrigVSI::Cluster< Cell * >::m_points
protectedinherited

Definition at line 37 of file DBScan.h.

◆ m_posAvr

template<typename WrkVrt, typename Cord>
KDPoint<double, 3> TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster::m_posAvr
private

Definition at line 149 of file VtxMap.h.

◆ m_posAvrVec

template<typename WrkVrt, typename Cord>
TVector3 TrigVSI::VtxMap< WrkVrt, Cord >::CellCluster::m_posAvrVec
private

Definition at line 150 of file VtxMap.h.

◆ m_selTrkIndices

template<typename WrkVrt>
std::unordered_set<size_t> TrigVSI::VtxPack< WrkVrt >::m_selTrkIndices
protectedinherited

Definition at line 101 of file IWrkVrt.h.

◆ m_vtxLists

template<typename WrkVrt>
std::vector<const WrkVrt*> TrigVSI::VtxPack< WrkVrt >::m_vtxLists
protectedinherited

Definition at line 100 of file IWrkVrt.h.


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