ATLAS Offline Software
Loading...
Searching...
No Matches
RPCCandData_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
8#include <cmath>
9#include <algorithm>
10#include <iostream>
11
12namespace {
13 static const std::string preFixStr{"L0Mu_"};
14}
15
16namespace xAOD {
17
18 void RPCCandData_v1::setZPos(std::array<float, 4>& zPos) {
19 std::array<uint16_t, 4> zPosBins;
20 for (size_t i = 0; i < zPos.size(); ++i) {
21 // Avoid FPE with clang.
23 uint16_t zPosBin = static_cast<uint16_t>(std::round((zPos[i] + s_zPosRange) / (2.0f * s_zPosRange) * static_cast<float>(s_zPosBitRange)));
24 zPosBins[i] = zPosBin;
25 }
26 static const SG::Accessor<std::array<uint16_t, 4>> acc(preFixStr + "zPos");
27 acc(*this) = zPosBins;
28 }
29
30 std::array<uint16_t, 4> RPCCandData_v1::zPos() const {
31 static const SG::ConstAccessor<std::array<uint16_t, 4>> acc(preFixStr + "zPos");
32 return acc(*this);
33 }
34
35} // namespace xAOD
36
37
38
Helper class to provide type-safe access to aux data.
Helper class to provide constant type-safe access to aux data.
void setZPos(std::array< float, 4 > &zPos)
Set the z positions of the RPC sector logic.
static constexpr float s_zPosRange
range of the RPC hits z positions
static constexpr uint16_t s_zPosBitRange
12 bits for z position
std::array< uint16_t, 4 > zPos() const
Retrieve the global 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::AuxElement::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