179 {
180 using CLHEP::micrometer;
181
182 const double TOPHAT_SIGMA = 1. / std::sqrt(12.);
183
184 const InDet::PixelCluster *pix = nullptr;
186 pix = static_cast<const InDet::PixelCluster *>(&rio);
187 }
188 else{
189 return nullptr;
190 }
191
193
194
195
196 Trk::LocalParameters locpar;
198
199
200
202 if (!element) {
203 return nullptr;
204 }
207
208 double errphi = -1;
209 double erreta = -1;
210
212 ATH_MSG_WARNING(
"Pixel RDO-list size is 0, check integrity of pixel clusters! stop ROT creation.");
213 return nullptr;
214 } else {
215 const InDetDD::PixelModuleDesign *design =
216 dynamic_cast<const InDetDD::PixelModuleDesign *
>(&element->
design());
217
218
223 float trkphicomp = my_track.dot(my_phiax);
224 float trketacomp = my_track.dot(my_etaax);
225 float trknormcomp = my_track.dot(my_normal);
226 double bowphi = std::atan2(trkphicomp, trknormcomp);
227 double boweta = std::atan2(trketacomp, trknormcomp);
228 float etatrack = trackPar.
eta();
229
232
233
234 if (bowphi >
M_PI *0.5) {
236 }
237 if (bowphi < -
M_PI *0.5) {
239 }
240
241
242
243 double angle = std::atan(std::tan(bowphi) - readoutside * tanl);
244
245
246 const Identifier element_id = element->
identify();
247 int PixEtaModule =
m_pixelid->eta_module(element_id);
248 int PixPhiModule =
m_pixelid->phi_module(element_id);
249 double PixTrkPt = trackPar.
pT();
250 double PixTrkEta = trackPar.
eta();
251 ATH_MSG_VERBOSE(
"tanl = " << tanl <<
" readout side is " << readoutside <<
252 " module " << PixEtaModule << " " << PixPhiModule <<
253 " track pt, eta = " << PixTrkPt << " " << PixTrkEta <<
254 " track momentum phi, norm = " << trkphicomp << " " <<
255 trknormcomp <<
" bowphi = " << bowphi <<
" angle = " <<
angle);
256
257 float omegaphi = pix->
omegax();
258 float omegaeta = pix->
omegay();
259 double localphi = -9999.;
260 double localeta = -9999.;
261
262 const std::vector<Identifier> & rdos = pix->
rdoList();
263 InDetDD::SiLocalPosition meanpos(0, 0, 0);
264 int rowmin = 9999;
265 int rowmax = -9999;
266 int colmin = 9999;
267 int colmax = -9999;
268 for (const auto & rId:rdos) {
270 const int col =
m_pixelid->eta_index(rId);
271 rowmin = std::min(rowmin, row);
272 rowmax = std::max(rowmax,row);
273 colmin = std::min(colmin, col);
274 colmax = std::max(colmax, col);
276 }
277 meanpos = meanpos / rdos.size();
278 InDetDD::SiLocalPosition pos1 =
280 InDetDD::SiLocalPosition pos2 =
282 InDetDD::SiLocalPosition pos3 =
284 InDetDD::SiLocalPosition pos4 =
286
287 InDetDD::SiLocalPosition centroid = 0.25 * (pos1 + pos2 + pos3 + pos4);
289 int nrows = rowmax - rowmin + 1;
290 int ncol = colmax - colmin + 1;
291 double ang = 999.;
292
293
294
295 SG::ReadCondHandle<PixelCalib::PixelOfflineCalibData> offlineCalibData(
m_clusterErrorKey, ctx);
297 localphi = centroid.
xPhi() + shift;
298 localeta = centroid.
xEta();
299
301 ang = 180 *
angle * M_1_PI;
302 double delta = 0.;
304 delta = offlineCalibData->getPixelChargeInterpolationParameters()->getDeltaXbarrel(nrows, ang, 1);
305 } else {
307 delta = 0.;
308 }else {
312 }
315 } else {
316 ATH_MSG_ERROR(
"bin out of range in line " << __LINE__ <<
" of PixelClusterOnTrackTool.cxx.");
317 }
318 }
319
320 if (offlineCalibData->getPixelChargeInterpolationParameters()->getVersion()<-1) {
321 delta = offlineCalibData->getPixelChargeInterpolationParameters()->getDeltaXbarrel(nrows, ang, 0);
322 }
323 }
324 localphi += delta * (omegaphi - 0.5);
325
326 double thetaloc = -999.;
327 if (boweta > -0.5 *
M_PI && boweta <
M_PI / 2.) {
328 thetaloc = M_PI_2 - boweta;
329 }
else if (boweta > M_PI_2 && boweta <
M_PI) {
330 thetaloc = 1.5 *
M_PI - boweta;
331 } else {
332 thetaloc = -M_PI_2 - boweta;
333 }
334 double etaloc = -1 *
log(
tan(thetaloc * 0.5));
336 delta = offlineCalibData->getPixelChargeInterpolationParameters()->getDeltaYbarrel(ncol, etaloc, 1);
337 } else {
338 etaloc = std::abs(etaloc);
340 delta = 0.;
341 } else {
343 while (etaloc >
m_etax[bin + 1]) {
345 }
347 if (ncol == bin) {
349 } else if (ncol == bin + 1) {
351 } else if (ncol == bin + 2) {
353 } else {
354 delta = 0.;
355 }
356 } else {
357 ATH_MSG_ERROR(
"bin out of range in line " << __LINE__ <<
" of PixelClusterOnTrackTool.cxx.");
358 }
359 }
360 if (offlineCalibData->getPixelChargeInterpolationParameters()->getVersion()<-1) {
361 delta = offlineCalibData->getPixelChargeInterpolationParameters()->getDeltaYbarrel(ncol, std::abs(etaloc), 0);
362 }
363 }
364 localeta += delta * (omegaeta - 0.5);
365 }else {
366
370 localphi += deltax * (omegaphi - 0.5);
371 localeta += deltay * (omegaeta - 0.5);
372 }
373
374
375
379 localphi += deltax * (omegaphi - 0.5);
380 localeta += deltay * (omegaeta - 0.5);
381 }
382 }
383 }
384
385 else {
386 localphi = meanpos.xPhi() + shift;
387 localeta = meanpos.xEta();
388 }
389
391
392
393
394
395
396
397
398
399 if (std::abs(
angle) > 1) {
402 width.z() * TOPHAT_SIGMA : 250 *
micrometer * std::tan(std::abs(boweta)) * TOPHAT_SIGMA;
403 ATH_MSG_VERBOSE(
"Shallow track with tanl = " << tanl <<
" bowphi = " <<
404 bowphi <<
" angle = " <<
angle <<
" width.z = " <<
width.z() <<
405 " errphi = " << errphi << " erreta = " << erreta);
407 errphi =
width.phiR() * TOPHAT_SIGMA;
408 erreta =
width.z() * TOPHAT_SIGMA;
410 errphi = (
width.phiR() / nrows) * TOPHAT_SIGMA;
411 erreta = (
width.z() / ncol) * TOPHAT_SIGMA;
415 int ibin = offlineCalibData->getPixelClusterOnTrackErrorData()->getBarrelBinPhi(ang, nrows);
416 errphi = offlineCalibData->getPixelClusterOnTrackErrorData()->getPixelBarrelPhiError(ibin);
417 } else {
419 errphi =
width.phiR() * TOPHAT_SIGMA;
420 } else {
424 }
426 if (nrows == 1) {
428 } else if (nrows == 2) {
430 } else {
432 }
433 } else {
434 ATH_MSG_ERROR(
"bin out of range in line " << __LINE__ <<
" of PixelClusterOnTrackTool.cxx.");
435 }
436 }
437 }
438
440 int ibin = offlineCalibData->getPixelClusterOnTrackErrorData()->getBarrelBinEta(std::abs(etatrack), ncol, nrows);
441 erreta = offlineCalibData->getPixelClusterOnTrackErrorData()->getPixelBarrelEtaError(ibin);
442 } else {
443 double etaloc = std::abs(etatrack);
445 erreta =
width.z() * TOPHAT_SIGMA;
446 } else {
448 while (bin < s_nbineta && etaloc >
m_etax[bin + 1]) {
450 }
452 ATH_MSG_ERROR(
"bin out of range in line " << __LINE__ <<
" of PixelClusterOnTrackTool.cxx.");
453 } else {
454 if (ncol == bin) {
456 } else if (ncol == bin + 1) {
458 } else if (ncol == bin + 2) {
460 } else {
461 erreta =
width.z() * TOPHAT_SIGMA;
462 }
463 }
464 }
465 }
466 }else {
467 int ibin = offlineCalibData->getPixelClusterErrorData()->getEndcapBin(ncol, nrows);
468 errphi = offlineCalibData->getPixelClusterErrorData()->getPixelEndcapPhiError(ibin);
469 erreta = offlineCalibData->getPixelClusterErrorData()->getPixelEndcapRError(ibin);
470 }
471 if (errphi > erreta) {
472 erreta =
width.z() * TOPHAT_SIGMA;
473 }
474 }
475
479 }
480
481
482 locpar = Trk::LocalParameters(locpos);
483 centroid = InDetDD::SiLocalPosition(localeta, localphi, 0.);
485 }
486
487
488
490
491
492 if (errphi > 0) {
493 cov(0, 0) = errphi * errphi;
494 }
495 if (erreta > 0) {
496 cov(1, 1) = erreta * erreta;
497 }
498
500
501
505 ->getScaledCovariance(std::move(cov), *
m_pixelid,
507 }
509 return new InDet::PixelClusterOnTrack(pix,
510 std::move(locpar),
511 std::move(cov), iH,
513}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
int readoutSide() const
ReadoutSide.
SiLocalPosition positionFromColumnRow(const int column, const int row) const
Given row and column index of a diode, return position of diode center ALTERNATIVE/PREFERED way is to...
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
double xPhi() const
position along phi direction:
double xEta() const
position along eta direction:
const Amg::Vector3D & etaAxis() const
virtual const Amg::Vector3D & normal() const override final
Get reconstruction local normal axes in global frame.
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
virtual Identifier identify() const override final
identifier of this detector element (inline)
const Amg::Vector3D & phiAxis() const
const Amg::Vector3D & globalPosition() const
return global position reference
bool gangedPixel() const
return the flag of this cluster containing a gangedPixel
const InDet::SiWidth & width() const
return width class reference
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
static float getDeltaXendcap()
static float getDeltaYendcap()
double eta() const
Access method for pseudorapidity - from momentum.
const Amg::Vector3D & momentum() const
Access method for the momentum.
double pT() const
Access method for transverse momentum.
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
row
Appending html table to final .html summary file.
const T_res * ErrorScalingCast(const T_src *src)