ATLAS Offline Software
CaloPhiRange.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  Liquid Argon detector description package
7  -----------------------------------------
8  ***************************************************************************/
9 
10 
12 
13 double
15 {
16  if (phi < m_phi_min) return (phi+m_twopi);
17  if (phi > m_phi_max) return (phi-m_twopi);
18  return phi;
19 }
20 
21 double
22 CaloPhiRange::diff ( double phi1, double phi2 )
23 {
24  double res = fix(phi1) - fix(phi2);
25  return fix(res);
26 }
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
CaloPhiRange::m_phi_max
constexpr static const double m_phi_max
Definition: CaloPhiRange.h:43
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
CaloPhiRange.h
CaloPhiRange class declaration.
CaloPhiRange::m_twopi
constexpr static const double m_twopi
Definition: CaloPhiRange.h:42
CaloPhiRange::m_phi_min
constexpr static const double m_phi_min
Definition: CaloPhiRange.h:41
CaloPhiRange::fix
static double fix(double phi)
Definition: CaloPhiRange.cxx:14
CaloPhiRange::diff
static double diff(double phi1, double phi2)
simple phi1 - phi2 calculation, but result is fixed to respect range.
Definition: CaloPhiRange.cxx:22