ATLAS Offline Software
Public Types | Public Member Functions | Public Attributes | List of all members
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

Definition at line 49 of file TgcHitClustering.h.

Constructor & Destructor Documentation

◆ TgcHitClusteringObj()

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

Definition at line 51 of file TgcHitClustering.h.

51  :
52  m_tgcIdHelper(tgcIdHelp) {}

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  }

◆ bestPhiCluster()

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

Definition at line 15 of file TgcHitClustering.cxx.

15  {
16  return clustersPhi.size() ? clustersPhi.front() : dummy;
17  }

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

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

◆ dump()

void Muon::TgcHitClusteringObj::dump ( ) const

Member Data Documentation

◆ clusters3D

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

Definition at line 69 of file TgcHitClustering.h.

◆ clustersEta

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

Definition at line 67 of file TgcHitClustering.h.

◆ clustersPhi

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

Definition at line 68 of file TgcHitClustering.h.

◆ m_tgcIdHelper

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

Definition at line 66 of file TgcHitClustering.h.


The documentation for this struct was generated from the following files:
MuonGM::TgcReadoutElement::spacePointPosition
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...
Definition: MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutElement.cxx:332
Trk::PrepRawDataType::TgcPrepData
@ TgcPrepData
TgcIdHelper::gasGap
int gasGap(const Identifier &id) const override
get the hashes
Definition: TgcIdHelper.cxx:642
read_hist_ntuple.h1
h1
Definition: read_hist_ntuple.py:21
std::stable_sort
void stable_sort(std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, std::reverse_iterator< DataModel_detail::iterator< DVL > > end, Compare comp)
Specialization of stable_sort for DataVector/List.
Definition: DVL_algorithms.h:711
Muon::TgcHitClusteringObj::HitList
TgcClusterObj3D::HitList HitList
Definition: TgcHitClustering.h:49
Muon::TgcHitClusteringObj::clustersEta
std::vector< HitList > clustersEta
Definition: TgcHitClustering.h:67
TgcIdHelper::channel
int channel(const Identifier &id) const override
Definition: TgcIdHelper.cxx:649
Muon::TgcHitClusteringObj::bestEtaCluster
const HitList & bestEtaCluster() const
Definition: TgcHitClustering.cxx:12
Muon::TgcClusterObj3D::Edge
Edge
Representation of the four edge points.
Definition: TgcHitClustering.h:30
MuonGM::TgcReadoutElement
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h:42
python.xAODType.dummy
dummy
Definition: xAODType.py:4
Muon::TgcHitClusteringObj::m_tgcIdHelper
const TgcIdHelper * m_tgcIdHelper
Definition: TgcHitClustering.h:66
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
a
TList * a
Definition: liststreamerinfos.cxx:10
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:569
Muon::TgcHitClusteringObj::clusters3D
std::vector< TgcClusterObj3D > clusters3D
Definition: TgcHitClustering.h:69
Muon::TgcHitClusteringObj::clustersPhi
std::vector< HitList > clustersPhi
Definition: TgcHitClustering.h:68