ATLAS Offline Software
Loading...
Searching...
No Matches
StripSpacePointFormationTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <cmath>
8
9namespace ActsTrk {
10
12 std::vector<StripSP>& collection,
13 const StripInformationHelper& firstInfo,
14 const StripInformationHelper& secondInfo,
15 const Amg::Vector3D& /*beamSpotVertex*/,
16 bool isEndcap,
17 double limit,
18 double slimit) const
19 {
20 // The vertex enters through StripInformationHelper::trajDirection().
21
22 double a =-firstInfo.trajDirection().dot(secondInfo.normal());
23 double b = firstInfo.stripDirection().dot(secondInfo.normal());
24 double l0 = firstInfo.oneOverStrip()*slimit+limit ;
25
26 if(std::abs(a) > (std::abs(b)*l0)) {
27 ATH_MSG_DEBUG("SP fails geometric cuts (first)");
29 return StatusCode::SUCCESS;
30 }
31 }
32
33 double c =-secondInfo.trajDirection().dot(firstInfo.normal());
34 double d = secondInfo.stripDirection().dot(firstInfo.normal());
35 double l1 = secondInfo.oneOverStrip()*slimit+limit ;
36
37 if(std::abs(c) > (std::abs(d)*l1)) {
38 ATH_MSG_DEBUG("SP fails geometric cuts (second)");
40 return StatusCode::SUCCESS;
41 }
42 }
43
44 double m = a/b;
45
46 if(slimit!=0.) {
47 double n = c/d;
48 if (m > limit || n > limit) {
49 double cs = firstInfo.stripDirection().dot(secondInfo.stripDirection())*(firstInfo.oneOverStrip()*firstInfo.oneOverStrip());
50 double dm = (m-1);
51 double dmn = (n-1.)*cs;
52 if(dmn > dm) dm = dmn;
53 m-=dm; n-=(dm/cs);
54 if(std::abs(m) > limit || std::abs(n) > limit) {
55 ATH_MSG_DEBUG("SP falls outside of limit");
57 return StatusCode::SUCCESS;
58 }
59 }
60 } else if (m < -limit || n < -limit) {
61 double cs = firstInfo.stripDirection().dot(secondInfo.stripDirection())*(firstInfo.oneOverStrip()*firstInfo.oneOverStrip());
62 double dm = -(1.+m);
63 double dmn = -(1.+n)*cs;
64 if(dmn > dm) dm = dmn;
65 m+=dm; n+=(dm/cs);
66 if(std::abs(m) > limit || std::abs(n) > limit) {
67 ATH_MSG_DEBUG("SP falls outside of limit");
69 return StatusCode::SUCCESS;
70 }
71 }
72 }
73 }
74
75 Eigen::Matrix<double, 3, 1> globalPosition(m_useTopSp ? secondInfo.position(m) : firstInfo.position(m));
76
77 collection.push_back(makeStripSP(globalPosition, firstInfo, secondInfo, isEndcap));
78
79 return StatusCode::SUCCESS;
80 }
81}
#define ATH_MSG_DEBUG(x,...)
static Double_t a
const Amg::Vector3D & stripDirection() const
Amg::Vector3D position(const double &shift) const
const Amg::Vector3D & trajDirection() const
const Amg::Vector3D & normal() const
static StripSP makeStripSP(const Eigen::Matrix< double, 3, 1 > &globalPosition, const StripInformationHelper &firstInfo, const StripInformationHelper &secondInfo, bool isEndcap)
Fill the StripSP payload that is common to all implementations, i.e.
virtual StatusCode makeStripSpacePoint(std::vector< StripSP > &collection, const StripInformationHelper &firstInfo, const StripInformationHelper &secondInfo, const Amg::Vector3D &beamSpotVertex, bool isEndcap, double limit, double slimit) const override
Compute the space point position for a compatible pair of strips and, if it satisfies the geometrical...
Gaudi::Property< bool > m_useBeamSpotConstraint
For applying geometric cuts on SPs using beamspot constraint.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Eigen::Matrix< double, 3, 1 > Vector3D