ATLAS Offline Software
TrackStateOnSurfaceDecorator.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TrackStateOnSurfaceDecorator.cxx, (c) ATLAS Detector software
8 // Author:Anthony Morley
9 //
10 
13 
16 
17 
21 
24 #include "InDetIdentifier/SCT_ID.h"
25 #include "InDetIdentifier/TRT_ID.h"
27 
31 
37 
39 
40 
42 
44 #include "TrkTrack/Track.h"
45 
48 
51 
52 #include "StoreGate/ReadHandle.h"
58 #include "AthContainers/Accessor.h"
59 
60 #include <vector>
61 #include <string>
62 
63 namespace DerivationFramework {
64 
66  {
67  ATH_MSG_DEBUG("Initialize");
68 
69  if (m_sgName.value() == "notSet") {
70  ATH_MSG_ERROR("No decoration prefix name provided for the output of TrackStateOnSurfaceDecorator! Use the variable DecorationPrefix to properly set a prefix.");
71  return StatusCode::FAILURE;
72  }
73  ATH_MSG_DEBUG("Prefix for decoration: " << m_sgName);
74 
76  if (m_containerName.key().empty()) {
77  ATH_MSG_ERROR("No TrackParticle collection provided for TrackStateOnSurfaceDecorator!");
78  return StatusCode::FAILURE;
79  }
80  ATH_MSG_DEBUG("Input TrackParticle container: " << m_containerName.key());
82 
83  if (!m_selectionString.empty()) {
84  ATH_CHECK(initializeParser(m_selectionString));
85  }
86 
87  // need Atlas id-helpers to identify sub-detectors, take them from detStore
88  if (detStore()->retrieve(m_idHelper, "AtlasID").isFailure()) {
89  ATH_MSG_ERROR("Could not get AtlasDetectorID helper");
90  return StatusCode::FAILURE;
91  }
92 
93  if( m_storePixel && detStore()->retrieve(m_pixId,"PixelID").isFailure() ){
94  ATH_MSG_ERROR("Unable to retrieve pixel ID helper");
95  return StatusCode::FAILURE;
96  }
97 
98  if( m_storeSCT && detStore()->retrieve(m_sctId,"SCT_ID").isFailure() ){
99  ATH_MSG_ERROR("Could not retrieve SCT helper");
100  return StatusCode::FAILURE;
101  }
102 
103  if( m_storeTRT && detStore()->retrieve(m_trtId,"TRT_ID").isFailure() ){
104  ATH_MSG_ERROR("Could not retrieve TRT helper");
105  return StatusCode::FAILURE;
106  }
107 
108  ATH_CHECK( m_trtcaldbTool.retrieve(DisableTool{ !m_storeTRT }));
110 
111  ATH_CHECK( m_updator.retrieve(DisableTool{ !m_addPulls }));
112  ATH_CHECK( m_residualPullCalculator.retrieve(DisableTool{ !m_addPulls }));
113 
114  ATH_CHECK( m_holeSearchTool.retrieve( DisableTool{ !m_storeHoles}) );
115 
116  ATH_CHECK( m_TRTdEdxTool.retrieve( DisableTool{!m_storeTRT || m_TRTdEdxTool.empty()}) );
117 
118  ATH_CHECK(m_extrapolator.retrieve());
119 
120 
122 
123  if (m_addExtraEventInfo) {
124  std::vector<std::string> decor_names{"TrtPhaseTime"};
125  std::vector<SG::WriteDecorHandleKey<xAOD::EventInfo> > decor_key_out;
127  assert(m_trtPhaseDecorKey.size() == 1);
128  }
129  if (m_storeTRT && m_TRTdEdxTool.isEnabled()) {
130  std::vector<std::string> names;
131  names.resize(kNTRTFloatDecor);
132  names[kTRTdEdxDecor]="ToT_dEdx";
133  names[kTRTusedHitsDecor]="ToT_usedHits";
134  names[kTRTdEdx_noHT_divByLDecor]="ToT_dEdx_noHT_divByL";
135  names[kTRTusedHits_noHT_divByLDecor]="ToT_usedHits_noHT_divByL";
137  }
142 
145  ATH_CHECK( m_trtDCName.initialize(m_storeTRT && m_addPRD) );
146 
148  ATH_CHECK( m_sctMsosName.initialize(m_storeSCT && m_addPRD) );
149  ATH_CHECK( m_trtMsosName.initialize(m_storeTRT && m_addPRD) );
150 
151  if (m_storePixel){
152  std::vector<std::string> names;
153  names.resize(kNPixFloatDecor);
154  names[kTrkIBLXDecor]="TrkIBLX";
155  names[kTrkIBLYDecor]="TrkIBLY";
156  names[kTrkIBLZDecor]="TrkIBLZ";
157  names[kTrkBLXDecor]="TrkBLX";
158  names[kTrkBLYDecor]="TrkBLY";
159  names[kTrkBLZDecor]="TrkBLZ";
160  names[kTrkL1XDecor]="TrkL1X";
161  names[kTrkL1YDecor]="TrkL1Y";
162  names[kTrkL1ZDecor]="TrkL1Z";
163  names[kTrkL2XDecor]="TrkL2X";
164  names[kTrkL2YDecor]="TrkL2Y";
165  names[kTrkL2ZDecor]="TrkL2Z";
167  }
168 
169  m_trackTSOSMOSLinkDecorKey = m_containerName.key() + "." + m_sgName + "msosLink";
171 
172  ATH_MSG_DEBUG("Initialization finished.");
173 
174  return StatusCode::SUCCESS;
175  }
176 
178  {
179  ATH_MSG_DEBUG("Finalize");
180  return StatusCode::SUCCESS;
181  }
182 
184  {
185  const EventContext& ctx = Gaudi::Hive::currentContext();
186  ATH_MSG_DEBUG("Adding TSOS decorations the track particles");
187 
189 
190  // --- Retrieve track container (absolutely needed for decoration)
192  if( ! tracks.isValid() ) {
193  ATH_MSG_ERROR ("Couldn't retrieve TrackParticles with key: " << m_containerName.key() );
194  return StatusCode::FAILURE;
195  }
196  size_t nTracks = tracks->size();
197 
198 
199  SG::ReadHandle<std::vector<unsigned int> > pixelClusterOffsets;
200  SG::ReadHandle<std::vector<unsigned int> > sctClusterOffsets;
202 
206 
207 
208  // Create the xAOD container and its auxiliary store
212 
213  int nPixelMSOS(0);
214  int nSCT_MSOS(0);
215  int nTRT_MSOS(0);
216 
217  // --- Add event-level information
218  if (m_addExtraEventInfo) {
219  ATH_MSG_DEBUG("Adding EventInfo decorations");
221  if (!eventInfo.isValid()) {
222  ATH_MSG_ERROR(" Cannot access to event info.");
223  return StatusCode::FAILURE;
224  }
225 
226  //Add TRT event phase
227  SG::ReadHandle<ComTime> trtPhase(m_trtPhaseKey, ctx);
228  float trtPhase_time=0.;
229  if (!trtPhase.isValid()) {
230  ATH_MSG_DEBUG("Failed to retrieve TRT phase information.");
231  } else {
232  trtPhase_time = trtPhase->getTime();
233  } //TRT phase
235  decorTRTPhase(*eventInfo) = trtPhase_time;
236  } //extra event info
237 
238  // --- Add track states containers
239  if(m_addPRD){
240  // Get clusters and the mapping between xAOD::PRD and Trk::PRD
241  // Store the MSOS's in a conatiner based on the type of the detector
242  if(m_storePixel){
243  ATH_MSG_DEBUG("Creating Pixel track state container");
244  pixelClusterOffsets=SG::ReadHandle<std::vector<unsigned int> >(m_pixelMapName,ctx);
246 
248  if (msosPixel.record(std::make_unique<xAOD::TrackStateValidationContainer>(),
249  std::make_unique<xAOD::TrackStateValidationAuxContainer>()).isFailure()) {
250  ATH_MSG_ERROR("Failed to record " << m_pixelMsosName.key() );
251  return StatusCode::FAILURE;
252  }
253  }
254  if(m_storeSCT){
255  ATH_MSG_DEBUG("Creating SCT track state container");
258 
260  if (msosSCT.record(std::make_unique<xAOD::TrackStateValidationContainer>(),
261  std::make_unique<xAOD::TrackStateValidationAuxContainer>()).isFailure()) {
262  ATH_MSG_ERROR("Failed to record " << m_sctMsosName.key() );
263  return StatusCode::FAILURE;
264  }
265  }
266  if(m_storeTRT){
267  ATH_MSG_DEBUG("Creating TRT track state container");
270 
272  if (msosTRT.record(std::make_unique<xAOD::TrackStateValidationContainer>(),
273  std::make_unique<xAOD::TrackStateValidationAuxContainer>()).isFailure()) {
274  ATH_MSG_ERROR("Failed to record " << m_trtMsosName.key() );
275  return StatusCode::FAILURE;
276  }
277  }
278  }
279 
280  SG::ReadHandle<Trk::PRDtoTrackMap> prd_to_track_map;
281  const Trk::PRDtoTrackMap *prd_to_track_map_cptr = nullptr;
282  if (!m_prdToTrackMap.key().empty()) {
284  if (!prd_to_track_map.isValid()) {
285  ATH_MSG_ERROR("Failed to read PRD to track association map: " << m_prdToTrackMap.key());
286  }
287  prd_to_track_map_cptr = prd_to_track_map.cptr();
288  }
289 
290  // Set up a mask with the same entries as the full TrackParticle collection
291  std::vector<bool> mask;
292  mask.assign(nTracks,true); // default: keep all the tracks
293  if (m_parser) {
294  std::vector<int> entries = m_parser->evaluateAsVector();
295  unsigned int nEntries = entries.size();
296  // check the sizes are compatible
297  if (nTracks != nEntries ) {
298  ATH_MSG_ERROR("Sizes incompatible! Are you sure your selection string used ID TrackParticles?");
299  return StatusCode::FAILURE;
300  } else {
301  // set mask
302  for (unsigned int i=0; i<nTracks; ++i) if (entries[i]!=1) mask[i]=false;
303  }
304  }
305 
306  std::vector<SG::WriteDecorHandle<xAOD::TrackParticleContainer,float> > trackTRTFloatDecorators;
307  if (m_storeTRT && m_TRTdEdxTool.isEnabled()) {
308  trackTRTFloatDecorators = createDecorators<xAOD::TrackParticleContainer,float>(m_trackTRTFloatDecorKeys,ctx);
309  }
310  std::vector<SG::WriteDecorHandle<xAOD::TrackParticleContainer,float> >
311  trackPixFloatDecorators = createDecorators<xAOD::TrackParticleContainer,float>(m_trackPixFloatDecorKeys,ctx);
312  // -- Run over each track and decorate it
313  unsigned i_track = 0;
314  for (const auto *const track : *tracks) {
315  //-- Start with things that do not need a Trk::Track object
316 
317  // mask bit check
318  if(!mask[i_track]) {
319  ++i_track;
320  continue;
321  }
322 
323  // -- Now things that require a Trk::Track object
324  if( !track->trackLink().isValid() || track->track() == nullptr ) {
325  ATH_MSG_WARNING("Track particle without Trk::Track");
326  continue;
327  }
328  ATH_MSG_DEBUG("We have a Trk::Track");
329 
330  // We now have a valid Trk::Track
331  const Trk::Track* trkTrack = track->track();
332 
333  // This is the vector in which we will store the element links to the MSOS's
334  std::vector< ElementLink< xAOD::TrackStateValidationContainer > > msosLink;
335 
336  if ( m_storeTRT && m_TRTdEdxTool.isEnabled() ) {
337  // for dEdx studies
338  trackTRTFloatDecorators[kTRTdEdxDecor] (*track) = m_TRTdEdxTool->dEdx(trkTrack,true);
339  trackTRTFloatDecorators[kTRTusedHitsDecor] (*track) = m_TRTdEdxTool->usedHits(trkTrack);
340  trackTRTFloatDecorators[kTRTdEdx_noHT_divByLDecor] (*track) = m_TRTdEdxTool->dEdx(trkTrack, false);
341  trackTRTFloatDecorators[kTRTusedHits_noHT_divByLDecor] (*track) = m_TRTdEdxTool->usedHits(trkTrack, false);
342  }
343 
344  if(m_storePixel){
345  if ( trkTrack->perigeeParameters() ){
346 
347  if(m_pixelLayerRadii.size() < 4) ATH_MSG_WARNING("Too few layer radii set! Should be at least 4!");
348 
349  Trk::CylinderSurface cylSurfIBL(m_pixelLayerRadii[0], 3000.0);
350  Trk::CylinderSurface cylSurfBL(m_pixelLayerRadii[1], 3000.0);
351  Trk::CylinderSurface cylSurfL1(m_pixelLayerRadii[2], 3000.0);
352  Trk::CylinderSurface cylSurfL2(m_pixelLayerRadii[3], 3000.0);
353 
354  bool allExtrapolationsSucceded = true;
357  //check the radius of the start parameters, to see which direction we need to go to the target surface
358  float startRadius = trkTrack->perigeeParameters()->associatedSurface().center().perp();
359  ATH_MSG_VERBOSE("Start radius for extrapolating to layers: "<<startRadius);
360  //see if we go along or opposite momentum
361  if(startRadius>m_pixelLayerRadii[0]) {whichDir = Trk::oppositeMomentum; whichMode = Trk::addNoise;}
362  std::unique_ptr<const Trk::TrackParameters> outputParamsIBL
363  (m_extrapolator->extrapolate(ctx,
364  *(trkTrack->perigeeParameters()),
365  cylSurfIBL,
366  whichDir,
367  true,
368  Trk::pion,
369  whichMode));
370  if(startRadius>m_pixelLayerRadii[1]){
371  whichDir = Trk::oppositeMomentum;
372  whichMode = Trk::addNoise;
373  }
374  std::unique_ptr<const Trk::TrackParameters> outputParamsBL
375  (m_extrapolator->extrapolate(ctx,
376  *(trkTrack->perigeeParameters()),
377  cylSurfBL,
378  whichDir,
379  true,
380  Trk::pion,
381  whichMode));
382  if(startRadius>m_pixelLayerRadii[2]){
383  whichDir = Trk::oppositeMomentum;
384  whichMode = Trk::addNoise;
385  }
386  std::unique_ptr<const Trk::TrackParameters> outputParamsL1
387  (m_extrapolator->extrapolate(ctx,
388  *(trkTrack->perigeeParameters()),
389  cylSurfL1,
390  whichDir,
391  true,
392  Trk::pion,
393  whichMode));
394  if(startRadius>m_pixelLayerRadii[2]){
395  whichDir = Trk::oppositeMomentum;
396  whichMode = Trk::addNoise;
397  }
398  std::unique_ptr<const Trk::TrackParameters> outputParamsL2
399  (m_extrapolator->extrapolate(ctx,
400  *(trkTrack->perigeeParameters()),
401  cylSurfL2,
402  whichDir,
403  true,
404  Trk::pion,
405  whichMode));
406 
407  if (outputParamsIBL.get()) {
408  trackPixFloatDecorators[kTrkIBLXDecor](*track) = outputParamsIBL->position().x();
409  trackPixFloatDecorators[kTrkIBLYDecor](*track) = outputParamsIBL->position().y();
410  trackPixFloatDecorators[kTrkIBLZDecor](*track) = outputParamsIBL->position().z();
411  }
412  else {
413  allExtrapolationsSucceded = false;
414  ATH_MSG_VERBOSE("Extrapolation to IBL failed...");
415  trackPixFloatDecorators[kTrkIBLXDecor](*track) = 0.0;
416  trackPixFloatDecorators[kTrkIBLYDecor](*track) = 0.0;
417  trackPixFloatDecorators[kTrkIBLZDecor](*track) = 0.0;
418  }
419 
420  if (outputParamsBL.get()) {
421  trackPixFloatDecorators[kTrkBLXDecor](*track) = outputParamsBL->position().x();
422  trackPixFloatDecorators[kTrkBLYDecor](*track) = outputParamsBL->position().y();
423  trackPixFloatDecorators[kTrkBLZDecor](*track) = outputParamsBL->position().z();
424  }
425  else {
426  allExtrapolationsSucceded = false;
427  ATH_MSG_VERBOSE("Extrapolation to BLayer failed...");
428  trackPixFloatDecorators[kTrkBLXDecor](*track) = 0.0;
429  trackPixFloatDecorators[kTrkBLYDecor](*track) = 0.0;
430  trackPixFloatDecorators[kTrkBLZDecor](*track) = 0.0;
431  }
432 
433  if (outputParamsL1.get()) {
434  trackPixFloatDecorators[kTrkL1XDecor](*track) = outputParamsL1->position().x();
435  trackPixFloatDecorators[kTrkL1YDecor](*track) = outputParamsL1->position().y();
436  trackPixFloatDecorators[kTrkL1ZDecor](*track) = outputParamsL1->position().z();
437  }
438  else {
439  allExtrapolationsSucceded = false;
440  ATH_MSG_VERBOSE("Extrapolation to L1 failed...");
441  trackPixFloatDecorators[kTrkL1XDecor](*track) = 0.0;
442  trackPixFloatDecorators[kTrkL1YDecor](*track) = 0.0;
443  trackPixFloatDecorators[kTrkL1ZDecor](*track) = 0.0;
444  }
445 
446  if (outputParamsL2.get()) {
447  trackPixFloatDecorators[kTrkL2XDecor](*track) = outputParamsL2->position().x();
448  trackPixFloatDecorators[kTrkL2YDecor](*track) = outputParamsL2->position().y();
449  trackPixFloatDecorators[kTrkL2ZDecor](*track) = outputParamsL2->position().z();
450  }
451  else {
452  allExtrapolationsSucceded = false;
453  ATH_MSG_VERBOSE("Extrapolation to L2 failed...");
454  trackPixFloatDecorators[kTrkL2XDecor](*track) = 0.0;
455  trackPixFloatDecorators[kTrkL2YDecor](*track) = 0.0;
456  trackPixFloatDecorators[kTrkL2ZDecor](*track) = 0.0;
457  }
458  if(!allExtrapolationsSucceded) ATH_MSG_WARNING("At least one extrapolation to a Pixel layer failed!");
459  }
460  else{
461  ATH_MSG_WARNING("No perigee TrackParameters found - filling positions on layers to (0,0,0)!");
462  //should decorate nonetheless, to make sure decorations are consistent across events
463  trackPixFloatDecorators[kTrkIBLXDecor](*track) = 0.0;
464  trackPixFloatDecorators[kTrkIBLYDecor](*track) = 0.0;
465  trackPixFloatDecorators[kTrkIBLZDecor](*track) = 0.0;
466  trackPixFloatDecorators[kTrkBLXDecor](*track) = 0.0;
467  trackPixFloatDecorators[kTrkBLYDecor](*track) = 0.0;
468  trackPixFloatDecorators[kTrkBLZDecor](*track) = 0.0;
469  trackPixFloatDecorators[kTrkL1XDecor](*track) = 0.0;
470  trackPixFloatDecorators[kTrkL1YDecor](*track) = 0.0;
471  trackPixFloatDecorators[kTrkL1ZDecor](*track) = 0.0;
472  trackPixFloatDecorators[kTrkL2XDecor](*track) = 0.0;
473  trackPixFloatDecorators[kTrkL2YDecor](*track) = 0.0;
474  trackPixFloatDecorators[kTrkL2ZDecor](*track) = 0.0;
475  }
476  }
477 
478  // -- Add Track states to the current track, filtering on their type
479  std::vector<const Trk::TrackStateOnSurface*> tsoss;
480  for (const auto *const trackState: *(trkTrack->trackStateOnSurfaces())){
481  //Get rid of any holes that already exist -- we are doing the search again
482  if( trackState->types()[Trk::TrackStateOnSurface::Hole] )
483  continue;
484  tsoss.push_back(trackState);
485  }
486 
487  std::unique_ptr<const Trk::TrackStates> holes;
488  if(m_storeHoles){
489  holes = std::unique_ptr<const Trk::TrackStates>( m_holeSearchTool->getHolesOnTrack(*trkTrack, trkTrack->info().particleHypothesis()) );
490  for (const auto *hole: *holes){
491  tsoss.push_back(hole);
492  }
493  if(trkTrack->perigeeParameters()){
494  Trk::TrackStateOnSurfaceComparisonFunction CompFunc( trkTrack->perigeeParameters()->momentum() );
495  stable_sort( tsoss.begin(), tsoss.end(), CompFunc );
496  } else {
497  ATH_MSG_ERROR("Track has no perigee parameters");
498  }
499  }
500 
501  //Loop over the TrkStateOnSurfaces
502  for (const auto& trackState: tsoss){
503 
504  //Only store Holes, Measurement & Outliers
505  if( !trackState->types()[Trk::TrackStateOnSurface::Hole] &&
506  !trackState->types()[Trk::TrackStateOnSurface::Measurement] &&
507  !trackState->types()[Trk::TrackStateOnSurface::Outlier] ) {
508  continue;
509  }
510 
511  // Check if we want to store this types of TSOS
512  if(!m_storeOutliers && trackState->types()[Trk::TrackStateOnSurface::Outlier] )
513  continue;
514 
515 
516  if(!m_storeHoles && trackState->types()[Trk::TrackStateOnSurface::Hole] )
517  continue;
518 
519  // Check that the surface has detector element
520  if(!trackState->surface().associatedDetectorElement()){
521  continue;
522  }
523 
524  // Check that the surface ID is valid
525  Identifier surfaceID = trackState->surface().associatedDetectorElement()->identify();
526  if( !surfaceID.is_valid() ){
527  ATH_MSG_WARNING("Invalid surface ID");
528  continue;
529  }
530 
531  //Determine what detector the hit is in
532  bool isPixel(false);
533  bool isSCT(false);
534  bool isTRT(false);
535 
536  if( m_idHelper->is_trt(surfaceID) ){
537  isTRT = true;
538  if(!m_storeTRT)
539  continue;
540  }else if( m_idHelper->is_sct(surfaceID) ){
541  isSCT = true;
542  if(!m_storeSCT)
543  continue;
544  }else if( m_idHelper->is_pixel(surfaceID) ){
545  isPixel = true;
546  if(!m_storePixel)
547  continue;
548  }
549 
550  if( !isPixel && !isSCT && !isTRT ){
551  continue;
552  }
553 
554  //Create new MSOS to fill with information
556 
557  //Put it in the obeject in the correct conatiner - one for each detector type.
558  if(isTRT){
559  //Add the msos to the container
560  msosTRT->push_back( msos );
561  //Set the det id
563  //Build the element link to the MSOS
564  ElementLink< xAOD::TrackStateValidationContainer > elink( *msosTRT, nTRT_MSOS );
565  elink.toPersistent();
566  msosLink.push_back(elink);
567  ++nTRT_MSOS;
568  }else if(isSCT){
569  //Add the msos to the container
570  msosSCT->push_back( msos );
571  //Set the det id
573  //Build the element link to the MSOS
574  ElementLink< xAOD::TrackStateValidationContainer > elink( *msosSCT, nSCT_MSOS );
575  elink.toPersistent();
576  msosLink.push_back(elink);
577  ++nSCT_MSOS;
578  }else if(isPixel){
579  //Add the msos to the container
580  msosPixel->push_back( msos );
581  //Set the det id
583  //Build the element link to the MSOS
584  ElementLink< xAOD::TrackStateValidationContainer > elink( *msosPixel, nPixelMSOS );
585  elink.toPersistent();
586  msosLink.push_back(elink);
587  ++nPixelMSOS;
588  }
589  else {
590  ATH_MSG_WARNING("NOT a pixel, SCT or TRT track state on surface.");
591  delete msos;
592  continue;
593  }
594 
595  //fill type
596  if( trackState->types()[Trk::TrackStateOnSurface::Hole] ){
598  } else if (trackState->types()[Trk::TrackStateOnSurface::Measurement]){
600  } else if ( trackState->types()[Trk::TrackStateOnSurface::Outlier] ) {
602  }
603 
604  //Fill surface id
605  msos->setDetElementId( surfaceID.get_compact() );
606 
607 
608  const Trk::TrackParameters* tp = trackState->trackParameters();
609 
610  // some more detailed hit info
611  double lTheta=-1000., lPhi=-1000.;
612  //Get the measurement base object
613  const Trk::MeasurementBase* measurement=trackState->measurementOnTrack();
614  static const SG::Accessor<float> errDCAcc("errDC");
615  errDCAcc(*msos) = -1 ;
616  const Trk::RIO_OnTrack* rotp = dynamic_cast<const Trk::RIO_OnTrack*>(measurement) ;
617  if (rotp) errDCAcc(*msos) = sqrt(rotp->localCovariance()(Trk::driftRadius, Trk::driftRadius)) ;
618 
619  if (m_storeTRT) {
620  const InDet::TRT_DriftCircleOnTrack *driftcircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(measurement);
621  static const SG::Accessor<float> HitZAcc("HitZ");
622  static const SG::Accessor<float> HitRAcc("HitR");
623  static const SG::Accessor<float> rTrkWireAcc("rTrkWire");
624  if (!measurement) {
625  HitZAcc(*msos)=-3000;
626  HitRAcc(*msos)=-1;
627  rTrkWireAcc(*msos)=-1;
628  }
629  else {
630  if (!driftcircle) {
631  HitZAcc(*msos)=-3000;
632  HitRAcc(*msos)=-1;
633  rTrkWireAcc(*msos)=-1;
634  }
635  else {
636  if (tp) {
637  const Amg::Vector3D& gp = driftcircle->globalPosition();
638  HitZAcc(*msos)=gp.z();
639  HitRAcc(*msos)=gp.perp();
640  rTrkWireAcc(*msos)= fabs(trackState->trackParameters()->parameters()[Trk::driftRadius]);
641  lTheta = trackState->trackParameters()->parameters()[Trk::theta];
642  lPhi = trackState->trackParameters()->parameters()[Trk::phi];
643  }
644  else {
645  HitZAcc(*msos) =driftcircle->associatedSurface().center().z();
646  HitRAcc(*msos) =driftcircle->associatedSurface().center().perp();
647  rTrkWireAcc(*msos)=0;
648  }
649  }
650  }
651  msos->setLocalAngles(lTheta, lPhi);
652 
653  bool isShared=false;
654  if (prd_to_track_map_cptr) {
655  const Trk::RIO_OnTrack* hit_trt = measurement ? dynamic_cast<const Trk::RIO_OnTrack*>(measurement) : nullptr;
656  if (hit_trt) {
657  if (prd_to_track_map_cptr->isShared(*(hit_trt->prepRawData())) ) isShared=true;
658  static const SG::Accessor<bool> isSharedAcc("isShared");
659  isSharedAcc(*msos) = isShared;
660  }
661  }
662  }
663 
664  // Track extrapolation
665  std::unique_ptr<const Trk::TrackParameters> extrap( m_extrapolator->extrapolateTrack(ctx,*trkTrack,trackState->surface()) );
666 
667  // Set local positions on the surface
668  if (tp) {
669  msos->setLocalPosition( tp->parameters()[0], tp->parameters()[1] );
670 
671  if (extrap.get()) {
672  ATH_MSG_DEBUG(" Original position " << tp->parameters()[0] << " " << tp->parameters()[1]);
673  ATH_MSG_DEBUG("Extrapolated position " << extrap->parameters()[0] << " " << extrap->parameters()[1]);
674  }
675 
676  }
677  else {
678  if (extrap.get()) {
679  msos->setLocalPosition( extrap->parameters()[0], extrap->parameters()[1] );
680  }
681  else {
682  ATH_MSG_DEBUG("Track extrapolation failed.");
683  }
684  }
685 
686  // Set calculate local incident angles
687  const Trk::TrkDetElementBase *de = trackState->surface().associatedDetectorElement();
688  const InDetDD::SiDetectorElement *side = dynamic_cast<const InDetDD::SiDetectorElement *>(de);
689  if (side && (isSCT || isPixel)) {
690  const Amg::Vector3D& mynormal = side->normal();
691  const Amg::Vector3D& myphiax = side->phiAxis();
692  const Amg::Vector3D& myetaax = side->etaAxis();
693  if (tp) {
694  Amg::Vector3D mytrack = tp->momentum();
695  float trketacomp = mytrack.dot(myetaax);
696  float trkphicomp = mytrack.dot(myphiax);
697  float trknormcomp = mytrack.dot(mynormal);
698 
699  ATH_MSG_DEBUG(" Original incident angle " << trketacomp << " " << trkphicomp << " " << trknormcomp);
700  if (extrap.get()) {
701  Amg::Vector3D metrack = extrap->momentum();
702  float trketacompX = metrack.dot(myetaax);
703  float trkphicompX = metrack.dot(myphiax);
704  float trknormcompX = metrack.dot(mynormal);
705  ATH_MSG_DEBUG("Extrapolated incident angle " << trketacompX << " " << trkphicompX << " " << trknormcompX);
706  }
707  msos->setLocalAngles( atan2(trketacomp,trknormcomp), atan2(trkphicomp,trknormcomp) );
708  }
709  else {
710  if (extrap.get()) {
711  Amg::Vector3D metrack = extrap->momentum();
712  float trketacompX = metrack.dot(myetaax);
713  float trkphicompX = metrack.dot(myphiax);
714  float trknormcompX = metrack.dot(mynormal);
715  msos->setLocalAngles( atan2(trketacompX,trknormcompX), atan2(trkphicompX,trknormcompX) );
716  }
717  }
718  }
719 
720  if(!measurement) { continue; }
721 
722  if (isTRT && !trtDCOffsets.isValid() && !trtDCs.isValid()) { continue; }
723  if (isSCT && !sctClusterOffsets.isValid() && !sctClusters.isValid()) { continue; }
724  if (isPixel && !pixelClusterOffsets.isValid() && !pixelClusters.isValid()) { continue; }
725 
726  const Trk::RIO_OnTrack* hit = measurement ? dynamic_cast<const Trk::RIO_OnTrack*>(measurement) : nullptr;
727 
728  if(!hit){
729  const Trk::CompetingRIOsOnTrack *crot = dynamic_cast<const Trk::CompetingRIOsOnTrack*>(measurement);
730  if(crot){
731  hit = &crot->rioOnTrack( crot->indexOfMaxAssignProb() );
732  }
733  }
734 
735  if(m_addPRD && hit){
736  // Build an element link to the xAOD PRD
737  const Trk::PrepRawData* prd = hit->prepRawData();
738  if(prd && prd->getHashAndIndex().isValid() ){
739  if(isTRT){
740  msos->setTrackMeasurementValidationLink( buildElementLink( prd, trtDCOffsets.cptr(), trtDCs.cptr()) );
741  }else if(isSCT){
742  msos->setTrackMeasurementValidationLink( buildElementLink( prd, sctClusterOffsets.cptr(), sctClusters.cptr()) );
743  }else if(isPixel){
744  msos->setTrackMeasurementValidationLink( buildElementLink( prd, pixelClusterOffsets.cptr(), pixelClusters.cptr()) );
745  }
746  }
747  }
748 
749  if (m_storeSCT && isSCT) {
750  // We use accessors because the aux variable is added directly in the TrackMeasurementValidation cluster producer
751  // and we are decorating the MSOS in the TrackStateValidationContainer producer here
752  static const SG::Accessor<int> SiWidthAcc("SiWidth");
753  static const SG::Accessor<int> firstStripAcc("first_strip");
754  static const SG::Accessor<std::vector<int>> rdoStripAcc("rdo_strip");
755 
756  if( msos->trackMeasurementValidationLink().isValid() && *(msos->trackMeasurementValidationLink()) ){
758  SiWidthAcc(*msos) = SiWidthAcc(*sctCluster);
759  firstStripAcc(*msos) = (rdoStripAcc(*sctCluster)).at(0);
760  } else {
761  SiWidthAcc(*msos) = -1;
762  firstStripAcc(*msos) = -1;
763  }
764  }
765 
766  // Add the drift time for the tracks position -- note the position is biased
767  if (isTRT) {
768  TRTCond::RtRelation const *rtr = m_trtcaldbTool->getRtRelation(surfaceID);
769  if(rtr) {
770  static const SG::Accessor<float> driftTimeAcc("driftTime");
771  if (tp){
772  driftTimeAcc(*msos) = rtr->drifttime(fabs(tp->parameters()[0]));
773  }
774  else {
775  if (extrap.get()) {
776  driftTimeAcc(*msos) = rtr->drifttime(fabs(extrap->parameters()[0]));
777  }
778  }
779  }
780  }
781 
782  static const SG::Accessor<float> TrackError_biasedAcc("TrackError_biased");
783  static const SG::Accessor<float> TrackError_unbiasedAcc("TrackError_unbiased");
784  if (m_addPulls) {
785 
786  std::optional<Trk::ResidualPull> biased;
787  std::optional<Trk::ResidualPull> unbiased;
788  if (tp) {
789  biased= m_residualPullCalculator->residualPull(measurement, tp, Trk::ResidualPull::Biased);
790  if (m_storeTRT) TrackError_biasedAcc(*msos) = sqrt(fabs((*tp->covariance())(Trk::locX,Trk::locX)));
791 
792  if (m_storeTRT) TrackError_biasedAcc(*msos) = sqrt(fabs((*tp->covariance())(Trk::locX,Trk::locX)));
793  std::unique_ptr<const Trk::TrackParameters> unbiasedTp( m_updator->removeFromState(*tp, measurement->localParameters(), measurement->localCovariance()) );
794  if(unbiasedTp.get()) {
795  if (m_storeTRT) TrackError_unbiasedAcc(*msos) = sqrt(fabs((*unbiasedTp.get()->covariance())(Trk::locX,Trk::locX)));
796  unbiased = m_residualPullCalculator->residualPull(measurement, unbiasedTp.get(), Trk::ResidualPull::Unbiased);
797  }
798  }
799  else {
800  if (extrap.get()) {
801  if (m_storeTRT) TrackError_unbiasedAcc(*msos) = sqrt(fabs((*extrap.get()->covariance())(Trk::locX,Trk::locX)));
802  biased = m_residualPullCalculator->residualPull(measurement, extrap.get(), Trk::ResidualPull::Biased);
803  unbiased = m_residualPullCalculator->residualPull(measurement, extrap.get(), Trk::ResidualPull::Unbiased);
804  }
805  }
806 
807  if (biased) {
808  if(biased->dimension()>Trk::locY){
809  msos->setBiasedResidual( biased->residual()[Trk::locX], biased->residual()[Trk::locY] );
810  msos->setBiasedPull( biased->pull()[Trk::locX], biased->pull()[Trk::locY] );
811  } else {
812  msos->setBiasedResidual( biased->residual()[Trk::locX], 0 );
813  msos->setBiasedPull( biased->pull()[Trk::locX], 0 );
814  }
815  }
816 
817  if (unbiased) {
818  if(unbiased->dimension()>Trk::locY){
819  msos->setUnbiasedResidual( unbiased->residual()[Trk::locX], unbiased->residual()[Trk::locY] );
820  msos->setUnbiasedPull( unbiased->pull()[Trk::locX], unbiased->pull()[Trk::locY] );
821  } else {
822  msos->setUnbiasedResidual( unbiased->residual()[Trk::locX], 0 );
823  msos->setUnbiasedPull( unbiased->pull()[Trk::locX], 0 );
824  }
825  }
826 
827  }
828 
829  } //end loop over TSOS's
830 
831  ATH_MSG_DEBUG("The number of TSOS's " << msosLink.size() );
832 
833  dectsos_msosLink( *track ) = msosLink;
834 
835  ATH_MSG_DEBUG("Finished dressing TrackParticle");
836 
837  ++i_track;
838  } // end of loop over tracks
839 
840  return StatusCode::SUCCESS;
841  }
842 
843 
845  const std::vector<unsigned int>* offsets,
846  const xAOD::TrackMeasurementValidationContainer* xaodPrdCont) const
847  {
848 
849  const IdentContIndex& contIndex = prd->getHashAndIndex();
850  if( contIndex.collHash() >= offsets->size() ){
851  ATH_MSG_ERROR(" Offsets are incorrect " << contIndex.collHash() << " " << offsets->size() <<" "<< contIndex.objIndex());
852  return {0,0};
853  }
854 
855  unsigned int xaodIndex = offsets->at( contIndex.collHash() ) + contIndex.objIndex();
857  el.toPersistent();
858 
859  return el;
860 
861  }
862 
863 
864 }
DecoratorUtils.h
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:767
DerivationFramework::TrackStateOnSurfaceDecorator::m_residualPullCalculator
ToolHandle< Trk::IResidualPullCalculator > m_residualPullCalculator
Definition: TrackStateOnSurfaceDecorator.h:130
DerivationFramework::TrackStateOnSurfaceDecorator::kNPixFloatDecor
@ kNPixFloatDecor
Definition: TrackStateOnSurfaceDecorator.h:152
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
DerivationFramework::TrackStateOnSurfaceDecorator::addBranches
virtual StatusCode addBranches() const
Definition: TrackStateOnSurfaceDecorator.cxx:183
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkIBLYDecor
@ kTrkIBLYDecor
Definition: TrackStateOnSurfaceDecorator.h:148
Trk::TrackState::Pixel
@ Pixel
Definition: TrackStateDefs.h:28
DerivationFramework::TrackStateOnSurfaceDecorator::m_pixelMapName
SG::ReadHandleKey< std::vector< unsigned int > > m_pixelMapName
Definition: TrackStateOnSurfaceDecorator.h:93
DerivationFramework::TrackStateOnSurfaceDecorator::kTRTusedHitsDecor
@ kTRTusedHitsDecor
Definition: TrackStateOnSurfaceDecorator.h:143
xAOD::TrackStateValidation_v1::setUnbiasedResidual
void setUnbiasedResidual(float unbiasedResidualX, float unbiasedResidualY)
Sets the unbiased residual.
Definition: TrackStateValidation_v1.cxx:47
Trk::Surface::associatedDetectorElement
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
DerivationFramework::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: DecoratorUtils.h:20
DerivationFramework::TrackStateOnSurfaceDecorator::kTRTdEdx_noHT_divByLDecor
@ kTRTdEdx_noHT_divByLDecor
Definition: TrackStateOnSurfaceDecorator.h:144
TrackStateValidationAuxContainer.h
TrackParameters.h
Trk::TrackState::TRT
@ TRT
Definition: TrackStateDefs.h:30
Trk::locX
@ locX
Definition: ParamDefs.h:37
ComTime::getTime
double getTime() const
Definition: ComTime.h:44
CompetingRIOsOnTrack.h
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
SG::Accessor< float >
xAOD::TrackStateValidation_v1::setDetType
void setDetType(char detType)
Sets the detector type.
AtlasDetectorID::is_sct
bool is_sct(Identifier id) const
Definition: AtlasDetectorID.h:777
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
TrackStateDefs.h
Trk::PRDtoTrackMap
Definition: PRDtoTrackMap.h:17
Trk::oppositeMomentum
@ oppositeMomentum
Definition: PropDirection.h:21
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
InDetDD::holes
@ holes
Definition: InDetDD_Defs.h:17
Trk::Track::trackStateOnSurfaces
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
DerivationFramework::TrackStateOnSurfaceDecorator::m_trtPhaseKey
SG::ReadHandleKey< ComTime > m_trtPhaseKey
Definition: TrackStateOnSurfaceDecorator.h:88
Trk::Track::info
const TrackInfo & info() const
Returns a const ref to info of a const tracks.
DerivationFramework::TrackStateOnSurfaceDecorator::m_trtMapName
SG::ReadHandleKey< std::vector< unsigned int > > m_trtMapName
Definition: TrackStateOnSurfaceDecorator.h:97
xAOD::TrackStateValidation
TrackStateValidation_v1 TrackStateValidation
Reference the current persistent version:
Definition: TrackStateValidation.h:13
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...
DerivationFramework::TrackStateOnSurfaceDecorator::m_storeOutliers
Gaudi::Property< bool > m_storeOutliers
Definition: TrackStateOnSurfaceDecorator.h:71
DerivationFramework::TrackStateOnSurfaceDecorator::m_storeHoles
Gaudi::Property< bool > m_storeHoles
Definition: TrackStateOnSurfaceDecorator.h:70
InDet::TRT_DriftCircleOnTrack::associatedSurface
virtual const Trk::Surface & associatedSurface() const override final
returns the surface for the local to global transformation
Definition: TRT_DriftCircleOnTrack.cxx:154
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkL2XDecor
@ kTrkL2XDecor
Definition: TrackStateOnSurfaceDecorator.h:151
ParticleTest.tp
tp
Definition: ParticleTest.py:25
xAOD::TrackStateValidation_v1
Class describing a TrackStateValidation.
Definition: TrackStateValidation_v1.h:28
Identifier::get_compact
value_type get_compact() const
Get the compact id.
TrackStateOnSurfaceComparisonFunction.h
PropDirection.h
IdentContIndex
Identifiable container index to a contained object.
Definition: IdentContIndex.h:23
IExtrapolator.h
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Trk::MaterialUpdateMode
MaterialUpdateMode
This is a steering enum to force the material update it can be: (1) addNoise (-1) removeNoise Second ...
Definition: MaterialUpdateMode.h:18
DerivationFramework::TrackStateOnSurfaceDecorator::m_trtcaldbTool
ToolHandle< ITRT_CalDbTool > m_trtcaldbTool
Definition: TrackStateOnSurfaceDecorator.h:136
xAOD::TrackStateValidation_v1::trackMeasurementValidationLink
ElementLink< xAOD::TrackMeasurementValidationContainer > trackMeasurementValidationLink() const
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
xAOD::TrackStateValidation_v1::setUnbiasedPull
void setUnbiasedPull(float unbiasedPullX, float unbiasedPullY)
Sets the unbiased pull.
Definition: TrackStateValidation_v1.cxx:57
DerivationFramework::TrackStateOnSurfaceDecorator::m_addPulls
Gaudi::Property< bool > m_addPulls
Definition: TrackStateOnSurfaceDecorator.h:75
DerivationFramework::TrackStateOnSurfaceDecorator::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: TrackStateOnSurfaceDecorator.h:135
AtlasDetectorID::is_trt
bool is_trt(Identifier id) const
Definition: AtlasDetectorID.h:789
DerivationFramework::TrackStateOnSurfaceDecorator::m_sctClustersName
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_sctClustersName
Definition: TrackStateOnSurfaceDecorator.h:102
DerivationFramework::TrackStateOnSurfaceDecorator::buildElementLink
ElementLink< xAOD::TrackMeasurementValidationContainer > buildElementLink(const Trk::PrepRawData *, const std::vector< unsigned int > *, const xAOD::TrackMeasurementValidationContainer *) const
Definition: TrackStateOnSurfaceDecorator.cxx:844
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
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
DerivationFramework::TrackStateOnSurfaceDecorator::m_trtId
const TRT_ID * m_trtId
Definition: TrackStateOnSurfaceDecorator.h:126
InDet::TRT_DriftCircleOnTrack
Definition: TRT_DriftCircleOnTrack.h:53
ITRT_ToT_dEdx.h
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkL1XDecor
@ kTrkL1XDecor
Definition: TrackStateOnSurfaceDecorator.h:150
PrepRawData.h
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:459
DerivationFramework::TrackStateOnSurfaceDecorator::m_sctMapName
SG::ReadHandleKey< std::vector< unsigned int > > m_sctMapName
Definition: TrackStateOnSurfaceDecorator.h:95
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkL2ZDecor
@ kTrkL2ZDecor
Definition: TrackStateOnSurfaceDecorator.h:151
IUpdator.h
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
TRT::Hit::side
@ side
Definition: HitInfo.h:83
DerivationFramework::TrackStateOnSurfaceDecorator::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: TrackStateOnSurfaceDecorator.h:123
Track.h
DerivationFramework::TrackStateOnSurfaceDecorator::m_sctMsosName
SG::WriteHandleKey< xAOD::TrackStateValidationContainer > m_sctMsosName
Definition: TrackStateOnSurfaceDecorator.h:112
Trk::ParametersT::associatedSurface
virtual const S & associatedSurface() const override final
Access to the Surface method.
TRTCond::RtRelation
Definition: RtRelation.h:27
DerivationFramework::TrackStateOnSurfaceDecorator::kNTRTFloatDecor
@ kNTRTFloatDecor
Definition: TrackStateOnSurfaceDecorator.h:146
xAOD::TrackMeasurementValidation_v1
Class describing a TrackMeasurementValidation.
Definition: TrackMeasurementValidation_v1.h:27
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Trk::CompetingRIOsOnTrack::rioOnTrack
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
Trk::TrackStateOnSurfaceComparisonFunction
Class providing comparison function, or relational definition, for sorting MeasurementBase objects.
Definition: TrackStateOnSurfaceComparisonFunction.h:37
Trk::PropDirection
PropDirection
Definition: PropDirection.h:19
DerivationFramework::TrackStateOnSurfaceDecorator::m_prdToTrackMap
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
Definition: TrackStateOnSurfaceDecorator.h:107
DerivationFramework::TrackStateOnSurfaceDecorator::kTRTusedHits_noHT_divByLDecor
@ kTRTusedHits_noHT_divByLDecor
Definition: TrackStateOnSurfaceDecorator.h:145
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkBLYDecor
@ kTrkBLYDecor
Definition: TrackStateOnSurfaceDecorator.h:149
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
DerivationFramework::TrackStateOnSurfaceDecorator::m_storeTRT
Gaudi::Property< bool > m_storeTRT
Definition: TrackStateOnSurfaceDecorator.h:72
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
ResidualPull.h
Trk::TrackStateOnSurface::Hole
@ Hole
A hole on the track - this is defined in the following way.
Definition: TrackStateOnSurface.h:128
lumiFormat.i
int i
Definition: lumiFormat.py:85
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkBLZDecor
@ kTrkBLZDecor
Definition: TrackStateOnSurfaceDecorator.h:149
TRTCond::RtRelation::drifttime
virtual float drifttime(float radius) const =0
drifttime for given radius
Trk::theta
@ theta
Definition: ParamDefs.h:66
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkL1ZDecor
@ kTrkL1ZDecor
Definition: TrackStateOnSurfaceDecorator.h:150
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
python.subdetectors.mmg.names
names
Definition: mmg.py:8
Trk::CylinderSurface
Definition: CylinderSurface.h:55
Trk::driftRadius
@ driftRadius
trt, straws
Definition: ParamDefs.h:53
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
Trk::pion
@ pion
Definition: ParticleHypothesis.h:32
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkBLXDecor
@ kTrkBLXDecor
Definition: TrackStateOnSurfaceDecorator.h:149
WriteDecorHandle.h
Handle class for adding a decoration to an object.
Trk::CompetingRIOsOnTrack
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
Definition: CompetingRIOsOnTrack.h:64
Trk::TrkDetElementBase::surface
virtual const Surface & surface() const =0
Return surface associated with this detector element.
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
DerivationFramework::TrackStateOnSurfaceDecorator::m_storePixel
Gaudi::Property< bool > m_storePixel
Definition: TrackStateOnSurfaceDecorator.h:74
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework::TrackStateOnSurfaceDecorator::m_pixelLayerRadii
Gaudi::Property< std::vector< float > > m_pixelLayerRadii
Definition: TrackStateOnSurfaceDecorator.h:155
DerivationFramework::TrackStateOnSurfaceDecorator::m_TRTdEdxTool
ToolHandle< ITRT_ToT_dEdx > m_TRTdEdxTool
Definition: TrackStateOnSurfaceDecorator.h:138
ITRT_CalDbTool.h
abstract interface to TRT calibration constants
Trk::ParametersBase
Definition: ParametersBase.h:55
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkIBLXDecor
@ kTrkIBLXDecor
Definition: TrackStateOnSurfaceDecorator.h:148
TRT_DriftCircleOnTrack.h
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
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
DerivationFramework::TrackStateOnSurfaceDecorator::kTRTdEdxDecor
@ kTRTdEdxDecor
Definition: TrackStateOnSurfaceDecorator.h:142
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
DerivationFramework::TrackStateOnSurfaceDecorator::m_trackTRTFloatDecorKeys
std::vector< SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > > m_trackTRTFloatDecorKeys
Definition: TrackStateOnSurfaceDecorator.h:147
DerivationFramework::TrackStateOnSurfaceDecorator::m_updator
ToolHandle< Trk::IUpdator > m_updator
Definition: TrackStateOnSurfaceDecorator.h:128
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
DerivationFramework::TrackStateOnSurfaceDecorator::m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
Definition: TrackStateOnSurfaceDecorator.h:119
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
DerivationFramework::TrackStateOnSurfaceDecorator::finalize
StatusCode finalize()
Definition: TrackStateOnSurfaceDecorator.cxx:177
IPRD_AssociationTool.h
Trk::PrepRawData
Definition: PrepRawData.h:62
DerivationFramework::TrackStateOnSurfaceDecorator::m_trackTSOSMOSLinkDecorKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_trackTSOSMOSLinkDecorKey
Definition: TrackStateOnSurfaceDecorator.h:154
Trk::MeasurementBase
Definition: MeasurementBase.h:58
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
IdentContIndex::objIndex
unsigned short objIndex() const
object index in collection
Definition: IdentContIndex.h:92
Trk::Track::perigeeParameters
const Perigee * perigeeParameters() const
return Perigee.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:163
ITrackHoleSearchTool.h
xAOD::TrackStateValidation_v1::setBiasedPull
void setBiasedPull(float biasedPullX, float biasedPullY)
Sets the biased pull.
Definition: TrackStateValidation_v1.cxx:77
RIO_OnTrack.h
xAOD::TrackStateValidation_v1::setBiasedResidual
void setBiasedResidual(float biasedResidualX, float biasedResidualY)
Sets the biased residual.
Definition: TrackStateValidation_v1.cxx:67
Accessor.h
Helper class to provide type-safe access to aux data.
DerivationFramework::TrackStateOnSurfaceDecorator::m_holeSearchTool
ToolHandle< Trk::ITrackHoleSearchTool > m_holeSearchTool
Definition: TrackStateOnSurfaceDecorator.h:133
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
IdentContIndex::isValid
bool isValid() const
check that both fields are set
Definition: IdentContIndex.h:108
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.
DerivationFramework::TrackStateOnSurfaceDecorator::m_sctId
const SCT_ID * m_sctId
Definition: TrackStateOnSurfaceDecorator.h:125
SiDetectorElement.h
TrackStateValidationContainer.h
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
IResidualPullCalculator.h
Trk::PrepRawData::getHashAndIndex
const IdentContIndex & getHashAndIndex() const
DerivationFramework::TrackStateOnSurfaceDecorator::m_addExtraEventInfo
Gaudi::Property< bool > m_addExtraEventInfo
Definition: TrackStateOnSurfaceDecorator.h:78
xAOD::TrackStateValidation_v1::setLocalAngles
void setLocalAngles(float localTheta, float localPhi)
Sets the local angles.
Definition: TrackStateValidation_v1.cxx:37
xAOD::TrackStateValidation_v1::setLocalPosition
void setLocalPosition(float localX, float localY)
Sets the local position.
Definition: TrackStateValidation_v1.cxx:27
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
DerivationFramework::TrackStateOnSurfaceDecorator::m_sgName
Gaudi::Property< std::string > m_sgName
Definition: TrackStateOnSurfaceDecorator.h:84
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
DerivationFramework::TrackStateOnSurfaceDecorator::m_trtMsosName
SG::WriteHandleKey< xAOD::TrackStateValidationContainer > m_trtMsosName
Definition: TrackStateOnSurfaceDecorator.h:114
DerivationFramework::TrackStateOnSurfaceDecorator::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: TrackStateOnSurfaceDecorator.h:82
Trk::ResidualPull::Biased
@ Biased
RP with track state including the hit.
Definition: ResidualPull.h:55
VertexContainer.h
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
DerivationFramework::TrackStateOnSurfaceDecorator::m_addPRD
Gaudi::Property< bool > m_addPRD
Definition: TrackStateOnSurfaceDecorator.h:77
DerivationFramework::TrackStateOnSurfaceDecorator::m_storeSCT
Gaudi::Property< bool > m_storeSCT
Definition: TrackStateOnSurfaceDecorator.h:73
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::addNoise
@ addNoise
Definition: MaterialUpdateMode.h:19
xAOD::TrackStateValidation_v1::setDetElementId
void setDetElementId(uint64_t detElementId)
Sets the detector element identifier.
DerivationFramework::TrackStateOnSurfaceDecorator::m_trackPixFloatDecorKeys
std::vector< SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > > m_trackPixFloatDecorKeys
Definition: TrackStateOnSurfaceDecorator.h:153
DerivationFramework::TrackStateOnSurfaceDecorator::initialize
StatusCode initialize()
Definition: TrackStateOnSurfaceDecorator.cxx:65
entries
double entries
Definition: listroot.cxx:49
DerivationFramework::TrackStateOnSurfaceDecorator::m_pixelMsosName
SG::WriteHandleKey< xAOD::TrackStateValidationContainer > m_pixelMsosName
Definition: TrackStateOnSurfaceDecorator.h:110
DerivationFramework::TrackStateOnSurfaceDecorator::m_pixelClustersName
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_pixelClustersName
Definition: TrackStateOnSurfaceDecorator.h:100
TrackMeasurementValidationContainer.h
ReadDecorHandle.h
Handle class for reading a decoration on an object.
Trk::hole
@ hole
Definition: MeasurementType.h:36
xAOD::TrackStateValidation_v1::setType
void setType(int type)
Sets the type (measurement, outlier, hole)
Trk::phi
@ phi
Definition: ParamDefs.h:75
DerivationFramework::TrackStateOnSurfaceDecorator::m_trtPhaseDecorKey
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_trtPhaseDecorKey
Definition: TrackStateOnSurfaceDecorator.h:141
TrackStateOnSurfaceDecorator.h
xAOD::TrackStateValidation_v1::setTrackMeasurementValidationLink
void setTrackMeasurementValidationLink(ElementLink< xAOD::TrackMeasurementValidationContainer > trackMeasurementValidationLink)
sets the link to the TrackMeasurementValidationContainer
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
Trk::TrackState::SCT
@ SCT
Definition: TrackStateDefs.h:29
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
ReadHandle.h
Handle class for reading from StoreGate.
InDet::TRT_DriftCircleOnTrack::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
return the global position of this RIO_OnTrack
Definition: TRT_DriftCircleOnTrack.cxx:160
DerivationFramework::TrackStateOnSurfaceDecorator::m_selectionString
StringProperty m_selectionString
Definition: TrackStateOnSurfaceDecorator.h:90
Trk::CompetingRIOsOnTrack::indexOfMaxAssignProb
unsigned int indexOfMaxAssignProb() const
Index of the ROT with the highest assignment probability.
Definition: CompetingRIOsOnTrack.cxx:101
dqBeamSpot.nEntries
int nEntries
Definition: dqBeamSpot.py:72
Trk::removeNoise
@ removeNoise
Definition: MaterialUpdateMode.h:20
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkIBLZDecor
@ kTrkIBLZDecor
Definition: TrackStateOnSurfaceDecorator.h:148
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkL2YDecor
@ kTrkL2YDecor
Definition: TrackStateOnSurfaceDecorator.h:151
DerivationFramework::TrackStateOnSurfaceDecorator::m_trtDCName
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_trtDCName
Definition: TrackStateOnSurfaceDecorator.h:104
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
IdentContIndex::collHash
unsigned short collHash() const
Accessor to hash, obj index and combined index.
Definition: IdentContIndex.h:85
Trk::PRDtoTrackMap::isShared
bool isShared(const PrepRawData &prd) const
does this PRD belong to more than one track?
DerivationFramework::TrackStateOnSurfaceDecorator::m_containerName
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_containerName
Definition: TrackStateOnSurfaceDecorator.h:86
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
TrackStateOnSurface.h
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkL1YDecor
@ kTrkL1YDecor
Definition: TrackStateOnSurfaceDecorator.h:150
Trk::TrackInfo::particleHypothesis
ParticleHypothesis particleHypothesis() const
Returns the particle hypothesis used for Track fitting.
DerivationFramework::TrackStateOnSurfaceDecorator::m_pixId
const PixelID * m_pixId
Definition: TrackStateOnSurfaceDecorator.h:124
Identifier
Definition: IdentifierFieldParser.cxx:14