ATLAS Offline Software
NswClusteringUtils.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONPREPRAWDATA_NSWCLUSTERING_UTILS_H
5 #define MUONPREPRAWDATA_NSWCLUSTERING_UTILS_H
6 
8 #include "TrkSurfaces/Surface.h"
9 
15 namespace Muon {
16  namespace NswClustering {
21  inline Amg::Vector3D toLocal(const Trk::Surface& surf, const Amg::Vector3D& dir){
22  Amg::Rotation3D rotMat{surf.transform().inverse().linear()};
23  const Amg::Vector3D rotDir = rotMat * dir;
24  return Amg::Vector3D{rotDir.x(), rotDir.y(), std::abs(rotDir.z())};
25  }
26  inline Amg::Vector3D toLocal(const MuonCluster& prd,const Amg::Vector3D& dir){
27  return toLocal(prd.detectorElement()->surface(prd.identify()), dir);
28  }
29  inline Amg::Vector3D toLocal(const MuonCluster& prd) {
30  return toLocal(prd, prd.globalPosition().unit());
31  }
32  }
33 }
34 #endif
MuonCluster.h
Amg::Rotation3D
Eigen::Quaternion< double > Rotation3D
Definition: GeoPrimitives.h:43
Surface.h
Muon::MuonCluster::globalPosition
virtual const Amg::Vector3D & globalPosition() const =0
Returns the global position of the measurement (calculated on the fly)
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
MuonGM::MuonClusterReadoutElement::surface
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
Definition: MuonClusterReadoutElement.h:123
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Muon::NswClustering::toLocal
Amg::Vector3D toLocal(const Trk::Surface &surf, const Amg::Vector3D &dir)
Rotates a direction vector into a local frame: x-axis : Parallell to the radial direction of the dete...
Definition: NswClusteringUtils.h:21
Muon::MuonCluster
Class representing clusters in the muon system.
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MuonCluster.h:37
Muon::MuonCluster::detectorElement
virtual const MuonGM::MuonClusterReadoutElement * detectorElement() const override=0
Returns the detector element corresponding to this PRD.
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::Surface::transform
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.