ATLAS Offline Software
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 
8 using namespace NswAsBuilt;
9 
11  : m_config_stgc(std::move(config)), m_element_stgc(element)
12 {
13 }
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 
39  ret.center = vectorset.col(0);
40  ret.left = vectorset.col(1);
41  ret.right = vectorset.col(2);
42  return ret;
43 }
44 
45 Amg::Vector3D CathodeBoardElement::getPositionAlongStgcStrip(ParameterClass iclass, int stripNumber, double sx, double sy) const {
47  if (stripNumber == 1){
51  }
52  else if (stripNumber == m_config_stgc.lastStripNumber){
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 
fitman.sy
sy
Definition: fitman.py:524
NswAsBuilt::CathodeBoardElement::stgcStrip_t
The return type of the getStrip method: three points along the strip, in quadruplet coordinate.
Definition: CathodeBoardElement.h:61
NswAsBuilt::CathodeBoardElement::stgcStripConfiguration_t
Definition: CathodeBoardElement.h:38
NswAsBuilt::CathodeBoardElement::getPositionAlongStgcStrip
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].
Definition: CathodeBoardElement.cxx:45
NswAsBuilt::CathodeBoardElement::CathodeBoardElement
CathodeBoardElement(stgcStripConfiguration_t config, const Element &element)
Constructor.
Definition: CathodeBoardElement.cxx:10
NswAsBuilt::CathodeBoardElement::stgcStripConfiguration_t::fCenterPoint
stgcStripPoint_t fCenterPoint
Definition: CathodeBoardElement.h:40
NswAsBuilt::CathodeBoardElement::m_config_stgc
stgcStripConfiguration_t m_config_stgc
Definition: CathodeBoardElement.h:81
NswAsBuilt::CathodeBoardElement::stgcStripPoint_t::pitch
Amg::Vector3D pitch
Definition: CathodeBoardElement.h:35
NswAsBuilt::CathodeBoardElement::stgcStripConfiguration_t::lastStripNumber
int lastStripNumber
Definition: CathodeBoardElement.h:39
NswAsBuilt::CathodeBoardElement::getStgcStrip
stgcStrip_t getStgcStrip(ParameterClass iclass, int stripNumber) const
Returns three points (center, left, right) of a given strip, in quadruplet coordinates.
Definition: CathodeBoardElement.cxx:18
python.compressB64.sx
string sx
Definition: compressB64.py:96
NswAsBuilt::CathodeBoardElement::stgcStripConfiguration_t::sRightPoint
stgcStripPoint_t sRightPoint
Definition: CathodeBoardElement.h:45
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
NswAsBuilt::CathodeBoardElement::stgcStripPoint_t::pos
Amg::Vector3D pos
Definition: CathodeBoardElement.h:34
ret
T ret(T t)
Definition: rootspy.cxx:260
NswAsBuilt::CathodeBoardElement::stgcStripConfiguration_t::fLeftPoint
stgcStripPoint_t fLeftPoint
Definition: CathodeBoardElement.h:41
NswAsBuilt::CathodeBoardElement::stgcStripConfiguration_t::sLeftPoint
stgcStripPoint_t sLeftPoint
Definition: CathodeBoardElement.h:44
NswAsBuilt::CathodeBoardElement::stgcStripConfiguration_t::sCenterPoint
stgcStripPoint_t sCenterPoint
Definition: CathodeBoardElement.h:43
NswAsBuilt::CathodeBoardElement::stgcStripConfiguration_t::lLeftPoint
stgcStripPoint_t lLeftPoint
Definition: CathodeBoardElement.h:47
NswAsBuilt::CathodeBoardElement::stgcStripConfiguration_t::lRightPoint
stgcStripPoint_t lRightPoint
Definition: CathodeBoardElement.h:48
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
CathodeBoardElement.h
NswAsBuilt::Element::ParameterClass
ParameterClass
Definition: Element.h:63
NswAsBuilt::CathodeBoardElement::m_element_stgc
const Element & m_element_stgc
Definition: CathodeBoardElement.h:82
NswAsBuilt::CathodeBoardElement::stgcStripConfiguration_t::fRightPoint
stgcStripPoint_t fRightPoint
Definition: CathodeBoardElement.h:42
NswAsBuilt
Definition: CathodeBoardElement.h:12
NswAsBuilt::Element
Element: a node in a hierarchy of alignment frames.
Definition: Element.h:52
NswAsBuilt::Element::transformToFrame
void transformToFrame(ParameterClass iclass, const VectorSetRef &local, const Element *frame) const
Definition: Element.cxx:40
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
NswAsBuilt::CathodeBoardElement::stgcStripConfiguration_t::lCenterPoint
stgcStripPoint_t lCenterPoint
Definition: CathodeBoardElement.h:46