ATLAS Offline Software
TrackStateOnSurfaceDecorator.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 // 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"
57 #include "AthContainers/Accessor.h"
58 
59 #include <vector>
60 #include <string>
61 
62 namespace DerivationFramework {
63 
65  const std::string& n,
66  const IInterface* p) :
67  AthAlgTool(t,n,p),
68  m_idHelper(nullptr),
69  m_pixId(nullptr),
70  m_sctId(nullptr),
71  m_trtId(nullptr),
72  m_updator("Trk::KalmanUpdator"),
73  m_residualPullCalculator("Trk::ResidualPullCalculator/ResidualPullCalculator"),
74  m_holeSearchTool("InDet::InDetTrackHoleSearchTool/InDetHoleSearchTool"),
75  m_extrapolator("Trk::Extrapolator/AtlasExtrapolator"),
76  m_trtcaldbTool("TRT_CalDbTool",this),
77  m_TRTdEdxTool("InDet::TRT_ElectronPidTools/TRT_ToT_dEdx")
78  {
79  declareInterface<DerivationFramework::IAugmentationTool>(this);
80  // --- Steering and configuration flags
81  declareProperty("IsSimulation", m_isSimulation=true);
82 
83  declareProperty("StoreHoles", m_storeHoles =true);
84  declareProperty("StoreOutliers", m_storeOutliers = true);
85  declareProperty("StoreTRT", m_storeTRT =false);
86  declareProperty("StoreSCT", m_storeSCT = true);
87  declareProperty("StorePixel", m_storePixel =true);
88  declareProperty("AddPulls", m_addPulls =true);
89  declareProperty("AddSurfaceInfo", m_addSurfaceInfo =true);
90  declareProperty("AddPRD", m_addPRD =true);
91  declareProperty("AddExtraEventInfo", m_addExtraEventInfo=true);
92 
93  // -- Tools
94  declareProperty("Updator", m_updator);
95  declareProperty("ResidualPullCalculator", m_residualPullCalculator);
96  declareProperty("HoleSearch", m_holeSearchTool);
97  declareProperty("TRT_CalDbTool", m_trtcaldbTool);
98  declareProperty("TRT_ToT_dEdx", m_TRTdEdxTool);
99  declareProperty("TrackExtrapolator", m_extrapolator);
100  }
101 
103  {
104  ATH_MSG_DEBUG("Initialize");
105 
106  if (m_sgName.value() == "notSet") {
107  ATH_MSG_ERROR("No decoration prefix name provided for the output of TrackStateOnSurfaceDecorator! Use the variable DecorationPrefix to properly set a prefix.");
108  return StatusCode::FAILURE;
109  }
110  ATH_MSG_DEBUG("Prefix for decoration: " << m_sgName);
111 
113  if (m_containerName.key().empty()) {
114  ATH_MSG_ERROR("No TrackParticle collection provided for TrackStateOnSurfaceDecorator!");
115  return StatusCode::FAILURE;
116  }
117  ATH_MSG_DEBUG("Input TrackParticle container: " << m_containerName.key());
119 
120  // need Atlas id-helpers to identify sub-detectors, take them from detStore
121  if (detStore()->retrieve(m_idHelper, "AtlasID").isFailure()) {
122  ATH_MSG_ERROR("Could not get AtlasDetectorID helper");
123  return StatusCode::FAILURE;
124  }
125 
126  if( m_storePixel && detStore()->retrieve(m_pixId,"PixelID").isFailure() ){
127  ATH_MSG_ERROR("Unable to retrieve pixel ID helper");
128  return StatusCode::FAILURE;
129  }
130 
131  if( m_storeSCT && detStore()->retrieve(m_sctId,"SCT_ID").isFailure() ){
132  ATH_MSG_ERROR("Could not retrieve SCT helper");
133  return StatusCode::FAILURE;
134  }
135 
136  if( m_storeTRT && detStore()->retrieve(m_trtId,"TRT_ID").isFailure() ){
137  ATH_MSG_ERROR("Could not retrieve TRT helper");
138  return StatusCode::FAILURE;
139  }
140 
141  ATH_CHECK( m_trtcaldbTool.retrieve(DisableTool{ !m_storeTRT }));
143 
144  ATH_CHECK( m_updator.retrieve(DisableTool{ !m_addPulls }));
145  ATH_CHECK( m_residualPullCalculator.retrieve(DisableTool{ !m_addPulls }));
146 
147  ATH_CHECK( m_holeSearchTool.retrieve( DisableTool{ !m_storeHoles}) );
148 
149  ATH_CHECK( m_TRTdEdxTool.retrieve( DisableTool{!m_storeTRT || m_TRTdEdxTool.empty()}) );
150 
151  ATH_CHECK(m_extrapolator.retrieve());
152 
153 
155 
156  if (m_addExtraEventInfo) {
157  std::vector<std::string> decor_names{"TrtPhaseTime"};
158  std::vector<SG::WriteDecorHandleKey<xAOD::EventInfo> > decor_key_out;
160  assert(m_trtPhaseDecorKey.size() == 1);
161  }
162  if (m_storeTRT && m_TRTdEdxTool.isEnabled()) {
163  std::vector<std::string> names;
164  names.resize(kNTRTFloatDecor);
165  names[kTRTdEdxDecor]="ToT_dEdx";
166  names[kTRTusedHitsDecor]="ToT_usedHits";
167  names[kTRTdEdx_noHT_divByLDecor]="ToT_dEdx_noHT_divByL";
168  names[kTRTusedHits_noHT_divByLDecor]="ToT_usedHits_noHT_divByL";
170  }
175 
178  ATH_CHECK( m_trtDCName.initialize(m_storeTRT && m_addPRD) );
179 
181  ATH_CHECK( m_sctMsosName.initialize(m_storeSCT && m_addPRD) );
182  ATH_CHECK( m_trtMsosName.initialize(m_storeTRT && m_addPRD) );
183 
184  if (m_storePixel){
185  std::vector<std::string> names;
186  names.resize(kNPixFloatDecor);
187  names[kTrkIBLXDecor]="TrkIBLX";
188  names[kTrkIBLYDecor]="TrkIBLY";
189  names[kTrkIBLZDecor]="TrkIBLZ";
190  names[kTrkBLXDecor]="TrkBLX";
191  names[kTrkBLYDecor]="TrkBLY";
192  names[kTrkBLZDecor]="TrkBLZ";
193  names[kTrkL1XDecor]="TrkL1X";
194  names[kTrkL1YDecor]="TrkL1Y";
195  names[kTrkL1ZDecor]="TrkL1Z";
196  names[kTrkL2XDecor]="TrkL2X";
197  names[kTrkL2YDecor]="TrkL2Y";
198  names[kTrkL2ZDecor]="TrkL2Z";
200  }
201 
202  m_trackTSOSMOSLinkDecorKey = m_containerName.key() + "." + m_sgName + "msosLink";
204 
205  ATH_MSG_DEBUG("Initialization finished.");
206 
207  return StatusCode::SUCCESS;
208  }
209 
211  {
212  ATH_MSG_DEBUG("Finalize");
213  return StatusCode::SUCCESS;
214  }
215 
217  {
218  const EventContext& ctx = Gaudi::Hive::currentContext();
219  ATH_MSG_DEBUG("Adding TSOS decorations the track particles");
220 
222 
223  // --- Retrieve track container (absolutely needed for decoration)
225  if( ! tracks.isValid() ) {
226  ATH_MSG_ERROR ("Couldn't retrieve TrackParticles with key: " << m_containerName.key() );
227  return StatusCode::FAILURE;
228  }
229 
230 
231  SG::ReadHandle<std::vector<unsigned int> > pixelClusterOffsets;
232  SG::ReadHandle<std::vector<unsigned int> > sctClusterOffsets;
234 
238 
239 
240  // Create the xAOD container and its auxiliary store
244 
245  int nPixelMSOS(0);
246  int nSCT_MSOS(0);
247  int nTRT_MSOS(0);
248 
249  // --- Add event-level information
250  if (m_addExtraEventInfo) {
251  ATH_MSG_DEBUG("Adding EventInfo decorations");
253  if (!eventInfo.isValid()) {
254  ATH_MSG_ERROR(" Cannot access to event info.");
255  return StatusCode::FAILURE;
256  }
257 
258  //Add TRT event phase
259  SG::ReadHandle<ComTime> trtPhase(m_trtPhaseKey, ctx);
260  float trtPhase_time=0.;
261  if (!trtPhase.isValid()) {
262  ATH_MSG_DEBUG("Failed to retrieve TRT phase information.");
263  } else {
264  trtPhase_time = trtPhase->getTime();
265  } //TRT phase
267  decorTRTPhase(*eventInfo) = trtPhase_time;
268  } //extra event info
269 
270  // --- Add track states containers
271  if(m_addPRD){
272  // Get clusters and the mapping between xAOD::PRD and Trk::PRD
273  // Store the MSOS's in a conatiner based on the type of the detector
274  if(m_storePixel){
275  ATH_MSG_DEBUG("Creating Pixel track state container");
276  pixelClusterOffsets=SG::ReadHandle<std::vector<unsigned int> >(m_pixelMapName,ctx);
278 
280  if (msosPixel.record(std::make_unique<xAOD::TrackStateValidationContainer>(),
281  std::make_unique<xAOD::TrackStateValidationAuxContainer>()).isFailure()) {
282  ATH_MSG_ERROR("Failed to record " << m_pixelMsosName.key() );
283  return StatusCode::FAILURE;
284  }
285  }
286  if(m_storeSCT){
287  ATH_MSG_DEBUG("Creating SCT track state container");
290 
292  if (msosSCT.record(std::make_unique<xAOD::TrackStateValidationContainer>(),
293  std::make_unique<xAOD::TrackStateValidationAuxContainer>()).isFailure()) {
294  ATH_MSG_ERROR("Failed to record " << m_sctMsosName.key() );
295  return StatusCode::FAILURE;
296  }
297  }
298  if(m_storeTRT){
299  ATH_MSG_DEBUG("Creating TRT track state container");
302 
304  if (msosTRT.record(std::make_unique<xAOD::TrackStateValidationContainer>(),
305  std::make_unique<xAOD::TrackStateValidationAuxContainer>()).isFailure()) {
306  ATH_MSG_ERROR("Failed to record " << m_trtMsosName.key() );
307  return StatusCode::FAILURE;
308  }
309  }
310  }
311 
312  SG::ReadHandle<Trk::PRDtoTrackMap> prd_to_track_map;
313  const Trk::PRDtoTrackMap *prd_to_track_map_cptr = nullptr;
314  if (!m_prdToTrackMap.key().empty()) {
316  if (!prd_to_track_map.isValid()) {
317  ATH_MSG_ERROR("Failed to read PRD to track association map: " << m_prdToTrackMap.key());
318  }
319  prd_to_track_map_cptr = prd_to_track_map.cptr();
320  }
321 
322  std::vector<SG::WriteDecorHandle<xAOD::TrackParticleContainer,float> > trackTRTFloatDecorators;
323  if (m_storeTRT && m_TRTdEdxTool.isEnabled()) {
324  trackTRTFloatDecorators = createDecorators<xAOD::TrackParticleContainer,float>(m_trackTRTFloatDecorKeys,ctx);
325  }
326  std::vector<SG::WriteDecorHandle<xAOD::TrackParticleContainer,float> >
327  trackPixFloatDecorators = createDecorators<xAOD::TrackParticleContainer,float>(m_trackPixFloatDecorKeys,ctx);
328  // -- Run over each track and decorate it
329  for (const auto *const track : *tracks) {
330  //-- Start with things that do not need a Trk::Track object
331 
332  // -- Now things that require a Trk::Track object
333  if( !track->trackLink().isValid() || track->track() == nullptr ) {
334  ATH_MSG_WARNING("Track particle without Trk::Track");
335  continue;
336  }
337  ATH_MSG_DEBUG("We have a Trk::Track");
338 
339  // We now have a valid Trk::Track
340  const Trk::Track* trkTrack = track->track();
341 
342  // This is the vector in which we will store the element links to the MSOS's
343  std::vector< ElementLink< xAOD::TrackStateValidationContainer > > msosLink;
344 
345  if ( m_storeTRT && m_TRTdEdxTool.isEnabled() ) {
346  // for dEdx studies
347  trackTRTFloatDecorators[kTRTdEdxDecor] (*track) = m_TRTdEdxTool->dEdx(trkTrack,true);
348  trackTRTFloatDecorators[kTRTusedHitsDecor] (*track) = m_TRTdEdxTool->usedHits(trkTrack);
349  trackTRTFloatDecorators[kTRTdEdx_noHT_divByLDecor] (*track) = m_TRTdEdxTool->dEdx(trkTrack, false);
350  trackTRTFloatDecorators[kTRTusedHits_noHT_divByLDecor] (*track) = m_TRTdEdxTool->usedHits(trkTrack, false);
351  }
352 
353  if(m_storePixel){
354  if ( trkTrack->perigeeParameters() ){
355 
356  if(m_pixelLayerRadii.size() < 4) ATH_MSG_WARNING("Too few layer radii set! Should be at least 4!");
357 
358  Trk::CylinderSurface cylSurfIBL(m_pixelLayerRadii[0], 3000.0);
359  Trk::CylinderSurface cylSurfBL(m_pixelLayerRadii[1], 3000.0);
360  Trk::CylinderSurface cylSurfL1(m_pixelLayerRadii[2], 3000.0);
361  Trk::CylinderSurface cylSurfL2(m_pixelLayerRadii[3], 3000.0);
362 
363  bool allExtrapolationsSucceded = true;
366  //check the radius of the start parameters, to see which direction we need to go to the target surface
367  float startRadius = trkTrack->perigeeParameters()->associatedSurface().center().perp();
368  ATH_MSG_VERBOSE("Start radius for extrapolating to layers: "<<startRadius);
369  //see if we go along or opposite momentum
370  if(startRadius>m_pixelLayerRadii[0]) {whichDir = Trk::oppositeMomentum; whichMode = Trk::addNoise;}
371  std::unique_ptr<const Trk::TrackParameters> outputParamsIBL
372  (m_extrapolator->extrapolate(ctx,
373  *(trkTrack->perigeeParameters()),
374  cylSurfIBL,
375  whichDir,
376  true,
377  Trk::pion,
378  whichMode));
379  if(startRadius>m_pixelLayerRadii[1]){
380  whichDir = Trk::oppositeMomentum;
381  whichMode = Trk::addNoise;
382  }
383  std::unique_ptr<const Trk::TrackParameters> outputParamsBL
384  (m_extrapolator->extrapolate(ctx,
385  *(trkTrack->perigeeParameters()),
386  cylSurfBL,
387  whichDir,
388  true,
389  Trk::pion,
390  whichMode));
391  if(startRadius>m_pixelLayerRadii[2]){
392  whichDir = Trk::oppositeMomentum;
393  whichMode = Trk::addNoise;
394  }
395  std::unique_ptr<const Trk::TrackParameters> outputParamsL1
396  (m_extrapolator->extrapolate(ctx,
397  *(trkTrack->perigeeParameters()),
398  cylSurfL1,
399  whichDir,
400  true,
401  Trk::pion,
402  whichMode));
403  if(startRadius>m_pixelLayerRadii[2]){
404  whichDir = Trk::oppositeMomentum;
405  whichMode = Trk::addNoise;
406  }
407  std::unique_ptr<const Trk::TrackParameters> outputParamsL2
408  (m_extrapolator->extrapolate(ctx,
409  *(trkTrack->perigeeParameters()),
410  cylSurfL2,
411  whichDir,
412  true,
413  Trk::pion,
414  whichMode));
415 
416  if (outputParamsIBL.get()) {
417  trackPixFloatDecorators[kTrkIBLXDecor](*track) = outputParamsIBL->position().x();
418  trackPixFloatDecorators[kTrkIBLYDecor](*track) = outputParamsIBL->position().y();
419  trackPixFloatDecorators[kTrkIBLZDecor](*track) = outputParamsIBL->position().z();
420  }
421  else {
422  allExtrapolationsSucceded = false;
423  ATH_MSG_VERBOSE("Extrapolation to IBL failed...");
424  trackPixFloatDecorators[kTrkIBLXDecor](*track) = 0.0;
425  trackPixFloatDecorators[kTrkIBLYDecor](*track) = 0.0;
426  trackPixFloatDecorators[kTrkIBLZDecor](*track) = 0.0;
427  }
428 
429  if (outputParamsBL.get()) {
430  trackPixFloatDecorators[kTrkBLXDecor](*track) = outputParamsBL->position().x();
431  trackPixFloatDecorators[kTrkBLYDecor](*track) = outputParamsBL->position().y();
432  trackPixFloatDecorators[kTrkBLZDecor](*track) = outputParamsBL->position().z();
433  }
434  else {
435  allExtrapolationsSucceded = false;
436  ATH_MSG_VERBOSE("Extrapolation to BLayer failed...");
437  trackPixFloatDecorators[kTrkBLXDecor](*track) = 0.0;
438  trackPixFloatDecorators[kTrkBLYDecor](*track) = 0.0;
439  trackPixFloatDecorators[kTrkBLZDecor](*track) = 0.0;
440  }
441 
442  if (outputParamsL1.get()) {
443  trackPixFloatDecorators[kTrkL1XDecor](*track) = outputParamsL1->position().x();
444  trackPixFloatDecorators[kTrkL1YDecor](*track) = outputParamsL1->position().y();
445  trackPixFloatDecorators[kTrkL1ZDecor](*track) = outputParamsL1->position().z();
446  }
447  else {
448  allExtrapolationsSucceded = false;
449  ATH_MSG_VERBOSE("Extrapolation to L1 failed...");
450  trackPixFloatDecorators[kTrkL1XDecor](*track) = 0.0;
451  trackPixFloatDecorators[kTrkL1YDecor](*track) = 0.0;
452  trackPixFloatDecorators[kTrkL1ZDecor](*track) = 0.0;
453  }
454 
455  if (outputParamsL2.get()) {
456  trackPixFloatDecorators[kTrkL2XDecor](*track) = outputParamsL2->position().x();
457  trackPixFloatDecorators[kTrkL2YDecor](*track) = outputParamsL2->position().y();
458  trackPixFloatDecorators[kTrkL2ZDecor](*track) = outputParamsL2->position().z();
459  }
460  else {
461  allExtrapolationsSucceded = false;
462  ATH_MSG_VERBOSE("Extrapolation to L2 failed...");
463  trackPixFloatDecorators[kTrkL2XDecor](*track) = 0.0;
464  trackPixFloatDecorators[kTrkL2YDecor](*track) = 0.0;
465  trackPixFloatDecorators[kTrkL2ZDecor](*track) = 0.0;
466  }
467  if(!allExtrapolationsSucceded) ATH_MSG_WARNING("At least one extrapolation to a Pixel layer failed!");
468  }
469  else{
470  ATH_MSG_WARNING("No perigee TrackParameters found - filling positions on layers to (0,0,0)!");
471  //should decorate nonetheless, to make sure decorations are consistent across events
472  trackPixFloatDecorators[kTrkIBLXDecor](*track) = 0.0;
473  trackPixFloatDecorators[kTrkIBLYDecor](*track) = 0.0;
474  trackPixFloatDecorators[kTrkIBLZDecor](*track) = 0.0;
475  trackPixFloatDecorators[kTrkBLXDecor](*track) = 0.0;
476  trackPixFloatDecorators[kTrkBLYDecor](*track) = 0.0;
477  trackPixFloatDecorators[kTrkBLZDecor](*track) = 0.0;
478  trackPixFloatDecorators[kTrkL1XDecor](*track) = 0.0;
479  trackPixFloatDecorators[kTrkL1YDecor](*track) = 0.0;
480  trackPixFloatDecorators[kTrkL1ZDecor](*track) = 0.0;
481  trackPixFloatDecorators[kTrkL2XDecor](*track) = 0.0;
482  trackPixFloatDecorators[kTrkL2YDecor](*track) = 0.0;
483  trackPixFloatDecorators[kTrkL2ZDecor](*track) = 0.0;
484  }
485  }
486 
487  // -- Add Track states to the current track, filtering on their type
488  std::vector<const Trk::TrackStateOnSurface*> tsoss;
489  for (const auto *const trackState: *(trkTrack->trackStateOnSurfaces())){
490  //Get rid of any holes that already exist -- we are doing the search again
491  if( trackState->types()[Trk::TrackStateOnSurface::Hole] )
492  continue;
493  tsoss.push_back(trackState);
494  }
495 
496  std::unique_ptr<const Trk::TrackStates> holes;
497  if(m_storeHoles){
498  holes = std::unique_ptr<const Trk::TrackStates>( m_holeSearchTool->getHolesOnTrack(*trkTrack, trkTrack->info().particleHypothesis()) );
499  for (const auto *hole: *holes){
500  tsoss.push_back(hole);
501  }
502  if(trkTrack->perigeeParameters()){
503  Trk::TrackStateOnSurfaceComparisonFunction CompFunc( trkTrack->perigeeParameters()->momentum() );
504  stable_sort( tsoss.begin(), tsoss.end(), CompFunc );
505  } else {
506  ATH_MSG_ERROR("Track has no perigee parameters");
507  }
508  }
509 
510  //Loop over the TrkStateOnSurfaces
511  for (const auto& trackState: tsoss){
512 
513  //Only store Holes, Measurement & Outliers
514  if( !trackState->types()[Trk::TrackStateOnSurface::Hole] &&
515  !trackState->types()[Trk::TrackStateOnSurface::Measurement] &&
516  !trackState->types()[Trk::TrackStateOnSurface::Outlier] ) {
517  continue;
518  }
519 
520  // Check if we want to store this types of TSOS
521  if(!m_storeOutliers && trackState->types()[Trk::TrackStateOnSurface::Outlier] )
522  continue;
523 
524 
525  if(!m_storeHoles && trackState->types()[Trk::TrackStateOnSurface::Hole] )
526  continue;
527 
528  // Check that the surface has detector element
529  if(!trackState->surface().associatedDetectorElement()){
530  continue;
531  }
532 
533  // Check that the surface ID is valid
534  Identifier surfaceID = trackState->surface().associatedDetectorElement()->identify();
535  if( !surfaceID.is_valid() ){
536  ATH_MSG_WARNING("Invalid surface ID");
537  continue;
538  }
539 
540  //Determine what detector the hit is in
541  bool isPixel(false);
542  bool isSCT(false);
543  bool isTRT(false);
544 
545  if( m_idHelper->is_trt(surfaceID) ){
546  isTRT = true;
547  if(!m_storeTRT)
548  continue;
549  }else if( m_idHelper->is_sct(surfaceID) ){
550  isSCT = true;
551  if(!m_storeSCT)
552  continue;
553  }else if( m_idHelper->is_pixel(surfaceID) ){
554  isPixel = true;
555  if(!m_storePixel)
556  continue;
557  }
558 
559  if( !isPixel && !isSCT && !isTRT ){
560  continue;
561  }
562 
563  //Create new MSOS to fill with information
565 
566  //Put it in the obeject in the correct conatiner - one for each detector type.
567  if(isTRT){
568  //Add the msos to the container
569  msosTRT->push_back( msos );
570  //Set the det id
572  //Build the element link to the MSOS
573  ElementLink< xAOD::TrackStateValidationContainer > elink( *msosTRT, nTRT_MSOS );
574  elink.toPersistent();
575  msosLink.push_back(elink);
576  ++nTRT_MSOS;
577  }else if(isSCT){
578  //Add the msos to the container
579  msosSCT->push_back( msos );
580  //Set the det id
582  //Build the element link to the MSOS
583  ElementLink< xAOD::TrackStateValidationContainer > elink( *msosSCT, nSCT_MSOS );
584  elink.toPersistent();
585  msosLink.push_back(elink);
586  ++nSCT_MSOS;
587  }else if(isPixel){
588  //Add the msos to the container
589  msosPixel->push_back( msos );
590  //Set the det id
592  //Build the element link to the MSOS
593  ElementLink< xAOD::TrackStateValidationContainer > elink( *msosPixel, nPixelMSOS );
594  elink.toPersistent();
595  msosLink.push_back(elink);
596  ++nPixelMSOS;
597  }
598  else {
599  ATH_MSG_WARNING("NOT a pixel, SCT or TRT track state on surface.");
600  delete msos;
601  continue;
602  }
603 
604  //fill type
605  if( trackState->types()[Trk::TrackStateOnSurface::Hole] ){
607  } else if (trackState->types()[Trk::TrackStateOnSurface::Measurement]){
609  } else if ( trackState->types()[Trk::TrackStateOnSurface::Outlier] ) {
611  }
612 
613  //Fill surface id
614  msos->setDetElementId( surfaceID.get_compact() );
615 
616 
617  const Trk::TrackParameters* tp = trackState->trackParameters();
618 
619  // some more detailed hit info
620  double lTheta=-1000., lPhi=-1000.;
621  //Get the measurement base object
622  const Trk::MeasurementBase* measurement=trackState->measurementOnTrack();
623  static const SG::Accessor<float> errDCAcc("errDC");
624  errDCAcc(*msos) = -1 ;
625  const Trk::RIO_OnTrack* rotp = dynamic_cast<const Trk::RIO_OnTrack*>(measurement) ;
626  if (rotp) errDCAcc(*msos) = sqrt(rotp->localCovariance()(Trk::driftRadius, Trk::driftRadius)) ;
627 
628  if (m_storeTRT) {
629  const InDet::TRT_DriftCircleOnTrack *driftcircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(measurement);
630  static const SG::Accessor<float> HitZAcc("HitZ");
631  static const SG::Accessor<float> HitRAcc("HitR");
632  static const SG::Accessor<float> rTrkWireAcc("rTrkWire");
633  if (!measurement) {
634  HitZAcc(*msos)=-3000;
635  HitRAcc(*msos)=-1;
636  rTrkWireAcc(*msos)=-1;
637  }
638  else {
639  if (!driftcircle) {
640  HitZAcc(*msos)=-3000;
641  HitRAcc(*msos)=-1;
642  rTrkWireAcc(*msos)=-1;
643  }
644  else {
645  if (tp) {
646  const Amg::Vector3D& gp = driftcircle->globalPosition();
647  HitZAcc(*msos)=gp.z();
648  HitRAcc(*msos)=gp.perp();
649  rTrkWireAcc(*msos)= fabs(trackState->trackParameters()->parameters()[Trk::driftRadius]);
650  lTheta = trackState->trackParameters()->parameters()[Trk::theta];
651  lPhi = trackState->trackParameters()->parameters()[Trk::phi];
652  }
653  else {
654  HitZAcc(*msos) =driftcircle->associatedSurface().center().z();
655  HitRAcc(*msos) =driftcircle->associatedSurface().center().perp();
656  rTrkWireAcc(*msos)=0;
657  }
658  }
659  }
660  msos->setLocalAngles(lTheta, lPhi);
661 
662  bool isShared=false;
663  if (prd_to_track_map_cptr) {
664  const Trk::RIO_OnTrack* hit_trt = measurement ? dynamic_cast<const Trk::RIO_OnTrack*>(measurement) : nullptr;
665  if (hit_trt) {
666  if (prd_to_track_map_cptr->isShared(*(hit_trt->prepRawData())) ) isShared=true;
667  static const SG::Accessor<bool> isSharedAcc("isShared");
668  isSharedAcc(*msos) = isShared;
669  }
670  }
671  }
672 
673 
674  // Track extrapolation
675  std::unique_ptr<const Trk::TrackParameters> extrap( m_extrapolator->extrapolateTrack(ctx,*trkTrack,trackState->surface()) );
676 
677  // Set local positions on the surface
678  if (tp) {
679  msos->setLocalPosition( tp->parameters()[0], tp->parameters()[1] );
680 
681  if (extrap.get()) {
682  ATH_MSG_DEBUG(" Original position " << tp->parameters()[0] << " " << tp->parameters()[1]);
683  ATH_MSG_DEBUG("Extrapolated position " << extrap->parameters()[0] << " " << extrap->parameters()[1]);
684  }
685 
686  }
687  else {
688  if (extrap.get()) {
689  msos->setLocalPosition( extrap->parameters()[0], extrap->parameters()[1] );
690  }
691  else {
692  ATH_MSG_DEBUG("Track extrapolation failed.");
693  }
694  }
695 
696  // Set calculate local incident angles
697  const Trk::TrkDetElementBase *de = trackState->surface().associatedDetectorElement();
698  const InDetDD::SiDetectorElement *side = dynamic_cast<const InDetDD::SiDetectorElement *>(de);
699  if (side && (isSCT || isPixel)) {
700  const Amg::Vector3D& mynormal = side->normal();
701  const Amg::Vector3D& myphiax = side->phiAxis();
702  const Amg::Vector3D& myetaax = side->etaAxis();
703  if (tp) {
704  Amg::Vector3D mytrack = tp->momentum();
705  float trketacomp = mytrack.dot(myetaax);
706  float trkphicomp = mytrack.dot(myphiax);
707  float trknormcomp = mytrack.dot(mynormal);
708 
709  ATH_MSG_DEBUG(" Original incident angle " << trketacomp << " " << trkphicomp << " " << trknormcomp);
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  ATH_MSG_DEBUG("Extrapolated incident angle " << trketacompX << " " << trkphicompX << " " << trknormcompX);
716  }
717  msos->setLocalAngles( atan2(trketacomp,trknormcomp), atan2(trkphicomp,trknormcomp) );
718  }
719  else {
720  if (extrap.get()) {
721  Amg::Vector3D metrack = extrap->momentum();
722  float trketacompX = metrack.dot(myetaax);
723  float trkphicompX = metrack.dot(myphiax);
724  float trknormcompX = metrack.dot(mynormal);
725  msos->setLocalAngles( atan2(trketacompX,trknormcompX), atan2(trkphicompX,trknormcompX) );
726  }
727  }
728  }
729 
730  if(!measurement) { continue; }
731 
732  if (isTRT && !trtDCOffsets.isValid() && !trtDCs.isValid()) { continue; }
733  if (isSCT && !sctClusterOffsets.isValid() && !sctClusters.isValid()) { continue; }
734  if (isPixel && !pixelClusterOffsets.isValid() && !pixelClusters.isValid()) { continue; }
735 
736  const Trk::RIO_OnTrack* hit = measurement ? dynamic_cast<const Trk::RIO_OnTrack*>(measurement) : nullptr;
737 
738  if(!hit){
739  const Trk::CompetingRIOsOnTrack *crot = dynamic_cast<const Trk::CompetingRIOsOnTrack*>(measurement);
740  if(crot){
741  hit = &crot->rioOnTrack( crot->indexOfMaxAssignProb() );
742  }
743  }
744 
745  if(m_addPRD && hit){
746  // Build an element link to the xAOD PRD
747  const Trk::PrepRawData* prd = hit->prepRawData();
748  if(prd && prd->getHashAndIndex().isValid() ){
749  if(isTRT){
750  msos->setTrackMeasurementValidationLink( buildElementLink( prd, trtDCOffsets.cptr(), trtDCs.cptr()) );
751  }else if(isSCT){
752  msos->setTrackMeasurementValidationLink( buildElementLink( prd, sctClusterOffsets.cptr(), sctClusters.cptr()) );
753  }else if(isPixel){
754  msos->setTrackMeasurementValidationLink( buildElementLink( prd, pixelClusterOffsets.cptr(), pixelClusters.cptr()) );
755  }
756  }
757  }
758 
759  // Add the drift time for the tracks position -- note the position is biased
760  if (isTRT) {
761  TRTCond::RtRelation const *rtr = m_trtcaldbTool->getRtRelation(surfaceID);
762  if(rtr) {
763  static const SG::Accessor<float> driftTimeAcc("driftTime");
764  if (tp){
765  driftTimeAcc(*msos) = rtr->drifttime(fabs(tp->parameters()[0]));
766  }
767  else {
768  if (extrap.get()) {
769  driftTimeAcc(*msos) = rtr->drifttime(fabs(extrap->parameters()[0]));
770  }
771  }
772  }
773  }
774 
775  static const SG::Accessor<float> TrackError_biasedAcc("TrackError_biased");
776  static const SG::Accessor<float> TrackError_unbiasedAcc("TrackError_unbiased");
777  if (m_addPulls) {
778 
779  std::optional<Trk::ResidualPull> biased;
780  std::optional<Trk::ResidualPull> unbiased;
781  if (tp) {
782  biased= m_residualPullCalculator->residualPull(measurement, tp, Trk::ResidualPull::Biased);
783  if (m_storeTRT) TrackError_biasedAcc(*msos) = sqrt(fabs((*tp->covariance())(Trk::locX,Trk::locX)));
784 
785  if (m_storeTRT) TrackError_biasedAcc(*msos) = sqrt(fabs((*tp->covariance())(Trk::locX,Trk::locX)));
786  std::unique_ptr<const Trk::TrackParameters> unbiasedTp( m_updator->removeFromState(*tp, measurement->localParameters(), measurement->localCovariance()) );
787  if(unbiasedTp.get()) {
788  if (m_storeTRT) TrackError_unbiasedAcc(*msos) = sqrt(fabs((*unbiasedTp.get()->covariance())(Trk::locX,Trk::locX)));
789  unbiased = m_residualPullCalculator->residualPull(measurement, unbiasedTp.get(), Trk::ResidualPull::Unbiased);
790  }
791  }
792  else {
793  if (extrap.get()) {
794  if (m_storeTRT) TrackError_unbiasedAcc(*msos) = sqrt(fabs((*extrap.get()->covariance())(Trk::locX,Trk::locX)));
795  biased = m_residualPullCalculator->residualPull(measurement, extrap.get(), Trk::ResidualPull::Biased);
796  unbiased = m_residualPullCalculator->residualPull(measurement, extrap.get(), Trk::ResidualPull::Unbiased);
797  }
798  }
799 
800  if (biased) {
801  if(biased->dimension()>Trk::locY){
802  msos->setBiasedResidual( biased->residual()[Trk::locX], biased->residual()[Trk::locY] );
803  msos->setBiasedPull( biased->pull()[Trk::locX], biased->pull()[Trk::locY] );
804  } else {
805  msos->setBiasedResidual( biased->residual()[Trk::locX], 0 );
806  msos->setBiasedPull( biased->pull()[Trk::locX], 0 );
807  }
808  }
809 
810  if (unbiased) {
811  if(unbiased->dimension()>Trk::locY){
812  msos->setUnbiasedResidual( unbiased->residual()[Trk::locX], unbiased->residual()[Trk::locY] );
813  msos->setUnbiasedPull( unbiased->pull()[Trk::locX], unbiased->pull()[Trk::locY] );
814  } else {
815  msos->setUnbiasedResidual( unbiased->residual()[Trk::locX], 0 );
816  msos->setUnbiasedPull( unbiased->pull()[Trk::locX], 0 );
817  }
818  }
819 
820  }
821 
822  } //end loop over TSOS's
823 
824  ATH_MSG_DEBUG("The number of TSOS's " << msosLink.size() );
825 
826  dectsos_msosLink( *track ) = msosLink;
827 
828  ATH_MSG_DEBUG("Finished dressing TrackParticle");
829 
830 
831  } // end of loop over tracks
832  return StatusCode::SUCCESS;
833  }
834 
835 
837  const std::vector<unsigned int>* offsets,
838  const xAOD::TrackMeasurementValidationContainer* xaodPrdCont) const
839  {
840 
841  const IdentContIndex& contIndex = prd->getHashAndIndex();
842  if( contIndex.collHash() >= offsets->size() ){
843  ATH_MSG_ERROR(" Offsets are incorrect " << contIndex.collHash() << " " << offsets->size() <<" "<< contIndex.objIndex());
844  return {0,0};
845  }
846 
847  unsigned int xaodIndex = offsets->at( contIndex.collHash() ) + contIndex.objIndex();
849  el.toPersistent();
850 
851  return el;
852 
853  }
854 
855 
856 }
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:760
DerivationFramework::TrackStateOnSurfaceDecorator::m_residualPullCalculator
ToolHandle< Trk::IResidualPullCalculator > m_residualPullCalculator
Definition: TrackStateOnSurfaceDecorator.h:125
DerivationFramework::TrackStateOnSurfaceDecorator::kNPixFloatDecor
@ kNPixFloatDecor
Definition: TrackStateOnSurfaceDecorator.h:143
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
Pass the thinning service
Definition: TrackStateOnSurfaceDecorator.cxx:216
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkIBLYDecor
@ kTrkIBLYDecor
Definition: TrackStateOnSurfaceDecorator.h:139
Trk::TrackState::Pixel
@ Pixel
Definition: TrackStateDefs.h:28
DerivationFramework::TrackStateOnSurfaceDecorator::m_pixelMapName
SG::ReadHandleKey< std::vector< unsigned int > > m_pixelMapName
Definition: TrackStateOnSurfaceDecorator.h:90
DerivationFramework::TrackStateOnSurfaceDecorator::kTRTusedHitsDecor
@ kTRTusedHitsDecor
Definition: TrackStateOnSurfaceDecorator.h:134
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
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
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:135
TrackStateValidationAuxContainer.h
TrackParameters.h
Trk::TrackState::TRT
@ TRT
Definition: TrackStateDefs.h:30
Trk::locX
@ locX
Definition: ParamDefs.h:43
ComTime::getTime
double getTime() const
Definition: ComTime.h:44
CompetingRIOsOnTrack.h
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:44
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:770
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:70
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
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:87
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:94
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...
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:142
ParticleTest.tp
tp
Definition: ParticleTest.py:25
xAOD::TrackStateValidation_v1
Class describing a TrackStateValidation.
Definition: TrackStateValidation_v1.h:28
TrackStateOnSurfaceComparisonFunction.h
DerivationFramework::TrackStateOnSurfaceDecorator::m_isSimulation
bool m_isSimulation
Definition: TrackStateOnSurfaceDecorator.h:67
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:128
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_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: TrackStateOnSurfaceDecorator.h:127
AtlasDetectorID::is_trt
bool is_trt(Identifier id) const
Definition: AtlasDetectorID.h:782
DerivationFramework::TrackStateOnSurfaceDecorator::m_sctClustersName
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_sctClustersName
Definition: TrackStateOnSurfaceDecorator.h:99
DerivationFramework::TrackStateOnSurfaceDecorator::buildElementLink
ElementLink< xAOD::TrackMeasurementValidationContainer > buildElementLink(const Trk::PrepRawData *, const std::vector< unsigned int > *, const xAOD::TrackMeasurementValidationContainer *) const
Definition: TrackStateOnSurfaceDecorator.cxx:836
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
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
DerivationFramework::TrackStateOnSurfaceDecorator::TrackStateOnSurfaceDecorator
TrackStateOnSurfaceDecorator(const std::string &t, const std::string &n, const IInterface *p)
Definition: TrackStateOnSurfaceDecorator.cxx:64
DerivationFramework::TrackStateOnSurfaceDecorator::m_trtId
const TRT_ID * m_trtId
Definition: TrackStateOnSurfaceDecorator.h:122
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:141
PrepRawData.h
DerivationFramework::TrackStateOnSurfaceDecorator::m_sctMapName
SG::ReadHandleKey< std::vector< unsigned int > > m_sctMapName
Definition: TrackStateOnSurfaceDecorator.h:92
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkL2ZDecor
@ kTrkL2ZDecor
Definition: TrackStateOnSurfaceDecorator.h:142
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
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:119
Track.h
DerivationFramework::TrackStateOnSurfaceDecorator::m_sctMsosName
SG::WriteHandleKey< xAOD::TrackStateValidationContainer > m_sctMsosName
Definition: TrackStateOnSurfaceDecorator.h:109
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:137
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
DerivationFramework::TrackStateOnSurfaceDecorator::m_addExtraEventInfo
bool m_addExtraEventInfo
Definition: TrackStateOnSurfaceDecorator.h:77
Trk::PropDirection
PropDirection
Definition: PropDirection.h:19
DerivationFramework::TrackStateOnSurfaceDecorator::m_prdToTrackMap
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
Definition: TrackStateOnSurfaceDecorator.h:104
DerivationFramework::TrackStateOnSurfaceDecorator::kTRTusedHits_noHT_divByLDecor
@ kTRTusedHits_noHT_divByLDecor
Definition: TrackStateOnSurfaceDecorator.h:136
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkBLYDecor
@ kTrkBLYDecor
Definition: TrackStateOnSurfaceDecorator.h:140
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkBLZDecor
@ kTrkBLZDecor
Definition: TrackStateOnSurfaceDecorator.h:140
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
TRTCond::RtRelation::drifttime
virtual float drifttime(float radius) const =0
drifttime for given radius
Trk::theta
@ theta
Definition: ParamDefs.h:72
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkL1ZDecor
@ kTrkL1ZDecor
Definition: TrackStateOnSurfaceDecorator.h:141
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:59
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:99
Trk::pion
@ pion
Definition: ParticleHypothesis.h:29
DerivationFramework::TrackStateOnSurfaceDecorator::m_storeOutliers
bool m_storeOutliers
Definition: TrackStateOnSurfaceDecorator.h:70
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkBLXDecor
@ kTrkBLXDecor
Definition: TrackStateOnSurfaceDecorator.h:140
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
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework::TrackStateOnSurfaceDecorator::m_pixelLayerRadii
Gaudi::Property< std::vector< float > > m_pixelLayerRadii
Definition: TrackStateOnSurfaceDecorator.h:146
DerivationFramework::TrackStateOnSurfaceDecorator::m_TRTdEdxTool
ToolHandle< ITRT_ToT_dEdx > m_TRTdEdxTool
Definition: TrackStateOnSurfaceDecorator.h:130
ITRT_CalDbTool.h
abstract interface to TRT calibration constants
Trk::ParametersBase
Definition: ParametersBase.h:55
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkIBLXDecor
@ kTrkIBLXDecor
Definition: TrackStateOnSurfaceDecorator.h:139
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:133
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
DerivationFramework::TrackStateOnSurfaceDecorator::m_trackTRTFloatDecorKeys
std::vector< SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > > m_trackTRTFloatDecorKeys
Definition: TrackStateOnSurfaceDecorator.h:138
DerivationFramework::TrackStateOnSurfaceDecorator::m_storeHoles
bool m_storeHoles
Definition: TrackStateOnSurfaceDecorator.h:69
DerivationFramework::TrackStateOnSurfaceDecorator::m_updator
ToolHandle< Trk::IUpdator > m_updator
Definition: TrackStateOnSurfaceDecorator.h:124
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:115
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:210
IPRD_AssociationTool.h
DerivationFramework::TrackStateOnSurfaceDecorator::m_addPRD
bool m_addPRD
Definition: TrackStateOnSurfaceDecorator.h:76
Trk::PrepRawData
Definition: PrepRawData.h:62
DerivationFramework::TrackStateOnSurfaceDecorator::m_trackTSOSMOSLinkDecorKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_trackTSOSMOSLinkDecorKey
Definition: TrackStateOnSurfaceDecorator.h:145
Trk::MeasurementBase
Definition: MeasurementBase.h:58
IdentContIndex::objIndex
unsigned short objIndex() const
object index in collection
Definition: IdentContIndex.h:92
DerivationFramework::TrackStateOnSurfaceDecorator::m_addSurfaceInfo
bool m_addSurfaceInfo
Definition: TrackStateOnSurfaceDecorator.h:75
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
DerivationFramework::TrackStateOnSurfaceDecorator::m_storeSCT
bool m_storeSCT
Definition: TrackStateOnSurfaceDecorator.h:72
DerivationFramework::TrackStateOnSurfaceDecorator::m_storeTRT
bool m_storeTRT
Definition: TrackStateOnSurfaceDecorator.h:71
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:126
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:121
SiDetectorElement.h
TrackStateValidationContainer.h
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
IResidualPullCalculator.h
DerivationFramework::TrackStateOnSurfaceDecorator::m_addPulls
bool m_addPulls
Definition: TrackStateOnSurfaceDecorator.h:74
Trk::PrepRawData::getHashAndIndex
const IdentContIndex & getHashAndIndex() const
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:76
DerivationFramework::TrackStateOnSurfaceDecorator::m_sgName
Gaudi::Property< std::string > m_sgName
Definition: TrackStateOnSurfaceDecorator.h:83
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:111
DerivationFramework::TrackStateOnSurfaceDecorator::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: TrackStateOnSurfaceDecorator.h:81
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.
Identifier::get_compact
value_type get_compact(void) const
Get the compact id.
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
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:144
DerivationFramework::TrackStateOnSurfaceDecorator::initialize
StatusCode initialize()
Definition: TrackStateOnSurfaceDecorator.cxx:102
DerivationFramework::TrackStateOnSurfaceDecorator::m_pixelMsosName
SG::WriteHandleKey< xAOD::TrackStateValidationContainer > m_pixelMsosName
Definition: TrackStateOnSurfaceDecorator.h:107
DerivationFramework::TrackStateOnSurfaceDecorator::m_pixelClustersName
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_pixelClustersName
Definition: TrackStateOnSurfaceDecorator.h:97
TrackMeasurementValidationContainer.h
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:81
DerivationFramework::TrackStateOnSurfaceDecorator::m_trtPhaseDecorKey
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_trtPhaseDecorKey
Definition: TrackStateOnSurfaceDecorator.h:132
TrackStateOnSurfaceDecorator.h
xAOD::TrackStateValidation_v1::setTrackMeasurementValidationLink
void setTrackMeasurementValidationLink(ElementLink< xAOD::TrackMeasurementValidationContainer > trackMeasurementValidationLink)
sets the link to the TrackMeasurementValidationContainer
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
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
AthAlgTool
Definition: AthAlgTool.h:26
Trk::CompetingRIOsOnTrack::indexOfMaxAssignProb
unsigned int indexOfMaxAssignProb() const
Index of the ROT with the highest assignment probability.
Definition: CompetingRIOsOnTrack.cxx:101
Trk::removeNoise
@ removeNoise
Definition: MaterialUpdateMode.h:20
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkIBLZDecor
@ kTrkIBLZDecor
Definition: TrackStateOnSurfaceDecorator.h:139
DerivationFramework::TrackStateOnSurfaceDecorator::kTrkL2YDecor
@ kTrkL2YDecor
Definition: TrackStateOnSurfaceDecorator.h:142
DerivationFramework::TrackStateOnSurfaceDecorator::m_storePixel
bool m_storePixel
Definition: TrackStateOnSurfaceDecorator.h:73
DerivationFramework::TrackStateOnSurfaceDecorator::m_trtDCName
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_trtDCName
Definition: TrackStateOnSurfaceDecorator.h:101
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:85
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:141
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:120