ATLAS Offline Software
Functions
proxim.h File Reference
#include <math.h>
#include <numbers>
#include "CxxUtils/AthUnlikelyMacros.h"
Include dependency graph for proxim.h:

Go to the source code of this file.

Functions

double proxim (double b, double a)
 

Function Documentation

◆ proxim()

double proxim ( double  b,
double  a 
)
inline

Definition at line 17 of file proxim.h.

18 {
19  using std::numbers::pi;
20  const double aplus = a + pi;
21  const double aminus = a - pi;
22  if (ATH_UNLIKELY(b > aplus)) {
23  do {
24  b -= 2*pi;
25  } while(b > aplus);
26  }
27  else if (ATH_UNLIKELY(b < aminus)) {
28  do {
29  b += 2*pi;
30  } while(b < aminus);
31  }
32  return b;
33 }
ATH_UNLIKELY
#define ATH_UNLIKELY(x)
Definition: AthUnlikelyMacros.h:17
pi
#define pi
Definition: TileMuonFitter.cxx:65
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
a
TList * a
Definition: liststreamerinfos.cxx:10