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

The SpacePointPerLayerSorter sort two given space points by their layer Identifier. More...

#include <SpacePointPerLayerSorter.h>

Collaboration diagram for MuonR4::SpacePointPerLayerSorter:

Public Member Functions

 SpacePointPerLayerSorter ()=default
 
bool operator() (const std::shared_ptr< SpacePoint > &sp1, const std::shared_ptr< SpacePoint > &sp2) const
 
bool operator() (const std::unique_ptr< SpacePoint > &sp1, const std::unique_ptr< SpacePoint > &sp2) const
 
bool operator() (const SpacePoint *sp1, const SpacePoint *sp2) const
 
bool operator() (const SpacePoint &sp1, const SpacePoint &sp2) const
 
unsigned int sectorLayerNum (const SpacePoint &sp) const
 method returning the logic layer number More...
 

Detailed Description

The SpacePointPerLayerSorter sort two given 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 layer Identifier - i.e. going outwards the detector. Then, hits in the same layer are sorted by y position (precision axis) in the sector frame and, if they have also the same y, they are sorted by x position (phi direction).

Definition at line 15 of file SpacePointPerLayerSorter.h.

Constructor & Destructor Documentation

◆ SpacePointPerLayerSorter()

MuonR4::SpacePointPerLayerSorter::SpacePointPerLayerSorter ( )
default

Member Function Documentation

◆ operator()() [1/4]

bool MuonR4::SpacePointPerLayerSorter::operator() ( const SpacePoint sp1,
const SpacePoint sp2 
) const

Definition at line 41 of file SpacePointPerLayerSorter.cxx.

41  {
42 
43  const unsigned int lay1 {sectorLayerNum(sp1)};
44  const unsigned int lay2 {sectorLayerNum(sp2)};
45 
46  if (lay1 == lay2) {
47  const double dy = sp1.positionInChamber().y() - sp2.positionInChamber().y();
48  if ( std::abs(dy) > 20 * Gaudi::Units::micrometer ){
49  return dy < 0;
50  }
51  return sp1.positionInChamber().x() < sp2.positionInChamber().x();
52  }
53  return lay1 < lay2;
54  }

◆ operator()() [2/4]

bool MuonR4::SpacePointPerLayerSorter::operator() ( const SpacePoint sp1,
const SpacePoint sp2 
) const

Definition at line 63 of file SpacePointPerLayerSorter.cxx.

63  {
64  return (*this)(*sp1, *sp2);
65  }

◆ operator()() [3/4]

bool MuonR4::SpacePointPerLayerSorter::operator() ( const std::shared_ptr< SpacePoint > &  sp1,
const std::shared_ptr< SpacePoint > &  sp2 
) const

Definition at line 56 of file SpacePointPerLayerSorter.cxx.

56  {
57  return (*this)(*sp1, *sp2);
58  }

◆ operator()() [4/4]

bool MuonR4::SpacePointPerLayerSorter::operator() ( const std::unique_ptr< SpacePoint > &  sp1,
const std::unique_ptr< SpacePoint > &  sp2 
) const

Definition at line 60 of file SpacePointPerLayerSorter.cxx.

60  {
61  return (*this)(*sp1, *sp2);
62  }

◆ sectorLayerNum()

unsigned int MuonR4::SpacePointPerLayerSorter::sectorLayerNum ( const SpacePoint sp) const

method returning the logic layer number

Definition at line 13 of file SpacePointPerLayerSorter.cxx.

13  {
14 
15  switch (sp.primaryMeasurement()->type()){
17  auto mdtMeas = static_cast<const xAOD::MdtDriftCircle*>(sp.primaryMeasurement());
18  return sp.msSector()->logicalLayerIdx(mdtMeas->readoutElement()).at(mdtMeas->tubeLayer()-1);
19  }
21  auto rpcMeas = static_cast<const xAOD::RpcMeasurement*>(sp.primaryMeasurement());
22  return sp.msSector()->logicalLayerIdx(rpcMeas->readoutElement()).at(rpcMeas->gasGap()-1);
23  }
25  auto tgcMeas = static_cast<const xAOD::TgcStrip*>(sp.primaryMeasurement());
26  return sp.msSector()->logicalLayerIdx(tgcMeas->readoutElement()).at(tgcMeas->gasGap()-1);
27  }
29  auto stgcMeas = static_cast<const xAOD::sTgcMeasurement*>(sp.primaryMeasurement());
30  return sp.msSector()->logicalLayerIdx(stgcMeas->readoutElement()).at(stgcMeas->gasGap()-1);
31  }
33  auto mmMeas = static_cast<const xAOD::MMCluster*>(sp.primaryMeasurement());
34  return sp.msSector()->logicalLayerIdx(mmMeas->readoutElement()).at(mmMeas->gasGap()-1);
35  }
36  default:
37  THROW_EXCEPTION("Unexpected Measurement Type in sectorLayerNum()");
38  }
39  }

The documentation for this class was generated from the following files:
xAOD::RpcMeasurement_v1
RpcMeasurement_v1: Class storing the geneic.
Definition: RpcMeasurement_v1.h:21
xAOD::MMCluster_v1
Definition: MMCluster_v1.h:20
MuonR4::SpacePointPerLayerSorter::sectorLayerNum
unsigned int sectorLayerNum(const SpacePoint &sp) const
method returning the logic layer number
Definition: SpacePointPerLayerSorter.cxx:13
xAOD::TgcStrip_v1
Definition: TgcStrip_v1.h:19
xAOD::UncalibMeasType::MMClusterType
@ MMClusterType
xAOD::UncalibMeasType::sTgcStripType
@ sTgcStripType
xAOD::UncalibMeasType::TgcStripType
@ TgcStripType
python.SystemOfUnits.micrometer
float micrometer
Definition: SystemOfUnits.py:80
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition: throwExcept.h:10
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
xAOD::MdtDriftCircle_v1
https://gitlab.cern.ch/atlas/athena/-/blob/master/MuonSpectrometer/MuonReconstruction/MuonRecEvent/Mu...
Definition: MdtDriftCircle_v1.h:21
xAOD::UncalibMeasType::RpcStripType
@ RpcStripType
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
xAOD::sTgcMeasurement_v1
Definition: sTgcMeasurement_v1.h:21