ATLAS Offline Software
PixelClusterOnTrackTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // Implementation file for class PixelClusterOnTrackTool
8 // (c) ATLAS Detector software
10 // AlgTool used for PixelClusterOnTrack object production
12 // started 1.0 21/04/2004 I.Gavrilenko - see ChangeLog
14 
22 
23 #include <cmath>
25 
26 //clustermap is most likely to be removed at later date
27 #define __clustermap
28 
29 
31 // Constructor
33 
34 namespace
35 {
36  // using x*x might be quicker than pow(x,2), depends on compiler optimisation
37  inline double
38  square(const double x) {
39  return x * x;
40  }
41 
42  double
43  distance(const std::vector<Amg::Vector2D> &vectorOfPositions,
44  const std::vector<Amg::Vector2D> &allLocalPositions,
45  const std::vector<Amg::MatrixX> &allErrorMatrix,
46  const int i, const int j, const int k) {
47  return
48  square(vectorOfPositions[i][0] - allLocalPositions[0][0]) / allErrorMatrix[0](0, 0) +
49  square(vectorOfPositions[j][0] - allLocalPositions[1][0]) / allErrorMatrix[1](0, 0) +
50  square(vectorOfPositions[k][0] - allLocalPositions[2][0]) / allErrorMatrix[2](0, 0) +
51  square(vectorOfPositions[i][1] - allLocalPositions[0][1]) / allErrorMatrix[0](1, 1) +
52  square(vectorOfPositions[j][1] - allLocalPositions[1][1]) / allErrorMatrix[1](1, 1) +
53  square(vectorOfPositions[k][1] - allLocalPositions[2][1]) / allErrorMatrix[2](1, 1);
54  }
55 }
56 
58  (const std::string &t, const std::string &n, const IInterface *p) :
59  ::AthAlgTool(t, n, p),
60  m_disableDistortions(false),
61  m_pixelid(nullptr),
62  m_NNIBLcorrection(false),
63  m_IBLAbsent(true),
64  m_NnClusterizationFactory("InDet::NnClusterizationFactory/NnClusterizationFactory", this),
65  m_IBLParameterSvc("IBLParameterSvc", n),
66  m_doNotRecalibrateNN(false),
67  m_noNNandBroadErrors(false),
68  m_usingTIDE_Ambi(false),
69  m_splitClusterMapKey("") {
70  declareInterface<IRIO_OnTrackCreator>(this);
71 
72  declareProperty("PositionStrategy", m_positionStrategy = 1, "Which calibration of cluster positions");
73  declareProperty("DisableDistortions", m_disableDistortions, "Disable simulation of module distortions");
74  declareProperty("NNIBLcorrection", m_NNIBLcorrection);
75  declareProperty("NnClusterizationFactory", m_NnClusterizationFactory);
76  declareProperty("SplitClusterAmbiguityMap", m_splitClusterMapKey);//Remove Later
77  declareProperty("doNotRecalibrateNN", m_doNotRecalibrateNN);
78  declareProperty("m_noNNandBroadErrors", m_noNNandBroadErrors);
79  declareProperty("RunningTIDE_Ambi", m_usingTIDE_Ambi);
80 }
81 
83 // Destructor
85 
87 
89 // Initialisation
91 
94 
95  ATH_MSG_DEBUG(name() << " initialize()");
96 
98  ATH_MSG_DEBUG("Error strategy is" << m_errorStrategy);
99 
100  if (m_IBLParameterSvc.retrieve().isFailure()) {
101  ATH_MSG_WARNING("Could not retrieve IBLParameterSvc");
102  } else {
103  m_IBLParameterSvc->setBoolParameters(m_applyNNcorrectionProperty.value(), "doPixelClusterSplitting");
104  m_IBLParameterSvc->setBoolParameters(m_IBLAbsent, "IBLAbsent");
105  }
107 
110 
111  // get the error scaling tool
113  if (!m_pixelErrorScalingKey.key().empty()) ATH_MSG_DEBUG("Detected need for scaling Pixel errors.");
114 
115  // get the module distortions tool
117  if (m_disableDistortions) ATH_MSG_DEBUG("No PixelDistortions will be simulated.");
118 
119  ATH_CHECK (detStore()->retrieve(m_pixelid, "PixelID"));
120 
123  ATH_CHECK(m_NnClusterizationFactory.retrieve( DisableTool{!m_applyNNcorrection} ));
124 
125  // Include IBL calibration constants
126  //Moved to initialize to remove statics and prevent repitition
127 
128  constexpr double phimin=-0.27, phimax=0.27;
129  for (int i=0; i<=s_nbinphi; i++) m_phix[i]=phimin+i*(phimax-phimin)/s_nbinphi;
130  constexpr double etacen[s_nbineta]={-0.,1.,1.55,1.9,2.15,2.35};
131  m_etax[0]=0.; m_etax[s_nbineta]=2.7;
132  for (int i=0; i<s_nbineta-1; i++) m_etax[i+1]=(etacen[i]+etacen[i+1])/2.;
133 
135 #include "IBL_calibration.h"
137 
138  ATH_CHECK(m_lorentzAngleTool.retrieve());
139  return StatusCode::SUCCESS;
140 }
141 
142 
143 
145 // Finalize
147 
150 return StatusCode::SUCCESS;
151 }
152 
154 // Trk::SiClusterOnTrack production
156 
157 
160  (const Trk::PrepRawData &rio, const Trk::TrackParameters &trackPar) const {
161 
162  const auto *element= dynamic_cast<const InDetDD::SiDetectorElement *>(rio.detectorElement());
163  if ((not m_applyNNcorrection) or (element and element->isBlayer() and (not m_NNIBLcorrection) and (not m_IBLAbsent))){
164  return correctDefault(rio, trackPar);
165  }else {
166  if (m_errorStrategy == 0 || m_errorStrategy == 1) {
167  // version from Giacinto
168  if (m_noNNandBroadErrors) {
169  return nullptr;
170  }
171  // if we try broad errors, get Pixel Cluster to test if it is split
172  const InDet::PixelCluster *pix = nullptr;
174  pix = static_cast<const InDet::PixelCluster *>(&rio);
175  }
176  if (!pix) {
177  return nullptr;
178  }
180  if (splitProb.isSplit()) {
181  return correctNN(rio, trackPar);
182  } else {
183  return correctDefault(rio, trackPar);
184  }
185  } else {
186  return correctNN(rio, trackPar);
187  }
188  }
189 }
190 
191 
192 
198  (const Trk::PrepRawData &rio, const Trk::TrackParameters &trackPar) const {
199  using CLHEP::micrometer;
200 
201  const double TOPHAT_SIGMA = 1. / std::sqrt(12.);
202 
203  const InDet::PixelCluster *pix = nullptr;
205  pix = static_cast<const InDet::PixelCluster *>(&rio);
206  }
207  else{
208  return nullptr;
209  }
210 
211  ATH_MSG_VERBOSE("Correct called with Error strategy " << m_errorStrategy);
212 
213  // PixelClusterOnTrack production
214  //
215  Trk::LocalParameters locpar;
216  Amg::Vector3D glob(pix->globalPosition());
217 
218 
219  // Get pointer to detector element
220  const InDetDD::SiDetectorElement *element = pix->detectorElement();
221  if (!element) {
222  return nullptr;
223  }
224  bool blayer = element->isBlayer();
225  IdentifierHash iH = element->identifyHash();
226 
227  double errphi = -1;
228  double erreta = -1;
229 
230  if (pix->rdoList().empty()) {
231  ATH_MSG_WARNING("Pixel RDO-list size is 0, check integrity of pixel clusters! stop ROT creation.");
232  return nullptr;
233  } else {
234  const InDetDD::PixelModuleDesign *design =
235  dynamic_cast<const InDetDD::PixelModuleDesign *>(&element->design());
236 
237  // get candidate track angle in module local frame
238  const Amg::Vector3D& my_track = trackPar.momentum();
239  const Amg::Vector3D& my_normal = element->normal();
240  const Amg::Vector3D& my_phiax = element->phiAxis();
241  const Amg::Vector3D& my_etaax = element->etaAxis();
242  float trkphicomp = my_track.dot(my_phiax);
243  float trketacomp = my_track.dot(my_etaax);
244  float trknormcomp = my_track.dot(my_normal);
245  double bowphi = std::atan2(trkphicomp, trknormcomp);
246  double boweta = std::atan2(trketacomp, trknormcomp);
247  float etatrack = trackPar.eta();
248 
249  float tanl = m_lorentzAngleTool->getTanLorentzAngle(iH);
250  int readoutside = element->design().readoutSide();
251 
252  // map the angles of inward-going tracks onto [-PI/2, PI/2]
253  if (bowphi > M_PI *0.5) {
254  bowphi -= M_PI;
255  }
256  if (bowphi < -M_PI *0.5) {
257  bowphi += M_PI;
258  }
259  // finally, subtract the Lorentz angle effect
260  // the readoutside term is needed because of a bug in old
261  // geometry versions (CSC-01-* and CSC-02-*)
262  double angle = std::atan(std::tan(bowphi) - readoutside * tanl);
263 
264  // try to understand...
265  const Identifier element_id = element->identify();
266  int PixEtaModule = m_pixelid->eta_module(element_id);
267  int PixPhiModule = m_pixelid->phi_module(element_id);
268  double PixTrkPt = trackPar.pT();
269  double PixTrkEta = trackPar.eta();
270  ATH_MSG_VERBOSE("tanl = " << tanl << " readout side is " << readoutside <<
271  " module " << PixEtaModule << " " << PixPhiModule <<
272  " track pt, eta = " << PixTrkPt << " " << PixTrkEta <<
273  " track momentum phi, norm = " << trkphicomp << " " <<
274  trknormcomp << " bowphi = " << bowphi << " angle = " << angle);
275 
276  float omegaphi = pix->omegax();
277  float omegaeta = pix->omegay();
278  double localphi = -9999.;
279  double localeta = -9999.;
280 
281  const std::vector<Identifier> & rdos = pix->rdoList();
282  InDetDD::SiLocalPosition meanpos(0, 0, 0);
283  int rowmin = 9999;
284  int rowmax = -9999;
285  int colmin = 9999;
286  int colmax = -9999;
287  for (const auto & rId:rdos) {
288  const int row = m_pixelid->phi_index(rId);
289  const int col = m_pixelid->eta_index(rId);
290  rowmin = std::min(rowmin, row);
291  rowmax = std::max(rowmax,row);
292  colmin = std::min(colmin, col);
293  colmax = std::max(colmax, col);
294  meanpos += design->positionFromColumnRow(col, row);
295  }
296  meanpos = meanpos / rdos.size();
298  design->positionFromColumnRow(colmin, rowmin);
300  design->positionFromColumnRow(colmax, rowmin);
302  design->positionFromColumnRow(colmin, rowmax);
304  design->positionFromColumnRow(colmax, rowmax);
305 
306  InDetDD::SiLocalPosition centroid = 0.25 * (pos1 + pos2 + pos3 + pos4);
307  double shift = m_lorentzAngleTool->getLorentzShift(iH);
308  int nrows = rowmax - rowmin + 1;
309  int ncol = colmax - colmin + 1;
310  double ang = 999.;
311 
312  // TOT interpolation for collision data
313  // Force IBL to use digital clustering and broad errors.
315  if (m_positionStrategy > 0 && omegaphi > -0.5 && omegaeta > -0.5) {
316  localphi = centroid.xPhi() + shift;
317  localeta = centroid.xEta();
318  // barrel
319  if (element->isBarrel()) {
320  ang = 180 * angle * M_1_PI; //M_1_PI in cmath, = 1/pi
321  double delta = 0.;
322  if (m_IBLAbsent || !blayer) {
323  delta = offlineCalibData->getPixelChargeInterpolationParameters()->getDeltaXbarrel(nrows, ang, 1);
324  } else { // special calibration for IBL
325  if (angle < m_phix[0] || angle > m_phix[s_nbinphi] || nrows != 2) {
326  delta = 0.;
327  }else {
328  int bin = -1;
329  while (angle > m_phix[bin + 1]) {
330  bin++;
331  }
332  if ((bin >= 0)and(bin < s_nbinphi)) {
333  delta = m_calphi[bin];
334  } else {
335  ATH_MSG_ERROR("bin out of range in line " << __LINE__ << " of PixelClusterOnTrackTool.cxx.");
336  }
337  }
338 
339  if (offlineCalibData->getPixelChargeInterpolationParameters()->getVersion()<-1) {
340  delta = offlineCalibData->getPixelChargeInterpolationParameters()->getDeltaXbarrel(nrows, ang, 0);
341  }
342  }
343  localphi += delta * (omegaphi - 0.5);
344  // settle the sign/pi periodicity issues
345  double thetaloc = -999.;
346  if (boweta > -0.5 * M_PI && boweta < M_PI / 2.) { //M_PI_2 in cmath
347  thetaloc = M_PI_2 - boweta;
348  }else if (boweta > M_PI_2 && boweta < M_PI) {
349  thetaloc = 1.5 * M_PI - boweta;
350  } else { // 3rd quadrant
351  thetaloc = -M_PI_2 - boweta;
352  }
353  double etaloc = -1 * log(tan(thetaloc * 0.5));
354  if (m_IBLAbsent || !blayer) {
355  delta = offlineCalibData->getPixelChargeInterpolationParameters()->getDeltaYbarrel(ncol, etaloc, 1);
356  } else { // special calibration for IBL
357  etaloc = std::abs(etaloc);
358  if (etaloc < m_etax[0] || etaloc > m_etax[s_nbineta]) {
359  delta = 0.;
360  } else {
361  int bin = -1;
362  while (etaloc > m_etax[bin + 1]) {
363  bin++;
364  }
365  if ((bin >= 0)and(bin < s_nbineta)) {
366  if (ncol == bin) {
367  delta = m_caleta[bin][0];
368  } else if (ncol == bin + 1) {
369  delta = m_caleta[bin][1];
370  } else if (ncol == bin + 2) {
371  delta = m_caleta[bin][2];
372  } else {
373  delta = 0.;
374  }
375  } else {// bin out of range of array indices
376  ATH_MSG_ERROR("bin out of range in line " << __LINE__ << " of PixelClusterOnTrackTool.cxx.");
377  }
378  }
379  if (offlineCalibData->getPixelChargeInterpolationParameters()->getVersion()<-1) {
380  delta = offlineCalibData->getPixelChargeInterpolationParameters()->getDeltaYbarrel(ncol, std::abs(etaloc), 0);
381  }
382  }
383  localeta += delta * (omegaeta - 0.5);
384  }else {
385  // collision endcap data
386  if (m_positionStrategy == 1) {
387  double deltax = offlineCalibData->getPixelChargeInterpolationParameters()->getDeltaXendcap();
388  double deltay = offlineCalibData->getPixelChargeInterpolationParameters()->getDeltaYendcap();
389  localphi += deltax * (omegaphi - 0.5);
390  localeta += deltay * (omegaeta - 0.5);
391  }
392  // SR1 cosmics endcap data
393  // some parametrization dependent on track angle
394  // would be better here
395  else if (m_positionStrategy == 20) {
396  double deltax = 35 * micrometer;
397  double deltay = 35 * micrometer;
398  localphi += deltax * (omegaphi - 0.5);
399  localeta += deltay * (omegaeta - 0.5);
400  }
401  }
402  }
403 // digital
404  else {
405  localphi = meanpos.xPhi() + shift;
406  localeta = meanpos.xEta();
407  }
408 
409  const InDet::SiWidth& width = pix->width();
410 
411  // Error strategies
412 
413  // For very shallow tracks the cluster can easily break as
414  // the average charge per pixel is of the order of the threshold
415  // In this case, an error equal to the geometrical projection
416  // of the track path in silicon onto the module surface seems
417  // appropriate
418  if (std::abs(angle) > 1) {
419  errphi = 250 * micrometer * std::tan(std::abs(angle)) * TOPHAT_SIGMA;
420  erreta = width.z() > 250 * micrometer * std::tan(std::abs(boweta)) ?
421  width.z() * TOPHAT_SIGMA : 250 * micrometer * std::tan(std::abs(boweta)) * TOPHAT_SIGMA;
422  ATH_MSG_VERBOSE("Shallow track with tanl = " << tanl << " bowphi = " <<
423  bowphi << " angle = " << angle << " width.z = " << width.z() <<
424  " errphi = " << errphi << " erreta = " << erreta);
425  }else if (m_errorStrategy == 0) {
426  errphi = width.phiR() * TOPHAT_SIGMA;
427  erreta = width.z() * TOPHAT_SIGMA;
428  }else if (m_errorStrategy == 1) {
429  errphi = (width.phiR() / nrows) * TOPHAT_SIGMA;
430  erreta = (width.z() / ncol) * TOPHAT_SIGMA;
431  }else if (m_errorStrategy == 2) {
432  if (element->isBarrel()) {
433  if (m_IBLAbsent || !blayer) {
434  int ibin = offlineCalibData->getPixelClusterOnTrackErrorData()->getBarrelBinPhi(ang, nrows);
435  errphi = offlineCalibData->getPixelClusterOnTrackErrorData()->getPixelBarrelPhiError(ibin);
436  } else { // special calibration for IBL
437  if (angle < m_phix[0] || angle > m_phix[s_nbinphi]) {
438  errphi = width.phiR() * TOPHAT_SIGMA;
439  } else {
440  int bin = -1;// cannot be used as array index, which will happen if angle<m_phix[bin+1]
441  while (angle > m_phix[bin + 1]) {
442  bin++;
443  }
444  if ((bin >= 0)and(bin < s_nbinphi)) {
445  if (nrows == 1) {
446  errphi = m_calerrphi[bin][0];
447  } else if (nrows == 2) {
448  errphi = m_calerrphi[bin][1];
449  } else {
450  errphi = m_calerrphi[bin][2];
451  }
452  } else {
453  ATH_MSG_ERROR("bin out of range in line " << __LINE__ << " of PixelClusterOnTrackTool.cxx.");
454  }
455  }
456  }
457 
458  if (m_IBLAbsent || !blayer) {
459  int ibin = offlineCalibData->getPixelClusterOnTrackErrorData()->getBarrelBinEta(std::abs(etatrack), ncol, nrows);
460  erreta = offlineCalibData->getPixelClusterOnTrackErrorData()->getPixelBarrelEtaError(ibin);
461  } else { // special calibration for IBL
462  double etaloc = std::abs(etatrack);
463  if (etaloc < m_etax[0] || etaloc > m_etax[s_nbineta]) {
464  erreta = width.z() * TOPHAT_SIGMA;
465  } else {
466  int bin = 0;
467  while (bin < s_nbineta && etaloc > m_etax[bin + 1]) {
468  ++bin;
469  }
470  if (bin >= s_nbineta) {
471  ATH_MSG_ERROR("bin out of range in line " << __LINE__ << " of PixelClusterOnTrackTool.cxx.");
472  } else {
473  if (ncol == bin) {
474  erreta = m_calerreta[bin][0];
475  } else if (ncol == bin + 1) {
476  erreta = m_calerreta[bin][1];
477  } else if (ncol == bin + 2) {
478  erreta = m_calerreta[bin][2];
479  } else {
480  erreta = width.z() * TOPHAT_SIGMA;
481  }
482  }
483  }
484  }
485  }else {
486  int ibin = offlineCalibData->getPixelClusterErrorData()->getEndcapBin(ncol, nrows);
487  errphi = offlineCalibData->getPixelClusterErrorData()->getPixelEndcapPhiError(ibin);
488  erreta = offlineCalibData->getPixelClusterErrorData()->getPixelEndcapRError(ibin);
489  }
490  if (errphi > erreta) {
491  erreta = width.z() * TOPHAT_SIGMA;
492  }
493  }
494 
495  Amg::Vector2D locpos = Amg::Vector2D(localphi, localeta);
496  if (element->isBarrel() && !m_disableDistortions) {
497  correctBow(element->identify(), locpos, bowphi, boweta);
498  }
499 
500 
501  locpar = Trk::LocalParameters(locpos);
502  centroid = InDetDD::SiLocalPosition(localeta, localphi, 0.);
503  glob = element->globalPosition(centroid);
504  }
505 
506  // Error matrix production
507 
508  Amg::MatrixX cov = pix->localCovariance();
509 
510  // corrected phi error
511  if (errphi > 0) {
512  cov(0, 0) = errphi * errphi;
513  }
514  if (erreta > 0) {
515  cov(1, 1) = erreta * erreta;
516  }
517 
518  ATH_MSG_VERBOSE(" errphi = " << errphi << " erreta = " << erreta);
519 
520  // create new copy of error matrix
521  if (!m_pixelErrorScalingKey.key().empty()) {
523  cov = Trk::ErrorScalingCast<PixelRIO_OnTrackErrorScaling>(*error_scaling)
524  ->getScaledCovariance(std::move(cov), *m_pixelid,
525  element->identify());
526  }
527  bool isbroad = m_errorStrategy == 0;
528  return new InDet::PixelClusterOnTrack(pix,
529  std::move(locpar),
530  std::move(cov), iH,
531  glob, pix->gangedPixel(), isbroad);
532 }
533 
534 void
536  const double theta) const {
537  Amg::Vector3D dir(tan(phi), tan(theta), 1.);
538  Amg::Vector2D newpos = SG::ReadCondHandle<PixelDistortionData>(m_distortionKey)->correctReconstruction(m_pixelid->wafer_hash(id), localpos, dir);
539 
540  localpos = newpos;
541 }
542 
545  (const Trk::PrepRawData &rio, const Trk::TrackParameters &trackPar,
547  int initial_errorStrategy;
549 
550  switch (strategy) {
551  case InDet::PIXELCLUSTER_OUTLIER: // if cluster is outlier, increase errors
553  initial_errorStrategy = m_errorStrategy;
554  m_errorStrategy = 0; // error as size of cluster /sqrt(12)
555  newROT = correct(rio, trackPar);
556  m_errorStrategy = initial_errorStrategy;
557  return newROT;
558 
559  default:
560  return correct(rio, trackPar);
561  }
562 }
563 
564 // GP: NEW correct() method in case of NN based calibration */
567  (const Trk::PrepRawData &rio,
568  const Trk::TrackParameters &trackPar) const {
569 
570  const InDet::PixelCluster *pixelPrepCluster = nullptr;
572  pixelPrepCluster = static_cast<const InDet::PixelCluster *>(&rio);
573  }
574 
575  if (pixelPrepCluster == nullptr) {
576  ATH_MSG_WARNING("This is not a pixel cluster, return 0.");
577  return nullptr;
578  }
579 
580  const InDetDD::SiDetectorElement *element = pixelPrepCluster->detectorElement();
581  if (!element) {
582  ATH_MSG_WARNING("Cannot access detector element. Aborting cluster correction...");
583  return nullptr;
584  }
585 
586  IdentifierHash iH = element->identifyHash();
587 
588  if (m_doNotRecalibrateNN) {
589  Amg::Vector3D glob(pixelPrepCluster->globalPosition());
590 
591  const Amg::Vector3D& my_track = trackPar.momentum();
592  const Amg::Vector3D& my_normal = element->normal();
593  const Amg::Vector3D& my_phiax = element->phiAxis();
594  const Amg::Vector3D& my_etaax = element->etaAxis();
595  float trkphicomp = my_track.dot(my_phiax);
596  float trketacomp = my_track.dot(my_etaax);
597  float trknormcomp = my_track.dot(my_normal);
598  double bowphi = std::atan2(trkphicomp, trknormcomp);
599  double boweta = std::atan2(trketacomp, trknormcomp);
600 
601  Amg::Vector2D locpos = pixelPrepCluster->localPosition();
602  if (element->isBarrel() && !m_disableDistortions) {
603  correctBow(element->identify(), locpos, bowphi, boweta);
604  }
605 
607  Amg::MatrixX cov = pixelPrepCluster->localCovariance();
608 
609  return new InDet::PixelClusterOnTrack(pixelPrepCluster, std::move(locpar), std::move(cov), iH, glob,
610  pixelPrepCluster->gangedPixel(), false);
611  }
612 
613 
614 
615  Amg::Vector2D finalposition;
616  Amg::MatrixX finalerrormatrix;
617 
618  if (m_usingTIDE_Ambi) {
619  if (!getErrorsTIDE_Ambi(pixelPrepCluster, trackPar, finalposition, finalerrormatrix)) {
620  return correctDefault(rio, trackPar);
621  }
622  }else {
623  if (!getErrorsDefaultAmbi(pixelPrepCluster, trackPar, finalposition, finalerrormatrix)) {
624  return correctDefault(rio, trackPar);
625  }
626  }
627 
628  ATH_MSG_DEBUG( " Old position x: " << pixelPrepCluster->localPosition()[0]
629  << " +/- " << std::sqrt(pixelPrepCluster->localCovariance()(0, 0))
630  << " y: " << pixelPrepCluster->localPosition()[1]
631  << " +/- " << std::sqrt(pixelPrepCluster->localCovariance()(1, 1)) <<"\n"
632  << " Final position x: " << finalposition[0]
633  << " +/- " << std::sqrt(finalerrormatrix(0, 0))
634  << " y: " << finalposition[1] << " +/- "
635  <<std::sqrt(finalerrormatrix(1, 1)) );
636 
637  const Amg::Vector3D& my_track = trackPar.momentum();
638  Amg::Vector3D my_normal = element->normal();
639  Amg::Vector3D my_phiax = element->phiAxis();
640  Amg::Vector3D my_etaax = element->etaAxis();
641  float trkphicomp = my_track.dot(my_phiax);
642  float trketacomp = my_track.dot(my_etaax);
643  float trknormcomp = my_track.dot(my_normal);
644  double bowphi = std::atan2(trkphicomp, trknormcomp);
645  double boweta = std::atan2(trketacomp, trknormcomp);
646 
647  if (element->isBarrel() && !m_disableDistortions) {
648  correctBow(element->identify(), finalposition, bowphi, boweta);
649  }
650 
651  Amg::MatrixX cov = finalerrormatrix;
652  // create new copy of error matrix
653  if (!m_pixelErrorScalingKey.key().empty()) {
656  cov = Trk::ErrorScalingCast<PixelRIO_OnTrackErrorScaling>(*error_scaling)
657  ->getScaledCovariance(std::move(cov), *m_pixelid,
658  element->identify());
659  }
660 
662  finalposition[0],
663  0);
664  Trk::LocalParameters locpar = Trk::LocalParameters(finalposition);
665 
666  const Amg::Vector3D &glob = element->globalPosition(centroid);
667 
668 
669  return new InDet::PixelClusterOnTrack(pixelPrepCluster, std::move(locpar),
670  std::move(cov), iH,
671  glob,
672  pixelPrepCluster->gangedPixel(),
673  false);
674 }
675 
676 bool
678  const Trk::TrackParameters &trackPar,
679  Amg::Vector2D &finalposition,
680  Amg::MatrixX &finalerrormatrix) const {
681  std::vector<Amg::Vector2D> vectorOfPositions;
682  int numberOfSubclusters = 1;
683  vectorOfPositions.push_back(pixelPrepCluster->localPosition());
684 
685  if (m_applyNNcorrection){
687  InDet::PixelGangedClusterAmbiguities::const_iterator mapBegin = splitClusterMap->begin();
688  InDet::PixelGangedClusterAmbiguities::const_iterator mapEnd = splitClusterMap->end();
689  for (InDet::PixelGangedClusterAmbiguities::const_iterator mapIter = mapBegin; mapIter != mapEnd; ++mapIter) {
690  const SiCluster *first = (*mapIter).first;
691  const SiCluster *second = (*mapIter).second;
692  if (first == pixelPrepCluster && second != pixelPrepCluster) {
693  ATH_MSG_DEBUG("Found additional split cluster in ambiguity map (+=1).");
694  numberOfSubclusters += 1;
695  const SiCluster *otherOne = second;
696  const InDet::PixelCluster *pixelAddCluster = nullptr;
697  if (otherOne->type(Trk::PrepRawDataType::PixelCluster)) {
698  pixelAddCluster = static_cast<const InDet::PixelCluster *>(otherOne);
699  }
700  if (pixelAddCluster == nullptr) {
701  ATH_MSG_WARNING("Pixel ambiguity map has empty pixel cluster. Please DEBUG!");
702  continue;
703  }
704  vectorOfPositions.push_back(pixelAddCluster->localPosition());
705 
706  ATH_MSG_DEBUG( "Found one more pixel cluster. Position x: "
707  << pixelAddCluster->localPosition()[0] << "y: " << pixelAddCluster->localPosition()[1]);
708  }// find relevant element of map
709  }// iterate over map
710  }
711 
712  // now you have numberOfSubclusters and the vectorOfPositions (Amg::Vector2D)
713 
714  if (trackPar.surfaceType() != Trk::SurfaceType::Plane ||
715  trackPar.type() != Trk::AtaSurface) {
717  "Parameters are not at a plane ! Aborting cluster correction... ");
718  return false;
719  }
720 
721  std::vector<Amg::Vector2D> allLocalPositions;
722  std::vector<Amg::MatrixX> allErrorMatrix;
723  allLocalPositions =
724  m_NnClusterizationFactory->estimatePositions(*pixelPrepCluster,
725  trackPar.associatedSurface(),
726  trackPar,
727  allErrorMatrix,
728  numberOfSubclusters);
729 
730  if (allLocalPositions.empty()) {
731  ATH_MSG_DEBUG( " Cluster cannot be treated by NN. Giving back to default clusterization " );
732 
733  return false;
734  }
735 
736  if (allLocalPositions.size() != size_t(numberOfSubclusters)) {
737  ATH_MSG_WARNING( "Returned position vector size " << allLocalPositions.size() <<
738  " not according to expected number of subclusters: " << numberOfSubclusters << ". Abort cluster correction..." );
739  return false;
740  }
741 
742 
743  // GP: now the not so nice part of matching the new result with the old one...
744  // Takes the error into account to improve the matching
745 
746  if (numberOfSubclusters == 1) {
747  finalposition = allLocalPositions[0];
748  finalerrormatrix = allErrorMatrix[0];
749  }
750 
751  else if (numberOfSubclusters == 2) {
752  double distancesq1 =
753  square(vectorOfPositions[0][0] - allLocalPositions[0][0]) / allErrorMatrix[0](0, 0) +
754  square(vectorOfPositions[1][0] - allLocalPositions[1][0]) / allErrorMatrix[1](0, 0) +
755  square(vectorOfPositions[0][1] - allLocalPositions[0][1]) / allErrorMatrix[0](1, 1) +
756  square(vectorOfPositions[1][1] - allLocalPositions[1][1]) / allErrorMatrix[1](1, 1);
757 
758  double distancesq2 =
759  square(vectorOfPositions[1][0] - allLocalPositions[0][0]) / allErrorMatrix[0](0, 0) +
760  square(vectorOfPositions[0][0] - allLocalPositions[1][0]) / allErrorMatrix[1](0, 0) +
761  square(vectorOfPositions[1][1] - allLocalPositions[0][1]) / allErrorMatrix[0](1, 1) +
762  square(vectorOfPositions[0][1] - allLocalPositions[1][1]) / allErrorMatrix[1](1, 1);
763 
765  " Old pix (1) x: " << vectorOfPositions[0][0] << " y: " << vectorOfPositions[0][1] << "\n"
766  << " Old pix (2) x: " << vectorOfPositions[1][0] << " y: " << vectorOfPositions[1][1] << "\n"
767  << " Pix (1) x: " << allLocalPositions[0][0] << " +/- " << std::sqrt(allErrorMatrix[0](0, 0))
768  << " y: " << allLocalPositions[0][1] << " +/- " << std::sqrt(allErrorMatrix[0](1, 1)) <<"\n"
769  << " Pix (2) x: " << allLocalPositions[1][0] << " +/- " << std::sqrt(allErrorMatrix[1](0, 0))
770  << " y: " << allLocalPositions[1][1] << " +/- " << std::sqrt(allErrorMatrix[1](1, 1)) << "\n"
771  << " Old (1) new (1) dist: " << std::sqrt(distancesq1) << " Old (1) new (2) " << std::sqrt(distancesq2) );
772 
773 
774  if (distancesq1 < distancesq2) {
775  finalposition = allLocalPositions[0];
776  finalerrormatrix = allErrorMatrix[0];
777  }else {
778  finalposition = allLocalPositions[1];
779  finalerrormatrix = allErrorMatrix[1];
780  }
781  }
782 
783 
784  else if (numberOfSubclusters == 3) {
785  double distances[6];
786 
787  distances[0] = distance(vectorOfPositions, allLocalPositions, allErrorMatrix, 0, 1, 2);
788  distances[1] = distance(vectorOfPositions, allLocalPositions, allErrorMatrix, 0, 2, 1);
789  distances[2] = distance(vectorOfPositions, allLocalPositions, allErrorMatrix, 1, 0, 2);
790  distances[3] = distance(vectorOfPositions, allLocalPositions, allErrorMatrix, 1, 2, 0);
791  distances[4] = distance(vectorOfPositions, allLocalPositions, allErrorMatrix, 2, 0, 1);
792  distances[5] = distance(vectorOfPositions, allLocalPositions, allErrorMatrix, 2, 1, 0);
793 
794  int smallestDistanceIndex = -10;
795  double minDistance = 1e10;
796 
797  for (int i = 0; i < 6; i++) {
798  ATH_MSG_VERBOSE(" distance n.: " << i << " distance is: " << distances[i]);
799 
800  if (distances[i] < minDistance) {
801  minDistance = distances[i];
802  smallestDistanceIndex = i;
803  }
804  }
805 
806  ATH_MSG_DEBUG(" The minimum distance is : " << minDistance << " for index: " << smallestDistanceIndex);
807 
808  if (smallestDistanceIndex == 0 || smallestDistanceIndex == 1) {
809  finalposition = allLocalPositions[0];
810  finalerrormatrix = allErrorMatrix[0];
811  }
812  if (smallestDistanceIndex == 2 || smallestDistanceIndex == 4) {
813  finalposition = allLocalPositions[1];
814  finalerrormatrix = allErrorMatrix[1];
815  }
816  if (smallestDistanceIndex == 3 || smallestDistanceIndex == 5) {
817  finalposition = allLocalPositions[2];
818  finalerrormatrix = allErrorMatrix[2];
819  }
820  }
821  return true;
822 }
823 
824 bool
826  const Trk::TrackParameters &trackPar,
827  Amg::Vector2D &finalposition,
828  Amg::MatrixX &finalerrormatrix) const {
830  std::vector<Amg::Vector2D> vectorOfPositions;
831  int numberOfSubclusters = 1;
834  numberOfSubclusters = 1 + splitClusterMap->count(pixelPrepCluster);
835 
836  if (splitClusterMap->count(pixelPrepCluster) == 0 && splitProb.isSplit()) {
837  numberOfSubclusters = 2;
838  }
839  if (splitClusterMap->count(pixelPrepCluster) != 0 && !splitProb.isSplit()) {
840  numberOfSubclusters = 1;
841  }
842  }
843 
844  // now you have numberOfSubclusters and the vectorOfPositions (Amg::Vector2D)
845  if (trackPar.surfaceType() != Trk::SurfaceType::Plane ||
846  trackPar.type() != Trk::AtaSurface) {
847  ATH_MSG_WARNING("Parameters are not at a plane surface ! Aborting cluster "
848  "correction... ");
849  return false;
850  }
851 
852  std::vector<Amg::Vector2D> allLocalPositions;
853  std::vector<Amg::MatrixX> allErrorMatrix;
854  allLocalPositions = m_NnClusterizationFactory->estimatePositions(
855  *pixelPrepCluster,
856  trackPar.associatedSurface(),
857  trackPar,
858  allErrorMatrix,
859  numberOfSubclusters);
860 
861  if (allLocalPositions.empty()) {
863  " Cluster cannot be treated by NN. Giving back to default clusterization, too big: " <<
864  splitProb.isTooBigToBeSplit());
865  return false;
866  }
867 
868  if (allLocalPositions.size() != size_t(numberOfSubclusters)) {
870  "Returned position vector size " << allLocalPositions.size() << " not according to expected number of subclusters: " << numberOfSubclusters <<
871  ". Abort cluster correction...");
872  return false;
873  }
874 
875  // AKM: now the not so nice part find the best match position option
876  // Takes the error into account to scale the importance of the measurement
877 
878  if (numberOfSubclusters == 1) {
879  finalposition = allLocalPositions[0];
880  finalerrormatrix = allErrorMatrix[0];
881  return true;
882  }
883 
884  // Get the track parameters local position
885  const Amg::Vector2D localpos = trackPar.localPosition();
886  // Use the track parameters cov to weight distcances
887  Amg::Vector2D localerr(0.01, 0.05);
888  if (trackPar.covariance()) {
889  localerr = Amg::Vector2D(std::sqrt((*trackPar.covariance())(0, 0)), std::sqrt((*trackPar.covariance())(1, 1)));
890  }
891 
892  double minDistance(1e300);
893  int index(0);
894 
895  for (unsigned int i(0); i < allLocalPositions.size(); ++i) {
896  double distance =
897  square(localpos[0] - allLocalPositions[i][0]) / localerr[0]
898  + square(localpos[1] - allLocalPositions[i][1]) / localerr[1];
899 
900  if (distance < minDistance) {
901  index = i;
902  minDistance = distance;
903  }
904  }
905 
906  finalposition = allLocalPositions[index];
907  finalerrormatrix = allErrorMatrix[index];
908  return true;
909 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
InDet::PixelClusterOnTrackTool::m_noNNandBroadErrors
bool m_noNNandBroadErrors
Definition: PixelClusterOnTrackTool.h:169
xAOD::strategy
strategy
Definition: L2CombinedMuon_v1.cxx:107
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
query_example.row
row
Definition: query_example.py:24
Trk::LocalParameters
Definition: LocalParameters.h:98
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
InDet::PixelClusterOnTrackTool::m_splitClusterMapKey
SG::ReadHandleKey< InDet::PixelGangedClusterAmbiguities > m_splitClusterMapKey
Definition: PixelClusterOnTrackTool.h:172
PixelClusterOnTrackTool.h
PixelCalib::PixelClusterOnTrackErrorData::getBarrelBinEta
int getBarrelBinEta(double eta, int etaClusterSize, int phiClusterSize) const
Definition: PixelClusterOnTrackErrorData.cxx:166
InDet::PixelClusterOnTrackTool::m_positionStrategy
int m_positionStrategy
Definition: PixelClusterOnTrackTool.h:138
PixelID::phi_index
int phi_index(const Identifier &id) const
Definition: PixelID.h:658
InDet::PixelClusterOnTrackTool::m_clusterSplitProbContainer
SG::ReadHandleKey< Trk::ClusterSplitProbabilityContainer > m_clusterSplitProbContainer
Definition: PixelClusterOnTrackTool.h:175
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
max
#define max(a, b)
Definition: cfImp.cxx:41
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
InDet::PixelClusterOnTrackTool::m_clusterErrorKey
SG::ReadCondHandleKey< PixelCalib::PixelOfflineCalibData > m_clusterErrorKey
Definition: PixelClusterOnTrackTool.h:131
PixelCalib::PixelClusterOnTrackErrorData::getPixelBarrelPhiError
static double getPixelBarrelPhiError(double ang, int phiClusterSize)
Definition: PixelClusterOnTrackErrorData.cxx:89
InDetDD::PixelModuleDesign
Definition: PixelModuleDesign.h:48
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo::isSplit
bool isSplit() const
Definition: ClusterSplitProbabilityContainer.h:27
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
Trk::ParametersBase::associatedSurface
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
InDet::SiCluster::type
virtual bool type(Trk::PrepRawDataType type) const override
Interface method checking the type.
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo
Definition: ClusterSplitProbabilityContainer.h:22
InDet::PixelClusterOnTrackTool::m_calphi
double m_calphi[s_nbinphi]
Definition: PixelClusterOnTrackTool.h:180
InDet::PixelClusterOnTrackTool::m_NnClusterizationFactory
ToolHandle< NnClusterizationFactory > m_NnClusterizationFactory
NN clusterizationi factory for NN based positions and errors.
Definition: PixelClusterOnTrackTool.h:165
InDet::PixelClusterOnTrackTool::m_phix
double m_phix[s_nbinphi+1]
Definition: PixelClusterOnTrackTool.h:184
InDet::PixelClusterOnTrackTool::initialize
virtual StatusCode initialize() override
AlgTool initialisation.
Definition: PixelClusterOnTrackTool.cxx:93
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:71
InDet::PixelClusterOnTrackTool::correctDefault
InDet::PixelClusterOnTrack * correctDefault(const Trk::PrepRawData &, const Trk::TrackParameters &) const
The correct method produces a PixelClusterOnTrack using the measured PixelCluster and the track predi...
Definition: PixelClusterOnTrackTool.cxx:198
InDetDD::SolidStateDetectorElementBase::etaAxis
const Amg::Vector3D & etaAxis() const
Definition: SolidStateDetectorElementBase.cxx:88
Trk::PrepRawData::localCovariance
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
Trk::ParametersBase::surfaceType
constexpr virtual SurfaceType surfaceType() const override=0
Returns the Surface Type enum for the surface used to define the derived class.
PixelCalib::PixelOfflineCalibData::getPixelClusterErrorData
PixelClusterErrorData * getPixelClusterErrorData()
Definition: PixelOfflineCalibData.h:97
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
M_PI
#define M_PI
Definition: ActiveFraction.h:11
bin
Definition: BinsDiffFromStripMedian.h:43
InDet::PixelClusterOnTrackTool::m_distortionKey
SG::ReadCondHandleKey< PixelDistortionData > m_distortionKey
Definition: PixelClusterOnTrackTool.h:127
InDetDD::DetectorDesign::readoutSide
int readoutSide() const
ReadoutSide.
Definition: DetectorDesign.h:291
Trk::PrepRawData::type
virtual bool type(PrepRawDataType type) const =0
Interface method checking the type.
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
x
#define x
PixelCalib::PixelChargeInterpolationParameters::getDeltaYendcap
static float getDeltaYendcap()
Definition: PixelChargeInterpolationParameters.cxx:322
InDetDD::SolidStateDetectorElementBase::identifyHash
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
PixelCalib::PixelClusterErrorData::getPixelEndcapPhiError
float getPixelEndcapPhiError(int ibin) const
Definition: PixelClusterErrorData.cxx:71
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
InDet::PixelClusterOnTrackTool::m_pixelErrorScalingKey
SG::ReadCondHandleKey< RIO_OnTrackErrorScaling > m_pixelErrorScalingKey
Definition: PixelClusterOnTrackTool.h:133
InDet::PixelClusterOnTrackTool::m_errorStrategy
std::atomic_int m_errorStrategy
Definition: PixelClusterOnTrackTool.h:139
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
InDet::PixelClusterOnTrackTool::finalize
virtual StatusCode finalize() override
AlgTool termination.
Definition: PixelClusterOnTrackTool.cxx:149
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
InDetDD::PixelModuleDesign::positionFromColumnRow
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...
Definition: PixelModuleDesign.cxx:219
InDetDD::SiLocalPosition::xPhi
double xPhi() const
position along phi direction:
Definition: SiLocalPosition.h:123
PixelCalib::PixelOfflineCalibData::getPixelClusterOnTrackErrorData
PixelClusterOnTrackErrorData * getPixelClusterOnTrackErrorData()
Definition: PixelOfflineCalibData.h:106
InDet::PixelClusterOnTrackTool::m_IBLParameterSvc
ServiceHandle< IIBLParameterSvc > m_IBLParameterSvc
Definition: PixelClusterOnTrackTool.h:166
PixelCalib::PixelClusterOnTrackErrorData::getBarrelBinPhi
int getBarrelBinPhi(double angle, int phiClusterSize) const
Definition: PixelClusterOnTrackErrorData.cxx:149
InDet::PixelClusterOnTrackTool::s_nbinphi
static constexpr int s_nbinphi
Definition: PixelClusterOnTrackTool.h:178
PixelID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: PixelID.h:387
InDet::PixelClusterOnTrackTool::m_doNotRecalibrateNN
bool m_doNotRecalibrateNN
Definition: PixelClusterOnTrackTool.h:168
InDet::PixelClusterOnTrackTool::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: PixelClusterOnTrackTool.h:129
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
InDet::PixelClusterOnTrackTool::m_IBLAbsent
bool m_IBLAbsent
Definition: PixelClusterOnTrackTool.h:162
lumiFormat.i
int i
Definition: lumiFormat.py:92
InDetDD::SiLocalPosition::xEta
double xEta() const
position along eta direction:
Definition: SiLocalPosition.h:118
InDet::PixelClusterStrategy
PixelClusterStrategy
Definition: PixelClusterOnTrackTool.h:53
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
angle
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Definition: TRTDetectorFactory_Full.cxx:73
InDet::PixelClusterOnTrackTool::m_errorStrategyProperty
IntegerProperty m_errorStrategyProperty
Definition: PixelClusterOnTrackTool.h:140
PixelID::eta_index
int eta_index(const Identifier &id) const
Definition: PixelID.h:664
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDet::PIXELCLUSTER_SHARED
@ PIXELCLUSTER_SHARED
Definition: PixelClusterOnTrackTool.h:56
PixelCalib::PixelClusterErrorData::getPixelEndcapRError
float getPixelEndcapRError(int ibin) const
Definition: PixelClusterErrorData.cxx:77
InDet::PixelClusterOnTrackTool::m_caleta
double m_caleta[s_nbineta][3]
Definition: PixelClusterOnTrackTool.h:181
InDet::PixelClusterOnTrackTool::getClusterSplittingProbability
const Trk::ClusterSplitProbabilityContainer::ProbabilityInfo & getClusterSplittingProbability(const InDet::PixelCluster *pix) const
Definition: PixelClusterOnTrackTool.h:110
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
InDetDD::SiDetectorElement::isBlayer
bool isBlayer() const
Definition: SiDetectorElement.cxx:53
Trk::ParametersBase
Definition: ParametersBase.h:55
python.SystemOfUnits.micrometer
int micrometer
Definition: SystemOfUnits.py:71
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
Trk::ParametersBase::type
constexpr virtual ParametersType type() const override=0
Return the ParametersType enum.
InDetDD::SolidStateDetectorElementBase::normal
virtual const Amg::Vector3D & normal() const override final
Get reconstruction local normal axes in global frame.
InDet::SiCluster::detectorElement
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...
InDet::PixelClusterOnTrackTool::m_applyNNcorrectionProperty
BooleanProperty m_applyNNcorrectionProperty
Definition: PixelClusterOnTrackTool.h:160
beamspotman.dir
string dir
Definition: beamspotman.py:623
min
#define min(a, b)
Definition: cfImp.cxx:40
Trk::PrepRawData
Definition: PrepRawData.h:62
Trk::ParametersCommon::localPosition
Amg::Vector2D localPosition() const
Access method for the local coordinates, local parameter definitions differ for each surface type.
EventPrimitives.h
PixelID::eta_module
int eta_module(const Identifier &id) const
Definition: PixelID.h:651
Trk::ParametersBase::pT
double pT() const
Access method for transverse momentum.
InDet::PIXELCLUSTER_OUTLIER
@ PIXELCLUSTER_OUTLIER
Definition: PixelClusterOnTrackTool.h:55
InDet::SiCluster::gangedPixel
bool gangedPixel() const
return the flag of this cluster containing a gangedPixel
InDet::PixelClusterOnTrackTool::m_calerrphi
double m_calerrphi[s_nbinphi][3]
Definition: PixelClusterOnTrackTool.h:182
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Trk::PrepRawDataType::PixelCluster
@ PixelCluster
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:83
PixelCalib::PixelOfflineCalibData::getPixelChargeInterpolationParameters
PixelChargeInterpolationParameters * getPixelChargeInterpolationParameters()
Definition: PixelOfflineCalibData.h:101
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
InDetDD::SiDetectorElement::isBarrel
bool isBarrel() const
PixelCalib::PixelChargeInterpolationParameters::getVersion
int getVersion() const
Definition: PixelChargeInterpolationParameters.cxx:88
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
IBL_calibration.h
query_example.col
col
Definition: query_example.py:7
SiDetectorElement.h
ErrorScalingCast.h
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo::isTooBigToBeSplit
bool isTooBigToBeSplit() const
Definition: ClusterSplitProbabilityContainer.h:26
InDet::PixelClusterOnTrackTool::PixelClusterOnTrackTool
PixelClusterOnTrackTool(const std::string &, const std::string &, const IInterface *)
AlgTool constructor.
Definition: PixelClusterOnTrackTool.cxx:58
InDet::PixelCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
PixelCalib::PixelClusterErrorData::getEndcapBin
int getEndcapBin(int etaClusterSize, int phiClusterSize) const
Definition: PixelClusterErrorData.cxx:165
Trk::AtaSurface
@ AtaSurface
Definition: ParametersCommon.h:29
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
InDet::SiCluster::globalPosition
const Amg::Vector3D & globalPosition() const
return global position reference
DeMoScan.index
string index
Definition: DeMoScan.py:362
InDet::PixelClusterOnTrackTool::getErrorsTIDE_Ambi
bool getErrorsTIDE_Ambi(const InDet::PixelCluster *, const Trk::TrackParameters &, Amg::Vector2D &, Amg::MatrixX &) const
Definition: PixelClusterOnTrackTool.cxx:825
NnClusterizationFactory.h
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
InDet::PixelClusterOnTrack
Definition: PixelClusterOnTrack.h:51
InDet::PixelClusterOnTrackTool::correctBow
void correctBow(const Identifier &, Amg::Vector2D &locpos, const double tanphi, const double taneta) const
Definition: PixelClusterOnTrackTool.cxx:535
PixelCalib::PixelClusterOnTrackErrorData::getPixelBarrelEtaError
float getPixelBarrelEtaError(int ibin) const
Definition: PixelClusterOnTrackErrorData.cxx:125
InDet::PixelClusterOnTrackTool::m_disableDistortions
bool m_disableDistortions
toolhandle for central error scaling flag storing if errors need scaling or should be kept nominal
Definition: PixelClusterOnTrackTool.h:137
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
InDet::PixelClusterOnTrackTool::m_usingTIDE_Ambi
bool m_usingTIDE_Ambi
Enable different treatment of cluster errors based on NN information (do only if TIDE ambi is run)
Definition: PixelClusterOnTrackTool.h:171
PixelModuleDesign.h
InDetDD::SolidStateDetectorElementBase::globalPosition
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
PlaneSurface.h
InDetDD::SolidStateDetectorElementBase::phiAxis
const Amg::Vector3D & phiAxis() const
Definition: SolidStateDetectorElementBase.cxx:74
DeMoScan.first
bool first
Definition: DeMoScan.py:534
PixelCalib::PixelChargeInterpolationParameters::getDeltaYbarrel
float getDeltaYbarrel(int nCol, float eta, int ilayer=0) const
Definition: PixelChargeInterpolationParameters.cxx:239
PixelCalib::PixelChargeInterpolationParameters::getDeltaXbarrel
float getDeltaXbarrel(int nRows, float angle, int ilayer=0) const
Methods to access the calibration data as a function of the cluster size, angle/pseudorapidity,...
Definition: PixelChargeInterpolationParameters.cxx:229
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
InDet::SiWidth
Definition: SiWidth.h:25
InDet::PixelClusterOnTrackTool::~PixelClusterOnTrackTool
virtual ~PixelClusterOnTrackTool()
Trk::ParametersBase::eta
double eta() const
Access method for pseudorapidity - from momentum.
Trk::SurfaceType::Plane
@ Plane
InDet::PixelClusterOnTrackTool::m_calerreta
double m_calerreta[s_nbineta][3]
Definition: PixelClusterOnTrackTool.h:183
InDet::PixelClusterOnTrackTool::correctNN
InDet::PixelClusterOnTrack * correctNN(const Trk::PrepRawData &, const Trk::TrackParameters &) const
Definition: PixelClusterOnTrackTool.cxx:567
InDet::PixelClusterOnTrackTool::s_nbineta
static constexpr int s_nbineta
Definition: PixelClusterOnTrackTool.h:179
InDet::PixelClusterOnTrackTool::m_applyNNcorrection
bool m_applyNNcorrection
Enable NN based calibration (do only if NN calibration is applied)
Definition: PixelClusterOnTrackTool.h:159
InDet::PixelClusterOnTrackTool::m_NNIBLcorrection
bool m_NNIBLcorrection
Definition: PixelClusterOnTrackTool.h:161
AthAlgTool
Definition: AthAlgTool.h:26
IdentifierHash
Definition: IdentifierHash.h:38
InDet::PixelClusterOnTrackTool::m_pixelid
const PixelID * m_pixelid
Flag controlling how module distortions are taken into account:
Definition: PixelClusterOnTrackTool.h:156
pix
Definition: PixelMapping.cxx:16
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
PixelID::phi_module
int phi_module(const Identifier &id) const
Definition: PixelID.h:644
InDet::PixelClusterOnTrackTool::correct
virtual InDet::PixelClusterOnTrack * correct(const Trk::PrepRawData &, const Trk::TrackParameters &) const override
produces a PixelClusterOnTrack (object factory!).
Definition: PixelClusterOnTrackTool.cxx:160
InDet::PixelClusterOnTrackTool::getErrorsDefaultAmbi
bool getErrorsDefaultAmbi(const InDet::PixelCluster *, const Trk::TrackParameters &, Amg::Vector2D &, Amg::MatrixX &) const
Definition: PixelClusterOnTrackTool.cxx:677
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
InDet::PixelClusterOnTrackTool::m_etax
double m_etax[s_nbineta+1]
Definition: PixelClusterOnTrackTool.h:185
InDet::SiCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h:40
InDetDD::SolidStateDetectorElementBase::identify
virtual Identifier identify() const override final
identifier of this detector element (inline)
NSWL1::centroid
Vertex centroid(const Polygon &p)
Definition: GeoUtils.cxx:59
PixelCalib::PixelChargeInterpolationParameters::getDeltaXendcap
static float getDeltaXendcap()
Definition: PixelChargeInterpolationParameters.cxx:318
fitman.k
k
Definition: fitman.py:528
Trk::PrepRawData::detectorElement
virtual const TrkDetElementBase * detectorElement() const =0
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...