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
RectangleBounds.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file RectangleBounds.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/RectangleBounds.hpp
"
10
#include "
Acts/Utilities/ThrowAssert.hpp
"
11
12
#include <cmath>
13
#include <iomanip>
14
#include <iostream>
15
16
bool
Acts::RectangleBounds::inside
(
const
Acts::Vector2D
& lposition,
17
const
Acts::BoundaryCheck
& bcheck)
const
{
18
return
bcheck.
isInside
(lposition,
m_min
,
m_max
);
19
}
20
21
double
Acts::RectangleBounds::distanceToBoundary
(
22
const
Acts::Vector2D
& lposition)
const
{
23
return
BoundaryCheck
(
true
).
distance
(lposition,
min
(),
max
());
24
}
25
26
std::vector<Acts::Vector2D>
Acts::RectangleBounds::vertices
(
27
unsigned
int
/*lseg*/
)
const
{
28
// counter-clockwise starting from bottom-left corner
29
return
{m_min, {m_max.x(), m_min.y()}, m_max, {m_min.x(), m_max.y()}};
30
}
31
32
const
Acts::RectangleBounds
&
Acts::RectangleBounds::boundingBox
()
const
{
33
return
(*
this
);
34
}
35
36
// ostream operator overload
37
std::ostream&
Acts::RectangleBounds::toStream
(std::ostream& sl)
const
{
38
sl << std::setiosflags(std::ios::fixed);
39
sl << std::setprecision(7);
40
sl <<
"Acts::RectangleBounds: (hlX, hlY) = "
41
<<
"("
<< 0.5 * (
get
(eMaxX) -
get
(eMinX)) <<
", "
42
<< 0.5 * (
get
(eMaxY) -
get
(eMinY)) <<
")"
;
43
sl <<
"\n(lower left, upper right):\n"
;
44
sl <<
min
().transpose() <<
"\n"
<<
max
().transpose();
45
sl << std::setprecision(-1);
46
return
sl;
47
}
acts
blob
master
Core
src
Surfaces
RectangleBounds.cpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:23
using
1.8.2 with
ECCE GitHub integration