ATLAS Offline Software
Loading...
Searching...
No Matches
TGCCandData_v1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
5
7#include <cmath>
8#include <algorithm>
9#include <iostream>
10
11namespace {
12 static const std::string preFixStr{"L0Mu_"};
13}
14
15namespace xAOD
16{
17
19 static const SG::ConstAccessor<uint8_t> acc(preFixStr + "deltaPhi");
20 uint8_t dphiBin = acc(*this);
21 float dphi = static_cast<float>(dphiBin & DPHI_BIT_MASK) / static_cast<float>(DPHI_BIT_MASK+1) * s_dphiRange;
22 return (dphiBin & (DPHI_BIT_MASK + 1)) ? dphi : -1. * dphi;
23}
24
26 static const SG::ConstAccessor<uint8_t> acc(preFixStr + "deltaTheta");
27 uint8_t dthetaBin = acc(*this);
28 float dtheta = static_cast<float>(dthetaBin & DTHETA_BIT_MASK) / static_cast<float>(DTHETA_BIT_MASK+1) * s_dthetaRange;
29 return (dthetaBin & (DTHETA_BIT_MASK + 1)) ? dtheta : -1. * dtheta;
30}
31
33 static const SG::ConstAccessor<uint32_t> acc(preFixStr + "nswSegment");
34 return acc(*this);
35}
36
38 uint8_t deltaPhiBin = std::min(static_cast<uint8_t>(std::abs(dphi) / s_dphiRange * static_cast<float>(DPHI_BIT_MASK+1)),
39 static_cast<uint8_t>(DPHI_BIT_MASK));
40 if (dphi > 0.) deltaPhiBin += DPHI_BIT_MASK + 1;
41 static const SG::Accessor<uint8_t> acc(preFixStr + "deltaPhi");
42 acc(*this) = deltaPhiBin;
43}
44
46 uint8_t deltaThetaBin = std::min(static_cast<uint8_t>(std::abs(dtheta) / s_dthetaRange * static_cast<float>(DTHETA_BIT_MASK+1)),
47 static_cast<uint8_t>(DTHETA_BIT_MASK));
48 if (dtheta > 0.) deltaThetaBin += DTHETA_BIT_MASK + 1;
49 static const SG::Accessor<uint8_t> acc(preFixStr + "deltaTheta");
50 acc(*this) = deltaThetaBin;
51}
52
54 static const SG::Accessor<uint32_t> acc(preFixStr + "nswSegment");
55 acc(*this) = nswout;
56}
57
58} // namespace xAOD
59
Helper class to provide type-safe access to aux data.
Helper class to provide constant type-safe access to aux data.
float deltaTheta() const
Retrieve the delta theta value wrt vector from IP to segment position.
static constexpr float s_dphiRange
static constexpr uint8_t DPHI_BIT_MASK
Bit mask for deltaPhi : 1 bit for sign and 3 bits.
static constexpr uint8_t DTHETA_BIT_MASK
Bit mask for deltaTheta : 1 bit for sign and 6 bits.
uint32_t nswSegment() const
Retrieve the NSW segments.
void setDeltaTheta(float dtheta)
Set the delta theta value.
float deltaPhi() const
Retrieve the delta phi wrt vector from IP to segment position.
void setDeltaPhi(float dphi)
Set the delta phi value.
void setNswSegment(uint32_t nswout)
Set the NSW segments.
static constexpr float s_dthetaRange
range of the RPC hits z positions
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setEventNumber uint32_t
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.