ATLAS Offline Software
SiSpacePointForSeed.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 
10 
14 #include "TrkSurfaces/Surface.h"
15 
16 namespace InDet {
17 
19  (const Trk::SpacePoint*const& sp,const float* r)
20  {
21  set(sp,r); m_param = 0.;
22  }
23 
25  (const Trk::SpacePoint*const& sp,const float* r,const float* sc)
26  {
27  set(sp,r,sc); m_param = 0.;
28  }
29 
30 
32  // Set
34 
36  (const Trk::SpacePoint*const& sp,const float* 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*.08333; if(cov < f22) cov = f22;
54  if(de->isBarrel()) {m_covz = 9.*cov; m_covr = .06;}
55  else {m_covr = 9.*cov; m_covz = .06;}
56  m_sn = nullptr;
57  }
58  else {
59 
60  const Amg::MatrixX& v = sp->localCovariance();
61  float f22 = float(v(1,1));
62  if(de->isBarrel()) {m_covz = 8.*f22; m_covr = .1;}
63  else {m_covr = 8.*f22; m_covz = .1;}
64  m_sn = &sp->clusterList().second->detectorElement()->surface();
65  }
66  m_su = &sp->clusterList().first->detectorElement()->surface();
67  }
68 
70  // Set with error correction
71  // sc[0] - barrel pixels error correction
72  // sc[1] - endcap pixels
73  // sc[2] - barrel sct
74  // sc[3] - endcap sct
76 
78  (const Trk::SpacePoint*const& sp,const float* r,const float* sc)
79  {
80  spacepoint = sp ;
81  m_x = r[0];
82  m_y = r[1];
83  m_z = r[2];
84  m_r =std::sqrt(m_x*m_x+m_y*m_y);
85  m_q = 100000.;
86 
87  const InDet::SiCluster* c = static_cast<const InDet::SiCluster*>(sp->clusterList().first);
88  const InDetDD::SiDetectorElement* de = c ->detectorElement();
89 
90  if( de->isPixel() ) {
91 
92  const Amg::MatrixX& v = c->localCovariance();
93  float f22 = float(v(1,1));
94  float wid = float(c->width().z());
95  float cov = wid*wid*.08333; if(cov < f22) cov = f22;
96  if(de->isBarrel()) {m_covz = 9.*cov*sc[0]; m_covr = .06;}
97  else {m_covr = 9.*cov*sc[1]; m_covz = .06;}
98  m_sn = nullptr;
99  }
100  else {
101 
102  const Amg::MatrixX& v = sp->localCovariance();
103  float f22 = float(v(1,1));
104  if(de->isBarrel()) {m_covz = 8.*f22*sc[2]; m_covr = .1;}
105  else {m_covr = 8.*f22*sc[3]; m_covz = .1;}
106  m_sn = &sp->clusterList().second->detectorElement()->surface();
107  }
108  m_su = &sp->clusterList().first->detectorElement()->surface();
109  }
110 
111  void SiSpacePointForSeed::setParam(const float& p)
112  {
113  m_param = p;
114  }
115 
116  void SiSpacePointForSeed::setD0(const float& d0)
117  {
118  m_d0 = d0;
119  }
120 
121  void SiSpacePointForSeed::setEta(const float& eta)
122  {
123  m_eta = eta;
124  }
125 
127  {
128  if(q <= m_q) m_q = q;
129  }
130 
131  void SiSpacePointForSeed::setDZDR(const float& dzdr)
132  {
133  m_dzdr = dzdr;
134  }
135 
136  void SiSpacePointForSeed::setPt(const float& pt)
137  {
138  m_pt = pt;
139  }
140 
141 } // end of name space
Trk::SpacePoint::clusterList
const std::pair< const PrepRawData *, const PrepRawData * > & clusterList() const
return the pair of cluster pointers by reference
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:127
Trk::SpacePoint
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:35
beamspotman.r
def r
Definition: beamspotman.py:676
InDet::SiSpacePointForSeed::m_r
float m_r
Definition: SiSpacePointForSeed.h:81
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
InDet::SiSpacePointForSeed::m_dzdr
float m_dzdr
Definition: SiSpacePointForSeed.h:86
InDet::SiSpacePointForSeed::d0
const float & d0() const
Definition: SiSpacePointForSeed.h:66
Surface.h
InDet::SiSpacePointForSeed::m_q
float m_q
penalty term in the seed score
Definition: SiSpacePointForSeed.h:90
InDet::SiSpacePointForSeed::spacepoint
const Trk::SpacePoint * spacepoint
Definition: SiSpacePointForSeed.h:58
InDet::SiSpacePointForSeed::m_d0
float m_d0
Definition: SiSpacePointForSeed.h:84
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
test_pyathena.pt
pt
Definition: test_pyathena.py:11
InDet::SiSpacePointForSeed::setEta
void setEta(const float &)
Definition: SiSpacePointForSeed.cxx:121
InDet::SiSpacePointForSeed::setParam
void setParam(const float &)
Definition: SiSpacePointForSeed.cxx:111
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
InDet::SiSpacePointForSeed::m_covz
float m_covz
Definition: SiSpacePointForSeed.h:83
InDet::SiSpacePointForSeed::setD0
void setD0(const float &)
Definition: SiSpacePointForSeed.cxx:116
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
InDet::SiSpacePointForSeed::eta
const float & eta() const
Definition: SiSpacePointForSeed.h:67
InDet::SiSpacePointForSeed::set
void set(const Trk::SpacePoint *const &, const float *)
Definition: SiSpacePointForSeed.cxx:36
InDet::SiSpacePointForSeed::m_z
float m_z
Definition: SiSpacePointForSeed.h:80
InDet::SiSpacePointForSeed::setDZDR
void setDZDR(const float &)
Definition: SiSpacePointForSeed.cxx:131
SpacePoint.h
InDet::SiSpacePointForSeed::setQuality
void setQuality(float)
Definition: SiSpacePointForSeed.cxx:126
SiSpacePointForSeed.h
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
InDet::SiSpacePointForSeed::SiSpacePointForSeed
SiSpacePointForSeed()=default
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
InDetDD::SiDetectorElement::isPixel
bool isPixel() const
InDet::SiSpacePointForSeed::m_covr
float m_covr
Definition: SiSpacePointForSeed.h:82
InDet::SiSpacePointForSeed::m_sn
const Trk::Surface * m_sn
Definition: SiSpacePointForSeed.h:92
InDet::SiSpacePointForSeed::m_su
const Trk::Surface * m_su
quality of the best seed this candidate was seen on
Definition: SiSpacePointForSeed.h:91
SiCluster.h
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
InDetDD::SiDetectorElement::isBarrel
bool isBarrel() const
InDet::SiSpacePointForSeed::m_pt
float m_pt
Definition: SiSpacePointForSeed.h:87
InDet::SiSpacePointForSeed::m_x
float m_x
Definition: SiSpacePointForSeed.h:78
SiDetectorElement.h
python.PyAthena.v
v
Definition: PyAthena.py:154
InDet::SiSpacePointForSeed::m_y
float m_y
Definition: SiSpacePointForSeed.h:79
extractSporadic.q
list q
Definition: extractSporadic.py:98
InDet::SiSpacePointForSeed::m_param
float m_param
Definition: SiSpacePointForSeed.h:88
InDet::SiSpacePointForSeed::dzdr
const float & dzdr() const
quality of the best seed this candidate was seen on
Definition: SiSpacePointForSeed.h:71
python.compressB64.c
def c
Definition: compressB64.py:93
readCCLHist.float
float
Definition: readCCLHist.py:83
InDet::SiCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h:40
InDet::SiSpacePointForSeed::setPt
void setPt(const float &)
Definition: SiSpacePointForSeed.cxx:136
InDet::SiSpacePointForSeed::m_eta
float m_eta
Definition: SiSpacePointForSeed.h:85