ATLAS Offline Software
Loading...
Searching...
No Matches
TGCCandData.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
5
6namespace L0Muon {
7
8uint8_t TGCCandData::coinType() const {
9 return m_coinType;
10}
11
12float TGCCandData::deltaPhi() const {
13 float dphi = static_cast<float>(m_deltaPhi & DPHI_BIT_MASK) / static_cast<float>(DPHI_BIT_MASK+1) * s_dphiRange;
14 return (m_deltaPhi & (DPHI_BIT_MASK + 1)) ? dphi : -1. * dphi;
15}
16
18 float dtheta = static_cast<float>(m_deltaTheta & DTHETA_BIT_MASK) / static_cast<float>(DTHETA_BIT_MASK+1) * s_dthetaRange;
19 return (m_deltaTheta & (DTHETA_BIT_MASK + 1)) ? dtheta : -1. * dtheta;
20}
21
22uint32_t TGCCandData::nswSegment() const {
23 return m_nswSegment;
24}
25
26
27void TGCCandData::setCoinType(uint8_t cointype) {
28 m_coinType = cointype & COINTYPE_BIT_MASK;
29}
30
31void TGCCandData::setDeltaPhi(float dphi) {
32 m_deltaPhi = std::min(static_cast<uint8_t>(std::abs(dphi) / s_dphiRange * static_cast<float>(DPHI_BIT_MASK+1)),
33 static_cast<uint8_t>(DPHI_BIT_MASK));
34 if (dphi > 0.) m_deltaPhi += DPHI_BIT_MASK + 1;
35}
36
37void TGCCandData::setDeltaTheta(float dtheta) {
38 m_deltaTheta = std::min(static_cast<uint8_t>(std::abs(dtheta) / s_dthetaRange * static_cast<float>(DTHETA_BIT_MASK+1)),
39 static_cast<uint8_t>(DTHETA_BIT_MASK));
40 if (dtheta > 0.) m_deltaTheta += DTHETA_BIT_MASK + 1;
41}
42
43void TGCCandData::setNswSegment(uint32_t nswout) {
44 m_nswSegment = nswout;
45}
46
47} // end of L0Muon namespace
void setDeltaPhi(float dphi)
uint8_t coinType() const
void setDeltaTheta(float dtheta)
uint8_t m_deltaTheta
Segment polar angle w.r.t. the vector from IP to the segment position (7 bits)
Definition TGCCandData.h:50
float deltaPhi() const
void setNswSegment(uint32_t nswout)
uint8_t m_deltaPhi
Segment azimuthal angle w.r.t. the vector from IP to the segment position (4 bits)
Definition TGCCandData.h:47
static constexpr float s_dthetaRange
range of the RPC hits z positions
Definition TGCCandData.h:30
static constexpr uint8_t DTHETA_BIT_MASK
Bit mask for deltaTheta : 1 bit for sign and 6 bits.
Definition TGCCandData.h:38
void setCoinType(uint8_t cointype)
uint32_t nswSegment() const
uint8_t m_coinType
Coincidence Type (3 bits) [rsv.][GoodMF][InnerCoin].
Definition TGCCandData.h:44
static constexpr uint8_t DPHI_BIT_MASK
Bit mask for deltaPhi : 1 bit for sign and 3 bits.
Definition TGCCandData.h:36
static constexpr uint8_t COINTYPE_BIT_MASK
Bit mask for Coincidence Types.
Definition TGCCandData.h:34
static constexpr float s_dphiRange
Definition TGCCandData.h:31
uint32_t m_nswSegment
Copy of the NSW-TP output (To be defined)
Definition TGCCandData.h:53
float deltaTheta() const