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...
 
unsigned int firstLayerFrom2ndMl () const
 Returns the layer index with hits from the second multilayer
More...
 

Private Attributes

HitLayVec m_mdtLayers {}
 Sorted Mdt hits per tube layer. More...
 
HitLayVec m_stripLayers {}
 Sorted Strip hits per gasGap strip
More...
 
unsigned int m_nMdtHits {0}
 Number of all Mdt tube hits
More...
 
unsigned int m_nStripHits {0}
 Number of all strip hits. More...
 
unsigned int m_tubeLaySwitch {0}
 Index of the first tube-layer from the second multilayer. More...
 

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  if (!m_tubeLaySwitch && layer &&
53  m_mdtLayers[layer -1].front()->primaryMeasurement()->identifierHash() != hit->primaryMeasurement()->identifierHash()) {
54 
55  }
56  } else {
57  const Identifier layId = idHelperSvc->gasGapId(id);
58  const unsigned int layer = stripLayerCounting.insert(std::make_pair(layId, stripLayerCounting.size())).first->second;
59 
60  if (layer >= m_stripLayers.size()) {
61  m_stripLayers.resize(layer + 1);
62  }
63  HitVec& pushTo{m_stripLayers[layer]};
64  if (pushTo.capacity() == pushTo.size()){
65  pushTo.reserve(pushTo.size() + 5);
66  }
67  pushTo.push_back(hit);
68  ++m_nStripHits;
69  }
70  }
71  }

Member Function Documentation

◆ firstLayerFrom2ndMl()

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

Returns the layer index with hits from the second multilayer

Definition at line 39 of file SpacePointPerLayerSorter.h.

39  {
40  return m_tubeLaySwitch;
41  }

◆ 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

Sorted Mdt hits per tube layer.

Definition at line 44 of file SpacePointPerLayerSorter.h.

◆ m_nMdtHits

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

Number of all Mdt tube hits

Definition at line 48 of file SpacePointPerLayerSorter.h.

◆ m_nStripHits

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

Number of all strip hits.

Definition at line 50 of file SpacePointPerLayerSorter.h.

◆ m_stripLayers

HitLayVec MuonR4::SpacePointPerLayerSorter::m_stripLayers {}
private

Sorted Strip hits per gasGap strip

Definition at line 46 of file SpacePointPerLayerSorter.h.

◆ m_tubeLaySwitch

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

Index of the first tube-layer from the second multilayer.

Definition at line 52 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
Number of all Mdt tube hits
Definition: SpacePointPerLayerSorter.h:48
MuonR4::stripSmartPtr
HitVec stripSmartPtr(const SpacePointBucket &bucket)
Definition: SpacePointPerLayerSorter.cxx:10
MuonR4::SpacePointPerLayerSorter::m_stripLayers
HitLayVec m_stripLayers
Sorted Strip hits per gasGap strip
Definition: SpacePointPerLayerSorter.h:46
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
Number of all strip hits.
Definition: SpacePointPerLayerSorter.h:50
MuonR4::SpacePointPerLayerSorter::m_tubeLaySwitch
unsigned int m_tubeLaySwitch
Index of the first tube-layer from the second multilayer.
Definition: SpacePointPerLayerSorter.h:52
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
MuonR4::SpacePointPerLayerSorter::m_mdtLayers
HitLayVec m_mdtLayers
Sorted Mdt hits per tube layer.
Definition: SpacePointPerLayerSorter.h:44
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