ATLAS Offline Software
Loading...
Searching...
No Matches
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

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.localPosition().y() - sp2.localPosition().y();
48 if ( std::abs(dy) > 20 * Gaudi::Units::micrometer ){
49 return dy < 0;
50 }
51 return sp1.localPosition().x() < sp2.localPosition().x();
52 }
53 return lay1 < lay2;
54 }
unsigned int sectorLayerNum(const SpacePoint &sp) const
method returning the logic layer number

◆ 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 }
static Double_t sp
MdtDriftCircle_v1 MdtDriftCircle
TgcStrip_v1 TgcStrip
Definition TgcStripFwd.h:9
RpcMeasurement_v1 RpcMeasurement
MMCluster_v1 MMCluster
sTgcMeasurement_v1 sTgcMeasurement
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10

The documentation for this class was generated from the following files: