ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
HighGranularityTimingDetector
HGTD_Reconstruction
HGTD_RecTools
src
StraightLineTOFcorrectionTool.cxx
Go to the documentation of this file.
1
10
11
#include "
StraightLineTOFcorrectionTool.h
"
12
13
#include "GaudiKernel/PhysicalConstants.h"
14
#include "
HGTD_PrepRawData/HGTD_Cluster.h
"
15
#include "
HGTD_ReadoutGeometry/HGTD_DetectorElement.h
"
16
#include "
TrkTrack/Track.h
"
17
18
HGTD::StraightLineTOFcorrectionTool::StraightLineTOFcorrectionTool
(
19
const
std::string& t,
const
std::string& n,
const
IInterface* p)
20
: base_class(t, n, p) {}
21
22
StatusCode
HGTD::StraightLineTOFcorrectionTool::initialize
() {
23
24
ATH_CHECK
(AlgTool::initialize());
25
26
ATH_CHECK
(detStore()->retrieve(
m_hgtd_det_mgr
,
"HGTD"
));
27
28
return
StatusCode::SUCCESS;
29
}
30
31
std::pair<float, float>
32
HGTD::StraightLineTOFcorrectionTool::correctTimeAndResolution
(
33
const
Trk::Track
& track,
const
HGTD_Cluster
& cluster,
34
const
float
time_of_arrival,
const
float
time_of_arrival_err)
const
{
35
36
ATH_MSG_DEBUG
(
"Correcting input time: "
<< time_of_arrival);
37
38
// FIXME: This should work with 'globalPosition' of the cluster alone, but no
39
// det element set during P->T conversion!
40
const
InDetDD::HGTD_DetectorElement
* det_el =
41
m_hgtd_det_mgr
->getDetectorElement(cluster.
identify
());
42
43
// get the distance between the track origin and the hit position
44
const
Trk::Perigee
* perigee = track.perigeeParameters();
45
Amg::Vector3D
glob_hit_pos = det_el->
globalPosition
(cluster.
localPosition
());
46
47
float
dx = glob_hit_pos.x() - perigee->
position
().x();
48
float
dy = glob_hit_pos.y() - perigee->
position
().y();
49
float
dz = glob_hit_pos.z() - perigee->
position
().z();
50
51
// compute TOF between origin and hit position
52
// FIXME define 1/c somewhere as constexpr?
53
// FIXME since this is an approximation anyway, can we use a fast sqrt?
54
float
tof = std::sqrt(dx * dx + dy * dy + dz * dz) / Gaudi::Units::c_light;
55
float
corrected_toa = time_of_arrival - tof;
56
57
ATH_MSG_DEBUG
(
"Corrected time: "
<< corrected_toa);
58
59
// TODO
60
// the intrinsic resolution on the time of arrival needs to be combined
61
// with the impact parameter resolution and the spatial resolution of the
62
// cluster. no large impact is expected though
63
64
return
{corrected_toa, time_of_arrival_err};
65
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
HGTD_Cluster.h
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration.
HGTD_DetectorElement.h
StraightLineTOFcorrectionTool.h
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration.
Track.h
HGTD::StraightLineTOFcorrectionTool::m_hgtd_det_mgr
const HGTD_DetectorManager * m_hgtd_det_mgr
Definition
StraightLineTOFcorrectionTool.h:48
HGTD::StraightLineTOFcorrectionTool::correctTimeAndResolution
virtual std::pair< float, float > correctTimeAndResolution(const Trk::Track &track, const HGTD_Cluster &cluster, const float time_of_arrival, const float time_of_arrival_err) const override final
Definition
StraightLineTOFcorrectionTool.cxx:32
HGTD::StraightLineTOFcorrectionTool::initialize
virtual StatusCode initialize() override final
Definition
StraightLineTOFcorrectionTool.cxx:22
HGTD::StraightLineTOFcorrectionTool::StraightLineTOFcorrectionTool
StraightLineTOFcorrectionTool(const std::string &, const std::string &, const IInterface *)
Definition
StraightLineTOFcorrectionTool.cxx:18
HGTD_Cluster
Definition
HGTD_Cluster.h:35
InDetDD::HGTD_DetectorElement
Class to hold geometrical description of an HGTD detector element.
Definition
HGTD_DetectorElement.h:40
InDetDD::SolidStateDetectorElementBase::globalPosition
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
Trk::Track
The ATLAS Track class.
Definition
Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Trk::Perigee
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
Definition
Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:33
Generated on
for ATLAS Offline Software by
1.17.0