ATLAS Offline Software
Loading...
Searching...
No Matches
AtlasGeoPoint.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// $Id: AtlasGeoPoint.h 689815 2015-08-17 15:39:55Z wsfreund $
6#ifndef XAODCALORINGS_UTILS_ATLASGEOPOINT_H
7#define XAODCALORINGS_UTILS_ATLASGEOPOINT_H
8
9#include <limits>
10
16
17 public:
18
20 m_eta(std::numeric_limits<float>::max()),
21 m_phi(std::numeric_limits<float>::max())
22 {;}
23
24 AtlasGeoPoint(const float eta, const float phi):
25 m_eta(eta),
26 m_phi(phi)
27 {;}
28
29 ~AtlasGeoPoint() = default;
30 AtlasGeoPoint(const AtlasGeoPoint &p) = default;
32
33 static const float PHI_MIN;
34 static const float PHI_MAX;
35 // static constexpr float PHI_MIN = CaloPhiRange::phi_min(); <- not constexpr
36 // static constexpr float PHI_MAX = CaloPhiRange::phi_max(); <- not constexpr
37 static constexpr float ETA_MIN = -5;
38 static constexpr float ETA_MAX = 5;
39
40 // Check if AtlasGeoPoint is within bounds
41 bool isValid() const;
42
43 // Get point eta
44 float eta() const;
45 // Get point phi
46 float phi() const;
47
48 // Set point eta
49 void setEta(const float eta);
50 // Set point phi
51 void setPhi(const float phi);
52
53 private:
54
55 // Eta
56 float m_eta;
57 // Phi
58 float m_phi;
59
60};
61
62//==============================================================================
63inline
65{
66 return m_eta >= ETA_MIN
67 && m_eta <= ETA_MAX
68 && m_phi >= PHI_MIN
69 && m_phi <= PHI_MAX;
70}
71
72//==============================================================================
73inline
74float AtlasGeoPoint::eta() const
75{
76 return m_eta;
77}
78
79//==============================================================================
80inline
81float AtlasGeoPoint::phi() const
82{
83 return m_phi;
84}
85
86//==============================================================================
87inline
88void AtlasGeoPoint::setEta(const float eta)
89{
90 m_eta = eta;
91}
92
93//==============================================================================
94inline
95void AtlasGeoPoint::setPhi(const float phi)
96{
97 m_phi = phi;
98}
99
100
101#endif // XAODCALORINGS_UTILS_ATLASGEOPOINT_H
#define max(a, b)
Definition cfImp.cxx:41
static const float PHI_MAX
~AtlasGeoPoint()=default
void setEta(const float eta)
float eta() const
bool isValid() const
AtlasGeoPoint(const AtlasGeoPoint &p)=default
static const float PHI_MIN
void setPhi(const float phi)
AtlasGeoPoint(const float eta, const float phi)
AtlasGeoPoint & operator=(const AtlasGeoPoint &p)=default
float phi() const
static constexpr float ETA_MIN
static constexpr float ETA_MAX
STL namespace.