Skip to content
Snippets Groups Projects
Commit 7057bf16 authored by Patrick Scholer's avatar Patrick Scholer Committed by Duc Ta
Browse files

Modify NSWClusterUtils to get local directions given a surface

Modify NSWClusterUtils to get local directions given a surface
parent f0fe938c
No related branches found
No related tags found
2 merge requests!714242024-05-16: merge of 24.0 into main,!71393Modify NSWClusterUtils to get local directions given a surface
......@@ -5,6 +5,7 @@
#define MUONPREPRAWDATA_NSWCLUSTERING_UTILS_H
#include "MuonPrepRawData/MuonCluster.h"
#include "TrkSurfaces/Surface.h"
/**
* Small helper functions to define a not neccessarily right-handed coordinate system which is
......@@ -17,11 +18,14 @@ namespace Muon {
/// x-axis : Parallell to the radial direction of the detector centre
/// y-axis : Pependicular to the x-axis in the transverse plane
/// z-axis : Points to the big wheel
inline Amg::Vector3D toLocal(const MuonCluster& prd,const Amg::Vector3D& dir){
Amg::Rotation3D rotMat{prd.detectorElement()->surface(prd.identify()).transform().inverse().linear()};
inline Amg::Vector3D toLocal(const Trk::Surface& surf, const Amg::Vector3D& dir){
Amg::Rotation3D rotMat{surf.transform().inverse().linear()};
const Amg::Vector3D rotDir = rotMat * dir;
return Amg::Vector3D{rotDir.x(), rotDir.y(), std::abs(rotDir.z())};
}
inline Amg::Vector3D toLocal(const MuonCluster& prd,const Amg::Vector3D& dir){
return toLocal(prd.detectorElement()->surface(prd.identify()), dir);
}
inline Amg::Vector3D toLocal(const MuonCluster& prd) {
return toLocal(prd, prd.globalPosition().unit());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment