ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoSimulationUtils
L1TopoSimulationUtils
Conversions.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef L1TopoSimulationUtils_Conversions
6
#define L1TopoSimulationUtils_Conversions
7
8
#include <math.h>
9
#include <string>
10
11
namespace
TSU
{
12
13
static
constexpr
float
phiRescaleFactor
= 3.2/
M_PI
;
14
static
constexpr
unsigned
int
phiIntegerResolution
= 20;
// only correct after(!) multiplying float values with phiRescaleFactor
15
static
constexpr
unsigned
int
etaIntegerResolution
= 40;
16
17
/*
18
@brief calculate the eta and phi L1Topo indices
19
20
The exact eta and phi coordinates are rounded according to a particular L1Topo granularity
21
Using product instead of division avoids unexpected rounding errors due to precision
22
Also, LUTs for the firmware are built using Python 3.x numpy.round(), which is different from std::round()
23
Input: value = float values, resolution = inverse of intended step size
24
Output: integer L1Topo values
25
*/
26
int
toTopoInteger
(
float
value,
unsigned
int
resolution);
27
28
/* @brief convert a floating point phi coordinate (in radians) to L1Topo's internal integer representation */
29
unsigned
int
toTopoPhi
(
float
phi
);
30
31
/* @brief convert a floating point eta coordinate to L1Topo's internal integer representation */
32
int
toTopoEta
(
float
eta
);
33
34
/* @brief convert an (unsigned) representation of a bit string into a signed value assuming a given length of the bit string (incl. possible sign bit) */
35
int
toSigned
(
unsigned
bits,
unsigned
length
);
36
/* @brief convert string representation of a bit string into a signed value assuming a given length of the bit string (incl. possible sign bit) */
37
int
toSigned
(
const
std::string& bits);
38
39
40
}
41
#endif
M_PI
#define M_PI
Definition
ActiveFraction.h:14
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
length
double length(const pvec &v)
Definition
FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
TSU
Definition
Conversions.h:11
TSU::phiIntegerResolution
static constexpr unsigned int phiIntegerResolution
Definition
Conversions.h:14
TSU::toTopoEta
int toTopoEta(float eta)
Definition
Conversions.cxx:27
TSU::toTopoPhi
unsigned int toTopoPhi(float phi)
Definition
Conversions.cxx:20
TSU::phiRescaleFactor
static constexpr float phiRescaleFactor
Definition
Conversions.h:13
TSU::toTopoInteger
int toTopoInteger(float value, unsigned int resolution)
Definition
Conversions.cxx:7
TSU::etaIntegerResolution
static constexpr unsigned int etaIntegerResolution
Definition
Conversions.h:15
TSU::toSigned
int toSigned(unsigned bits, unsigned length)
Definition
Conversions.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0