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
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
11
#include <iomanip>
12
#include <iostream>
13
14
Acts::SurfaceBounds::BoundsType
Acts::DiamondBounds::type
()
const
{
15
return
SurfaceBounds::eDiamond
;
16
}
17
18
bool
Acts::DiamondBounds::inside
(
const
Acts::Vector2
& lposition,
19
const
Acts::BoundaryCheck
& bcheck)
const
{
20
return
bcheck.
isInside
(lposition,
vertices
());
21
}
22
23
std::vector<Acts::Vector2>
Acts::DiamondBounds::vertices
(
24
unsigned
int
/*lseg*/
)
const
{
25
// Vertices starting at lower left (min rel. phi)
26
// counter-clockwise
27
double
x1 =
get
(
DiamondBounds::eHalfLengthXnegY
);
28
double
y1 =
get
(
DiamondBounds::eHalfLengthYneg
);
29
double
x2 =
get
(
DiamondBounds::eHalfLengthXzeroY
);
30
double
y2 = 0.;
31
double
x3 =
get
(
DiamondBounds::eHalfLengthXposY
);
32
double
y3 =
get
(
DiamondBounds::eHalfLengthYpos
);
33
return
{{-x1, -y1}, {x1, -y1}, {x2, y2}, {x3, y3}, {-x3, y3}, {-x2, y2}};
34
}
35
36
const
Acts::RectangleBounds
&
Acts::DiamondBounds::boundingBox
()
const
{
37
return
m_boundingBox;
38
}
39
40
std::ostream&
Acts::DiamondBounds::toStream
(std::ostream& sl)
const
{
41
sl << std::setiosflags(std::ios::fixed);
42
sl << std::setprecision(7);
43
sl <<
"Acts::DiamondBounds: (halfXatYneg, halfXatYzero, halfXatYpos, "
44
"halfYneg, halfYpos) = "
;
45
sl <<
"("
<<
get
(
DiamondBounds::eHalfLengthXnegY
) <<
", "
46
<<
get
(
DiamondBounds::eHalfLengthXzeroY
) <<
", "
47
<<
get
(
DiamondBounds::eHalfLengthXposY
) <<
", "
48
<<
get
(
DiamondBounds::eHalfLengthYneg
) <<
", "
49
<<
get
(
DiamondBounds::eHalfLengthYpos
) <<
")"
;
50
sl << std::setprecision(-1);
51
return
sl;
52
}
acts
blob
sPHENIX
Core
src
Surfaces
DiamondBounds.cpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:36
using
1.8.2 with
sPHENIX GitHub integration