ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
MuonR4::SpacePointPerLayerSorter Class Reference

The SpacePointPerLayerSorter groups the space points by their layer Identifier. More...

#include <SpacePointPerLayerSorter.h>

Collaboration diagram for MuonR4::SpacePointPerLayerSorter:

Public Types

using HitVec = std::vector< const SpacePoint * >
 
using HitLayVec = std::vector< HitVec >
 

Public Member Functions

 SpacePointPerLayerSorter (const SpacePointBucket &bucket)
 Constructor taking a complete bucket
More...
 
 SpacePointPerLayerSorter (HitVec vec)
 Constructor taking a subset of SpacePoints. More...
 
const HitLayVecmdtHits () const
 Returns the sorted Mdt hits. More...
 
unsigned int nMdtHits () const
 Returns the number of all Mdt hits in the seed. More...
 
const HitLayVecstripHits () const
 Returns the sorted strip hits. More...
 
unsigned int nStripHits () const
 Returns the number of all strip hits in the seed. More...
 

Private Attributes

HitLayVec m_mdtLayers {}
 
HitLayVec m_stripLayers {}
 
unsigned int m_nMdtHits {0}
 
unsigned int m_nStripHits {0}
 

Detailed Description

The SpacePointPerLayerSorter groups the space points by their layer Identifier.

It is defined as the Identifier of the first tube in layer for the Mdts or as the Identifier of the first strip in a gasGap expressed in an eta view. First, all hits are sorted by increasing chamber z - i.e. going outwards the detector, and then grouped into two sets of vectors. One for the Mdts and the other for the remaining strip detectors.

Definition at line 14 of file SpacePointPerLayerSorter.h.

Member Typedef Documentation

◆ HitLayVec

Definition at line 17 of file SpacePointPerLayerSorter.h.

◆ HitVec

Definition at line 16 of file SpacePointPerLayerSorter.h.

Constructor & Destructor Documentation

◆ SpacePointPerLayerSorter() [1/2]

MuonR4::SpacePointPerLayerSorter::SpacePointPerLayerSorter ( const SpacePointBucket bucket)

Constructor taking a complete bucket

Definition at line 17 of file SpacePointPerLayerSorter.cxx.

17  :

◆ SpacePointPerLayerSorter() [2/2]

MuonR4::SpacePointPerLayerSorter::SpacePointPerLayerSorter ( HitVec  vec)

Constructor taking a subset of SpacePoints.

Sort space points by z

The hits are radially sorted from low local-z to high local z. Build the gasGap Identifier to find out to which layer the hit belongs to and then use the layer counting map as auxillary object fetch the indices for the sorted measurements

Definition at line 20 of file SpacePointPerLayerSorter.cxx.

20  {
21  if (hits.empty()) return;
22 
24  std::ranges::sort(hits, [](const SpacePoint* a, const SpacePoint*b){
25  return a->positionInChamber().z() < b->positionInChamber().z();
26  });
27  const Muon::IMuonIdHelperSvc* idHelperSvc{hits.front()->msSector()->idHelperSvc()};
28  m_mdtLayers.reserve(8);
29 
33  using LayerCounting = std::unordered_map<Identifier, unsigned int>;
34  LayerCounting mdtLayerCounting{}, stripLayerCounting{};
35  for (const SpacePoint* hit : hits) {
36  const Identifier& id {hit->identify()};
37  if (hit->type() == xAOD::UncalibMeasType::MdtDriftCircleType) {
38  const MdtIdHelper& idHelper{idHelperSvc->mdtIdHelper()};
39  const Identifier layId = idHelper.channelID(idHelper.stationName(id), 1, idHelper.stationPhi(id),
40  idHelper.multilayer(id), idHelper.tubeLayer(id), 1);
41 
42  const unsigned int layer = mdtLayerCounting.insert(std::make_pair(layId, mdtLayerCounting.size())).first->second;
43  if (layer >= m_mdtLayers.size()) {
44  m_mdtLayers.resize(layer + 1);
45  }
46  HitVec& pushTo{m_mdtLayers[layer]};
47  if (pushTo.capacity() == pushTo.size()){
48  pushTo.reserve(pushTo.size() + 5);
49  }
50  pushTo.push_back(hit);
51  ++m_nMdtHits;
52  } else {
53  const Identifier layId = idHelperSvc->gasGapId(id);
54  const unsigned int layer = stripLayerCounting.insert(std::make_pair(layId, stripLayerCounting.size())).first->second;
55 
56  if (layer >= m_stripLayers.size()) {
57  m_stripLayers.resize(layer + 1);
58  }
59  HitVec& pushTo{m_stripLayers[layer]};
60  if (pushTo.capacity() == pushTo.size()){
61  pushTo.reserve(pushTo.size() + 5);
62  }
63  pushTo.push_back(hit);
64  ++m_nStripHits;
65  }
66  }
67  }

Member Function Documentation

◆ mdtHits()

const HitLayVec& MuonR4::SpacePointPerLayerSorter::mdtHits ( ) const
inline

Returns the sorted Mdt hits.

Definition at line 23 of file SpacePointPerLayerSorter.h.

23  {
24  return m_mdtLayers;
25  }

◆ nMdtHits()

unsigned int MuonR4::SpacePointPerLayerSorter::nMdtHits ( ) const
inline

Returns the number of all Mdt hits in the seed.

Definition at line 27 of file SpacePointPerLayerSorter.h.

27  {
28  return m_nMdtHits;
29  }

◆ nStripHits()

unsigned int MuonR4::SpacePointPerLayerSorter::nStripHits ( ) const
inline

Returns the number of all strip hits in the seed.

Definition at line 35 of file SpacePointPerLayerSorter.h.

35  {
36  return m_nStripHits;
37  }

◆ stripHits()

const HitLayVec& MuonR4::SpacePointPerLayerSorter::stripHits ( ) const
inline

Returns the sorted strip hits.

Definition at line 31 of file SpacePointPerLayerSorter.h.

31  {
32  return m_stripLayers;
33  }

Member Data Documentation

◆ m_mdtLayers

HitLayVec MuonR4::SpacePointPerLayerSorter::m_mdtLayers {}
private

Definition at line 40 of file SpacePointPerLayerSorter.h.

◆ m_nMdtHits

unsigned int MuonR4::SpacePointPerLayerSorter::m_nMdtHits {0}
private

Definition at line 42 of file SpacePointPerLayerSorter.h.

◆ m_nStripHits

unsigned int MuonR4::SpacePointPerLayerSorter::m_nStripHits {0}
private

Definition at line 43 of file SpacePointPerLayerSorter.h.

◆ m_stripLayers

HitLayVec MuonR4::SpacePointPerLayerSorter::m_stripLayers {}
private

Definition at line 41 of file SpacePointPerLayerSorter.h.


The documentation for this class was generated from the following files:
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
MuonR4::SpacePointPerLayerSorter::m_nMdtHits
unsigned int m_nMdtHits
Definition: SpacePointPerLayerSorter.h:42
MuonR4::stripSmartPtr
HitVec stripSmartPtr(const SpacePointBucket &bucket)
Definition: SpacePointPerLayerSorter.cxx:10
MuonR4::SpacePointPerLayerSorter::m_stripLayers
HitLayVec m_stripLayers
Definition: SpacePointPerLayerSorter.h:41
SpacePoint
Definition: Trigger/TrigAccel/TrigCudaFitter/src/SpacePoint.h:7
MuonR4::SpacePointPerLayerSorter::SpacePointPerLayerSorter
SpacePointPerLayerSorter(const SpacePointBucket &bucket)
Constructor taking a complete bucket
Definition: SpacePointPerLayerSorter.cxx:17
z
#define z
MuonR4::SpacePointPerLayerSorter::HitVec
std::vector< const SpacePoint * > HitVec
Definition: SpacePointPerLayerSorter.h:16
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
MdtIdHelper
Definition: MdtIdHelper.h:61
MuonR4::SpacePointPerLayerSorter::m_nStripHits
unsigned int m_nStripHits
Definition: SpacePointPerLayerSorter.h:43
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
MuonR4::SpacePointPerLayerSorter::m_mdtLayers
HitLayVec m_mdtLayers
Definition: SpacePointPerLayerSorter.h:40
a
TList * a
Definition: liststreamerinfos.cxx:10
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:26
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
Identifier
Definition: IdentifierFieldParser.cxx:14