ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetRecTools
InDetTrackSelectorTool
src
InDetIsoTrackSelectorTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
InDetTrackSelectorTool/InDetIsoTrackSelectorTool.h
"
6
#include "
TrkToolInterfaces/ITrackSelectorTool.h
"
7
8
#include "
TrkExInterfaces/IExtrapolator.h
"
9
#include "
TrkTrack/Track.h
"
10
#include "
TrkParticleBase/TrackParticleBase.h
"
11
#include "
TrkSurfaces/StraightLineSurface.h
"
12
13
//_______________________________________________________________________________
14
InDet::InDetIsoTrackSelectorTool::InDetIsoTrackSelectorTool
(
const
std::string & t,
const
std::string & n,
const
IInterface * p)
15
:
AthAlgTool
(t,n,p)
16
{
17
declareInterface<Trk::IIsoTrackSelectorTool>(
this
);
18
}
19
20
//_______________________________________________________________________________
21
InDet::InDetIsoTrackSelectorTool::~InDetIsoTrackSelectorTool
()
22
=
default
;
23
24
//_______________________________________________________________________________
25
StatusCode
InDet::InDetIsoTrackSelectorTool::initialize
()
26
{
27
28
m_d0Significance2
=
m_d0Significance
*
m_d0Significance
;
29
m_z0Significance2
=
m_z0Significance
*
m_z0Significance
;
30
31
// get the extrapolator
32
if
(
m_extrapolator
.retrieve().isFailure() ){
33
ATH_MSG_ERROR
(
"Could not retrieve Extrapolator '"
<<
m_extrapolator
<<
"' (essential). Abort."
);
34
return
StatusCode::FAILURE;
35
}
else
36
ATH_MSG_DEBUG
(
"Successfully retrieved "
<<
m_extrapolator
);
37
38
// get the track selector if needed
39
if
( !
m_trackSelector
.empty() &&
m_trackSelector
.retrieve().isFailure() ){
40
ATH_MSG_ERROR
(
"Could not retrieve TrackSelector '"
<<
m_trackSelector
<<
"' although configured. Abort."
);
41
return
StatusCode::FAILURE;
42
}
43
// done
44
return
StatusCode::SUCCESS;
45
}
46
47
48
//_______________________________________________________________________________
49
bool
InDet::InDetIsoTrackSelectorTool::decision
(
const
Trk::AtaStraightLine
& atl,
const
Trk::Track
& track)
const
50
{
51
const
Trk::Perigee
* tPerigee = track.perigeeParameters();
52
if
(!tPerigee){
53
ATH_MSG_DEBUG
(
"No perigee on track, discard this one."
);
54
return
false
;
55
}
56
// call the workhorse interface
57
bool
passed
=
decision
(atl,*tPerigee);
58
// only check if needed
59
passed
= (!
passed
||
m_trackSelector
.empty()) ?
passed
: (
passed
&&
m_trackSelector
->decision(track) );
60
// return what you have
61
ATH_MSG_VERBOSE
(
"Track "
<< (
passed
?
"passed"
:
"did not pass"
) <<
" isolation track selector."
);
62
return
passed
;
63
}
64
65
66
//_______________________________________________________________________________
67
bool
InDet::InDetIsoTrackSelectorTool::decision
(
const
Trk::AtaStraightLine
& atl,
const
Trk::TrackParticleBase
& trackParticle)
const
68
{
69
70
// get the paramters base
71
const
Trk::TrackParameters
* definintParameters = &(trackParticle.
definingParameters
());
72
const
Trk::TrackParameters
* trackParameters=
73
dynamic_cast<
const
Trk::Perigee
*
>
(definintParameters);
74
if
(!trackParameters){
75
ATH_MSG_DEBUG
(
"No parameters to start from on track, discard this one."
);
76
return
false
;
77
}
78
// call the workhorse interface
79
bool
passed
=
decision
(atl,*trackParameters);
80
// only check if needed
81
passed
= (!
passed
||
m_trackSelector
.empty()) ?
passed
: (
passed
&&
m_trackSelector
->decision(trackParticle) );
82
// return what you have
83
ATH_MSG_VERBOSE
(
"TrackParticle "
<< (
passed
?
"passed"
:
"did not pass"
) <<
" isolation track selector."
);
84
return
passed
;
85
}
86
87
//_______________________________________________________________________________
88
bool
InDet::InDetIsoTrackSelectorTool::decision
(
const
Trk::AtaStraightLine
& atl,
const
Trk::TrackParameters
& trackPars)
const
89
{
90
// get the surface
91
bool
passed
=
false
;
92
const
Trk::StraightLineSurface
& alSurface = atl.
associatedSurface
();
93
// no surface: bail out
94
// get the track to the BeamLine Parameters ( given by AtaStrainghtLine)
95
std::unique_ptr<Trk::TrackParameters> trackAtBL =
m_extrapolator
->extrapolate(
96
Gaudi::Hive::currentContext(),
97
trackPars,
98
alSurface,
99
Trk::anyDirection
,
100
false
);
101
// no parameterisation : bail out
102
if
(!trackAtBL)
return
false
;
103
// d0,z0 wrt BL for reference and track
104
double
d0track_wrtBL = trackAtBL->parameters()[
Trk::d0
];
105
double
sinTheta =
m_applySinThetaCorrection
? 1. : sin(trackAtBL->parameters()[
Trk::theta
]);
106
double
z0track_wrtBL = trackAtBL->parameters()[
Trk::z0
]*sinTheta;
107
double
sinThetaRef =
m_applySinThetaCorrection
? 1. : sin(atl.parameters()[
Trk::theta
]);
108
double
z0ref_wrtBL = atl.parameters()[
Trk::z0
] * sinThetaRef;
109
if
(
m_robustCuts
){
110
// check d0 cut with respect to BL
111
passed
= std::abs(d0track_wrtBL) <
m_d0max
;
112
ATH_MSG_VERBOSE
(
"TrackParameters "
<< (
passed
?
"passed"
:
"did not pass"
) <<
" d0 cut wrt BL : "
113
<< d0track_wrtBL <<
" (cut is : | "
<<
m_d0max
<<
" | )."
);
114
// check z0 cut with respect to reference
115
passed
= std::abs(z0track_wrtBL-z0ref_wrtBL) <
m_z0stMax
;
116
ATH_MSG_VERBOSE
(
"TrackParameters "
<< (
passed
?
"passed"
:
"did not pass"
) <<
" z0 "
<< (
m_applySinThetaCorrection
?
"*sin(theta)"
:
""
)
117
<<
" cut wrt reference :"
118
<< (z0track_wrtBL-z0ref_wrtBL) <<
" (cut is : | "
<<
m_z0stMax
<<
" | )."
);
119
}
else
{
120
// cast to measured parameters
121
if
(!trackAtBL->covariance()){
122
ATH_MSG_VERBOSE
(
"Can not apply significance cut on Parameters w/o Error. Ignore Track."
);
123
return
false
;
124
}
125
// get the error on the track
126
double
covTrackD0 = (*trackAtBL->covariance())(
Trk::d0
,
Trk::d0
);
127
double
covTrackZ0 = (*trackAtBL->covariance())(
Trk::z0
,
Trk::z0
);
128
// check d0 significiance cut with respect to BL
129
double
d0sig2 = (d0track_wrtBL*d0track_wrtBL)/covTrackD0;
130
passed
= d0sig2 <
m_d0Significance2
;
131
ATH_MSG_VERBOSE
(
"TrackParameters "
<< (
passed
?
"passed"
:
"did not pass"
) <<
" d0 significance^2 cut wrt BL : "
132
<< d0sig2 <<
" (cut is : | "
<<
m_d0Significance2
<<
" | )."
);
133
double
deltaZ = z0ref_wrtBL - z0track_wrtBL;
134
double
z0Err2 = covTrackZ0;
135
if
(
m_applySinThetaCorrection
){
136
double
covTrackTheta = (*trackAtBL->covariance())(
Trk::theta
,
Trk::theta
);
137
double
covTrackZ0Theta = (*trackAtBL->covariance())(
Trk::z0
,
Trk::theta
);
138
// check z0 significance cut with respect to reference -- apply theta projection into longitudinal track frame
139
double
cosTheta = cos(trackAtBL->parameters()[
Trk::theta
]);
140
// derivatives + apply jacobian transormation
141
double
dZIPdTheta = deltaZ*cosTheta;
142
double
dZIPdz0 = sinTheta;
143
double
DTheta2 = dZIPdTheta*dZIPdTheta*covTrackTheta;
144
double
DZ02 = dZIPdz0*dZIPdz0*covTrackZ0;
145
double
DThetaZ0 = 2.*dZIPdTheta*dZIPdz0*covTrackZ0Theta;
146
// check for it
147
z0Err2 = DTheta2 + DZ02 + DThetaZ0;
148
}
149
double
z0sig2 = (deltaZ*deltaZ)/(z0Err2);
150
passed
= z0sig2 <
m_z0Significance2
;
151
ATH_MSG_VERBOSE
(
"TrackParameters "
<< (
passed
?
"passed"
:
"did not pass"
) <<
" z0*sin(theta) significance cut wrt BL : "
152
<< z0sig2 <<
" (cut is : | "
<<
m_z0Significance2
<<
" | )."
);
153
}
154
return
passed
;
155
}
156
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x,...)
Definition
AthMsgStreamMacros.h:42
IExtrapolator.h
ITrackSelectorTool.h
InDetIsoTrackSelectorTool.h
passed
bool passed(DecisionID id, const DecisionIDContainer &)
checks if required decision ID is in the set of IDs in the container
Definition
TrigCompositeUtilsRoot.cxx:118
StraightLineSurface.h
TrackParticleBase.h
Track.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
InDet::InDetIsoTrackSelectorTool::m_robustCuts
BooleanProperty m_robustCuts
Robust cut window setting.
Definition
InDetIsoTrackSelectorTool.h:58
InDet::InDetIsoTrackSelectorTool::m_z0Significance2
double m_z0Significance2
Definition
InDetIsoTrackSelectorTool.h:66
InDet::InDetIsoTrackSelectorTool::decision
virtual bool decision(const Trk::AtaStraightLine &, const Trk::Track &track) const override
ESD type interface.
Definition
InDetIsoTrackSelectorTool.cxx:49
InDet::InDetIsoTrackSelectorTool::m_applySinThetaCorrection
BooleanProperty m_applySinThetaCorrection
Definition
InDetIsoTrackSelectorTool.h:59
InDet::InDetIsoTrackSelectorTool::m_trackSelector
ToolHandle< Trk::ITrackSelectorTool > m_trackSelector
Extra checks on hits & holes.
Definition
InDetIsoTrackSelectorTool.h:71
InDet::InDetIsoTrackSelectorTool::InDetIsoTrackSelectorTool
InDetIsoTrackSelectorTool(const std::string &t, const std::string &n, const IInterface *p)
Constructor / Destructor.
Definition
InDetIsoTrackSelectorTool.cxx:14
InDet::InDetIsoTrackSelectorTool::initialize
virtual StatusCode initialize() override
Athena AlgTool methods.
Definition
InDetIsoTrackSelectorTool.cxx:25
InDet::InDetIsoTrackSelectorTool::m_d0Significance2
double m_d0Significance2
Definition
InDetIsoTrackSelectorTool.h:65
InDet::InDetIsoTrackSelectorTool::m_d0max
DoubleProperty m_d0max
Definition
InDetIsoTrackSelectorTool.h:60
InDet::InDetIsoTrackSelectorTool::m_d0Significance
DoubleProperty m_d0Significance
Sophisticated cut window setting : d0/z0 significance - only when robustCuts off.
Definition
InDetIsoTrackSelectorTool.h:63
InDet::InDetIsoTrackSelectorTool::~InDetIsoTrackSelectorTool
~InDetIsoTrackSelectorTool()
InDet::InDetIsoTrackSelectorTool::m_z0stMax
DoubleProperty m_z0stMax
Definition
InDetIsoTrackSelectorTool.h:61
InDet::InDetIsoTrackSelectorTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition
InDetIsoTrackSelectorTool.h:69
InDet::InDetIsoTrackSelectorTool::m_z0Significance
DoubleProperty m_z0Significance
Definition
InDetIsoTrackSelectorTool.h:64
Trk::ParametersT::associatedSurface
virtual const S & associatedSurface() const override final
Access to the Surface method.
Trk::StraightLineSurface
Class for a StraightLineSurface in the ATLAS detector to describe dirft tube and straw like detectors...
Definition
StraightLineSurface.h:51
Trk::TrackParticleBase
Definition
TrackParticleBase.h:41
Trk::TrackParticleBase::definingParameters
const TrackParameters & definingParameters() const
Returns the 'defining' parameter of this TrackParticle.
Definition
TrackParticleBase.h:239
Trk::Track
The ATLAS Track class.
Definition
Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Trk::anyDirection
@ anyDirection
Definition
PropDirection.h:22
Trk::Perigee
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
Definition
Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:33
Trk::AtaStraightLine
ParametersT< TrackParametersDim, Charged, StraightLineSurface > AtaStraightLine
Definition
Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:35
Trk::theta
@ theta
Definition
ParamDefs.h:66
Trk::d0
@ d0
Definition
ParamDefs.h:63
Trk::z0
@ z0
Definition
ParamDefs.h:64
Trk::TrackParameters
ParametersBase< TrackParametersDim, Charged > TrackParameters
Definition
Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:27
Generated on
for ATLAS Offline Software by
1.17.0