ATLAS Offline Software
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=:
63 inline
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 //==============================================================================
75 inline
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 //==============================================================================
86 inline
87 float AtlasGeoPoint::eta() const
88 {
89  return m_eta;
90 }
91 
92 //==============================================================================
93 inline
94 float AtlasGeoPoint::phi() const
95 {
96  return m_phi;
97 }
98 
99 //==============================================================================
100 inline
101 void AtlasGeoPoint::setEta(const float eta)
102 {
103  m_eta = eta;
104 }
105 
106 //==============================================================================
107 inline
108 void AtlasGeoPoint::setPhi(const float phi)
109 {
110  m_phi = phi;
111 }
112 
113 
114 #endif // XAODCALORINGS_UTILS_ATLASGEOPOINT_H
AtlasGeoPoint::PHI_MAX
static const float PHI_MAX
Definition: AtlasGeoPoint.h:30
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
max
#define max(a, b)
Definition: cfImp.cxx:41
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
AtlasGeoPoint::phi
float phi() const
Definition: AtlasGeoPoint.h:94
AtlasGeoPoint::ETA_MAX
static constexpr float ETA_MAX
Definition: AtlasGeoPoint.h:34
AtlasGeoPoint::setPhi
void setPhi(const float phi)
Definition: AtlasGeoPoint.h:108
AtlasGeoPoint::m_eta
float m_eta
Definition: AtlasGeoPoint.h:55
AtlasGeoPoint::isValid
bool isValid() const
Definition: AtlasGeoPoint.h:76
AtlasGeoPoint::AtlasGeoPoint
AtlasGeoPoint()
Definition: AtlasGeoPoint.h:19
AtlasGeoPoint::m_phi
float m_phi
Definition: AtlasGeoPoint.h:57
AtlasGeoPoint::ETA_MIN
static constexpr float ETA_MIN
Definition: AtlasGeoPoint.h:33
AtlasGeoPoint::eta
float eta() const
Definition: AtlasGeoPoint.h:87
AtlasGeoPoint::PHI_MIN
static const float PHI_MIN
Definition: AtlasGeoPoint.h:29
AtlasGeoPoint::operator=
AtlasGeoPoint & operator=(const AtlasGeoPoint &p)
Definition: AtlasGeoPoint.h:64
AtlasGeoPoint::AtlasGeoPoint
AtlasGeoPoint(const float eta, const float phi)
Definition: AtlasGeoPoint.h:24
AtlasGeoPoint
Definition: AtlasGeoPoint.h:15
AtlasGeoPoint::setEta
void setEta(const float eta)
Definition: AtlasGeoPoint.h:101
readCCLHist.float
float
Definition: readCCLHist.py:83