124 {
125
126 ITk::SiSpacePointForSeed& bottom = *
m_s0;
127 ITk::SiSpacePointForSeed& medium = *
m_s1;
128 ITk::SiSpacePointForSeed&
top = *
m_s2;
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;
155 float iDeltaR = std::sqrt(iDeltaR2);
157 float cot_theta =
deltaZ * iDeltaR * bottomFactor;
158
159
160 std::array<float, 5>
params =
161 {
162 cot_theta,
163 zM - rM * cot_theta,
164 iDeltaR,
167 };
168
170 };
171
172 auto coo_b = extractCoordinates(bottom);
173 auto coo_m = extractCoordinates(medium);
174 auto coo_t = extractCoordinates(
top);
175
176
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
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;
205 float drt = std::sqrt(
xt*
xt +
yt*
yt + dzt*dzt );
206
207 float tzb = dzb * std::sqrt( 1.f/dxyb );
208 float tzt = dzt * std::sqrt( 1.f/dxyt );
209
210 float sTzb2 = std::sqrt(1.f + 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.f +
A *
A;
219 float B = Vb -
A * Ub;
220 if (B==0)
221 return;
223
224
225 float dzdr_b = (zM - zB) / (rM - rB);
226 float dzdr_t = (zT - zM) / (rT - rM);
227
228
229 float meanOneOverTanThetaSquare = isPixel ? (cotThetaB * cotThetaT) :
230 std::
pow((cotThetaB + cotThetaT) / 2.f,2);
231 if (meanOneOverTanThetaSquare <= 0) {
232 return;
233 }
234 float theta = std::atan(1.f / std::sqrt(meanOneOverTanThetaSquare));
237 float eta = -std::log(std::tan(0.5f *
theta));
238
239
240 float pt = pTPerHelixRadius*std::sqrt(
S2 / B2);
241
242
243 float d0 = std::abs((A - B * rM) * rM);
244
245
248 top.setScorePenalty( std::abs((tzb - tzt) / (squarediDeltaR * sTzb2)) );
252
255
256 }
Scalar eta() const
pseudorapidity method
Scalar theta() const
theta method
bool isBottom(const T &p)
struct TBPatternUnitContext S2
constexpr int pow(int base, int exp) noexcept