ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetRecEvent
SiSPSeededTrackFinderData
src
ITkSiSpacePointForSeed.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include <cmath>
6
7
8
9
#include "
SiSPSeededTrackFinderData/ITkSiSpacePointForSeed.h
"
10
11
#include "
InDetPrepRawData/SiCluster.h
"
12
#include "
InDetReadoutGeometry/SiDetectorElement.h
"
13
#include "
TrkSpacePoint/SpacePoint.h
"
14
#include "
TrkSurfaces/Surface.h
"
15
#include "
CxxUtils/restrict.h
"
16
namespace
ITk
17
{
18
19
SiSpacePointForSeed::SiSpacePointForSeed
20
(
const
Trk::SpacePoint
*
sp
,std::span<float const, 15>
r
)
21
{
22
set
(
sp
,
r
);
m_param
= 0.;
23
}
24
25
SiSpacePointForSeed::SiSpacePointForSeed
26
(
const
Trk::SpacePoint
*
sp
,std::span<float const, 15>
r
,std::span<float const, 15>
sc
)
27
{
28
set
(
sp
,
r
,
sc
);
m_param
= 0.;
29
}
30
32
// Set
34
35
void
SiSpacePointForSeed::set
36
(
const
Trk::SpacePoint
*
sp
,std::span<float const, 15>
r
)
37
{
38
spacepoint
=
sp
;
39
m_x
=
r
[0];
40
m_y
=
r
[1];
41
m_z
=
r
[2];
42
m_r
=std::sqrt(
m_x
*
m_x
+
m_y
*
m_y
);
43
m_q
= 100000.;
44
45
const
InDet::SiCluster
* c =
static_cast<
const
InDet::SiCluster
*
>
(
sp
->clusterList().first);
46
const
InDetDD::SiDetectorElement
* de = c ->detectorElement();
47
48
if
( de->
isPixel
() ) {
49
50
const
Amg::MatrixX
& v = c->localCovariance();
51
float
f22 = float(v(1,1) );
52
float
wid = float(c->width().z());
53
float
cov = wid*wid*.08333f;
if
(cov < f22) cov = f22;
54
m_sn
=
nullptr
;
55
cov*=6.;
56
m_covz
= cov*(
r
[3]*
r
[3]+
r
[4]*
r
[4]);
57
m_covr
= cov*(
r
[5]*
r
[5]);
58
}
59
else
{
60
61
const
Amg::MatrixX
& v =
sp
->localCovariance();
62
float
f22 = float(v(1,1));
63
if
(de->
isBarrel
()) {
m_covz
= 8.f*f22;
m_covr
= .1f;}
64
else
{
m_covr
= 8.f*f22;
m_covz
= .1f;}
65
m_sn
= &
sp
->clusterList().second->detectorElement()->surface();
66
67
for
(
int
i=0; i!=3; ++i) {
68
m_b0
[i]=
r
[3 +i];
m_b1
[i]=
r
[6 +i];
m_dr
[i]=
r
[9 +i];
m_r0
[i]=
r
[12+i];
69
}
70
}
71
m_su
= &
sp
->clusterList().first->detectorElement()->surface();
72
}
73
74
76
// Set with error correction
77
// sc[0] - barrel pixels error correction
78
// sc[1] - endcap pixels
79
// sc[2] - barrel sct
80
// sc[3] - endcap sct
82
83
void
SiSpacePointForSeed::set
84
(
const
Trk::SpacePoint
*
sp
,std::span<float const, 15>
r
, std::span<float const, 15>
sc
)
85
{
86
m_sn
=
nullptr
;
87
spacepoint
=
sp
;
88
m_x
=
r
[0];
89
m_y
=
r
[1];
90
m_z
=
r
[2];
91
m_r
=std::sqrt(
m_x
*
m_x
+
m_y
*
m_y
);
92
m_q
= 100000.;
93
94
const
InDet::SiCluster
* c =
static_cast<
const
InDet::SiCluster
*
>
(
sp
->clusterList().first);
95
const
InDetDD::SiDetectorElement
* de = c ->detectorElement();
96
97
if
( de->
isPixel
() ) {
98
const
Amg::MatrixX
& v = c->localCovariance();
99
float
f22 = float(v(1,1));
100
float
wid = float(c->width().z());
101
float
cov = wid*wid*.08333f;
if
(cov < f22) cov = f22;
102
cov*=6.;
103
m_covz
= cov*(
r
[3]*
r
[3]+
r
[4]*
r
[4]);
104
m_covr
= cov*(
r
[5]*
r
[5]);
105
}
else
{
106
const
Amg::MatrixX
& v =
sp
->localCovariance();
107
float
f22 = float(v(1,1));
108
if
(de->
isBarrel
()) {
m_covz
= 8.f*f22*
sc
[2];
m_covr
= .1f;}
109
else
{
m_covr
= 8.f*f22*
sc
[3];
m_covz
= .1f;}
110
for
(
int
i=0; i!=3; ++i) {
m_b0
[i]=
r
[3 +i];
m_b1
[i]=
r
[6 +i];
m_dr
[i]=
r
[9 +i];
m_r0
[i]=
r
[12+i];}
111
}
112
m_su
= &
sp
->clusterList().first->detectorElement()->surface();
113
}
114
115
void
SiSpacePointForSeed::setQuality
(
float
q)
116
{
117
if
(q <=
m_q
)
m_q
= q;
118
}
119
121
// Coordinate of cross points two SCT strip calculation for given direction
122
// d - input direction
123
// r - output coordinates
124
// true if cross point is inside detector elements
126
127
bool
SiSpacePointForSeed::coordinates
(
const
float
* d,
float
*
ATH_RESTRICT
r
)
128
{
129
float
d1[3] = {
m_b0
[1]*d[2]-
m_b0
[2]*d[1],
m_b0
[2]*d[0]-
m_b0
[0]*d[2],
m_b0
[0]*d[1]-
m_b0
[1]*d[0]};
130
float
bd =
m_b1
[0]*d1[0]+
m_b1
[1]*d1[1]+
m_b1
[2]*d1[2];
131
132
if
(std::abs(
m_dr
[0]*d1[0]+
m_dr
[1]*d1[1]+
m_dr
[2]*d1[2]) > std::abs(bd)*1.1)
return
false
;
133
134
float
s0
=
m_dr
[0]*(
m_b1
[1]*d[2]-
m_b1
[2]*d[1])+
135
m_dr
[1]*(
m_b1
[2]*d[0]-
m_b1
[0]*d[2])+
136
m_dr
[2]*(
m_b1
[0]*d[1]-
m_b1
[1]*d[0]);
137
if
(std::abs(
s0
) > std::abs(bd)*1.1)
return
false
;
138
139
s0
/=bd;
140
r
[0] =
m_r0
[0]+
m_b0
[0]*
s0
;
141
r
[1] =
m_r0
[1]+
m_b0
[1]*
s0
;
142
r
[2] =
m_r0
[2]+
m_b0
[2]*
s0
;
143
return
true
;
144
}
145
146
}
// end of name space ITk
ITkSiSpacePointForSeed.h
sp
static Double_t sp
Definition
LArPhysWaveHECTool.cxx:37
s0
static Double_t s0
Definition
LArPhysWaveHECTool.cxx:37
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
SiCluster.h
SiDetectorElement.h
Surface.h
SpacePoint.h
ITk::SiSpacePointForSeed::m_param
float m_param
Definition
ITkSiSpacePointForSeed.h:94
ITk::SiSpacePointForSeed::m_covr
float m_covr
Definition
ITkSiSpacePointForSeed.h:92
ITk::SiSpacePointForSeed::m_covz
float m_covz
Definition
ITkSiSpacePointForSeed.h:93
ITk::SiSpacePointForSeed::spacepoint
const Trk::SpacePoint * spacepoint
Definition
ITkSiSpacePointForSeed.h:62
ITk::SiSpacePointForSeed::m_q
float m_q
Definition
ITkSiSpacePointForSeed.h:95
ITk::SiSpacePointForSeed::setQuality
void setQuality(float)
Definition
ITkSiSpacePointForSeed.cxx:115
ITk::SiSpacePointForSeed::m_b1
float m_b1[3]
Definition
ITkSiSpacePointForSeed.h:104
ITk::SiSpacePointForSeed::m_z
float m_z
Definition
ITkSiSpacePointForSeed.h:90
ITk::SiSpacePointForSeed::m_x
float m_x
Definition
ITkSiSpacePointForSeed.h:88
ITk::SiSpacePointForSeed::m_su
const Trk::Surface * m_su
Definition
ITkSiSpacePointForSeed.h:108
ITk::SiSpacePointForSeed::set
void set(const Trk::SpacePoint *, std::span< float const, 15 >)
Definition
ITkSiSpacePointForSeed.cxx:36
ITk::SiSpacePointForSeed::SiSpacePointForSeed
SiSpacePointForSeed()=default
ITk::SiSpacePointForSeed::m_r
float m_r
Definition
ITkSiSpacePointForSeed.h:91
ITk::SiSpacePointForSeed::coordinates
bool coordinates(const float *, float *)
Definition
ITkSiSpacePointForSeed.cxx:127
ITk::SiSpacePointForSeed::m_y
float m_y
Definition
ITkSiSpacePointForSeed.h:89
ITk::SiSpacePointForSeed::m_dr
float m_dr[3]
Definition
ITkSiSpacePointForSeed.h:105
ITk::SiSpacePointForSeed::m_r0
float m_r0[3]
Definition
ITkSiSpacePointForSeed.h:106
ITk::SiSpacePointForSeed::m_sn
const Trk::Surface * m_sn
Definition
ITkSiSpacePointForSeed.h:109
ITk::SiSpacePointForSeed::m_b0
float m_b0[3]
Definition
ITkSiSpacePointForSeed.h:103
InDetDD::SiDetectorElement
Class to hold geometrical description of a silicon detector element.
Definition
SiDetectorElement.h:109
InDetDD::SiDetectorElement::isPixel
bool isPixel() const
InDetDD::SiDetectorElement::isBarrel
bool isBarrel() const
InDet::SiCluster
Definition
SiCluster.h:40
Trk::SpacePoint
Definition
Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:35
r
int r
Definition
globals.cxx:22
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition
EventPrimitives.h:27
ITk
Definition
ITkPixelOfflineCalibCondAlg.cxx:13
restrict.h
Macro wrapping the nonstandard restrict keyword.
ATH_RESTRICT
#define ATH_RESTRICT
Definition
restrict.h:31
Generated on
for ATLAS Offline Software by
1.17.0