ATLAS Offline Software
Loading...
Searching...
No Matches
ICandData.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace L0Muon
8{
9
13 {
15 const float etaClamped = std::max(-s_etaRange, std::min(eta, s_etaRange));
16 m_eta = static_cast<uint16_t>(std::lround((etaClamped + s_etaRange) / (2.0f * s_etaRange) *static_cast<float>(s_etaBitRange)));
17 }
19 {
20 m_phi = static_cast<uint16_t>(((phi+M_PI)/s_phiRange)*static_cast<float>(s_phiBitRange));
21 }
22 void ICandData::setPt(float pt)
23 {
24 m_pt = static_cast<uint16_t>(std::round(pt/s_ptRange)*static_cast<float>(s_ptBitRange));
25 }
26
28 float ICandData::eta() const
29 {
30 return (static_cast<float>(m_eta) / static_cast<float>(s_etaBitRange)) * (2.0f * s_etaRange) - s_etaRange;
31
32 }
33 float ICandData::phi() const
34 {
35 return static_cast<float> (m_phi) / static_cast<float>(s_phiBitRange) * s_phiRange-M_PI;
36
37 }
38 float ICandData::pt() const
39 {
40 return static_cast<float>(m_pt)/static_cast<float>(s_ptBitRange)*s_ptRange;
41 }
42
43} // namespace L0Muon
#define M_PI
uint16_t m_eta
theta coordinate of the candidate
Definition ICandData.h:70
static constexpr float s_phiRange
Definition ICandData.h:54
static constexpr float s_etaRange
variables range
Definition ICandData.h:53
static constexpr uint16_t s_phiBitRange
Definition ICandData.h:60
float pt() const
Definition ICandData.cxx:38
static constexpr float s_ptRange
Definition ICandData.h:55
uint16_t m_pt
pt of the candidate
Definition ICandData.h:74
void setEta(float eta)
Set functions of the modifiable parameters.
Definition ICandData.cxx:12
float phi() const
Definition ICandData.cxx:33
void setPhi(float phi)
Definition ICandData.cxx:18
static constexpr uint16_t s_etaBitRange
variables bit size 14 bits for eta, 9 bits for phi, 8 bits for pt
Definition ICandData.h:59
float eta() const
get the kinematic parameters
Definition ICandData.cxx:28
uint16_t m_phi
phi coordinate of the candidate
Definition ICandData.h:72
void setPt(float pt)
Definition ICandData.cxx:22
static constexpr uint16_t s_ptBitRange
Definition ICandData.h:61