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::stable_sort(hits, [](const SpacePoint* a, const SpacePoint*b){
25  const double dZ = a->positionInChamber().z() - b->positionInChamber().z();
26  if (std::abs(dZ) > 50.*Gaudi::Units::micrometer) {
27  return dZ < 0.;
28  }
29  return a->positionInChamber().y() < b->positionInChamber().y();
30  });
31  const Muon::IMuonIdHelperSvc* idHelperSvc{hits.front()->msSector()->idHelperSvc()};
32  m_mdtLayers.reserve(8);
33 
37  using LayerCounting = std::unordered_map<Identifier, unsigned int>;
38  LayerCounting mdtLayerCounting{}, stripLayerCounting{};
39  for (const SpacePoint* hit : hits) {
40  const Identifier& id {hit->identify()};
41  if (hit->type() == xAOD::UncalibMeasType::MdtDriftCircleType) {
42  const MdtIdHelper& idHelper{idHelperSvc->mdtIdHelper()};
43  const Identifier layId = idHelper.channelID(idHelper.stationName(id), 1, idHelper.stationPhi(id),
44  idHelper.multilayer(id), idHelper.tubeLayer(id), 1);
45 
46  const unsigned int layer = mdtLayerCounting.insert(std::make_pair(layId, mdtLayerCounting.size())).first->second;
47  if (layer >= m_mdtLayers.size()) {
48  m_mdtLayers.resize(layer + 1);
49  }
50  HitVec& pushTo{m_mdtLayers[layer]};
51  if (pushTo.capacity() == pushTo.size()){
52  pushTo.reserve(pushTo.size() + 5);
53  }
54  pushTo.push_back(hit);
55  ++m_nMdtHits;
56  if (!m_tubeLaySwitch && layer &&
57  m_mdtLayers[layer -1].front()->primaryMeasurement()->identifierHash() != hit->primaryMeasurement()->identifierHash()) {
58 
59  }
60  } else {
61  const Identifier layId = idHelperSvc->gasGapId(id);
62  const unsigned int layer = stripLayerCounting.insert(std::make_pair(layId, stripLayerCounting.size())).first->second;
63 
64  if (layer >= m_stripLayers.size()) {
65  m_stripLayers.resize(layer + 1);
66  }
67  HitVec& pushTo{m_stripLayers[layer]};
68  if (pushTo.capacity() == pushTo.size()){
69  pushTo.reserve(pushTo.size() + 5);
70  }
71  pushTo.push_back(hit);
72  ++m_nStripHits;
73  }
74  }
75  }

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
python.SystemOfUnits.micrometer
int micrometer
Definition: SystemOfUnits.py:71
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
y
#define y
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:27
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
Identifier
Definition: IdentifierFieldParser.cxx:14