ATLAS Offline Software
Loading...
Searching...
No Matches
InnerDetector
InDetRecTools
SiDetElementsRoadTool_xk
src
SiDetElementLink_xk.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// Implementation file for class SiDetElementLink_xk
8
// (c) ATLAS Detector software
10
//
12
// Version 1.0 21/04/2004 I.Gavrilenko
14
15
#include <iostream>
16
#include <iomanip>
17
#include "
SiDetElementsRoadTool_xk/SiDetElementLink_xk.h
"
18
19
21
// Set parameters
23
24
void
InDet::SiDetElementLink_xk::set
(
const
double
*
P
,
bool
isITk)
25
{
26
m_z
= float(
P
[ 1]) ;
// Z
27
m_dz
= float(std::abs(
P
[12]-
P
[11])*.5) ;
// dZ
28
m_phi
= float(
P
[ 2]) ;
// azimuthal angle
29
m_geo
[0] = float(
P
[ 3]) ;
// min. distance
30
m_geo
[1] = float(
P
[ 4]) ;
// phi
31
m_geo
[2] = float(
P
[ 5]) ;
// sin(phi)
32
m_geo
[3] = float(
P
[ 6]) ;
// cos(phi)
33
m_geo
[4] = float(
P
[ 7]) ;
// sin(polar)
34
m_geo
[5] = float(
P
[ 8]) ;
// cos(polar)
35
m_center
[0] = float(
P
[18]) ;
//
36
m_center
[1] = float(
P
[19]) ;
//
37
m_bound
[0][2] = float(sqrt(
P
[20]*
P
[20]+
P
[21]*
P
[21]));
// -F
38
m_bound
[0][0] = float(
P
[20]/
double
(
m_bound
[0][2])) ;
//
39
m_bound
[0][1] = float(
P
[21]/
double
(
m_bound
[0][2])) ;
//
40
m_bound
[1][2] = float(sqrt(
P
[22]*
P
[22]+
P
[23]*
P
[23]));
// +ZR
41
m_bound
[1][0] = float(
P
[22]/
double
(
m_bound
[1][2])) ;
//
42
m_bound
[1][1] = float(
P
[23]/
double
(
m_bound
[1][2])) ;
//
43
m_bound
[2][2] = float(sqrt(
P
[24]*
P
[24]+
P
[25]*
P
[25]));
// +F
44
m_bound
[2][0] = float(
P
[24]/
double
(
m_bound
[2][2])) ;
//
45
m_bound
[2][1] = float(
P
[25]/
double
(
m_bound
[2][2])) ;
//
46
m_bound
[3][2] = float(sqrt(
P
[26]*
P
[26]+
P
[27]*
P
[27]));
// -ZR
47
m_bound
[3][0] = float(
P
[26]/
double
(
m_bound
[3][2])) ;
//
48
m_bound
[3][1] = float(
P
[27]/
double
(
m_bound
[3][2])) ;
//
49
if
(isITk) {
50
m_bound
[0][2]+=
P
[40];
51
m_bound
[1][2]+=
P
[40];
52
m_bound
[2][2]+=
P
[40];
53
m_bound
[3][2]+=
P
[40];
54
}
55
}
56
58
// Detector element intersection using cashed information
59
// Input parameters: r[0] - X a[0] - Ax
60
// r[1] - Y a[1] - Ay
61
// r[2] - Z a[2] - Az
62
// Output parameters: O[0] - close distance in azimuthal direction
63
// O[1] - close distance in r or z direction
64
// O[2] - step to detector element
66
67
void
InDet::SiDetElementLink_xk::intersect
68
(
const
float
*
r
,
const
float
*
a
,
float
* O)
const
69
{
70
const
float
* g = &
m_geo
[0];
71
float
s[3] = {g[3]*g[4],g[2]*g[4],g[5]} ;
72
float
S =
a
[0]*s[0]+
a
[1]*s[1]+
a
[2]*s[2] ;
73
if
(S!=0.) S = (g[0]-(
r
[0]*s[0]+
r
[1]*s[1]+
r
[2]*s[2]))/S ;
74
float
rn[3] = {
r
[0]+S*
a
[0],
r
[1]+S*
a
[1],
r
[2]+S*
a
[2]} ;
75
float
d0 = rn[1]*g[3]-rn[0]*g[2] -
m_center
[0];
76
float
d1 = g[5]*(rn[0]*g[3]+rn[1]*g[2])-g[4]*rn[2]-
m_center
[1];
77
O[0] =
m_bound
[0][0]*d0+
m_bound
[0][1]*d1-
m_bound
[0][2] ;
78
float
daz =
m_bound
[2][0]*d0+
m_bound
[2][1]*d1-
m_bound
[2][2] ;
79
O[1] =
m_bound
[1][0]*d0+
m_bound
[1][1]*d1-
m_bound
[1][2] ;
80
float
drz =
m_bound
[3][0]*d0+
m_bound
[3][1]*d1-
m_bound
[3][2] ;
81
if
(O[0] < daz) O[0] = daz;
82
if
(O[1] < drz) O[1] = drz;
83
O[2] = S;
84
}
85
86
88
// Detector element intersection using cashed information
89
// Input parameters: r[0] - X a[0] - Ax
90
// r[1] - Y a[1] - Ay
91
// r[2] - Z a[2] - Az
92
// Output parameters: Step - step to detector element
94
bool
InDet::SiDetElementLink_xk::intersectITk
95
(
const
float
*
r
,
const
float
*
a
,
float
& Step)
const
96
{
97
const
float
* g = &
m_geo
[0];
98
99
float
S =
a
[0]*g[6]+
a
[1]*g[7]+
a
[2]*g[5] ;
100
if
(S!=0.) S = (g[0]-(
r
[0]*g[6]+
r
[1]*g[7]+
r
[2]*g[5]))/S ;
101
float
r0 =
r
[0]+S*
a
[0] ;
102
float
r1 =
r
[1]+S*
a
[1] ;
103
float
r2 =
r
[2]+S*
a
[2] ;
104
float
d0 = r1*g[3]-r0*g[2] -g[8] ;
105
float
d1 = g[5]*(r0*g[3]+r1*g[2])-(g[4]*r2+g[9]);
106
107
if
((
m_bound
[1][0]*d0+
m_bound
[1][1]*d1) >
m_bound
[1][2] ||
108
(
m_bound
[3][0]*d0+
m_bound
[3][1]*d1) >
m_bound
[3][2] ||
109
(
m_bound
[0][0]*d0+
m_bound
[0][1]*d1) >
m_bound
[0][2] ||
110
(
m_bound
[2][0]*d0+
m_bound
[2][1]*d1) >
m_bound
[2][2])
return
false
;
111
Step = S+
r
[5];
112
return
true
;
113
}
114
115
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
P
static Double_t P(Double_t *tt, Double_t *par)
Definition
LArPhysWaveHECTool.cxx:280
SiDetElementLink_xk.h
InDet::SiDetElementLink_xk::intersectITk
bool intersectITk(const float *, const float *, float &) const
Definition
SiDetElementLink_xk.cxx:95
InDet::SiDetElementLink_xk::m_center
float m_center[2]
Definition
SiDetElementLink_xk.h:72
InDet::SiDetElementLink_xk::m_phi
float m_phi
Definition
SiDetElementLink_xk.h:68
InDet::SiDetElementLink_xk::m_z
float m_z
Definition
SiDetElementLink_xk.h:69
InDet::SiDetElementLink_xk::set
void set(const double *, bool isITk=false)
Definition
SiDetElementLink_xk.cxx:24
InDet::SiDetElementLink_xk::m_bound
float m_bound[4][3]
Definition
SiDetElementLink_xk.h:73
InDet::SiDetElementLink_xk::m_geo
float m_geo[6]
Definition
SiDetElementLink_xk.h:71
InDet::SiDetElementLink_xk::m_dz
float m_dz
Definition
SiDetElementLink_xk.h:70
InDet::SiDetElementLink_xk::intersect
void intersect(const float *, const float *, float *) const
Definition
SiDetElementLink_xk.cxx:68
r
int r
Definition
globals.cxx:22
Generated on
for ATLAS Offline Software by
1.14.0