ATLAS Offline Software
Loading...
Searching...
No Matches
AtlasGeoPoint.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 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 static const float PHI_MIN;
30 static const float PHI_MAX;
31 // static constexpr float PHI_MIN = CaloPhiRange::phi_min(); <- not constexpr
32 // static constexpr float PHI_MAX = CaloPhiRange::phi_max(); <- not constexpr
33 static constexpr float ETA_MIN = -5;
34 static constexpr float ETA_MAX = 5;
35
36 // Assign operator
38
39 // Check if AtlasGeoPoint is within bounds
40 bool isValid() const;
41
42 // Get point eta
43 float eta() const;
44 // Get point phi
45 float phi() const;
46
47 // Set point eta
48 void setEta(const float eta);
49 // Set point phi
50 void setPhi(const float phi);
51
52 private:
53
54 // Eta
55 float m_eta;
56 // Phi
57 float m_phi;
58
59};
60
61//==============================================================================
62// @name RingSet_v1::AtlasGeoPoint operator=:
63inline
65{
66 if(this==&p){
67 return *this;
68 }
69 m_eta = p.eta();
70 m_phi = p.phi();
71 return *this;
72}
73
74//==============================================================================
75inline
77{
78 if ( ( m_eta >= ETA_MIN && m_phi >= PHI_MIN ) &&
79 ( m_eta <= ETA_MAX && m_phi <= PHI_MAX ) ){
80 return true;
81 }
82 return false;
83}
84
85//==============================================================================
86inline
87float AtlasGeoPoint::eta() const
88{
89 return m_eta;
90}
91
92//==============================================================================
93inline
94float AtlasGeoPoint::phi() const
95{
96 return m_phi;
97}
98
99//==============================================================================
100inline
101void AtlasGeoPoint::setEta(const float eta)
102{
103 m_eta = eta;
104}
105
106//==============================================================================
107inline
108void AtlasGeoPoint::setPhi(const float phi)
109{
110 m_phi = phi;
111}
112
113
114#endif // XAODCALORINGS_UTILS_ATLASGEOPOINT_H
#define max(a, b)
Definition cfImp.cxx:41
AtlasGeoPoint & operator=(const AtlasGeoPoint &p)
static const float PHI_MAX
void setEta(const float eta)
float eta() const
bool isValid() const
static const float PHI_MIN
void setPhi(const float phi)
AtlasGeoPoint(const float eta, const float phi)
float phi() const
static constexpr float ETA_MIN
static constexpr float ETA_MAX
STL namespace.