ATLAS Offline Software
InnerDetector
InDetValidation
InDetTrackPerfMon
src
OfflineTrackQualitySelectionTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
OfflineTrackQualitySelectionTool.h
"
6
#include "
TrackAnalysisCollections.h
"
7
#include "
TrackParametersHelper.h
"
8
9
namespace
IDTPM
{
10
11
OfflineTrackQualitySelectionTool::OfflineTrackQualitySelectionTool
(
const
std::string&
name
)
12
:
asg
::AsgTool(
name
) {}
13
14
StatusCode
OfflineTrackQualitySelectionTool::initialize
() {
15
ATH_CHECK
(
asg::AsgTool::initialize
() );
16
ATH_CHECK
(
m_offlineTool
.retrieve() );
17
return
StatusCode::SUCCESS;
18
}
19
20
StatusCode
OfflineTrackQualitySelectionTool::selectTracks
(
21
TrackAnalysisCollections
& trkAnaColls) {
22
23
std::vector< const xAOD::TrackParticle* > selected;
24
for
(
auto
trkPtr: trkAnaColls.
offlTrackVec
(
TrackAnalysisCollections::FS
)) {
25
if
(
m_offlineTool
->accept(trkPtr) and this->accept(trkPtr))
// TODO vertex needs to be provided here
26
selected.push_back(trkPtr);
27
}
28
ATH_MSG_DEBUG
(
"Out of "
<< trkAnaColls.
offlTrackVec
(
TrackAnalysisCollections::FS
).size() <<
" tracks, selected "
<< selected.size() );
29
ATH_CHECK
(trkAnaColls.
fillOfflTrackVec
(selected,
TrackAnalysisCollections::FS
));
30
return
StatusCode::SUCCESS;
31
}
32
33
bool
OfflineTrackQualitySelectionTool::accept
(
const
xAOD::TrackParticle
*
track
) {
34
if
(
m_maxPt
!=-9999. and (
pT
(*
track
)) >
m_maxPt
)
return
false
;
35
if
(
m_maxEta
!=-9999. and (
eta
(*
track
)) >
m_maxEta
)
return
false
;
36
if
(
m_minEta
!=-9999. and (
eta
(*
track
)) <
m_minEta
)
return
false
;
37
if
(
m_minPhi
!=-9999. and (
phi
(*
track
)) <
m_minPhi
)
return
false
;
38
if
(
m_maxPhi
!=-9999. and (
phi
(*
track
)) >
m_maxPhi
)
return
false
;
39
if
(
m_minD0
!=-9999. and (
d0
(*
track
)) <
m_minD0
)
return
false
;
40
if
(
m_minZ0
!=-9999. and (
z0
(*
track
)) <
m_minZ0
)
return
false
;
41
if
(
m_minQoPT
!=-9999. and (
qOverPT
(*
track
)) <
m_minQoPT
)
return
false
;
42
if
(
m_maxQoPT
!=-9999. and (
qOverPT
(*
track
)) >
m_maxQoPT
)
return
false
;
43
if
(
m_minAbsEta
!=-9999. and std::fabs(
eta
(*
track
)) <
m_minAbsEta
)
return
false
;
44
if
(
m_minAbsPhi
!=-9999. and std::fabs(
phi
(*
track
)) <
m_minAbsPhi
)
return
false
;
45
if
(
m_maxAbsPhi
!=-9999. and std::fabs(
phi
(*
track
)) >
m_maxAbsPhi
)
return
false
;
46
if
(
m_minAbsD0
!=-9999. and std::fabs(
d0
(*
track
)) <
m_minAbsD0
)
return
false
;
47
if
(
m_maxAbsD0
!=-9999. and std::fabs(
d0
(*
track
)) >
m_maxAbsD0
)
return
false
;
48
if
(
m_minAbsZ0
!=-9999. and std::fabs(
z0
(*
track
)) <
m_minAbsZ0
)
return
false
;
49
if
(
m_maxAbsZ0
!=-9999. and std::fabs(
z0
(*
track
)) >
m_maxAbsZ0
)
return
false
;
50
if
(
m_minAbsQoPT
!=-9999. and std::fabs(
qOverPT
(*
track
)) <
m_minAbsQoPT
)
return
false
;
51
if
(
m_maxAbsQoPT
!=-9999. and std::fabs(
qOverPT
(*
track
)) >
m_maxAbsQoPT
)
return
false
;
52
return
true
;
53
}
54
55
}
// namespace IDTPM
IDTPM::TrackAnalysisCollections
Definition:
TrackAnalysisCollections.h:46
IDTPM::OfflineTrackQualitySelectionTool::m_minPhi
FloatProperty m_minPhi
Definition:
OfflineTrackQualitySelectionTool.h:58
IDTPM::z0
float z0(const U &p)
Definition:
TrackParametersHelper.h:72
IDTPM::OfflineTrackQualitySelectionTool::m_minZ0
FloatProperty m_minZ0
Definition:
OfflineTrackQualitySelectionTool.h:61
IDTPM::OfflineTrackQualitySelectionTool::m_maxAbsQoPT
FloatProperty m_maxAbsQoPT
Definition:
OfflineTrackQualitySelectionTool.h:54
IDTPM::OfflineTrackQualitySelectionTool::m_minAbsPhi
FloatProperty m_minAbsPhi
Definition:
OfflineTrackQualitySelectionTool.h:47
asg
Definition:
DataHandleTestTool.h:28
IDTPM::OfflineTrackQualitySelectionTool::m_maxPhi
FloatProperty m_maxPhi
Definition:
OfflineTrackQualitySelectionTool.h:59
IDTPM::OfflineTrackQualitySelectionTool::m_minAbsQoPT
FloatProperty m_minAbsQoPT
Definition:
OfflineTrackQualitySelectionTool.h:53
IDTPM::OfflineTrackQualitySelectionTool::m_maxAbsZ0
FloatProperty m_maxAbsZ0
Definition:
OfflineTrackQualitySelectionTool.h:52
TrackAnalysisCollections.h
Class to hold for each event collections needed in the TrkAnalsis.
IDTPM::OfflineTrackQualitySelectionTool::selectTracks
virtual StatusCode selectTracks(TrackAnalysisCollections &trkAnaColls) override
Definition:
OfflineTrackQualitySelectionTool.cxx:20
IDTPM::OfflineTrackQualitySelectionTool::m_minAbsD0
FloatProperty m_minAbsD0
Definition:
OfflineTrackQualitySelectionTool.h:49
IDTPM::OfflineTrackQualitySelectionTool::m_minQoPT
FloatProperty m_minQoPT
Definition:
OfflineTrackQualitySelectionTool.h:62
IDTPM::OfflineTrackQualitySelectionTool::m_maxAbsPhi
FloatProperty m_maxAbsPhi
Definition:
OfflineTrackQualitySelectionTool.h:48
IDTPM::phi
float phi(const U &p)
Definition:
TrackParametersHelper.h:61
IDTPM::OfflineTrackQualitySelectionTool::m_offlineTool
ToolHandle< InDet::IInDetTrackSelectionTool > m_offlineTool
Definition:
OfflineTrackQualitySelectionTool.h:44
IDTPM::TrackAnalysisCollections::fillOfflTrackVec
StatusCode fillOfflTrackVec(const std::vector< const xAOD::TrackParticle * > &vec, Stage stage=FULL)
Offline tracks.
Definition:
TrackAnalysisCollections.cxx:336
IDTPM::OfflineTrackQualitySelectionTool::OfflineTrackQualitySelectionTool
OfflineTrackQualitySelectionTool(const std::string &name)
Definition:
OfflineTrackQualitySelectionTool.cxx:11
TrackParametersHelper.h
Utility methods to access track/truth particles parmeters in a consitent way in this package.
IDTPM::qOverPT
float qOverPT(const U &p)
Definition:
TrackParametersHelper.h:114
IDTPM::eta
float eta(const U &p)
Accessor utility function for getting the value of eta.
Definition:
TrackParametersHelper.h:43
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition:
AthMsgStreamMacros.h:29
IDTPM::TrackAnalysisCollections::FS
@ FS
Definition:
TrackAnalysisCollections.h:54
IDTPM::d0
float d0(const U &p)
Definition:
TrackParametersHelper.h:84
IDTPM::pT
float pT(const U &p)
Accessor utility function for getting the value of pT.
Definition:
TrackParametersHelper.h:33
ATH_CHECK
#define ATH_CHECK
Definition:
AthCheckMacros.h:40
IDTPM::TrackAnalysisCollections::offlTrackVec
const std::vector< const xAOD::TrackParticle * > & offlTrackVec(Stage stage=FULL)
Definition:
TrackAnalysisCollections.h:215
IDTPM::OfflineTrackQualitySelectionTool::m_maxPt
FloatProperty m_maxPt
Definition:
OfflineTrackQualitySelectionTool.h:55
IDTPM::OfflineTrackQualitySelectionTool::accept
bool accept(const xAOD::TrackParticle *track)
Definition:
OfflineTrackQualitySelectionTool.cxx:33
IDTPM::OfflineTrackQualitySelectionTool::m_maxQoPT
FloatProperty m_maxQoPT
Definition:
OfflineTrackQualitySelectionTool.h:63
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:228
OfflineTrackQualitySelectionTool.h
IDTPM::OfflineTrackQualitySelectionTool::m_minAbsZ0
FloatProperty m_minAbsZ0
Definition:
OfflineTrackQualitySelectionTool.h:51
IDTPM::OfflineTrackQualitySelectionTool::m_maxAbsD0
FloatProperty m_maxAbsD0
Definition:
OfflineTrackQualitySelectionTool.h:50
IDTPM::OfflineTrackQualitySelectionTool::m_minD0
FloatProperty m_minD0
Definition:
OfflineTrackQualitySelectionTool.h:60
IDTPM::OfflineTrackQualitySelectionTool::m_minAbsEta
FloatProperty m_minAbsEta
Definition:
OfflineTrackQualitySelectionTool.h:46
IDTPM::OfflineTrackQualitySelectionTool::m_maxEta
FloatProperty m_maxEta
Definition:
OfflineTrackQualitySelectionTool.h:57
IDTPM::OfflineTrackQualitySelectionTool::m_minEta
FloatProperty m_minEta
Definition:
OfflineTrackQualitySelectionTool.h:56
xAOD::track
@ track
Definition:
TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition:
TrackParticle_v1.h:43
IDTPM
Athena include(s).
Definition:
IPlotsDefinitionSvc.h:25
IDTPM::OfflineTrackQualitySelectionTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition:
OfflineTrackQualitySelectionTool.cxx:14
asg::AsgTool::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition:
AsgTool.h:133
Generated on Sun Dec 22 2024 21:15:50 for ATLAS Offline Software by
1.8.18