ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloGeoHelpers
CaloGeoHelpers
proxim.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef CALOGEOHELPER_PROXIM
6
#define CALOGEOHELPER_PROXIM
7
8
// inline function for handling two phi angles, to avoid 2PI wrap around.
9
//
10
11
#include <math.h>
12
#include <numbers>
13
14
15
16
inline
double
proxim
(
double
b,
double
a
)
17
{
18
using
std::numbers::pi;
19
const
double
aplus =
a
+
pi
;
20
const
double
aminus =
a
-
pi
;
21
if
(b > aplus) [[
unlikely
]] {
22
do
{
23
b -= 2*
pi
;
24
}
while
(b > aplus);
25
}
26
else
if
(b < aminus) [[
unlikely
]] {
27
do
{
28
b += 2*
pi
;
29
}
while
(b < aminus);
30
}
31
return
b;
32
}
33
34
35
#endif
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
pi
#define pi
Definition
TileMuonFitter.cxx:65
proxim
double proxim(double b, double a)
Definition
proxim.h:16
unlikely
#define unlikely(x)
Definition
pythonic_coracool.cxx:9
Generated on
for ATLAS Offline Software by
1.17.0