ATLAS Offline Software
Loading...
Searching...
No Matches
PcbElement.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
10
11//===============================================================================
15
16
17//===============================================================================
19{
20 int npitch = stripNumber - m_config.centralStripNumber;
21 Eigen::Matrix3d vectorset;
22 vectorset.col(0) = m_config.centerPoint.pos + npitch * m_config.centerPoint.pitchvector;
23 vectorset.col(1) = m_config.leftPoint.pos + npitch * m_config.leftPoint.pitchvector;
24 vectorset.col(2) = m_config.rightPoint.pos + npitch * m_config.rightPoint.pitchvector;
25
26 m_element.transformToFrame(iclass, vectorset, nullptr);
27
28 strip_t ret;
29 ret.center = vectorset.col(0);
30 ret.left = vectorset.col(1);
31 ret.right = vectorset.col(2);
32 return ret;
33}
34
35
36//===============================================================================
37Amg::Vector3D PcbElement::getPositionAlongStrip(ParameterClass iclass, int stripNumber, double sx, double sy) const
38{
39 // sx is expected to be in [-1, 1]
40 // sy is expected to be in [-0.5, 0.5] (i.e. in a dx band of 1 pitch)
41 double npitch = sy + (stripNumber - m_config.centralStripNumber);
42 Amg::Vector3D center = m_config.centerPoint.pos + npitch * m_config.centerPoint.pitchvector;
43 Amg::Vector3D left = m_config.leftPoint.pos + npitch * m_config.leftPoint.pitchvector;
44 Amg::Vector3D right = m_config.rightPoint.pos + npitch * m_config.rightPoint.pitchvector;
45
46 // Get strip-local coordinate of point along strip
47 // Note: left, center and right are exactly in line in local coordinates
48 // (i.e. strip is not deformed in local coordinates)
49 Amg::Vector3D ret{Amg::Vector3D::Zero()};
50 if (sx < 0.0)
51 ret = (sx+1.0)*center - sx*left;
52 else
53 ret = (1.0-sx)*center + sx*right;
54
55 m_element.transformToFrame(iclass, ret, nullptr);
56 return ret;
57}
58
59
60
Element: a node in a hierarchy of alignment frames.
Definition Element.h:52
Amg::Vector3D getPositionAlongStrip(ParameterClass iclass, int stripNumber, double sx, double sy) const
const Element & m_element
Definition PcbElement.h:63
Element::ParameterClass ParameterClass
Definition PcbElement.h:29
PcbElement(stripConfiguration_t config, const Element &element)
strip_t getStrip(ParameterClass iclass, int stripNumber) const
stripConfiguration_t m_config
Definition PcbElement.h:62
Eigen::Matrix< double, 3, 1 > Vector3D
STL namespace.