ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ITk::SiSpacePointsProSeed Class Referencefinal

#include <ITkSiSpacePointsProSeed.h>

Collaboration diagram for ITk::SiSpacePointsProSeed:

Public Member Functions

 SiSpacePointsProSeed ()
 
 SiSpacePointsProSeed (SiSpacePointForSeed *&, SiSpacePointForSeed *&, SiSpacePointForSeed *&, float)
 
 SiSpacePointsProSeed (const SiSpacePointsProSeed &)
 
SiSpacePointsProSeedoperator= (const SiSpacePointsProSeed &)
 
 SiSpacePointsProSeed (SiSpacePointsProSeed &&)=default
 
SiSpacePointsProSeedoperator= (SiSpacePointsProSeed &&)=default
 
 ~SiSpacePointsProSeed ()=default
 
SiSpacePointForSeedspacepoint0 ()
 
SiSpacePointForSeedspacepoint1 ()
 
SiSpacePointForSeedspacepoint2 ()
 
const float & z () const
 
const float & quality () const
 
void set (SiSpacePointForSeed *&, SiSpacePointForSeed *&, SiSpacePointForSeed *&, float)
 
bool setQuality (float)
 
bool set3 (InDet::SiSpacePointsSeed &, float pTPerHelixRadius)
 
void set2 (InDet::SiSpacePointsSeed &)
 

Private Member Functions

void estimateParameters (float pTPerHelixRadius)
 

Private Attributes

SiSpacePointForSeedm_s0 {}
 
SiSpacePointForSeedm_s1 {}
 
SiSpacePointForSeedm_s2 {}
 
float m_z {}
 
float m_q {}
 

Detailed Description

Definition at line 28 of file ITkSiSpacePointsProSeed.h.

Constructor & Destructor Documentation

◆ SiSpacePointsProSeed() [1/4]

ITk::SiSpacePointsProSeed::SiSpacePointsProSeed ( )

Definition at line 15 of file ITkSiSpacePointsProSeed.cxx.

16  {
17  m_s0 = nullptr ;
18  m_s1 = nullptr ;
19  m_s2 = nullptr ;
20  m_z = 0.;
21  m_q = 0.;
22  }

◆ SiSpacePointsProSeed() [2/4]

ITk::SiSpacePointsProSeed::SiSpacePointsProSeed ( SiSpacePointForSeed *&  s0,
SiSpacePointForSeed *&  s1,
SiSpacePointForSeed *&  s2,
float  z 
)

Definition at line 38 of file ITkSiSpacePointsProSeed.cxx.

40  {
41  set(s0,s1,s2,z); m_q = 0.;
42  }

◆ SiSpacePointsProSeed() [3/4]

ITk::SiSpacePointsProSeed::SiSpacePointsProSeed ( const SiSpacePointsProSeed sp)

Definition at line 48 of file ITkSiSpacePointsProSeed.cxx.

48  : m_s0(sp.m_s0),m_s1(sp.m_s1),m_s2(sp.m_s2)
49  {
50  *this = sp;
51  }

◆ SiSpacePointsProSeed() [4/4]

ITk::SiSpacePointsProSeed::SiSpacePointsProSeed ( SiSpacePointsProSeed &&  )
default

◆ ~SiSpacePointsProSeed()

ITk::SiSpacePointsProSeed::~SiSpacePointsProSeed ( )
default

Member Function Documentation

◆ estimateParameters()

void ITk::SiSpacePointsProSeed::estimateParameters ( float  pTPerHelixRadius)
private

Definition at line 123 of file ITkSiSpacePointsProSeed.cxx.

124  {
125 
126  ITk::SiSpacePointForSeed& bottom = *m_s0;
127  ITk::SiSpacePointForSeed& medium = *m_s1;
129 
130  bool isPixel = !m_s2->spacepoint->clusterList().second;
131 
132  auto extractCoordinates =
133  [] (const ITk::SiSpacePointForSeed& sp) -> std::array<float,4>
134  {
135  std::array<float, 4> coordinates {sp.x(), sp.y(), sp.z(), sp.radius()};
136  return coordinates;
137  };
138 
139  auto extractQuantities =
140  [] (const std::array<float, 4>& sp,
141  const std::array<float, 4>& spM,
142  bool isBottom) -> std::array<float, 5>
143  {
144  const auto& [xM, yM, zM, rM] = spM;
145  const auto& [xO, yO, zO, rO] = sp;
146 
147  float cosPhiM = xM / rM;
148  float sinPhiM = yM / rM;
149  float deltaX = xO - xM;
150  float deltaY = yO - yM;
151  float deltaZ = zO - zM;
152  float x = deltaX * cosPhiM + deltaY * sinPhiM;
153  float y = deltaY * cosPhiM - deltaX * sinPhiM;
154  float iDeltaR2 = 1. / (deltaX * deltaX + deltaY * deltaY);
155  float iDeltaR = std::sqrt(iDeltaR2);
156  int bottomFactor = 1 * (int(not isBottom)) - 1 * (int(isBottom));
157  float cot_theta = deltaZ * iDeltaR * bottomFactor;
158 
159  // cotTheta, Zo, iDeltaR, U, V
160  std::array<float, 5> params =
161  {
162  cot_theta,
163  zM - rM * cot_theta,
164  iDeltaR,
165  x * iDeltaR2,
166  y * iDeltaR2
167  };
168 
169  return params;
170  };
171 
172  auto coo_b = extractCoordinates(bottom);
173  auto coo_m = extractCoordinates(medium);
174  auto coo_t = extractCoordinates(top);
175 
176  // Compute the variables we need
177  auto [cotThetaB, Zob, iDeltaRB, Ub, Vb] = extractQuantities(coo_b, coo_m, true);
178  auto [cotThetaT, Zot, iDeltaRT, Ut, Vt] = extractQuantities(coo_t, coo_m, false);
179 
180  float squarediDeltaR2B = iDeltaRB*iDeltaRB;
181  float squarediDeltaR2T = iDeltaRB*iDeltaRT;
182  float squarediDeltaR = std::min(squarediDeltaR2B, squarediDeltaR2T);
183 
184  auto& [xB, yB, zB, rB] = coo_b;
185  auto& [xM, yM, zM, rM] = coo_m;
186  auto& [xT, yT, zT, rT] = coo_t;
187 
188  float ax = xM / rM;
189  float ay = yM/ rM;
190 
191  float dxb = xM - xB;
192  float dyb = yM - yB;
193  float dzb = zM - zB;
194  float xb = dxb * ax + dyb *ay;
195  float yb = dyb * ax - dxb * ay;
196  float dxyb = xb * xb + yb * yb;
197  float drb = std::sqrt( xb*xb + yb*yb + dzb*dzb );
198 
199  float dxt = xT - xM;
200  float dyt = yT - yM;
201  float dzt = zT - zM;
202  float xt = dxt * ax + dyt *ay;
203  float yt = dyt * ax - dxt * ay;
204  float dxyt = xt * xt + yt * yt;
205  float drt = std::sqrt( xt*xt + yt*yt + dzt*dzt );
206 
207  float tzb = dzb * std::sqrt( 1./dxyb );
208  float tzt = dzt * std::sqrt( 1./dxyt );
209 
210  float sTzb2 = std::sqrt(1 + tzb*tzb);
211 
212  float dU = Ut - Ub;
213  if (dU == 0.) {
214  return;
215  }
216 
217  float A = (Vt - Vb) / dU;
218  float S2 = 1. + A * A;
219  float B = Vb - A * Ub;
220  if (B==0)
221  return;
222  float B2 = B * B;
223 
224  // dzdr
225  float dzdr_b = (zM - zB) / (rM - rB);
226  float dzdr_t = (zT - zM) / (rT - rM);
227 
228  // eta
229  float meanOneOverTanThetaSquare = isPixel ? (cotThetaB * cotThetaT) :
230  std::pow((cotThetaB + cotThetaT) / 2.,2);
231  if (meanOneOverTanThetaSquare <= 0) {
232  return;
233  }
234  float theta = std::atan(1. / std::sqrt(meanOneOverTanThetaSquare)); // [0, pi/2)
235  if (top.z()<0) {theta = -theta;} // (-pi/2, pi/2)
236  if (theta < 0.) {theta = theta + M_PI;} // [0, pi)
237  float eta = -std::log(std::tan(0.5 * theta));
238 
239  // pt
240  float pt = pTPerHelixRadius*std::sqrt(S2 / B2);
241 
242  // d0
243  float d0 = std::abs((A - B * rM) * rM);
244 
245  // Attach variables to SPs
246  top.setDR(drt);
247  top.setDZDR(dzdr_t);
248  top.setScorePenalty( std::abs((tzb - tzt) / (squarediDeltaR * sTzb2)) );
249  top.setParam(d0);
250  top.setEta(eta);
251  top.setPt(pt);
252 
253  bottom.setDR(drb);
254  bottom.setDZDR(dzdr_b);
255 
256  }

◆ operator=() [1/2]

SiSpacePointsProSeed & ITk::SiSpacePointsProSeed::operator= ( const SiSpacePointsProSeed sp)

Definition at line 24 of file ITkSiSpacePointsProSeed.cxx.

26  {
27  if(&sp!=this) {
28 
29  m_z = sp.m_z ;
30  m_q = sp.m_q ;
31  m_s0 = sp.m_s0;
32  m_s1 = sp.m_s1;
33  m_s2 = sp.m_s2;
34  }
35  return(*this);
36  }

◆ operator=() [2/2]

SiSpacePointsProSeed& ITk::SiSpacePointsProSeed::operator= ( SiSpacePointsProSeed &&  )
default

◆ quality()

const float& ITk::SiSpacePointsProSeed::quality ( ) const
inline

Definition at line 49 of file ITkSiSpacePointsProSeed.h.

49 {return m_q ;}

◆ set()

void ITk::SiSpacePointsProSeed::set ( SiSpacePointForSeed *&  s0,
SiSpacePointForSeed *&  s1,
SiSpacePointForSeed *&  s2,
float  z 
)

Definition at line 58 of file ITkSiSpacePointsProSeed.cxx.

60  {
61  m_z = z ;
62  m_s0 = s0;
63  m_s1 = s1;
64  m_s2 = s2;
65  }

◆ set2()

void ITk::SiSpacePointsProSeed::set2 ( InDet::SiSpacePointsSeed s)

Definition at line 71 of file ITkSiSpacePointsProSeed.cxx.

72  {
73  s.erase();
74  s.add(m_s0->spacepoint);
75  s.add(m_s1->spacepoint);
76  s.setZVertex(double(m_z));
77  }

◆ set3()

bool ITk::SiSpacePointsProSeed::set3 ( InDet::SiSpacePointsSeed s,
float  pTPerHelixRadius 
)

Definition at line 83 of file ITkSiSpacePointsProSeed.cxx.

84  {
85  bool pixt = !m_s2->spacepoint->clusterList().second;
86 
87  if(pixt) {
88  if(m_q > m_s0->quality() && m_q > m_s1->quality() && m_q > m_s2->quality()) return false;
89  }
90 
94 
95  s.erase();
96  s.add(m_s0->spacepoint);
97  s.add(m_s1->spacepoint);
98  s.add(m_s2->spacepoint);
99  s.setZVertex(double(m_z));
100  s.setX1(m_s0->x());
101  s.setX2(m_s1->x());
102  s.setX3(m_s2->x());
103  s.setY1(m_s0->y());
104  s.setY2(m_s1->y());
105  s.setY3(m_s2->y());
106  s.setZ1(m_s0->z());
107  s.setZ2(m_s1->z());
108  s.setZ3(m_s2->z());
109  s.setR1(m_s0->radius());
110  s.setR2(m_s1->radius());
111  s.setR3(m_s2->radius());
112 
113  estimateParameters(pTPerHelixRadius);
114  s.setD0(m_s2->param());
115  s.setEta(m_s2->eta());
116  s.setDZDR_B(m_s0->dzdr());
117  s.setDZDR_T(m_s2->dzdr());
118  s.setPt(m_s2->pt());
119 
120  return true;
121  }

◆ setQuality()

bool ITk::SiSpacePointsProSeed::setQuality ( float  q)

Definition at line 262 of file ITkSiSpacePointsProSeed.cxx.

263  {
264  m_q = q;
265 
266  if(!m_s2->spacepoint->clusterList().second) {
267  if(q > m_s0->quality() && q > m_s1->quality() && q > m_s2->quality()) return false;
268  }
269  m_s0->setQuality(m_q);
270  m_s1->setQuality(m_q);
271  m_s2->setQuality(m_q);
272  return true;
273  }

◆ spacepoint0()

SiSpacePointForSeed* ITk::SiSpacePointsProSeed::spacepoint0 ( )
inline

Definition at line 45 of file ITkSiSpacePointsProSeed.h.

45 {return m_s0;}

◆ spacepoint1()

SiSpacePointForSeed* ITk::SiSpacePointsProSeed::spacepoint1 ( )
inline

Definition at line 46 of file ITkSiSpacePointsProSeed.h.

46 {return m_s1;}

◆ spacepoint2()

SiSpacePointForSeed* ITk::SiSpacePointsProSeed::spacepoint2 ( )
inline

Definition at line 47 of file ITkSiSpacePointsProSeed.h.

47 {return m_s2;}

◆ z()

const float& ITk::SiSpacePointsProSeed::z ( ) const
inline

Definition at line 48 of file ITkSiSpacePointsProSeed.h.

48 {return m_z ;}

Member Data Documentation

◆ m_q

float ITk::SiSpacePointsProSeed::m_q {}
private

Definition at line 63 of file ITkSiSpacePointsProSeed.h.

◆ m_s0

SiSpacePointForSeed* ITk::SiSpacePointsProSeed::m_s0 {}
private

Definition at line 59 of file ITkSiSpacePointsProSeed.h.

◆ m_s1

SiSpacePointForSeed* ITk::SiSpacePointsProSeed::m_s1 {}
private

Definition at line 60 of file ITkSiSpacePointsProSeed.h.

◆ m_s2

SiSpacePointForSeed* ITk::SiSpacePointsProSeed::m_s2 {}
private

Definition at line 61 of file ITkSiSpacePointsProSeed.h.

◆ m_z

float ITk::SiSpacePointsProSeed::m_z {}
private

Definition at line 62 of file ITkSiSpacePointsProSeed.h.


The documentation for this class was generated from the following files:
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
test_pyathena.eta
eta
Definition: test_pyathena.py:10
ReadCellNoiseFromCoolCompare.s1
s1
Definition: ReadCellNoiseFromCoolCompare.py:378
ITk::SiSpacePointForSeed::param
const float & param() const
Definition: ITkSiSpacePointForSeed.h:69
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
ITk::SiSpacePointsProSeed::z
const float & z() const
Definition: ITkSiSpacePointsProSeed.h:48
yt
#define yt
fitman.ax
ax
Definition: fitman.py:522
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
ITk::SiSpacePointForSeed::pt
const float & pt() const
Definition: ITkSiSpacePointForSeed.h:73
makeComparison.deltaY
int deltaY
Definition: makeComparison.py:44
ITk::SiSpacePointsProSeed::set
void set(SiSpacePointForSeed *&, SiSpacePointForSeed *&, SiSpacePointForSeed *&, float)
Definition: ITkSiSpacePointsProSeed.cxx:59
ITk::SiSpacePointsProSeed::m_q
float m_q
Definition: ITkSiSpacePointsProSeed.h:63
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
ITk::SiSpacePointForSeed::y
const float & y() const
Definition: ITkSiSpacePointForSeed.h:63
test_pyathena.pt
pt
Definition: test_pyathena.py:11
ITk::SiSpacePointForSeed::z
const float & z() const
Definition: ITkSiSpacePointForSeed.h:64
M_PI
#define M_PI
Definition: ActiveFraction.h:11
MCP::ScaleSmearParam::s0
@ s0
x
#define x
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
ITk::SiSpacePointForSeed::quality
const float & quality() const
Definition: ITkSiSpacePointForSeed.h:70
A
xt
#define xt
ITk::SiSpacePointForSeed::spacepoint
const Trk::SpacePoint * spacepoint
Definition: ITkSiSpacePointForSeed.h:61
isBottom
bool isBottom(const T &p)
Definition: AtlasPID.h:148
ITk::SiSpacePointsProSeed::m_s0
SiSpacePointForSeed * m_s0
Definition: ITkSiSpacePointsProSeed.h:59
ITk::SiSpacePointsProSeed::m_s1
SiSpacePointForSeed * m_s1
Definition: ITkSiSpacePointsProSeed.h:60
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
ITk::SiSpacePointsProSeed::estimateParameters
void estimateParameters(float pTPerHelixRadius)
Definition: ITkSiSpacePointsProSeed.cxx:123
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
jobOption.theta
theta
Definition: jobOption.ParticleGun_fwd_sequence.py:13
ITk::SiSpacePointForSeed::eta
const float & eta() const
Definition: ITkSiSpacePointForSeed.h:72
compareGeometries.deltaX
float deltaX
Definition: compareGeometries.py:32
ITk::SiSpacePointForSeed::radius
const float & radius() const
Definition: ITkSiSpacePointForSeed.h:65
ITk::SiSpacePointForSeed::setDZDR
void setDZDR(const float &)
Definition: ITkSiSpacePointForSeed.cxx:85
dqt_zlumi_alleff_HIST.B
B
Definition: dqt_zlumi_alleff_HIST.py:110
ITk::SiSpacePointsProSeed::m_z
float m_z
Definition: ITkSiSpacePointsProSeed.h:62
DataModelTestDataCommonDict::xb
DMTest::CView::Pers_t xb
Definition: DataModelTestDataCommonDict.h:55
ITk::SiSpacePointsProSeed::m_s2
SiSpacePointForSeed * m_s2
Definition: ITkSiSpacePointsProSeed.h:61
y
#define y
ITk::SiSpacePointForSeed::setQuality
void setQuality(float)
Definition: ITkSiSpacePointForSeed.cxx:145
ITk::SiSpacePointForSeed::x
const float & x() const
Definition: ITkSiSpacePointForSeed.h:62
ReadCellNoiseFromCoolCompare.s2
s2
Definition: ReadCellNoiseFromCoolCompare.py:379
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
S2
struct TBPatternUnitContext S2
extractSporadic.q
list q
Definition: extractSporadic.py:98
ITk::SiSpacePointForSeed::dzdr
const float & dzdr() const
Definition: ITkSiSpacePointForSeed.h:71
top
@ top
Definition: TruthClasses.h:64
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
makeComparison.deltaZ
int deltaZ
Definition: makeComparison.py:46
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
ITk::SiSpacePointForSeed::setDR
void setDR(const float &)
Definition: ITkSiSpacePointForSeed.cxx:75
ITk::SiSpacePointForSeed
Definition: ITkSiSpacePointForSeed.h:33
fitman.ay
ay
Definition: fitman.py:525