Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SurfaceStub.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file SurfaceStub.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2017-2018 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#pragma once
10
11
#include "
Acts/Definitions/Algebra.hpp
"
12
#include "
Acts/Geometry/GeometryContext.hpp
"
13
#include "
Acts/Surfaces/InfiniteBounds.hpp
"
//to get s_noBounds
14
#include "
Acts/Surfaces/PlanarBounds.hpp
"
15
#include "
Acts/Surfaces/Surface.hpp
"
16
#include "
Acts/Utilities/Intersection.hpp
"
17
18
namespace
Acts {
20
class
SurfaceStub
:
public
Surface
{
21
public
:
22
SurfaceStub
(
const
Transform3
& htrans = Transform3::Identity())
23
:
GeometryObject
(),
Surface
(htrans) {}
24
SurfaceStub
(
const
GeometryContext
&
gctx
,
const
SurfaceStub
& sf,
25
const
Transform3
& transf)
26
:
GeometryObject
(),
Surface
(gctx, sf, transf) {}
27
SurfaceStub
(
const
DetectorElementBase
& detelement)
28
:
GeometryObject
(),
Surface
(detelement) {}
29
30
~SurfaceStub
()
override
=
default
;
31
33
SurfaceType
type
() const final {
return
Surface::Other
; }
34
36
Vector3
normal
(
const
GeometryContext
&
gctx
,
37
const
Vector2
&
/*lpos*/
) const final {
38
return
normal
(gctx);
39
}
40
41
Vector3
normal
(
const
GeometryContext
&
gctx
,
42
const
Vector3
&
/*position*/
) const final {
43
return
normal
(gctx);
44
}
45
46
Vector3
normal
(
const
GeometryContext
&
/*gctx*/
) const final {
47
return
Vector3
{0., 0., 0.};
48
}
49
51
const
SurfaceBounds
&
bounds
() const final {
52
return
s_noBounds
;
// need to improve this for meaningful test
53
}
54
56
Vector3
localToGlobal
(
const
GeometryContext
&
/*gctx*/
,
57
const
Vector2
&
/*lpos*/
,
58
const
Vector3
&
/*gmom*/
) const final {
59
return
Vector3
(0., 0., 0.);
60
}
61
63
Result<Vector2>
globalToLocal
(
const
GeometryContext
&
/*cxt*/
,
64
const
Vector3
&
/*gpos*/
,
65
const
Vector3
&
/*gmom*/
,
66
double
/*tolerance*/
) const final {
67
return
Result<Vector2>::success
(
Vector2
{20., 20.});
68
}
69
71
double
pathCorrection
(
const
GeometryContext
&
/*cxt*/
,
const
Vector3
&
/*gpos*/
,
72
const
Vector3
&
/*gmom*/
) const final {
73
return
0.0;
74
}
75
77
Vector3
binningPosition
(
const
GeometryContext
&
/*txt*/
,
78
BinningValue
/*bValue*/
) const final {
79
const
Vector3
v
{0.0, 0.0, 0.0};
80
return
v
;
81
}
82
84
SurfaceMultiIntersection
intersect
(
85
const
GeometryContext
&
/*gctx*/
,
const
Vector3
&
/*position*/
,
86
const
Vector3
&
/*direction*/
,
const
BoundaryCheck
&
/*bcheck*/
,
87
const
ActsScalar
/*tolerance*/
) const final {
88
Intersection3D
stubIntersection(
Vector3
(20., 0., 0.), 20.,
89
Intersection3D::Status::reachable);
90
return
SurfaceMultiIntersection
(
91
{stubIntersection,
Intersection3D::invalid
()},
this
);
92
}
93
95
std::string
name
() const final {
return
std::string
(
"SurfaceStub"
); }
96
98
bool
constructedOk
()
const
{
return
true
; }
99
101
Polyhedron
polyhedronRepresentation
(
const
GeometryContext
&
/*gctx*/
,
102
size_t
/*lseg */
) const final {
103
std::vector<Vector3>
vertices
;
104
std::vector<std::vector<size_t>> faces;
105
std::vector<std::vector<size_t>> triangularMesh;
106
107
return
Polyhedron
(vertices, faces, triangularMesh);
108
}
109
110
// Cartesian 3D to local bound derivative
111
ActsMatrix<2, 3>
localCartesianToBoundLocalDerivative
(
112
const
GeometryContext
&
/*gctx*/
,
113
const
Vector3
&
/*position*/
) const final {
114
return
ActsMatrix<2, 3>::Identity
();
115
};
116
117
private
:
119
std::shared_ptr<const PlanarBounds>
m_bounds
;
120
};
121
}
// namespace Acts
acts
blob
sPHENIX
Tests
UnitTests
Core
Surfaces
SurfaceStub.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:44
using
1.8.2 with
sPHENIX GitHub integration