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

The class of a cell in 3D histogram. More...

#include <VtxMap.h>

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

Public Member Functions

 Cell (size_t id, const KDPoint< double, 3 > &p, std::vector< const WrkVrt * > &v)
 Constructor.
 Cell (size_t id, const KDPoint< double, 3 > &p, std::vector< const WrkVrt * > &&v)
 Cell (size_t id, const KDPoint< double, 3 > &p, const WrkVrt *vtx_ptr)
 Cell (size_t id, const KDPoint< double, 3 > &p)
 Cell ()
int getId ()
KDPoint< double, 3 > getPosPoint ()
 Return center position as a KDPoint in specified coordinate.
TVector3 getPosVect () const
 Return center position in TVector3.
void emplace_back (const WrkVrt *vtx_ptr)
 Emplace vertex pointer to vertex list.
void updateLists ()
 Update set of tracks and incompatible track pair list.
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

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

int m_id = -1
KDPoint< double, 3 > m_pos

Detailed Description

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

The class of a cell in 3D histogram.

Basically a vertex pack with cell id and position.

Definition at line 58 of file VtxMap.h.

Constructor & Destructor Documentation

◆ Cell() [1/5]

template<typename WrkVrt, typename Cord>
TrigVSI::VtxMap< WrkVrt, Cord >::Cell::Cell ( size_t id,
const KDPoint< double, 3 > & p,
std::vector< const WrkVrt * > & v )
inline

Constructor.

Parameters
[in]idIndex of the cell. Usually equivalent to ibin.
[in]pCenter point of the cell.
[in]vList of vertices inside this cell.

ID and point can't be configured after construction.

Definition at line 68 of file VtxMap.h.

68: VtxPack<WrkVrt>(v), m_id(id), m_pos(p) {};
KDPoint< double, 3 > m_pos
Definition VtxMap.h:84
The vertex map class to be used to find multi-track vertices.
Definition VtxMap.h:38

◆ Cell() [2/5]

template<typename WrkVrt, typename Cord>
TrigVSI::VtxMap< WrkVrt, Cord >::Cell::Cell ( size_t id,
const KDPoint< double, 3 > & p,
std::vector< const WrkVrt * > && v )
inline

Definition at line 69 of file VtxMap.h.

69: VtxPack<WrkVrt>(v), m_id(id), m_pos(p) {};

◆ Cell() [3/5]

template<typename WrkVrt, typename Cord>
TrigVSI::VtxMap< WrkVrt, Cord >::Cell::Cell ( size_t id,
const KDPoint< double, 3 > & p,
const WrkVrt * vtx_ptr )
inline

Definition at line 70 of file VtxMap.h.

◆ Cell() [4/5]

template<typename WrkVrt, typename Cord>
TrigVSI::VtxMap< WrkVrt, Cord >::Cell::Cell ( size_t id,
const KDPoint< double, 3 > & p )
inline

Definition at line 71 of file VtxMap.h.

71: m_id(id), m_pos(p) {};

◆ Cell() [5/5]

template<typename WrkVrt, typename Cord>
TrigVSI::VtxMap< WrkVrt, Cord >::Cell::Cell ( )
inline

Definition at line 72 of file VtxMap.h.

72{};

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
void updateLists()
Update set of tracks and incompatible track pair list.
Definition IWrkVrt.h:117

◆ emplace_back()

template<typename WrkVrt>
void TrigVSI::VtxPack< WrkVrt >::emplace_back ( const WrkVrt * vtx_ptr)
inlineinherited

Emplace vertex pointer to vertex list.

Definition at line 67 of file IWrkVrt.h.

68 {
69 m_isUpToDate = false;
70 m_vtxLists.emplace_back(vtx_ptr);
71 };
Base class of local vertex container in VtxMap.
Definition IWrkVrt.h:56
std::vector< const WrkVrt * > m_vtxLists
Definition IWrkVrt.h:100

◆ getId()

template<typename WrkVrt, typename Cord>
int TrigVSI::VtxMap< WrkVrt, Cord >::Cell::getId ( )
inline

Definition at line 74 of file VtxMap.h.

74{ return m_id; };

◆ 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

◆ getPosPoint()

template<typename WrkVrt, typename Cord>
KDPoint< double, 3 > TrigVSI::VtxMap< WrkVrt, Cord >::Cell::getPosPoint ( )
inline

Return center position as a KDPoint in specified coordinate.

Definition at line 77 of file VtxMap.h.

77{ m_pos.setWeight(this->getWeight()); return m_pos; };
double getWeight()
Return the weight of the container.
Definition IWrkVrt.h:93

◆ getPosVect()

template<typename WrkVrt, typename Cord>
TVector3 TrigVSI::VtxMap< WrkVrt, Cord >::Cell::getPosVect ( ) const
inline

Return center position in TVector3.

Definition at line 80 of file VtxMap.h.

80{ return Cord::X123toXYZ(m_pos); };

◆ 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]; };

◆ 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; };

◆ 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(); };

◆ 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; };

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_id

template<typename WrkVrt, typename Cord>
int TrigVSI::VtxMap< WrkVrt, Cord >::Cell::m_id = -1
private

Definition at line 83 of file VtxMap.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_pos

template<typename WrkVrt, typename Cord>
KDPoint<double, 3> TrigVSI::VtxMap< WrkVrt, Cord >::Cell::m_pos
private

Definition at line 84 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: