ATLAS Offline Software
Loading...
Searching...
No Matches
BoundaryCylinderSurface.icc
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5///////////////////////////////////////////////////////////////////
6// BoundaryCylinderSurface.icc, (c) ATLAS Detector software
7///////////////////////////////////////////////////////////////////
8
9template<class Tvol>
10inline const Surface&
11BoundaryCylinderSurface<Tvol>::surfaceRepresentation() const
12{
13 return *this;
14}
15
16template<class Tvol>
17inline Surface&
18BoundaryCylinderSurface<Tvol>::surfaceRepresentation()
19{
20 return *this;
21}
22
23template<class Tvol>
24inline const Tvol*
25BoundaryCylinderSurface<Tvol>::attachedVolume(const TrackParameters& parms,
26 PropDirection dir) const
27{
28 const Tvol* attVolume = nullptr;
29 auto locPos = this->surfaceRepresentation().globalToLocal(parms.position());
30 Amg::Vector3D localNormal{};
31 if (locPos) {
32 localNormal = this->surfaceRepresentation().normal(*locPos);
33 } else {
34 return attVolume;
35 }
36
37 if (localNormal.dot(dir * parms.momentum()) > 0.) {
38 attVolume = BoundarySurface<Tvol>::m_outsideVolume;
39 if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()) {
40 attVolume = BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(
41 parms.position());
42 }
43 } else {
44 attVolume = BoundarySurface<Tvol>::m_insideVolume;
45 if (BoundarySurface<Tvol>::m_insideVolumeArray.get()) {
46 attVolume = BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(
47 parms.position());
48 }
49 }
50 return attVolume;
51}
52
53template<class Tvol>
54inline const Tvol*
55BoundaryCylinderSurface<Tvol>::attachedVolume(const Amg::Vector3D& pos,
56 const Amg::Vector3D& mom,
57 PropDirection dir) const
58{
59 const Tvol* attVolume = nullptr;
60 // const Amg::Vector2D* lp =
61 // CylinderSurface::globalToLocal(pos, 2.*Gaudi::Units::mm);
62 Amg::Vector2D lp{};
63 // The new interface returns true or false , based on internal tolerance
64 // there is not nullptr to check.
65 const bool intol = CylinderSurface::globalToLocal(pos, pos, lp);
66
67 if (intol) {
68 Amg::Vector3D localNormal = CylinderSurface::normal(lp);
69 if (localNormal.dot(dir * mom) > 0.) {
70 attVolume = BoundarySurface<Tvol>::m_outsideVolume;
71 if (BoundarySurface<Tvol>::m_outsideVolumeArray.get()) {
72 attVolume =
73 BoundarySurface<Tvol>::m_outsideVolumeArray.get()->object(pos);
74 }
75 } else {
76 attVolume = BoundarySurface<Tvol>::m_insideVolume;
77 if (BoundarySurface<Tvol>::m_insideVolumeArray.get()) {
78 attVolume =
79 BoundarySurface<Tvol>::m_insideVolumeArray.get()->object(pos);
80 }
81 }
82 }
83
84 return attVolume;
85}
86