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
TrapezoidBounds.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file TrapezoidBounds.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/TrapezoidBounds.hpp
"
10
11
#include <cmath>
12
#include <iomanip>
13
#include <iostream>
14
15
Acts::TrapezoidBounds::~TrapezoidBounds
() =
default
;
16
17
Acts::SurfaceBounds::BoundsType
Acts::TrapezoidBounds::type
()
const
{
18
return
SurfaceBounds::eTrapezoid
;
19
}
20
21
bool
Acts::TrapezoidBounds::inside
(
const
Acts::Vector2D
& lposition,
22
const
Acts::BoundaryCheck
& bcheck)
const
{
23
return
bcheck.
isInside
(lposition, vertices());
24
}
25
26
double
Acts::TrapezoidBounds::distanceToBoundary
(
27
const
Acts::Vector2D
& lposition)
const
{
28
return
BoundaryCheck
(
true
).
distance
(lposition, vertices());
29
}
30
31
std::vector<Acts::Vector2D>
Acts::TrapezoidBounds::vertices
(
32
unsigned
int
/*lseg*/
)
const
{
33
double
minhx =
get
(
TrapezoidBounds::eHalfLengthXnegY
);
34
double
maxhx =
get
(
TrapezoidBounds::eHalfLengthXposY
);
35
double
hy
=
get
(
TrapezoidBounds::eHalfLengthY
);
36
return
{{-minhx, -hy}, {minhx, -hy}, {maxhx, hy}, {-maxhx, hy}};
37
}
38
39
const
Acts::RectangleBounds
&
Acts::TrapezoidBounds::boundingBox
()
const
{
40
return
m_boundingBox;
41
}
42
43
std::ostream&
Acts::TrapezoidBounds::toStream
(std::ostream& sl)
const
{
44
sl << std::setiosflags(std::ios::fixed);
45
sl << std::setprecision(7);
46
sl <<
"Acts::TrapezoidBounds: (halfXnegY, halfXposY, halfY) = "
47
<<
"("
<<
get
(eHalfLengthXnegY) <<
", "
<<
get
(eHalfLengthXposY) <<
", "
48
<<
get
(eHalfLengthY) <<
")"
;
49
sl << std::setprecision(-1);
50
return
sl;
51
}
acts
blob
master
Core
src
Surfaces
TrapezoidBounds.cpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:23
using
1.8.2 with
ECCE GitHub integration