ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_DriftFunctionTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7// TRT_DriftFunctionTool.h
8// Header file for class TRT_DriftFunctionTool
10// (c) ATLAS Detector software
12// AlgTool used to go from drift time to drift distance
14
15#ifndef TRT_DRIFTFUNCTIONTOOL
16#define TRT_DRIFTFUNCTIONTOOL
17
18#include <string>
22class TRT_ID;
23
24
26#include "GaudiKernel/ToolHandle.h"
27
28#include "CLHEP/Units/SystemOfUnits.h"
29
37class TRT_DriftFunctionTool: public extends<AthAlgTool, ITRT_DriftFunctionTool>{
38
39public:
41 TRT_DriftFunctionTool(const std::string& type,
42 const std::string& name,
43 const IInterface* parent);
44
47
49 virtual StatusCode initialize() override;
50
52 virtual StatusCode finalize() override;
53
55 virtual bool isValidTime(double drifttime) const override;
56
59 virtual double rawTime(int tdcvalue) const override;
60
61
65 virtual double driftRadius(double rawtime, Identifier id, double& t0, bool& isOK, unsigned int word=0) const override;
66
69 virtual double driftRadius(double drifttime) const override;
70
72 virtual double approxDriftTime(double driftradius) const override;
73
75 virtual double errorOfDriftRadius(double drifttime, Identifier id, float mu = -10, unsigned int word=0) const override;
76
78 virtual double driftTimeToTCorrection(double tot, Identifier id, bool isArgonStraw=false) const override;
79
81 virtual double driftTimeHTCorrection(Identifier id, bool isArgonStraw=false) const override;
82
84 void setupRtRelation();
85
86
87private:
88
90 ToolHandle< ITRT_CalDbTool > m_TRTCalDbTool {this, "TRTCalDbTool", "TRT_CalDbTool"};
91 ToolHandle< ITRT_CalDbTool > m_TRTCalDbTool2{this, "TRTCalDbTool2", ""};
92
95 const TRT_ID* m_trtid{};
96
97 static constexpr double s_drifttimeperbin = 3.125 * CLHEP::ns;
98
99 enum ETimeBins { MaxTimeBin = 50 } ;
102
103 BooleanProperty m_isMC{this, "IsMC", true};
104 BooleanProperty m_isDataOverlay{this, "IsDataOverlay", false};
105 BooleanProperty m_dummy{this, "DummyMode", false,
106 "flag for ignoring drift time info"};
107
108 bool m_istestbeam = false;
109
110 DoubleProperty m_err_fudge{this, "ErrorFudgeFactor", 1.0,
111 "fudge_factor for error scaling"};
112
114 {this, "T0BarrelShift", true};
115
117 {this, "ForceUniversalErrors", false};
118 DoubleProperty m_uni_error{this, "UniversalError", 0.136};
119
120 std::string m_key = "";
121 StringProperty m_trt_mgr_location
122 {this, "TrtDescrManageLocation", "TRT", "Name of TRT detector manager"};
123
124 double m_t0_barrel[3]{};
125 double m_t0_endcap[18]{};
126 double m_t0_shift;
127
128 DoubleProperty m_ht_correction_barrel_Xe{this, "HTCorrectionBarrelXe", 0.,
129 "HT correction for Xe straws in barrel"};
130 DoubleProperty m_ht_correction_endcap_Xe{this, "HTCorrectionEndcapXe", 0.,
131 "HT correction for Xe straws in endcaps"};
132 DoubleProperty m_ht_correction_barrel_Ar{this, "HTCorrectionBarrelAr", 0.,
133 "HT correction for Ar straws in barrel"};
134 DoubleProperty m_ht_correction_endcap_Ar{this, "HTCorrectionEndcapAr", 0.,
135 "HT correction for Ar straws in endcaps"};
136
137 DoubleArrayProperty m_tot_corrections_barrel_Xe
138 {this, "ToTCorrectionsBarrelXe", {},
139 "ToT corrections for 20 ToT bins in Xe barrel straws"};
140 DoubleArrayProperty m_tot_corrections_endcap_Xe
141 {this, "ToTCorrectionsEndcapXe", {},
142 "ToT corrections for 20 ToT bins in Xe endcap straws"};
143 DoubleArrayProperty m_tot_corrections_barrel_Ar
144 {this, "ToTCorrectionsBarrelAr", {},
145 "ToT corrections for 20 ToT bins in Ar barrel straws"};
146 DoubleArrayProperty m_tot_corrections_endcap_Ar
147 {this, "ToTCorrectionsEndcapAr", {},
148 "ToT corrections for 20 ToT bins in Ar endcap straws"};
149
150 static const size_t s_size_default = 19;
151 static constexpr double s_radius_default[s_size_default] = {
152 0. , 0. , 0.1 , 0.262, 0.466,
153 0.607, 0.796, 0.931, 1.065, 1.212,
154 1.326, 1.466, 1.585, 1.689, 1.809,
155 1.880, 1.940, 1.950, 1.955 };
156 static constexpr double s_errors_default[s_size_default] = {
157 0.15, 0.15, 0.20, 0.23, 0.21,
158 0.18, 0.17, 0.16, 0.15, 0.15,
159 0.14, 0.13, 0.12, 0.11, 0.11,
160 0.11, 0.13, 0.20, 0.20 };
161
162 static const size_t s_size_Comm = 13;
163 static constexpr double s_radius_Comm[s_size_Comm] = {
164 0. , 0. , 0. , 0.252054, 0.488319,
165 0.751514, 1.00173, 1.21851, 1.40886 , 1.68368 ,
166 1.85363 , 1.91764, 1.94114 };
167 static constexpr double s_errors_Comm[s_size_Comm] = {
168 0.10440061, 0.1510298, 0.26130742, 0.260436, 0.246961,
169 0.226037, 0.18272 , 0.195482 , 0.213817, 0.157627,
170 0.0922559, 0.0463124, 0.0480864 };
171
172};
173
174inline bool TRT_DriftFunctionTool::isValidTime(double drifttime) const
175{ return (drifttime>-10. && drifttime<75.); }
176
177inline double TRT_DriftFunctionTool::rawTime(int tdcvalue) const
178{
179 double time = (tdcvalue+0.5)*s_drifttimeperbin ;
180 return m_istestbeam ? 0.5*time : time;
181}
182
183
184#endif // TRT_DRIFTFUNCTIONTOOL_H
185
abstract interface to TRT calibration constants
static Double_t t0
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
static constexpr double s_errors_default[s_size_default]
std::string m_key
GeoModel version key.
virtual StatusCode finalize() override
Finalize.
DoubleArrayProperty m_tot_corrections_barrel_Xe
virtual bool isValidTime(double drifttime) const override
Returns True for drifttimes between -10 and 75ns.
double m_errors[MaxTimeBin]
width of radius dist in each bin
static constexpr double s_radius_Comm[s_size_Comm]
virtual double errorOfDriftRadius(double drifttime, Identifier id, float mu=-10, unsigned int word=0) const override
Time-dependent error of drift radius in mm.
DoubleProperty m_ht_correction_barrel_Ar
double m_radius[MaxTimeBin]
most probable radius in each bin
virtual ~TRT_DriftFunctionTool()
Destructor.
DoubleProperty m_ht_correction_endcap_Ar
static constexpr double s_errors_Comm[s_size_Comm]
DoubleArrayProperty m_tot_corrections_endcap_Ar
DoubleProperty m_ht_correction_barrel_Xe
const InDetDD::TRT_DetectorManager * m_manager
DetectorManager and helper.
virtual double approxDriftTime(double driftradius) const override
Returns approximate drift time (t0 subtracted)
double m_t0_shift
digiversion dependent t0 shift
void setupRtRelation()
Initialise Rt relation.
DoubleArrayProperty m_tot_corrections_endcap_Xe
static const size_t s_size_default
BooleanProperty m_force_universal_errors
use one universal error
TRT_DriftFunctionTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
static const size_t s_size_Comm
DoubleProperty m_ht_correction_endcap_Xe
virtual StatusCode initialize() override
Retrieves needed services.
virtual double driftRadius(double rawtime, Identifier id, double &t0, bool &isOK, unsigned int word=0) const override
Returns drift radius in mm and t0 in ns The radius is truncated so it belongs to [0,...
ToolHandle< ITRT_CalDbTool > m_TRTCalDbTool
Tool to fetch data from database.
static constexpr double s_drifttimeperbin
double m_t0_endcap[18]
t0 for the 14(18) endcap wheels
BooleanProperty m_enable_t0_barrel_shift
enable T0 barrel shift
virtual double driftTimeHTCorrection(Identifier id, bool isArgonStraw=false) const override
Returns high threshold correction to the drift time (ns)
virtual double rawTime(int tdcvalue) const override
Returns center of leading edge bin in ns for bin number = tdcvalue.
ToolHandle< ITRT_CalDbTool > m_TRTCalDbTool2
virtual double driftTimeToTCorrection(double tot, Identifier id, bool isArgonStraw=false) const override
Returns time over threshold correction to the drift time (ns)
DoubleArrayProperty m_tot_corrections_barrel_Ar
static constexpr double s_radius_default[s_size_default]
DoubleProperty m_uni_error
namely this one
double m_t0_barrel[3]
t0 for the 3 barrel rings
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:82