ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
EFTracking
FPGATrackSim
FPGATrackSimBinning
src
FPGATrackSimKeyLayerTool.h
Go to the documentation of this file.
1
// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3
#ifndef FPGATrackSimKeyLayerTool_H
4
#define FPGATrackSimKeyLayerTool_H
5
24
25
26
#include "
FPGATrackSimObjects/FPGATrackSimTrackPars.h
"
27
#include "
FPGATrackSimBinning/FPGATrackSimBinUtil.h
"
28
#include <cmath>
29
30
//-------------------------------------------------------------------------------------------------------
31
//
32
// Tool for doing Key Layer Math
33
// -- that is converting be the track parameters set by the standard (pT,eta,phi,d0,z0) and
34
// the "KeyLayer" parametes set by the phi and z at to radii (R1,R2) and a deviation from
35
// straight line between the two points (xm)
36
// -- All the math for the r-phi plane is based finding the rotated coordinate system where
37
// the points (R1,phiR1) and (R2,phiR2) both lie on the x=0 axis. Then the x of a track halfway
38
// between the points (called xm) is the sagitta.
39
//
40
//-------------------------------------------------------------------------------------------------------
41
class
FPGATrackSimKeyLayerTool
42
{
43
public
:
44
FPGATrackSimKeyLayerTool
(
double
r1,
double
r2) :
m_R1
(r1),
m_R2
(r2) {}
45
FPGATrackSimKeyLayerTool
() {}
// NOTE r1 and r2 must be set before using class
46
47
struct
KeyLyrPars
{
48
KeyLyrPars
() =
default
;
49
KeyLyrPars
(
const
FPGATrackSimBinUtil::ParSet
&parset)
50
:
z1
(parset[0]),
z2
(parset[1]),
phi1
(parset[2]),
phi2
(parset[3]),
xm
(parset[4]) {}
51
double
z1
{};
52
double
z2
{};
53
double
phi1
{};
54
double
phi2
{};
55
double
xm
{};
56
};
57
58
// convert (r,phi) to (x,y)
59
std::pair<double, double>
getXY
(
double
r
,
double
phi
)
const
;
60
61
// Get rotation angles need to rotate the two given points to be only seperated in the y direction (both have same x)
62
// results is the sin and cos of rotation
63
std::pair<double, double>
getRotationAngles
(
const
std::pair<double, double>& xy1,
const
std::pair<double, double>& xy2)
const
;
64
65
// Apply a rotation angles (sin and cos) to a point xy
66
std::pair<double, double>
rotateXY
(
const
std::pair<double, double>& xy,
const
std::pair<double, double>& ang)
const
;
67
68
// Simple struct and function to get the rotation angle and full rotated information in one call
69
struct
rotatedConfig
70
{
71
std::pair<double, double>
xy1p
{};
// point 1 after rotation
72
std::pair<double, double>
xy2p
{};
// point 2 after rotation
73
std::pair<double, double>
rotang
{};
// rotation angle
74
double
y
{};
// y seperation after rotation
75
};
76
rotatedConfig
getRotatedConfig
(
const
KeyLyrPars &keypars)
const
;
77
78
// get the x,y coordinates of a hit in the rotated coordinate system specified by rotang
79
std::pair<double, double>
getRotatedHit
(
const
std::pair<double, double>& rotang,
double
rHit,
double
phiHit)
const
;
80
81
// Convert back and forth to standard track parameters
82
KeyLyrPars
trackParsToKeyPars
(
const
FPGATrackSimTrackPars
&pars)
const
;
83
FPGATrackSimTrackPars
keyParsToTrackPars
(
const
KeyLyrPars &keypars)
const
;
84
85
// find expected z hit position given a radius
86
double
zExpected
(
const
KeyLyrPars& keypars,
double
r
)
const
;
87
88
// find expected x position of a hit at given a radius in the rotated coordinate system
89
double
xExpected
(
const
KeyLyrPars& keypars,
double
rHit,
double
phiHit)
const
;
90
91
// takes hit position and calculated what xm would be for track going through that hit
92
double
xmForHit
(
const
KeyLyrPars& keypars,
double
rHit,
double
phiHit)
const
;
93
94
// Find shift from nominal track to hit in the "x" direction
95
double
deltaX
(
const
KeyLyrPars& keypars,
double
rHit,
double
phiHit)
const
;
96
97
// accessors
98
double
R1
()
const
{
return
m_R1
;}
99
double
R2
()
const
{
return
m_R2
;}
100
void
setR1
(
const
double
r1) {
m_R1
=r1;}
101
void
setR2
(
const
double
r2) {
m_R2
=r2;}
102
103
private
:
104
double
m_R1
{};
105
double
m_R2
{};
106
};
107
108
109
110
#endif
// FPGATrackSimKeyLayerTool_H
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
FPGATrackSimBinUtil.h
Binning Utilities for GenScanTool.
FPGATrackSimTrackPars.h
Structs that store the 5 track parameters.
FPGATrackSimKeyLayerTool::deltaX
double deltaX(const KeyLyrPars &keypars, double rHit, double phiHit) const
Definition
FPGATrackSimKeyLayerTool.cxx:157
FPGATrackSimKeyLayerTool::m_R1
double m_R1
Definition
FPGATrackSimKeyLayerTool.h:104
FPGATrackSimKeyLayerTool::R1
double R1() const
Definition
FPGATrackSimKeyLayerTool.h:98
FPGATrackSimKeyLayerTool::getRotatedConfig
rotatedConfig getRotatedConfig(const KeyLyrPars &keypars) const
Definition
FPGATrackSimKeyLayerTool.cxx:32
FPGATrackSimKeyLayerTool::getXY
std::pair< double, double > getXY(double r, double phi) const
Definition
FPGATrackSimKeyLayerTool.cxx:11
FPGATrackSimKeyLayerTool::m_R2
double m_R2
Definition
FPGATrackSimKeyLayerTool.h:105
FPGATrackSimKeyLayerTool::trackParsToKeyPars
KeyLyrPars trackParsToKeyPars(const FPGATrackSimTrackPars &pars) const
Definition
FPGATrackSimKeyLayerTool.cxx:53
FPGATrackSimKeyLayerTool::FPGATrackSimKeyLayerTool
FPGATrackSimKeyLayerTool()
Definition
FPGATrackSimKeyLayerTool.h:45
FPGATrackSimKeyLayerTool::xExpected
double xExpected(const KeyLyrPars &keypars, double rHit, double phiHit) const
Definition
FPGATrackSimKeyLayerTool.cxx:171
FPGATrackSimKeyLayerTool::setR2
void setR2(const double r2)
Definition
FPGATrackSimKeyLayerTool.h:101
FPGATrackSimKeyLayerTool::getRotatedHit
std::pair< double, double > getRotatedHit(const std::pair< double, double > &rotang, double rHit, double phiHit) const
Definition
FPGATrackSimKeyLayerTool.cxx:47
FPGATrackSimKeyLayerTool::FPGATrackSimKeyLayerTool
FPGATrackSimKeyLayerTool(double r1, double r2)
Definition
FPGATrackSimKeyLayerTool.h:44
FPGATrackSimKeyLayerTool::rotateXY
std::pair< double, double > rotateXY(const std::pair< double, double > &xy, const std::pair< double, double > &ang) const
Definition
FPGATrackSimKeyLayerTool.cxx:26
FPGATrackSimKeyLayerTool::keyParsToTrackPars
FPGATrackSimTrackPars keyParsToTrackPars(const KeyLyrPars &keypars) const
Definition
FPGATrackSimKeyLayerTool.cxx:79
FPGATrackSimKeyLayerTool::zExpected
double zExpected(const KeyLyrPars &keypars, double r) const
Definition
FPGATrackSimKeyLayerTool.cxx:127
FPGATrackSimKeyLayerTool::setR1
void setR1(const double r1)
Definition
FPGATrackSimKeyLayerTool.h:100
FPGATrackSimKeyLayerTool::getRotationAngles
std::pair< double, double > getRotationAngles(const std::pair< double, double > &xy1, const std::pair< double, double > &xy2) const
Definition
FPGATrackSimKeyLayerTool.cxx:16
FPGATrackSimKeyLayerTool::xmForHit
double xmForHit(const KeyLyrPars &keypars, double rHit, double phiHit) const
Definition
FPGATrackSimKeyLayerTool.cxx:133
FPGATrackSimKeyLayerTool::R2
double R2() const
Definition
FPGATrackSimKeyLayerTool.h:99
FPGATrackSimTrackPars
Definition
FPGATrackSimTrackPars.h:22
r
int r
Definition
globals.cxx:22
FPGATrackSimBinUtil::ParSet
Definition
FPGATrackSimBinUtil.h:36
FPGATrackSimKeyLayerTool::KeyLyrPars::z2
double z2
Definition
FPGATrackSimKeyLayerTool.h:52
FPGATrackSimKeyLayerTool::KeyLyrPars::xm
double xm
Definition
FPGATrackSimKeyLayerTool.h:55
FPGATrackSimKeyLayerTool::KeyLyrPars::phi2
double phi2
Definition
FPGATrackSimKeyLayerTool.h:54
FPGATrackSimKeyLayerTool::KeyLyrPars::KeyLyrPars
KeyLyrPars()=default
FPGATrackSimKeyLayerTool::KeyLyrPars::phi1
double phi1
Definition
FPGATrackSimKeyLayerTool.h:53
FPGATrackSimKeyLayerTool::KeyLyrPars::z1
double z1
Definition
FPGATrackSimKeyLayerTool.h:51
FPGATrackSimKeyLayerTool::KeyLyrPars::KeyLyrPars
KeyLyrPars(const FPGATrackSimBinUtil::ParSet &parset)
Definition
FPGATrackSimKeyLayerTool.h:49
FPGATrackSimKeyLayerTool::rotatedConfig
Definition
FPGATrackSimKeyLayerTool.h:70
FPGATrackSimKeyLayerTool::rotatedConfig::xy1p
std::pair< double, double > xy1p
Definition
FPGATrackSimKeyLayerTool.h:71
FPGATrackSimKeyLayerTool::rotatedConfig::rotang
std::pair< double, double > rotang
Definition
FPGATrackSimKeyLayerTool.h:73
FPGATrackSimKeyLayerTool::rotatedConfig::xy2p
std::pair< double, double > xy2p
Definition
FPGATrackSimKeyLayerTool.h:72
FPGATrackSimKeyLayerTool::rotatedConfig::y
double y
Definition
FPGATrackSimKeyLayerTool.h:74
Generated on
for ATLAS Offline Software by
1.17.0