ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::TgcHitClusteringObj Struct Reference

#include <TgcHitClustering.h>

Collaboration diagram for Muon::TgcHitClusteringObj:

Public Types

using HitList = TgcClusterObj3D::HitList

Public Member Functions

 TgcHitClusteringObj (const TgcIdHelper *tgcIdHelp)
bool cluster (const HitList &col)
bool cluster (HitList &filteredHits, std::vector< HitList > &finalClusts)
bool buildClusters3D ()
void dump () const
const HitListbestEtaCluster () const
const HitListbestPhiCluster () const

Public Attributes

const TgcIdHelperm_tgcIdHelper {nullptr}
std::vector< HitListclustersEta {}
std::vector< HitListclustersPhi {}
std::vector< TgcClusterObj3Dclusters3D {}

Detailed Description

Definition at line 47 of file TgcHitClustering.h.

Member Typedef Documentation

◆ HitList

Constructor & Destructor Documentation

◆ TgcHitClusteringObj()

Muon::TgcHitClusteringObj::TgcHitClusteringObj ( const TgcIdHelper * tgcIdHelp)
inline

Definition at line 51 of file TgcHitClustering.h.

51 :
52 m_tgcIdHelper(tgcIdHelp) {}
const TgcIdHelper * m_tgcIdHelper

Member Function Documentation

◆ bestEtaCluster()

const HitList & Muon::TgcHitClusteringObj::bestEtaCluster ( ) const

Definition at line 12 of file TgcHitClustering.cxx.

12 {
13 return clustersEta.size() ? clustersEta.front() : dummy;
14 }
std::vector< HitList > clustersEta

◆ bestPhiCluster()

const HitList & Muon::TgcHitClusteringObj::bestPhiCluster ( ) const

Definition at line 15 of file TgcHitClustering.cxx.

15 {
16 return clustersPhi.size() ? clustersPhi.front() : dummy;
17 }
std::vector< HitList > clustersPhi

◆ buildClusters3D()

bool Muon::TgcHitClusteringObj::buildClusters3D ( )

Definition at line 65 of file TgcHitClustering.cxx.

65 {
66
67 if( clustersPhi.empty() || clustersEta.empty() ) return false;
68
69 const TgcPrepData* etaHit = bestEtaCluster().front();
70
71 const MuonGM::TgcReadoutElement* detEl = etaHit->detectorElement();
72
73 // now loop over eta and phi clusters and form space points
74 for(HitList& eit : clustersEta) {
75
76 const TgcPrepData* firstEta = eit.front();
77 const TgcPrepData* lastEta = eit.back();
78
79 for(HitList& pit : clustersPhi) {
80
81 const TgcPrepData* firstPhi = pit.front();
82 const TgcPrepData* lastPhi = pit.back();
83
84 TgcClusterObj3D cl3D{eit, pit};
85 using Edge = TgcClusterObj3D::Edge;
86
87 detEl->spacePointPosition( firstPhi->identify(), firstEta->identify(), cl3D.getEdge(Edge::LowEtaLowPhi) );
88 if( lastPhi != firstPhi ) {
89 detEl->spacePointPosition( lastPhi->identify(), firstEta->identify(), cl3D.getEdge(Edge::LowEtaHighPhi));
90 } else {
91 cl3D.getEdge(Edge::LowEtaHighPhi) = cl3D.getEdge(Edge::LowEtaLowPhi);
92 }
93 if( lastEta != firstEta ) {
94 detEl->spacePointPosition( firstPhi->identify(),lastEta->identify(), cl3D.getEdge(Edge::HighEtaLowPhi) );
95 if( lastPhi != firstPhi ) {
96 detEl->spacePointPosition( lastPhi->identify(),lastEta->identify(), cl3D.getEdge(Edge::HighEtaHighPhi) );
97 } else {
98 cl3D.getEdge(Edge::HighEtaHighPhi) = cl3D.getEdge(Edge::HighEtaLowPhi);
99 }
100 }else{
101 cl3D.getEdge(Edge::HighEtaLowPhi) = cl3D.getEdge(Edge::LowEtaLowPhi);
102 cl3D.getEdge(Edge::HighEtaHighPhi) = cl3D.getEdge(Edge::LowEtaHighPhi);
103 }
104 clusters3D.push_back(std::move(cl3D));
105 }
106 }
107 return true;
108 }
virtual bool spacePointPosition(const Identifier &phiId, const Identifier &etaId, Amg::Vector2D &pos) const override
space point position for a given pair of phi and eta identifiers The LocalPosition is expressed in th...
Edge
Representation of the four edge points.
std::vector< TgcClusterObj3D > clusters3D
const HitList & bestEtaCluster() const
TgcClusterObj3D::HitList HitList

◆ cluster() [1/2]

bool Muon::TgcHitClusteringObj::cluster ( const HitList & col)

◆ cluster() [2/2]

bool Muon::TgcHitClusteringObj::cluster ( HitList & filteredHits,
std::vector< HitList > & finalClusts )

Create new clusters if the cluster is more separated by more than one channel or if the gas gaps don't match

Definition at line 18 of file TgcHitClustering.cxx.

19 {
20 if (filteredHits.empty()) return false;
21 finalClusts.reserve(filteredHits.size());
22 std::sort(filteredHits.begin(), filteredHits.end(),
23 [this](const TgcPrepData* h1,const TgcPrepData* h2) {
24 const int gap1{m_tgcIdHelper->gasGap(h1->identify())}, gap2{m_tgcIdHelper->gasGap(h2->identify())};
25 if (gap1 != gap2) return gap1 < gap2;
26 return m_tgcIdHelper->channel(h1->identify()) < m_tgcIdHelper->channel(h2->identify());
27 });
28
29 for (const TgcPrepData* prd : filteredHits) {
31 if (finalClusts.empty() ||
32 m_tgcIdHelper->channel(finalClusts.back().back()->identify()) +1 != m_tgcIdHelper->channel(prd->identify()) ||
33 m_tgcIdHelper->gasGap(finalClusts.back().back()->identify()) != m_tgcIdHelper->gasGap(prd->identify())) {
34 finalClusts.emplace_back();
35 }
36 finalClusts.back().push_back(prd);
37 }
38 std::stable_sort(finalClusts.begin(),finalClusts.end(),
39 []( const HitList& a, const HitList& b){
40 return a.size() < b.size();
41 });
42 return true;
43 }
static Double_t a
if(febId1==febId2)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
void stable_sort(DataModel_detail::iterator< DVL > beg, DataModel_detail::iterator< DVL > end)
Specialization of stable_sort for DataVector/List.

◆ dump()

void Muon::TgcHitClusteringObj::dump ( ) const

Member Data Documentation

◆ clusters3D

std::vector<TgcClusterObj3D> Muon::TgcHitClusteringObj::clusters3D {}

Definition at line 69 of file TgcHitClustering.h.

69{};

◆ clustersEta

std::vector<HitList> Muon::TgcHitClusteringObj::clustersEta {}

Definition at line 67 of file TgcHitClustering.h.

67{};

◆ clustersPhi

std::vector<HitList> Muon::TgcHitClusteringObj::clustersPhi {}

Definition at line 68 of file TgcHitClustering.h.

68{};

◆ m_tgcIdHelper

const TgcIdHelper* Muon::TgcHitClusteringObj::m_tgcIdHelper {nullptr}

Definition at line 66 of file TgcHitClustering.h.

66{nullptr};

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