ATLAS Offline Software
Loading...
Searching...
No Matches
CathodeBoardElement.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include <utility>
6
8using namespace NswAsBuilt;
9
14/* In the sTGC strip (cathode) boards due to the staggering, the first/last strip could be a half
15* or a full strip depending on the strip_board_type. Therefore first and last strip are handled
16* separately from second or any i-strip
17*/
19 Eigen::Matrix3d vectorset{Eigen::Matrix3d::Identity()};
20 if (stripNumber == 1){
21 vectorset.col(0) = m_config_stgc.fCenterPoint.pos;
22 vectorset.col(1) = m_config_stgc.fLeftPoint.pos;
23 vectorset.col(2) = m_config_stgc.fRightPoint.pos;
24 }
25 else if (stripNumber == m_config_stgc.lastStripNumber){
26 vectorset.col(0) = m_config_stgc.lCenterPoint.pos;
27 vectorset.col(1) = m_config_stgc.lLeftPoint.pos;
28 vectorset.col(2) = m_config_stgc.lRightPoint.pos;
29 }
30 else {
31 vectorset.col(0) = m_config_stgc.sCenterPoint.pos + (stripNumber - 2) * m_config_stgc.sCenterPoint.pitch;
32 vectorset.col(1) = m_config_stgc.sLeftPoint.pos + (stripNumber - 2) * m_config_stgc.sLeftPoint.pitch;
33 vectorset.col(2) = m_config_stgc.sRightPoint.pos + (stripNumber - 2) * m_config_stgc.sRightPoint.pitch;
34 }
35
36 m_element_stgc.transformToFrame(iclass, vectorset, nullptr);
37
38 stgcStrip_t ret;
39 ret.center = vectorset.col(0);
40 ret.left = vectorset.col(1);
41 ret.right = vectorset.col(2);
42 return ret;
43}
44
45Amg::Vector3D CathodeBoardElement::getPositionAlongStgcStrip(ParameterClass iclass, int stripNumber, double sx, double sy) const {
46 Amg::Vector3D center{Amg::Vector3D::Zero()}, left{Amg::Vector3D::Zero()}, right{Amg::Vector3D::Zero()};
47 if (stripNumber == 1){
48 center = m_config_stgc.fCenterPoint.pos;
49 left = m_config_stgc.fLeftPoint.pos;
50 right = m_config_stgc.fRightPoint.pos;
51 }
52 else if (stripNumber == m_config_stgc.lastStripNumber){
53 center = m_config_stgc.lCenterPoint.pos;
54 left = m_config_stgc.lLeftPoint.pos;
55 right = m_config_stgc.lRightPoint.pos;
56 }
57 else {
58 center = m_config_stgc.sCenterPoint.pos + (stripNumber - 2) * m_config_stgc.sCenterPoint.pitch;
59 left = m_config_stgc.sLeftPoint.pos + (stripNumber - 2) * m_config_stgc.sLeftPoint.pitch;
60 right = m_config_stgc.sRightPoint.pos + (stripNumber - 2) * m_config_stgc.sRightPoint.pitch;
61 }
62
63 // sy is the radial distance from the strip center / pitch, so in [-0.5, 0.5]
64 center += sy * m_config_stgc.sCenterPoint.pitch;
65 left += sy * m_config_stgc.sLeftPoint.pitch;
66 right += sy * m_config_stgc.sRightPoint.pitch;
67
68 // Get strip-local coordinate of point along strip
69 // Note: left, center and right are exactly in line in local coordinates
70 // (i.e. strip is not deformed in local coordinates)
71 Amg::Vector3D ret = center;
72 if (sx < 0.0) {
73 ret = (sx+1.0)*center - sx*left;
74 } else {
75 ret = (1.0-sx)*center + sx*right;
76 }
77 m_element_stgc.transformToFrame(iclass, ret, nullptr);
78 return ret;
79}
80
stgcStripConfiguration_t m_config_stgc
stgcStrip_t getStgcStrip(ParameterClass iclass, int stripNumber) const
Returns three points (center, left, right) of a given strip, in quadruplet coordinates.
CathodeBoardElement(stgcStripConfiguration_t config, const Element &element)
Constructor.
Element::ParameterClass ParameterClass
Amg::Vector3D getPositionAlongStgcStrip(ParameterClass iclass, int stripNumber, double sx, double sy) const
Returns a point on the strip, parameterized by second coordinate s, in [-1,+1].
Element: a node in a hierarchy of alignment frames.
Definition Element.h:52
Eigen::Matrix< double, 3, 1 > Vector3D
STL namespace.
The return type of the getStrip method: three points along the strip, in quadruplet coordinate.