ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
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. More...
 

Public Member Functions

 MuonSegmentKey ()
 default constructor More...
 
 MuonSegmentKey (const MuonSegment &segment)
 constructor taking a MuonSegment More...
 
 MuonSegmentKey (const std::vector< const Trk::MeasurementBase * > &measurements)
 constructor taking a vector of measurements More...
 
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 More...
 
virtual ~MuonSegmentKey ()
 
const MeasurementKeyskeys () const
 access to precision hit keys More...
 
const MeasurementKeyskeysTrigger () const
 access to trigger hit keys More...
 

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 }

◆ 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 }

◆ 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:
Trk::LocalParameters
Definition: LocalParameters.h:98
skel.it
it
Definition: skel.GENtoEVGEN.py:396
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Muon::CompetingMuonClustersOnTrack
Definition: CompetingMuonClustersOnTrack.h:54
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
Muon::MuonSegmentKey::m_measKeysTrigger
MeasurementKeys m_measKeysTrigger
Definition: MuonSegmentKey.h:52
Trk::LocalParameters::get
double get(ParamDefs par) const
Retrieve specified parameter (const version).
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
Muon::sTgcClusterOnTrack
Class to represent calibrated clusters formed from TGC strips.
Definition: sTgcClusterOnTrack.h:30
Muon::MMClusterOnTrack
Class to represent calibrated clusters formed from TGC strips.
Definition: MMClusterOnTrack.h:26
Muon::MuonSegmentKey::calculateKeys
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...
Definition: MuonSegmentKey.cxx:26
Muon::MdtDriftCircleOnTrack
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
Definition: MdtDriftCircleOnTrack.h:37
Muon::CompetingMuonClustersOnTrack::containedROTs
const std::vector< const MuonClusterOnTrack * > & containedROTs() const
returns the vector of SCT_ClusterOnTrack objects .
Definition: CompetingMuonClustersOnTrack.h:184
Muon::CscClusterOnTrack
Class to represent the calibrated clusters created from CSC strips.
Definition: CscClusterOnTrack.h:47
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
Trk::loc1
@ loc1
Definition: ParamDefs.h:34
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5
Muon::MuonSegmentKey::m_measKeys
MeasurementKeys m_measKeys
Definition: MuonSegmentKey.h:51