ATLAS Offline Software
TRT_DriftCircleOnTrackUniversalTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // Implementation file for class TRT_DriftCircleOnTrackUniversalTool
8 // (c) ATLAS Detector software
10 // AlgTool used for TRT_DriftCircleOnTrack object production
12 
13 
16 
18 // Constructor
20 
22 (const std::string& ty,const std::string& na,const IInterface* pa)
23  : AthAlgTool(ty,na,pa)
24 {
25  declareInterface<IRIO_OnTrackCreator>(this);
26 }
27 
29 // Destructor
31 
33 
35 // Initialisation
37 
39 {
41 
42  if(m_riontrackTube.retrieve().isFailure()){
43  msg(MSG::FATAL) << "Failed to retrieve tool " << m_riontrackTube << endmsg;
44  return StatusCode::FAILURE;
45  }
46 
47  if(m_riontrackDrift.retrieve().isFailure()){
48  msg(MSG::FATAL) << "Failed to retrieve tool " << m_riontrackDrift << endmsg;
49  return StatusCode::FAILURE;
50  }
51 
52  return sc;
53 }
54 
56 // Finalize
58 
60 {
61  StatusCode sc = AlgTool::finalize(); return sc;
62 }
63 
65 // Trk::TRT_DriftCircleOnTrack production
67 
69 (const Trk::PrepRawData& rio,const Trk::TrackParameters& TP,const EventContext& ctx) const
70 {
71  const InDet::TRT_DriftCircle* DC = dynamic_cast<const InDet::TRT_DriftCircle*>(&rio);
72  if(!DC) return nullptr;
73 
74  Trk::RIO_OnTrack *rot=nullptr;
75 
76  //now decide about tube or precision hit
77 
79  double driftradius = DC->localPosition()[Trk::driftRadius];
80  double distance2 = fabs(TP.parameters()[0])-driftradius; distance2 *= distance2;
81 
82 
83  if(distance2 > error2){
84  //tube hit
85  rot=m_riontrackTube->correct(rio,TP,ctx);
86  }else {
87  //precision hit
88  rot=m_riontrackDrift->correct(rio,TP,ctx);
89  }
90 
91  return rot;
92 }
93 
94 
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
InDet::TRT_DriftCircleOnTrackUniversalTool::correct
virtual Trk::RIO_OnTrack * correct(const Trk::PrepRawData &, const Trk::TrackParameters &, const EventContext &ctx=Gaudi::Hive::currentContext()) const override
abstract base method for the creation of RIO_OnTrack it takes a RIO (PrepRawData) and the given Track...
Definition: TRT_DriftCircleOnTrackUniversalTool.cxx:69
initialize
void initialize()
Definition: run_EoverP.cxx:894
Trk::PrepRawData::localCovariance
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
InDet::TRT_DriftCircleOnTrackUniversalTool::~TRT_DriftCircleOnTrackUniversalTool
virtual ~TRT_DriftCircleOnTrackUniversalTool()
InDet::TRT_DriftCircle
Definition: TRT_DriftCircle.h:32
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
InDet::TRT_DriftCircleOnTrackUniversalTool::finalize
virtual StatusCode finalize() override
Definition: TRT_DriftCircleOnTrackUniversalTool.cxx:59
InDet::TRT_DriftCircleOnTrackUniversalTool::m_riontrackDrift
ToolHandle< Trk::IRIO_OnTrackCreator > m_riontrackDrift
Definition: TRT_DriftCircleOnTrackUniversalTool.h:55
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk::driftRadius
@ driftRadius
trt, straws
Definition: ParamDefs.h:53
Trk::ParametersBase
Definition: ParametersBase.h:55
TRT_DriftCircleOnTrack.h
InDet::TRT_DriftCircleOnTrackUniversalTool::TRT_DriftCircleOnTrackUniversalTool
TRT_DriftCircleOnTrackUniversalTool(const std::string &, const std::string &, const IInterface *)
Definition: TRT_DriftCircleOnTrackUniversalTool.cxx:22
Trk::PrepRawData
Definition: PrepRawData.h:62
TRT_DriftCircleOnTrackUniversalTool.h
InDet::TRT_DriftCircleOnTrackUniversalTool::m_scalefactor
DoubleProperty m_scalefactor
Definition: TRT_DriftCircleOnTrackUniversalTool.h:58
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
InDet::TRT_DriftCircleOnTrackUniversalTool::initialize
virtual StatusCode initialize() override
Definition: TRT_DriftCircleOnTrackUniversalTool.cxx:38
InDet::TRT_DriftCircleOnTrackUniversalTool::m_riontrackTube
ToolHandle< Trk::IRIO_OnTrackCreator > m_riontrackTube
Definition: TRT_DriftCircleOnTrackUniversalTool.h:57
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
Amg::distance2
float distance2(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the squared distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:48
AthAlgTool
Definition: AthAlgTool.h:26