ATLAS Offline Software
InDetPhysHitDecoratorAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
11 #include "safeDecorator.h"
12 #include "TrkParameters/TrackParameters.h" // Contains typedef to Trk::CurvilinearParameters
19 // for the identifiers
22 #include "InDetIdentifier/SCT_ID.h"
23 #include "InDetIdentifier/TRT_ID.h"
25 //
26 #include <tuple>
27 #include <limits>
28 
29 
30 InDetPhysHitDecoratorAlg::InDetPhysHitDecoratorAlg(const std::string& name, ISvcLocator* pSvcLocator) :
31  AthReentrantAlgorithm(name,pSvcLocator),
32  m_holeSearchTool("InDet::InDetTrackHoleSearchTool"),
33  m_updatorHandle("Trk::KalmanUpdator/TrkKalmanUpdator"),
34  m_residualPullCalculator("Trk::ResidualPullCalculator/ResidualPullCalculator"),
35  m_ptThreshold(0.8), m_doUpgrade(false),
36  m_idHelper(nullptr),
37  m_pixelID(nullptr),
38  m_sctID(nullptr),
39  m_trtID(nullptr) {
40  declareProperty("InDetTrackHoleSearchTool", m_holeSearchTool);
41  declareProperty("Updator", m_updatorHandle);
42  declareProperty("ResidualPullCalculator", m_residualPullCalculator);
43  // do I need to retrieve the 'Tracks' container?
44 }
45 
47 // nop
48 }
49 
52  ATH_CHECK(m_holeSearchTool.retrieve());
53  if (not (m_updatorHandle.empty())) {
54  ATH_CHECK(m_updatorHandle.retrieve());
55  }
56  if (not (m_holeSearchTool.empty())) {
57  ATH_CHECK(m_holeSearchTool.retrieve());
58  }
59  ATH_CHECK(m_lorentzAngleTool.retrieve());
60 
61  std::vector<std::string> float_decor_names(kNFloatDecorators);
62  std::vector<std::string> int_decor_names(kNIntDecorators);
63  std::vector<std::string> uint64_decor_names(kNUInt64Decorators);
64 
65  int_decor_names[kDecorRegion]="measurement_region";
66  int_decor_names[kDecorDet]="measurement_det";
67  int_decor_names[kDecorILayer]="measurement_iLayer";
68  int_decor_names[kDecorType]="measurement_type";
69  int_decor_names[kDecorPhiWidth]="hitResiduals_phiWidth";
70  int_decor_names[kDecorEtaWidth]="hitResiduals_etaWidth";
71 
72  float_decor_names[kDecorResidualLocX]="hitResiduals_residualLocX";
73  float_decor_names[kDecorPullLocX]="hitResiduals_pullLocX";
74  float_decor_names[kDecorMeasLocX]="measurementLocX";
75  float_decor_names[kDecorTrkParamLocX]="trackParamLocX";
76  float_decor_names[kDecorMeasLocCovX]="measurementLocCovX";
77 
78  float_decor_names[kDecorResidualLocY]="hitResiduals_residualLocY";
79  float_decor_names[kDecorPullLocY]="hitResiduals_pullLocY";
80  float_decor_names[kDecorMeasLocY]="measurementLocY";
81  float_decor_names[kDecorTrkParamLocY]="trackParamLocY";
82  float_decor_names[kDecorMeasLocCovY]="measurementLocCovY";
83 
84  float_decor_names[kDecorAngle]="angle";
85  float_decor_names[kDecorEtaLoc]="etaloc";
86 
87  uint64_decor_names[kDecorID]="surfaceID";
88 
93  assert( m_intDecor.size() == kNIntDecorators);
94  assert( m_uint64Decor.size() == kNUInt64Decorators);
95  assert( m_floatDecor.size() == kNFloatDecorators);
96 
97  // ID Helper
99 
100  // Get the dictionary manager from the detector store
101  ATH_CHECK(detStore()->retrieve(m_idHelper, "AtlasID"));
102  ATH_CHECK(detStore()->retrieve(m_pixelID, "PixelID"));
103  ATH_CHECK(detStore()->retrieve(m_sctID, "SCT_ID"));
104 
105  if (!m_doUpgrade) {
106  ATH_CHECK(detStore()->retrieve(m_trtID, "TRT_ID"));
107  }
108  if (m_residualPullCalculator.empty()) {
109  ATH_MSG_INFO("No residual/pull calculator for general hit residuals configured.");
110  ATH_MSG_INFO("It is recommended to give R/P calculators to the det-specific tool handle lists then.");
111  } else if (m_residualPullCalculator.retrieve().isFailure()) {
112  ATH_MSG_FATAL( "Could not retrieve " << m_residualPullCalculator << " (to calculate residuals and pulls) " );
113  } else {
114  ATH_MSG_INFO("Generic hit residuals & pulls will be calculated in one or both available local coordinates");
115  }
116  return StatusCode::SUCCESS;
117 }
118 
121  return StatusCode::SUCCESS;
122 }
123 
124 // to migrate to AthReentrantAlgorithm later
126 InDetPhysHitDecoratorAlg::execute(const EventContext &ctx) const {
128  if ((not ptracks.isValid())) {
129  ATH_MSG_ERROR("Cannot get ReadHandle " << m_trkParticleName);
130  return StatusCode::FAILURE;
131  }
132 
133  std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,std::vector<float> > >
134  float_decor( IDPVM::createDecorators<xAOD::TrackParticleContainer, std::vector<float> >(m_floatDecor, ctx) );
135  std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,std::vector<int> > >
136  int_decor( IDPVM::createDecorators<xAOD::TrackParticleContainer,std::vector<int> >(m_intDecor, ctx) );
137  std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,std::vector<uint64_t> > >
138  uint64_decor( IDPVM::createDecorators<xAOD::TrackParticleContainer,std::vector<uint64_t> >(m_uint64Decor, ctx) );
139 
140  for (const xAOD::TrackParticle *trk_particle : *ptracks) {
141  if (not decorateTrack(*trk_particle, float_decor, int_decor, uint64_decor) ) {
142  ATH_MSG_ERROR("Could not decorate track");
143  return StatusCode::FAILURE;
144  }
145  }
146  return StatusCode::SUCCESS;
147 }
148 
149 bool
151  std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,std::vector<float> > > &float_decor,
152  std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,std::vector<int> > > &int_decor,
153  std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,std::vector<uint64_t> > > &uint64_decor) const
154 {
155  int trackNumber(0);
156 
157  using SingleResult_t = std::tuple<int, int, int,
158  float, float, float, float,
159  int, int, int,
160  float, float, float, float,
161  float, float, float, float,
162  uint64_t>;
163  using TrackResult_t = std::vector<SingleResult_t>;
164  const float invalidFloat(-1);
165  // const float invalidDouble(std::numeric_limits<double>::quiet_NaN());
166  const float invalidRes(invalidFloat), invalidPull(invalidFloat);
167  const int invalidDetector(-1);
168  const int invalidRegion(-1);
169  const int invalidLayer(-1);
170  const int invalidWidth(-1);
171  const int invalidMeasure(-1);
172  const uint64_t invalidID(0);
173  const SingleResult_t invalidResult = std::make_tuple(invalidDetector, invalidRegion, invalidLayer,
174  invalidRes, invalidPull, invalidRes, invalidPull,
175  invalidWidth, invalidWidth, invalidMeasure,
176  invalidRes, invalidRes, invalidRes, invalidRes,
177  invalidRes, invalidRes, invalidRes, invalidRes,
178  invalidID);
179  bool isUnbiased(true);
180  // get element link to the original track
181  const ElementLink< TrackCollection >& trackLink = particle.trackLink();// using xAODTracking-00-03-09, interface has
182  // changed later
183  if (trackLink.isValid()) {
184  ATH_MSG_VERBOSE("Track link found ");
185  const double pt = particle.pt();
186  if (pt > m_ptThreshold) {
187  ATH_MSG_VERBOSE("pt is over threshold ");
188  std::unique_ptr<const Trk::Track> trackWithHoles(m_holeSearchTool->getTrackWithHoles(**trackLink));
189  const auto& allTrackStates = *(trackWithHoles->trackStateOnSurfaces());
190  const int numberOfHits(allTrackStates.size());
191  unsigned int trackParametersCounter(numberOfHits);
192  TrackResult_t result;
193  result.reserve(numberOfHits);
194  // line 3595 original
195  if (!m_updatorHandle.empty()) {
196  isUnbiased = true;
197  } else {
198  ATH_MSG_WARNING("The updater handle is empty, now using biased estimators");
199  isUnbiased = false;
200  }
201  ATH_MSG_DEBUG("Num. track states in track " << ++trackNumber << ": " << allTrackStates.size());
202 
203  for (const auto *const thisTrackState: allTrackStates) {
204  // Copy logic from InDetRttPerformance to get hits/outliers/holes
205  // Variable specifying measurement type filled
206  SingleResult_t thisResult(invalidResult);
207  if (not thisTrackState) { // is this check needed?
208  msg(MSG::ERROR) << "TSOS is NULL" << (thisTrackState) << endmsg;
209  continue;
210  }
211  Identifier surfaceID;
212  const Trk::MeasurementBase* mesb = (thisTrackState)->measurementOnTrack();
213  const Trk::RIO_OnTrack* hit = mesb ? dynamic_cast<const Trk::RIO_OnTrack*>(mesb) : nullptr;
214  if (mesb && !hit) {
215  continue; // skip pseudomeasurements
216  }
217  // Get surfaceID, different for measuremnt hits & outliers, and holes
218  if (mesb && mesb->associatedSurface().associatedDetectorElement()) {
219  surfaceID = mesb->associatedSurface().associatedDetectorElement()->identify();
220  } // Holes
221  else {
222  if (not (thisTrackState)->trackParameters()) {
223  msg(MSG::INFO) << "TSOS surface is NULL" << endmsg;
224  continue;
225  }
226  surfaceID = (thisTrackState)->trackParameters()->associatedSurface().associatedDetectorElementIdentifier();
227  }
228  bool isMesb = (thisTrackState)->type(Trk::TrackStateOnSurface::Measurement);
229  bool isOutl = (thisTrackState)->type(Trk::TrackStateOnSurface::Outlier);
230  bool isHole = (thisTrackState)->type(Trk::TrackStateOnSurface::Hole);
231 
232  int measureType = -1;
233  if (isMesb) {
234  measureType = 0;
235  }
236  if (isOutl) {
237  measureType = 1;
238  }
239  if (isHole) {
240  measureType = 2;
241  }
242 
243  bool anyHit = isMesb || isOutl || isHole;
244  if (!anyHit) {
245  continue;
246  }
249  int iLayer(invalidLayer);
250  const bool successfulIdentification = decideDetectorRegion(surfaceID, det, r, iLayer);
251  if (not successfulIdentification) {
252  ATH_MSG_DEBUG("Could not identify surface");
253  continue;
254  }
255  uint64_t Surface_ID = surfaceID.get_compact();
256  // Get residuals - old code, remains the same?
257  // define residuals at -1 if no measurement (better way?)
258  float residualLocX(invalidFloat), pullLocX(invalidFloat), measurementLocX(invalidFloat), trackParamLocX(invalidFloat), measurementLocCovX(invalidFloat);
259  float residualLocY(invalidFloat), pullLocY(invalidFloat), measurementLocY(invalidFloat), trackParamLocY(invalidFloat), measurementLocCovY(invalidFloat);// -1 by default
260  float angle(0), etaloc(0);
261  int phiWidth(-1);
262  int etaWidth(-1);
263  std::optional<Trk::ResidualPull> residualPull(std::nullopt);
264  const Trk::TrackParameters* biasedTrackParameters = thisTrackState->trackParameters();
265  if (biasedTrackParameters) {
266  ATH_MSG_VERBOSE("biased track parameters ok");
267  }
268  ATH_MSG_VERBOSE("checking mesb and track parameters");
269  if (mesb && biasedTrackParameters) {
270  ATH_MSG_DEBUG("mesb and biased track parameters are ok");
271  // for outliers, the measurement is not part of the fit, so track parameters are already unbiased
272  std::unique_ptr<const Trk::TrackParameters> cleanup_trackparam;
273  const Trk::TrackParameters* trackParameters =
275  biasedTrackParameters,
276  mesb, isUnbiased) :
277  biasedTrackParameters;
278  if (trackParameters != biasedTrackParameters) {
279  cleanup_trackparam.reset(trackParameters);
280  }
281  if (not trackParameters) {
282  ATH_MSG_DEBUG("unbiased track parameters pointer is NULL");
283  }
286 
287  residualPull= m_residualPullCalculator->residualPull(hit, trackParameters, resType);
288  ATH_MSG_VERBOSE("checking residual pull");
289  if (not residualPull) {
290  ATH_MSG_DEBUG("residualPull is NULL");
291  continue;
292  }
293  ATH_MSG_DEBUG("residualPull is OK");
294  // around line 4058 in original code
295  residualLocX = 1000. * residualPull->residual()[Trk::loc1]; // residuals in microns
296  pullLocX = residualPull->pull()[Trk::loc1];
297  measurementLocX = hit->localParameters()[Trk::loc1];
298  trackParamLocX = trackParameters->parameters()[Trk::loc1];
299  measurementLocCovX = hit->localCovariance()(Trk::loc1,Trk::loc1);
300 
301  if (residualPull->dimension() > 1) {
302  residualLocY = 1000. * residualPull->residual()[Trk::loc2];
303  pullLocY = residualPull->pull()[Trk::loc2];
304  measurementLocY = hit->localParameters()[Trk::loc2];
305  trackParamLocY = trackParameters->parameters()[Trk::loc2];
306  measurementLocCovY = hit->localCovariance()(Trk::loc2,Trk::loc2);
307  }
308 
309  // Unbiased residuals?!
310  measureType = 4;
311 
312  // int width = 1; //check original code
313  // copy-paste from original
314  if (hit && isUnbiased) {
315  // Cluster width determination
316  if ((det == L0PIXBARR)or(det == PIXEL) or(det == SCT)) {
317  const InDet::SiCluster* pCluster = dynamic_cast <const InDet::SiCluster*>(hit->prepRawData());
318  if (pCluster) {
319  InDet::SiWidth width = pCluster->width();
320  phiWidth = int(width.colRow().x());
321  etaWidth = int(width.colRow().y());
322 
323  // get candidate track angle in module local frame
324  Amg::Vector3D my_track = trackParameters->momentum();
325  const InDetDD::SiDetectorElement* element = pCluster->detectorElement();
326  Amg::Vector3D my_normal = element->normal();
327  Amg::Vector3D my_phiax = element->phiAxis();
328  Amg::Vector3D my_etaax = element->etaAxis();
329  float trkphicomp = my_track.dot(my_phiax);
330  float trketacomp = my_track.dot(my_etaax);
331  float trknormcomp = my_track.dot(my_normal);
332  double bowphi = atan2(trkphicomp,trknormcomp);
333  double boweta = atan2(trketacomp,trknormcomp);
334 
335  float tanl = m_lorentzAngleTool->getTanLorentzAngle(element->identifyHash());
336  int readoutside = element->design().readoutSide();
337 
338  // map the angles of inward-going tracks onto [-PI/2, PI/2]
339  if(bowphi > M_PI/2) bowphi -= M_PI;
340  if(bowphi < -M_PI/2) bowphi += M_PI;
341  // finally, subtract the Lorentz angle effect
342  // the readoutside term is needed because of a bug in old
343  // geometry versions (CSC-01-* and CSC-02-*)
344  angle = atan(tan(bowphi)-readoutside*tanl);
345 
346  double thetaloc=-999.;
347  if(boweta > -0.5*M_PI && boweta < M_PI/2.){
348  thetaloc = M_PI/2.-boweta;
349  }else if(boweta > M_PI/2. && boweta < M_PI){
350  thetaloc = 1.5*M_PI-boweta;
351  } else{ // 3rd quadrant
352  thetaloc = -0.5*M_PI-boweta;
353  }
354  etaloc = -1*log(tan(thetaloc/2.));
355 
356  }
357  }
358  ATH_MSG_VERBOSE("hit and isUnbiased ok");
359  }
360  // end copy-paste
361  // must delete the pointers?
362  } else {
363  if (not mesb) {
364  ATH_MSG_VERBOSE("mesb not ok");
365  }
366  if (not biasedTrackParameters) {
367  ATH_MSG_VERBOSE("biasedTrackParameters were not found");
368  }
369  --trackParametersCounter;
370  }
371  thisResult = std::make_tuple(det, r, iLayer,
372  residualLocX, pullLocX, residualLocY, pullLocY,
373  phiWidth, etaWidth, measureType,
374  measurementLocX, measurementLocY,
375  trackParamLocX, trackParamLocY,
376  angle, etaloc,
377  measurementLocCovX, measurementLocCovY,
378  Surface_ID);
379  result.push_back(thisResult);
380  }// end of for loop*/
382  "Out of " << numberOfHits << " hits, " << trackParametersCounter << " had track params, and " << result.size() <<
383  " had residuals.");
384  if (not result.empty()) {
385 // particle.auxdecor<TrackResult_t>(prefix+"hitResiduals") = result; //!< no dictionary for tuple
386  const unsigned int arraySize = result.size();
387  std::vector<int> result_det;
388  result_det.reserve(arraySize);
389  std::vector<int> result_r;
390  result_r.reserve(arraySize);
391  std::vector<int> result_iLayer;
392  result_iLayer.reserve(arraySize);
393  std::vector<float> result_residualLocX;
394  result_residualLocX.reserve(arraySize);
395  std::vector<float> result_pullLocX;
396  result_pullLocX.reserve(arraySize);
397  std::vector<float> result_residualLocY;
398  result_residualLocY.reserve(arraySize);
399  std::vector<float> result_pullLocY;
400  result_pullLocY.reserve(arraySize);
401  std::vector<int> result_phiWidth;
402  result_phiWidth.reserve(arraySize);
403  std::vector<int> result_etaWidth;
404  result_etaWidth.reserve(arraySize);
405  std::vector<int> result_measureType;
406  result_measureType.reserve(arraySize);
407  std::vector<float> result_measurementLocX;
408  result_measurementLocX.reserve(arraySize);
409  std::vector<float> result_measurementLocY;
410  result_measurementLocY.reserve(arraySize);
411  std::vector<float> result_trackParamLocX;
412  result_trackParamLocX.reserve(arraySize);
413  std::vector<float> result_trackParamLocY;
414  result_trackParamLocY.reserve(arraySize);
415  std::vector<float> result_angle;
416  result_angle.reserve(arraySize);
417  std::vector<float> result_etaloc;
418  result_etaloc.reserve(arraySize);
419  std::vector<float> result_measurementLocCovX;
420  result_measurementLocCovX.reserve(arraySize);
421  std::vector<float> result_measurementLocCovY;
422  result_measurementLocCovY.reserve(arraySize);
423  std::vector<uint64_t> result_surfaceID;
424  result_surfaceID.reserve(arraySize);
425 
426  for (const SingleResult_t& single_result : result) {
427  result_det.push_back(std::get<0>(single_result));
428  result_r.push_back(std::get<1>(single_result));
429  result_iLayer.push_back(std::get<2>(single_result));
430  result_residualLocX.push_back(std::get<3>(single_result));
431  result_pullLocX.push_back(std::get<4>(single_result));
432  result_residualLocY.push_back(std::get<5>(single_result));
433  result_pullLocY.push_back(std::get<6>(single_result));
434  result_phiWidth.push_back(std::get<7>(single_result));
435  result_etaWidth.push_back(std::get<8>(single_result));
436  result_measureType.push_back(std::get<9>(single_result));
437  result_measurementLocX.push_back(std::get<10>(single_result));
438  result_measurementLocY.push_back(std::get<11>(single_result));
439  result_trackParamLocX.push_back(std::get<12>(single_result));
440  result_trackParamLocY.push_back(std::get<13>(single_result));
441  result_angle.push_back(std::get<14>(single_result));
442  result_etaloc.push_back(std::get<15>(single_result));
443  result_measurementLocCovX.push_back(std::get<16>(single_result));
444  result_measurementLocCovY.push_back(std::get<17>(single_result));
445  result_surfaceID.push_back(std::get<18>(single_result));
446  }
447 
448  int_decor[kDecorRegion](particle) = result_r;
449  int_decor[kDecorDet](particle) = result_det;
450  int_decor[kDecorILayer](particle) = result_iLayer;
451  int_decor[kDecorPhiWidth](particle) = result_phiWidth;
452  int_decor[kDecorEtaWidth](particle) = result_etaWidth;
453  int_decor[kDecorType](particle) = result_measureType;
454 
455  float_decor[kDecorResidualLocX](particle) = result_residualLocX;
456  float_decor[kDecorPullLocX](particle) = result_pullLocX;
457  float_decor[kDecorMeasLocX](particle) = result_measurementLocX;
458  float_decor[kDecorTrkParamLocX](particle) = result_trackParamLocX;
459  float_decor[kDecorMeasLocCovX](particle) = result_measurementLocCovX;
460 
461  float_decor[kDecorResidualLocY](particle) = result_residualLocY;
462  float_decor[kDecorPullLocY](particle) = result_pullLocY;
463  float_decor[kDecorMeasLocY](particle) = result_measurementLocY;
464  float_decor[kDecorTrkParamLocY](particle) = result_trackParamLocY;
465  float_decor[kDecorMeasLocCovY](particle) = result_measurementLocCovY;
466 
467  float_decor[kDecorAngle](particle) = result_angle;
468  float_decor[kDecorEtaLoc](particle) = result_etaloc;
469 
470  uint64_decor[kDecorID](particle) = result_surfaceID;
471 
472  return true;
473  }
474  }
475  else {
476  // particle below pt threshold for decoration. Since this is not an error now "true" is returned.
477  // If "false" is returned the job would be aborted.
478  return true;
479  }
480  } else {
481  ATH_MSG_ERROR("No valid track link found ");
482  }
483  return false;
484 }
485 
486 bool
488  bool success(false);
489  const int normalBarrel(0);
490  const int upgradedBarrel(1);
491  const int normalTrtBarrel(1);
492 
493  det = INVALID_DETECTOR;// default
494  r = INVALID_REGION;
495  int bec(-100);
496 
497  // following the logic in the original code, should be reviewed!
498  if (m_idHelper->is_pixel(id)) {
499  bec = std::abs(m_pixelID->barrel_ec(id));
500  if(bec < 4) det = PIXEL;
501  }
502  if (m_idHelper->is_sct(id)) {
503  det = SCT;
504  }
505  if (not m_doUpgrade and m_idHelper->is_trt(id)) {
506  det = TRT;
507  }
508  //
509  // check this specifically
510  if (det == PIXEL) {
511  bec = abs(m_pixelID->barrel_ec(id));
512  r = (bec == normalBarrel) ? (BARREL) : (ENDCAP);
513  layer = m_pixelID->layer_disk(id);
514  if (BARREL == r and layer == 0) {
515  det = L0PIXBARR;
516  }
517  }
518 
519  if (det == SCT) {
520  bec = abs(m_sctID->barrel_ec(id));
521  if (not m_doUpgrade) {
522  r = (bec == normalBarrel) ? (BARREL) : (ENDCAP);
523  } else {
524  r = (bec == upgradedBarrel) ? (BARREL) : (ENDCAP);
525  }
526  layer = m_sctID->layer_disk(id);
527  }
528  if (det == TRT) {
529  bec = abs(m_trtID->barrel_ec(id));
530  r = (bec == normalTrtBarrel) ? (BARREL) : (ENDCAP);
532  }
533  success = (det != INVALID_DETECTOR)and(r != INVALID_REGION);
534 
535  return success;
536 }
537 
540  const Trk::MeasurementBase* measurement,
541  bool &isUnbiased) const {
542  const Trk::TrackParameters* unbiasedTrkParameters(trkParameters);
543 
544  if (!m_updatorHandle.empty() && (isUnbiased)) {
545  if (trkParameters->covariance()) {
546  // Get unbiased state
547  unbiasedTrkParameters = m_updatorHandle->removeFromState(*trkParameters,
548  measurement->localParameters(),
549  measurement->localCovariance()).release();
550  if (!unbiasedTrkParameters) {
551  ATH_MSG_INFO( "Could not get unbiased track parameters, use normal parameters" );
552  isUnbiased = false;
553  }
554  } else if (not m_alreadyWarned) {
555  // warn only once!
556  ATH_MSG_WARNING("TrackParameters contain no covariance, unbiased track states can not be calculated "
557  "(ie. pulls and residuals will be too small)" );
558  m_alreadyWarned = true;
559  isUnbiased = false;
560  } else {
561  isUnbiased = false;
562  }// end if no measured track parameter
563  }
564  return unbiasedTrkParameters;
565 }
566 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
AtlasDetectorID::is_pixel
bool is_pixel(Identifier id) const
Definition: AtlasDetectorID.h:760
InDetPhysHitDecoratorAlg::kDecorResidualLocX
@ kDecorResidualLocX
Definition: InDetPhysHitDecoratorAlg.h:80
beamspotman.r
def r
Definition: beamspotman.py:676
InDetPhysHitDecoratorAlg::m_holeSearchTool
ToolHandle< Trk::ITrackHoleSearchTool > m_holeSearchTool
Definition: InDetPhysHitDecoratorAlg.h:60
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
Trk::Surface::associatedDetectorElement
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
get_generator_info.result
result
Definition: get_generator_info.py:21
TrackParameters.h
InDetPhysHitDecoratorAlg::kDecorMeasLocY
@ kDecorMeasLocY
Definition: InDetPhysHitDecoratorAlg.h:87
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
InDetPhysHitDecoratorAlg::finalize
virtual StatusCode finalize() override
Definition: InDetPhysHitDecoratorAlg.cxx:120
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
InDetPhysHitDecoratorAlg::kDecorILayer
@ kDecorILayer
Definition: InDetPhysHitDecoratorAlg.h:69
InDetPhysHitDecoratorAlg::~InDetPhysHitDecoratorAlg
virtual ~InDetPhysHitDecoratorAlg()
Definition: InDetPhysHitDecoratorAlg.cxx:46
ParticleGun_SamplingFraction.bec
int bec
Definition: ParticleGun_SamplingFraction.py:89
AtlasDetectorID::is_sct
bool is_sct(Identifier id) const
Definition: AtlasDetectorID.h:770
PixelID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: PixelID.h:619
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::Track::trackStateOnSurfaces
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
InDetPhysHitDecoratorAlg::m_residualPullCalculator
ToolHandle< Trk::IResidualPullCalculator > m_residualPullCalculator
Definition: InDetPhysHitDecoratorAlg.h:62
InDetPhysHitDecoratorAlg::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: InDetPhysHitDecoratorAlg.h:109
InDetDD::SolidStateDetectorElementBase::etaAxis
const Amg::Vector3D & etaAxis() const
Definition: SolidStateDetectorElementBase.cxx:88
InDetPhysHitDecoratorAlg::kDecorPullLocY
@ kDecorPullLocY
Definition: InDetPhysHitDecoratorAlg.h:86
InDetPhysHitDecoratorAlg::kDecorTrkParamLocX
@ kDecorTrkParamLocX
Definition: InDetPhysHitDecoratorAlg.h:83
Trk::ResidualPull::Unbiased
@ Unbiased
RP with track state that has measurement not included.
Definition: ResidualPull.h:57
TRT_ID.h
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
test_pyathena.pt
pt
Definition: test_pyathena.py:11
M_PI
#define M_PI
Definition: ActiveFraction.h:11
safeDecorator.h
InDetDD::DetectorDesign::readoutSide
int readoutSide() const
ReadoutSide.
Definition: DetectorDesign.h:291
InDetPhysHitDecoratorAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: InDetPhysHitDecoratorAlg.cxx:126
Trk::loc2
@ loc2
generic first and second local coordinate
Definition: ParamDefs.h:41
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
SiClusterOnTrack.h
SCT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: SCT_ID.h:728
AtlasDetectorID::is_trt
bool is_trt(Identifier id) const
Definition: AtlasDetectorID.h:782
InDetPhysHitDecoratorAlg::INVALID_REGION
@ INVALID_REGION
Definition: InDetPhysHitDecoratorAlg.h:44
InDetPhysHitDecoratorAlg::Region
Region
Definition: InDetPhysHitDecoratorAlg.h:43
Trk::TrkDetElementBase::identify
virtual Identifier identify() const =0
Identifier.
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
InDetPhysHitDecoratorAlg::m_updatorHandle
ToolHandle< Trk::IUpdator > m_updatorHandle
Definition: InDetPhysHitDecoratorAlg.h:61
InDetDD::SolidStateDetectorElementBase::identifyHash
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
InDetPhysHitDecoratorAlg::m_prefix
Gaudi::Property< std::string > m_prefix
Definition: InDetPhysHitDecoratorAlg.h:103
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
IUpdator.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
InDetPhysHitDecoratorAlg::SCT
@ SCT
Definition: InDetPhysHitDecoratorAlg.h:41
Trk::TrackStateOnSurface::Outlier
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Definition: TrackStateOnSurface.h:122
InDetPhysHitDecoratorAlg::kDecorPullLocX
@ kDecorPullLocX
Definition: InDetPhysHitDecoratorAlg.h:81
InDetPhysHitDecoratorAlg::kDecorMeasLocCovY
@ kDecorMeasLocCovY
Definition: InDetPhysHitDecoratorAlg.h:89
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
InDetPhysHitDecoratorAlg::kDecorType
@ kDecorType
Definition: InDetPhysHitDecoratorAlg.h:70
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TRT
Definition: HitInfo.h:33
ResidualPull.h
Trk::TrackStateOnSurface::Hole
@ Hole
A hole on the track - this is defined in the following way.
Definition: TrackStateOnSurface.h:128
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
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
InDetPhysHitDecoratorAlg::TRT
@ TRT
Definition: InDetPhysHitDecoratorAlg.h:41
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
InDetPhysHitDecoratorAlg::Subdetector
Subdetector
Definition: InDetPhysHitDecoratorAlg.h:40
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:99
WritePulseShapeToCool.det
det
Definition: WritePulseShapeToCool.py:204
InDetPhysHitDecoratorAlg::initialize
virtual StatusCode initialize() override
Definition: InDetPhysHitDecoratorAlg.cxx:51
TrackCollection.h
InDetPhysHitDecoratorAlg::m_trkParticleName
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trkParticleName
Definition: InDetPhysHitDecoratorAlg.h:96
InDetPhysHitDecoratorAlg::decorateTrack
bool decorateTrack(const xAOD::TrackParticle &particle, std::vector< SG::WriteDecorHandle< xAOD::TrackParticleContainer, std::vector< float > > > &float_decor, std::vector< SG::WriteDecorHandle< xAOD::TrackParticleContainer, std::vector< int > > > &int_decor, std::vector< SG::WriteDecorHandle< xAOD::TrackParticleContainer, std::vector< uint64_t > > > &uint64_decor) const
Definition: InDetPhysHitDecoratorAlg.cxx:150
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
Trk::ParametersBase
Definition: ParametersBase.h:55
InDetPhysHitDecoratorAlg::kDecorAngle
@ kDecorAngle
Definition: InDetPhysHitDecoratorAlg.h:90
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
TRT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: TRT_ID.h:866
InDetPhysHitDecoratorAlg::getUnbiasedTrackParameters
const Trk::TrackParameters * getUnbiasedTrackParameters(const Trk::TrackParameters *trkParameters, const Trk::MeasurementBase *measurement, bool &isUnbiased) const
Definition: InDetPhysHitDecoratorAlg.cxx:539
InDetPhysHitDecoratorAlg::kDecorTrkParamLocY
@ kDecorTrkParamLocY
Definition: InDetPhysHitDecoratorAlg.h:88
DataVector< xAOD::TrackParticle_v1 >
TRT_ID::layer_or_wheel
int layer_or_wheel(const Identifier &id) const
Definition: TRT_ID.h:884
InDetDD::SolidStateDetectorElementBase::normal
virtual const Amg::Vector3D & normal() const override final
Get reconstruction local normal axes in global frame.
InDetPhysHitDecoratorAlg::m_floatDecor
std::vector< SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > > m_floatDecor
Definition: InDetPhysHitDecoratorAlg.h:100
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...
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SCT
Definition: SCT_ChipUtils.h:14
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
Trk::MeasurementBase
Definition: MeasurementBase.h:58
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:626
InDetPhysHitDecoratorAlg::kDecorEtaLoc
@ kDecorEtaLoc
Definition: InDetPhysHitDecoratorAlg.h:91
ITrackHoleSearchTool.h
InDetPhysHitDecoratorAlg::L0PIXBARR
@ L0PIXBARR
Definition: InDetPhysHitDecoratorAlg.h:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Trk::MeasurementBase::associatedSurface
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
InDetPhysHitDecoratorAlg::kDecorDet
@ kDecorDet
Definition: InDetPhysHitDecoratorAlg.h:68
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:734
SiCluster.h
InDetPhysHitDecoratorAlg::m_trtID
const TRT_ID * m_trtID
Definition: InDetPhysHitDecoratorAlg.h:112
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
InDetPhysHitDecoratorAlg::m_alreadyWarned
std::atomic< bool > m_alreadyWarned
Definition: InDetPhysHitDecoratorAlg.h:107
InDetPhysHitDecoratorAlg::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: InDetPhysHitDecoratorAlg.h:64
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::RIO_OnTrack::prepRawData
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
InDetPhysHitDecoratorAlg::kDecorEtaWidth
@ kDecorEtaWidth
Definition: InDetPhysHitDecoratorAlg.h:72
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
InDetPhysHitDecoratorAlg::InDetPhysHitDecoratorAlg
InDetPhysHitDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: InDetPhysHitDecoratorAlg.cxx:30
IResidualPullCalculator.h
InDet::SiCluster::width
const InDet::SiWidth & width() const
return width class reference
InDetPhysHitDecoratorAlg::m_ptThreshold
const double m_ptThreshold
Definition: InDetPhysHitDecoratorAlg.h:105
Trk::ResidualPull::Biased
@ Biased
RP with track state including the hit.
Definition: ResidualPull.h:55
VKalVrtAthena::AlgConsts::invalidFloat
constexpr double invalidFloat
Definition: Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/Constants.h:23
Identifier::get_compact
value_type get_compact(void) const
Get the compact id.
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
InDetPhysHitDecoratorAlg::kDecorResidualLocY
@ kDecorResidualLocY
Definition: InDetPhysHitDecoratorAlg.h:85
InDetDD::SolidStateDetectorElementBase::phiAxis
const Amg::Vector3D & phiAxis() const
Definition: SolidStateDetectorElementBase.cxx:74
TRT::Track::trackNumber
@ trackNumber
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:75
InDetPhysHitDecoratorAlg::BARREL
@ BARREL
Definition: InDetPhysHitDecoratorAlg.h:44
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthCommonMsg< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
InDetPhysHitDecoratorAlg::m_pixelID
const PixelID * m_pixelID
Definition: InDetPhysHitDecoratorAlg.h:110
InDetPhysHitDecoratorAlg::kNIntDecorators
@ kNIntDecorators
Definition: InDetPhysHitDecoratorAlg.h:73
xAOD::phiWidth
phiWidth
Definition: RingSetConf_v1.cxx:612
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
InDet::SiWidth
Definition: SiWidth.h:25
InDetPhysHitDecoratorAlg.h
InDetPhysHitDecoratorAlg::decideDetectorRegion
bool decideDetectorRegion(const Identifier &id, Subdetector &det, Region &r, int &layer) const
Definition: InDetPhysHitDecoratorAlg.cxx:487
InDetPhysHitDecoratorAlg::PIXEL
@ PIXEL
Definition: InDetPhysHitDecoratorAlg.h:41
IDPVM::createDecoratorKeys
void createDecoratorKeys(T_Parent &parent, const SG::ReadHandleKey< T_Cont > &container_key, const std::string &prefix, const std::vector< std::string > &decor_names, std::vector< SG::WriteDecorHandleKey< T_Cont > > &decor_out)
Definition: safeDecorator.h:125
IDPVM::createDecorators
std::vector< SG::WriteDecorHandle< T_Cont, T > > createDecorators(const std::vector< SG::WriteDecorHandleKey< T_Cont > > &keys, const EventContext &ctx)
Definition: safeDecorator.h:107
InDetPhysHitDecoratorAlg::m_sctID
const SCT_ID * m_sctID
Definition: InDetPhysHitDecoratorAlg.h:111
InDetPhysHitDecoratorAlg::m_intDecor
std::vector< SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > > m_intDecor
Definition: InDetPhysHitDecoratorAlg.h:98
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
InDetPhysHitDecoratorAlg::kDecorPhiWidth
@ kDecorPhiWidth
Definition: InDetPhysHitDecoratorAlg.h:71
InDetPhysHitDecoratorAlg::kNUInt64Decorators
@ kNUInt64Decorators
Definition: InDetPhysHitDecoratorAlg.h:77
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
Trk::loc1
@ loc1
Definition: ParamDefs.h:40
InDetPhysHitDecoratorAlg::ENDCAP
@ ENDCAP
Definition: InDetPhysHitDecoratorAlg.h:44
InDetPhysHitDecoratorAlg::kNFloatDecorators
@ kNFloatDecorators
Definition: InDetPhysHitDecoratorAlg.h:92
InDetPhysHitDecoratorAlg::kDecorID
@ kDecorID
Definition: InDetPhysHitDecoratorAlg.h:76
InDetPhysHitDecoratorAlg::m_uint64Decor
std::vector< SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > > m_uint64Decor
Definition: InDetPhysHitDecoratorAlg.h:99
readCCLHist.float
float
Definition: readCCLHist.py:83
InDet::SiCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h:40
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
Trk::ResidualPull::ResidualType
ResidualType
Definition: ResidualPull.h:53
InDetPhysHitDecoratorAlg::INVALID_DETECTOR
@ INVALID_DETECTOR
Definition: InDetPhysHitDecoratorAlg.h:41
InDetPhysHitDecoratorAlg::m_doUpgrade
bool m_doUpgrade
Definition: InDetPhysHitDecoratorAlg.h:106
InDetPhysHitDecoratorAlg::kDecorMeasLocCovX
@ kDecorMeasLocCovX
Definition: InDetPhysHitDecoratorAlg.h:84
InDetPhysHitDecoratorAlg::kDecorMeasLocX
@ kDecorMeasLocX
Definition: InDetPhysHitDecoratorAlg.h:82
InDetPhysHitDecoratorAlg::kDecorRegion
@ kDecorRegion
Definition: InDetPhysHitDecoratorAlg.h:67