ATLAS Offline Software
Loading...
Searching...
No Matches
RIO_OnTrackCreator.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// RIO_OnTrackCreator.cxx
7// AlgTool for adapting a RIO to a track candidate. It
8// automatically selects the corresponding subdet correction.
10// (c) ATLAS Detector software
12// 2004 - now: Wolfgang Liebig <http://consult.cern.ch/xwho/people/54608>
14
15// --- the base class
20// --- Gaudi stuff
21#include "GaudiKernel/TypeNameString.h"
23#include "Identifier/Identifier.h"
24
25// destructor
27
28// initialise
30
31 if (m_mode == "all") {
33 } else if (m_mode == "indet") {
35 } else if (m_mode == "muon") {
37 } else {
39 }
40
42 ATH_MSG_FATAL("Mode is set to unknown value " << m_mode);
43 return StatusCode::FAILURE;
44 }
45
46 ATH_MSG_INFO("Mode is set to :" <<m_mode);
47 const bool doId = m_enumMode == Mode::all || m_enumMode == Mode::indet;
48 const bool doMuon = m_enumMode == Mode::all || m_enumMode == Mode::muon;
49 ATH_CHECK(m_pixClusCor.retrieve(EnableTool{!m_pixClusCor.empty() && doId}));
50 ATH_CHECK(m_sctClusCor.retrieve(EnableTool{!m_sctClusCor.empty() && doId}));
51 ATH_CHECK(m_trt_Cor.retrieve(EnableTool{!m_trt_Cor.empty() && doId}));
52
53 ATH_CHECK(m_muonDriftCircleCor.retrieve(EnableTool{!m_muonDriftCircleCor.empty() && doMuon}));
54 ATH_CHECK(m_muonClusterCor.retrieve(EnableTool{!m_muonClusterCor.empty() && doMuon}));
55 return StatusCode::SUCCESS;
56}
57
58// The sub-detector brancher algorithm
61 const TrackParameters& trk,
62 const EventContext& ctx) const{
63
64
65 // --- print RIO
66 ATH_MSG_VERBOSE ("RIO ID prints as "<<rio);
67 ATH_MSG_VERBOSE ("RIO.locP = "<<Amg::toString(rio.localPosition()));
68 switch (rio.prdType()) {
69 using enum Trk::PrepRawDataType;
70 case PixelCluster:
71 if (m_pixClusCor.isEnabled()) {
72 return m_pixClusCor->correct(rio, trk, ctx);
73 }
74 break;
75 case SCT_Cluster:
76 if (m_sctClusCor.isEnabled()) {
77 return m_sctClusCor->correct(rio, trk, ctx);
78 }
79 break;
80 case TRT_DriftCircle:
81 if (m_trt_Cor.isEnabled()){
82 return m_trt_Cor->correct(rio, trk, ctx);
83 }
84 break;
85 case MdtPrepData:
86 if (m_muonDriftCircleCor.isEnabled()) {
87 return m_muonDriftCircleCor->correct(rio, trk, ctx);
88 }
89 break;
90 case RpcPrepData:
91 case TgcPrepData:
92 case sTgcPrepData:
93 case MMPrepData:
94 case CscPrepData:
95 if (m_muonClusterCor.isEnabled()) {
96 return m_muonClusterCor->correct(rio, trk, ctx);
97 }
98 break;
99 case HGTD_Cluster:
100 ATH_MSG_WARNING("HGTD is not implemented yet");
101 break;
102 case CscStripPrepData:
103 case PlanarCluster:
104 case SiCluster:
105 ATH_MSG_WARNING("Cannot associate prd to a technology ROT creator "<<rio);
106 break;
107 }
108 ATH_MSG_WARNING("No ROT creator active for PRD "<<rio);
109 return nullptr;
110}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
const Amg::Vector2D & localPosition() const
return the local position reference
virtual PrepRawDataType prdType() const =0
Interface method returning the prdType.
ToolHandle< IRIO_OnTrackCreator > m_sctClusCor
Detector-specific helper tool, performing the actual calibration corrections for every InDet::SCT_Clu...
RIO_OnTrack * correct(const PrepRawData &rio, const TrackParameters &pars, const EventContext &ctx) const override final
the master method for going from RIO to ROT.
ToolHandle< IRIO_OnTrackCreator > m_trt_Cor
Detector-specific helper tool, performing the actual calibration corrections for every InDet::TRT::Dr...
ToolHandle< IRIO_OnTrackCreator > m_muonClusterCor
Detector-specific helper tool, performing the actual calibration corrections for the remaining muon d...
Gaudi::Property< std::string > m_mode
flag: can be 'all', 'indet' or 'muon'
ToolHandle< IRIO_OnTrackCreator > m_muonDriftCircleCor
Detector-specific helper tool, performing the actual calibration corrections for every Muon::MdtPrepD...
virtual StatusCode initialize() override
get specific ROT tools and the AtlasIdHelper
ToolHandle< IRIO_OnTrackCreator > m_pixClusCor
Detector-specific helper tool, performing the actual calibration corrections for every InDet::PixelCl...
virtual ~RIO_OnTrackCreator()
virtual destructor
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Definition RIO_OnTrack.h:70
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
PrepRawDataType
Definition PrepRawData.h:39
ParametersBase< TrackParametersDim, Charged > TrackParameters