ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
DiamondBounds.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file DiamondBounds.cpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2016-2020 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
#include "
Acts/Surfaces/DiamondBounds.hpp
"
10
#include "
Acts/Utilities/ThrowAssert.hpp
"
11
12
#include <iomanip>
13
#include <iostream>
14
15
Acts::SurfaceBounds::BoundsType
Acts::DiamondBounds::type
()
const
{
16
return
SurfaceBounds::eDiamond
;
17
}
18
19
bool
Acts::DiamondBounds::inside
(
const
Acts::Vector2D
& lposition,
20
const
Acts::BoundaryCheck
& bcheck)
const
{
21
return
bcheck.
isInside
(lposition, vertices());
22
}
23
24
double
Acts::DiamondBounds::distanceToBoundary
(
25
const
Acts::Vector2D
& lposition)
const
{
26
return
BoundaryCheck
(
true
).
distance
(lposition, vertices());
27
}
28
29
std::vector<Acts::Vector2D>
Acts::DiamondBounds::vertices
(
30
unsigned
int
/*lseg*/
)
const
{
31
// Vertices starting at lower left (min rel. phi)
32
// counter-clockwise
33
double
x1
=
get
(
DiamondBounds::eHalfLengthXnegY
);
34
double
y1
=
get
(
DiamondBounds::eHalfLengthYneg
);
35
double
x2
=
get
(
DiamondBounds::eHalfLengthXzeroY
);
36
double
y2
= 0.;
37
double
x3
=
get
(
DiamondBounds::eHalfLengthXposY
);
38
double
y3
=
get
(
DiamondBounds::eHalfLengthYpos
);
39
return
{{-
x1
, -y1}, {
x1
, -y1}, {
x2
, y2}, {
x3
, y3}, {-
x3
, y3}, {-
x2
, y2}};
40
}
41
42
const
Acts::RectangleBounds
&
Acts::DiamondBounds::boundingBox
()
const
{
43
return
m_boundingBox;
44
}
45
46
std::ostream&
Acts::DiamondBounds::toStream
(std::ostream& sl)
const
{
47
sl << std::setiosflags(std::ios::fixed);
48
sl << std::setprecision(7);
49
sl <<
"Acts::DiamondBounds: (halfXatYneg, halfXatYzero, halfXatYpos, "
50
"halfYneg, halfYpos) = "
;
51
sl <<
"("
<<
get
(
DiamondBounds::eHalfLengthXnegY
) <<
", "
52
<<
get
(
DiamondBounds::eHalfLengthXzeroY
) <<
", "
53
<<
get
(
DiamondBounds::eHalfLengthXposY
) <<
", "
54
<<
get
(
DiamondBounds::eHalfLengthYneg
) <<
", "
55
<<
get
(
DiamondBounds::eHalfLengthYpos
) <<
")"
;
56
sl << std::setprecision(-1);
57
return
sl;
58
}
acts
blob
master
Core
src
Surfaces
DiamondBounds.cpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:23
using
1.8.2 with
ECCE GitHub integration