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