ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::MuonSegmentKey Class Reference

Class to cache the identifiers on a segment in sets that can later be used to perform an overlap removel between two segments. More...

#include <MuonSegmentKey.h>

Collaboration diagram for Muon::MuonSegmentKey:

Public Types

typedef std::set< std::pair< unsigned int, int > > MeasurementKeys
 The first int is the Identifier, whilst the second is the sign of the 1st measurement (i.e.

Public Member Functions

 MuonSegmentKey ()
 default constructor
 MuonSegmentKey (const MuonSegment &segment)
 constructor taking a MuonSegment
 MuonSegmentKey (const std::vector< const Trk::MeasurementBase * > &measurements)
 constructor taking a vector of measurements
void calculateKeys (const std::vector< const Trk::MeasurementBase * > &measurements, int signCor=1)
 function to calculate keys from a vector of measurements, the signCor is can be use to flip the signs of the MDT hits if the two segments that are compared have opposite directions
virtual ~MuonSegmentKey ()
const MeasurementKeyskeys () const
 access to precision hit keys
const MeasurementKeyskeysTrigger () const
 access to trigger hit keys

Private Attributes

MeasurementKeys m_measKeys
MeasurementKeys m_measKeysTrigger

Detailed Description

Class to cache the identifiers on a segment in sets that can later be used to perform an overlap removel between two segments.

Author
Ed Moyse, Niels van Eldik

Definition at line 24 of file MuonSegmentKey.h.

Member Typedef Documentation

◆ MeasurementKeys

typedef std::set<std::pair<unsigned int, int> > Muon::MuonSegmentKey::MeasurementKeys

The first int is the Identifier, whilst the second is the sign of the 1st measurement (i.e.

drift radius)

Definition at line 27 of file MuonSegmentKey.h.

Constructor & Destructor Documentation

◆ MuonSegmentKey() [1/3]

Muon::MuonSegmentKey::MuonSegmentKey ( )
default

default constructor

◆ MuonSegmentKey() [2/3]

Muon::MuonSegmentKey::MuonSegmentKey ( const MuonSegment & segment)

constructor taking a MuonSegment

Definition at line 18 of file MuonSegmentKey.cxx.

18 {
19 // to ensure consistent usage of MDT signs flip
20 int signCor = segment.localDirection().angleYZ() < 0 ? -1 : 1;
21 calculateKeys(segment.containedMeasurements(), signCor);
22}
void calculateKeys(const std::vector< const Trk::MeasurementBase * > &measurements, int signCor=1)
function to calculate keys from a vector of measurements, the signCor is can be use to flip the signs...
double angleYZ() const
access method for angle of local YZ projection
const std::vector< const Trk::MeasurementBase * > & containedMeasurements() const
returns the vector of Trk::MeasurementBase objects

◆ MuonSegmentKey() [3/3]

Muon::MuonSegmentKey::MuonSegmentKey ( const std::vector< const Trk::MeasurementBase * > & measurements)

constructor taking a vector of measurements

Definition at line 24 of file MuonSegmentKey.cxx.

24{ calculateKeys(measurements, 1); }

◆ ~MuonSegmentKey()

Muon::MuonSegmentKey::~MuonSegmentKey ( )
virtualdefault

Member Function Documentation

◆ calculateKeys()

void Muon::MuonSegmentKey::calculateKeys ( const std::vector< const Trk::MeasurementBase * > & measurements,
int signCor = 1 )

function to calculate keys from a vector of measurements, the signCor is can be use to flip the signs of the MDT hits if the two segments that are compared have opposite directions

Definition at line 26 of file MuonSegmentKey.cxx.

26 {
27 // clear internal lists
28 m_measKeys.clear();
29 m_measKeysTrigger.clear();
30
31 // loop over measurements
32 std::vector<const Trk::MeasurementBase*>::const_iterator it = measurements.begin(), itEnd = measurements.end();
33 for (; it != itEnd; ++it) {
34 const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(*it);
35 const Muon::CompetingMuonClustersOnTrack* crot = nullptr;
36 if (!rot) {
37 crot = dynamic_cast<const Muon::CompetingMuonClustersOnTrack*>(*it);
38
39 if (crot && !crot->containedROTs().empty()) rot = crot->containedROTs().front();
40 }
41 if (!rot) continue;
42
43 // cast Identifier to an int
44 unsigned int id = rot->identify().get_identifier32().get_compact();
45 int sign = 1;
46 // only consider MDT's and CSCs for now
47 const Muon::MdtDriftCircleOnTrack* mdt = dynamic_cast<const Muon::MdtDriftCircleOnTrack*>(*it);
48 if (mdt) {
49 // get drift radius for MDTs
50 const Trk::LocalParameters& locParams = (*it)->localParameters();
51
52 // only take into account sign if more than 1 mm from wire
53 if (signCor * locParams.get(Trk::loc1) < -1.) sign = -1;
54
55 // if signCor == 2 ignore sign
56 if (signCor == 2) sign = 1;
57
58 m_measKeys.insert(std::make_pair(id, sign));
59 } else if (dynamic_cast<const Muon::CscClusterOnTrack*>(*it)) {
60 m_measKeys.insert(std::make_pair(id, sign));
61 } else if (dynamic_cast<const Muon::MMClusterOnTrack*>(*it)) {
62 m_measKeys.insert(std::make_pair(id, sign));
63 } else if (dynamic_cast<const Muon::sTgcClusterOnTrack*>(*it)) {
64 m_measKeys.insert(std::make_pair(id, sign));
65 } else {
66 m_measKeysTrigger.insert(std::make_pair(id, sign));
67 }
68 }
69}
int sign(int a)
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
const std::vector< const MuonClusterOnTrack * > & containedROTs() const
returns the vector of SCT_ClusterOnTrack objects .
MeasurementKeys m_measKeysTrigger
MeasurementKeys m_measKeys
double get(ParamDefs par) const
Retrieve specified parameter (const version).
Identifier identify() const
return the identifier -extends MeasurementBase
@ loc1
Definition ParamDefs.h:34

◆ keys()

const Muon::MuonSegmentKey::MeasurementKeys & Muon::MuonSegmentKey::keys ( ) const
inline

access to precision hit keys

Definition at line 59 of file MuonSegmentKey.h.

59{ return m_measKeys; }

◆ keysTrigger()

const Muon::MuonSegmentKey::MeasurementKeys & Muon::MuonSegmentKey::keysTrigger ( ) const
inline

access to trigger hit keys

Definition at line 57 of file MuonSegmentKey.h.

57{ return m_measKeysTrigger; }

Member Data Documentation

◆ m_measKeys

MeasurementKeys Muon::MuonSegmentKey::m_measKeys
private

Definition at line 51 of file MuonSegmentKey.h.

◆ m_measKeysTrigger

MeasurementKeys Muon::MuonSegmentKey::m_measKeysTrigger
private

Definition at line 52 of file MuonSegmentKey.h.


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