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
SurfaceBinningMatcher.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file SurfaceBinningMatcher.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 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
#pragma once
10
11
#include "
Acts/Geometry/Extent.hpp
"
12
#include "
Acts/Geometry/GeometryContext.hpp
"
13
#include "
Acts/Surfaces/Surface.hpp
"
14
15
#include <utility>
16
#include <vector>
17
18
namespace
Acts {
19
20
struct
SurfaceBinningMatcher
{
22
using
Range
= std::pair<double, double>;
23
std::vector<Range>
tolerances
{(int)
binValues
, {0., 0.}};
24
25
SurfaceBinningMatcher
() =
default
;
26
27
SurfaceBinningMatcher
(
const
std::vector<Range>& tolpars)
28
:
tolerances
(tolpars) {}
29
36
bool
operator()
(
const
Acts::GeometryContext
&
gctx
,
Acts::BinningValue
bValue,
37
const
Acts::Surface
*
one
,
const
Acts::Surface
* other)
const
{
38
// Fast exit
39
if
(one == other) {
40
return
true
;
41
}
42
43
auto
oneExt = one->
polyhedronRepresentation
(gctx, 1).
extent
();
44
auto
otherExt = other->
polyhedronRepresentation
(gctx, 1).
extent
();
45
46
double
oneMin = oneExt.
min
(bValue);
47
double
oneMax = oneExt.max(bValue);
48
49
double
otherMin = otherExt.min(bValue);
50
double
otherMax = otherExt.max(bValue);
51
52
return
(
std::abs
(oneMin - otherMin) <=
tolerances
[bValue].first and
53
std::abs
(oneMax - otherMax) <=
tolerances
[bValue].second);
54
}
55
};
56
57
}
// namespace Acts
acts
blob
sPHENIX
Core
include
Acts
Geometry
SurfaceBinningMatcher.hpp
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:23
using
1.8.2 with
EIC GitHub integration