ATLAS Offline Software
Loading...
Searching...
No Matches
L1RPCCandData_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
10namespace xAOD {
11
12 void L1RPCCandData_v1::setL1ZPos(std::array<float, 4>& zPos) {
13 std::array<uint16_t, 4> zPosBins;
14 for (size_t i = 0; i < zPos.size(); ++i) {
15 // Avoid FPE with clang.
17 uint16_t zPosBin = static_cast<uint16_t>(std::round((zPos[i] + s_zPosRange) / (2.0f * s_zPosRange) * static_cast<float>(s_zPosBitRange)));
18 zPosBins[i] = zPosBin;
19 }
20 static const SG::Accessor<std::array<uint16_t, 4>> acc("l1ZPos");
21 acc(*this) = zPosBins;
22 }
23
24 std::array<uint16_t, 4> L1RPCCandData_v1::l1ZPos() const {
25 static const SG::ConstAccessor<std::array<uint16_t, 4>> acc("l1ZPos");
26 return acc(*this);
27 }
28
29} // namespace xAOD
Helper class to provide type-safe access to aux data.
Helper class to provide constant type-safe access to aux data.
std::array< uint16_t, 4 > l1ZPos() const
Retrieve the global z positions of the RPC sector logic.
static constexpr uint16_t s_zPosBitRange
12 bits for z position
static constexpr float s_zPosRange
range of the RPC hits z positions
void setL1ZPos(std::array< float, 4 > &zPos)
Set the z positions of the RPC sector logic.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setWord1 uint16_t
static const SG::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.
Tell the compiler to optimize assuming that FP may trap.
#define CXXUTILS_TRAPPING_FP
Definition trapping_fp.h:24