ATLAS Offline Software
Loading...
Searching...
No Matches
PhiComps.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6#ifndef TRIGT2CALOEGAMMA_PHICOMPS_H
7#define TRIGT2CALOEGAMMA_PHICOMPS_H
8
9
10#include <cmath> // for M_PI
11
12namespace Ringer{
17 inline bool check_wrap_around(const double phi_center, const bool reverse_wrap) {
18 if (reverse_wrap) return (phi_center < (1.0 - M_PI)); // 1.0 is the PI_THRESHOLD
19 else return (phi_center > (M_PI - 1.0));
20 }
21
26 inline double fix_wrap_around(const double phi_value, const bool reverse_wrap) {
27 if (reverse_wrap) {
28 if (phi_value > 0.) return (phi_value - 2*M_PI);
29 } else {
30 if (phi_value < 0.) return (phi_value + 2*M_PI);
31 }
32 return phi_value;
33 }
34
35}
36
37#endif
#define M_PI
Namespace dedicated for Ringer utilities.
bool check_wrap_around(const double phi_center, const bool reverse_wrap)
Helper function to identify wrap around cases.
Definition PhiComps.h:17
double fix_wrap_around(const double phi_value, const bool reverse_wrap)
Helper function to fix wrap around cases.
Definition PhiComps.h:26