ATLAS Offline Software
Loading...
Searching...
No Matches
MuonSegmentKey.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
15
17
19 // to ensure consistent usage of MDT signs flip
20 int signCor = segment.localDirection().angleYZ() < 0 ? -1 : 1;
21 calculateKeys(segment.containedMeasurements(), signCor);
22}
23
24Muon::MuonSegmentKey::MuonSegmentKey(const std::vector<const Trk::MeasurementBase*>& measurements) { calculateKeys(measurements, 1); }
25
26void Muon::MuonSegmentKey::calculateKeys(const std::vector<const Trk::MeasurementBase*>& measurements, int signCor) {
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}
70
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.
Class for competing MuonClusters, it extends the Trk::CompetingRIOsOnTrack base class.
const std::vector< const MuonClusterOnTrack * > & containedROTs() const
returns the vector of SCT_ClusterOnTrack objects .
Class to represent the calibrated clusters created from CSC strips.
Class to represent calibrated clusters formed from TGC strips.
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
MeasurementKeys m_measKeysTrigger
MuonSegmentKey()
default constructor
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...
MeasurementKeys m_measKeys
virtual ~MuonSegmentKey()
This is the common class for 3D segments used in the muon spectrometer.
Class to represent calibrated clusters formed from TGC strips.
double angleYZ() const
access method for angle of local YZ projection
double get(ParamDefs par) const
Retrieve specified parameter (const version).
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Definition RIO_OnTrack.h:70
Identifier identify() const
return the identifier -extends MeasurementBase
const std::vector< const Trk::MeasurementBase * > & containedMeasurements() const
returns the vector of Trk::MeasurementBase objects
@ loc1
Definition ParamDefs.h:34