ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigMonitoring
TrigIDR4Monitoring
src
TrackSelector.cxx
Go to the documentation of this file.
1
13
14
#include "
xAODTracking/TrackParticleContainer.h
"
15
#include "
xAODEgamma/ElectronContainer.h
"
16
17
#include "
TrackSelector.h
"
18
21
#include "
find_bin.h
"
22
23
IDTPM2::TrackSelector::TrackSelector
(
const
std::string& name )
24
:
GenericTrackSelector
( name ) { }
25
26
27
28
StatusCode
IDTPM2::TrackSelector::initialize
() {
29
ATH_CHECK
(
GenericTrackSelector::initialize
() );
30
if
(
m_useOfflineTool
)
ATH_CHECK
(
m_offlineTool
.retrieve() );
31
return
StatusCode::SUCCESS;
32
}
33
34
41
42
template
<
typename
T,
typename
U=T>
43
bool
select_min
(
const
T&
x
,
const
std::vector<T>& xbins,
44
const
U&
y
,
const
std::vector<U>& ycuts ) {
return
y
>=ycuts.at(
IDTPM2::bins::find_bin
( xbins,
x
) ); }
45
46
template
<
typename
T,
typename
U=T>
47
bool
select_max
(
const
T&
x
,
const
std::vector<T>& xbins,
48
const
U&
y
,
const
std::vector<U>& ycuts ) {
return
y
<=ycuts.at(
IDTPM2::bins::find_bin
( xbins,
x
) ); }
49
50
51
52
bool
IDTPM2::TrackSelector::selectTrack
(
const
TrackView
& t )
const
{
53
54
if
(
m_useOfflineTool
) {
56
const
xAOD::TrackParticle
* track = t.as<
xAOD::TrackParticle
>();
57
58
if
( !track ) {
60
const
xAOD::Electron
* electron = t.as<
xAOD::Electron
>();
61
if
( electron ) track = electron->trackParticle();
62
else
return
false
;
63
}
64
66
if
( !
m_offlineTool
->accept( track ) )
return
false
;
// TODO vertex needs to be provided here
67
}
68
72
if
( !
GenericTrackSelector::selectTrack
(t) )
return
false
;
73
76
if
( !
m_etaBins
.empty() ) {
78
// if (!m_minHitsVec.empty() && !nHitsSelVec(*track, m_minHitsVec, m_etaBins)) return false;
79
// if (!m_minPtVec.empty() && !minPtSelVec(*track, m_minPtVec, m_etaBins)) return false;
80
// if (!m_maxD0Vec.empty() && !maxD0SelVec(*track, m_maxD0Vec, m_etaBins)) return false;
81
// if (!m_maxZ0Vec.empty() && !maxZ0SelVec(*track, m_maxZ0Vec, m_etaBins)) return false;
82
83
// if (!m_minHitsVec.empty() && !vector_select( track, m_minHitsVec, m_etaBins)) return false;
84
// if (!m_minPtVec.empty() && !minPtSelVec(*track, m_minPtVec, m_etaBins)) return false;
85
// if (!m_maxD0Vec.empty() && !maxD0SelVec(*track, m_maxD0Vec, m_etaBins)) return false;
86
// if (!m_maxZ0Vec.empty() && !maxZ0SelVec(*track, m_maxZ0Vec, m_etaBins)) return false;
87
95
if
( !
m_minHitsVec
.empty() && !
select_min<float,unsigned>
( t.eta(),
m_etaBins
, t.nSi(),
m_minHitsVec
.value() ))
return
false
;
96
if
( !
m_minPtVec
.empty() && !
select_min<float>
( t.eta(),
m_etaBins
, t.pt(),
m_minPtVec
.value() ))
return
false
;
97
if
( !
m_maxZ0Vec
.empty() && !
select_max<float>
( t.eta(),
m_etaBins
, std::fabs(t.z0()),
m_maxZ0Vec
.value() ))
return
false
;
98
if
( !
m_maxD0Vec
.empty() && !
select_max<float>
( t.eta(),
m_etaBins
, std::fabs(t.d0()),
m_maxD0Vec
.value() ))
return
false
;
99
100
}
101
102
return
true
;
103
}
104
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ElectronContainer.h
TrackParticleContainer.h
select_min
bool select_min(const T &x, const std::vector< T > &xbins, const U &y, const std::vector< U > &ycuts)
do we really need these ?
Definition
TrackSelector.cxx:43
select_max
bool select_max(const T &x, const std::vector< T > &xbins, const U &y, const std::vector< U > &ycuts)
Definition
TrackSelector.cxx:47
TrackSelector.h
emacs: this is -*- c++ -*-
y
#define y
x
#define x
IDTPM2::GenericTrackSelector::selectTrack
virtual bool selectTrack(const TrackView &t) const override
Definition
GenericTrackSelector.cxx:41
IDTPM2::GenericTrackSelector::GenericTrackSelector
GenericTrackSelector(const std::string &name)
Definition
GenericTrackSelector.cxx:27
IDTPM2::GenericTrackSelector::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition
GenericTrackSelector.cxx:32
IDTPM2::TrackSelector::m_minPtVec
FloatArrayProperty m_minPtVec
Definition
TrigMonitoring/TrigIDR4Monitoring/src/TrackSelector.h:49
IDTPM2::TrackSelector::m_etaBins
FloatArrayProperty m_etaBins
how these vector cuts are handled needs to be tidied up - put in to some genertic templates
Definition
TrigMonitoring/TrigIDR4Monitoring/src/TrackSelector.h:47
IDTPM2::TrackSelector::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition
TrackSelector.cxx:28
IDTPM2::TrackSelector::TrackSelector
TrackSelector(const std::string &name)
the functions in find_bin are not nice and need to be tidied up
Definition
TrackSelector.cxx:23
IDTPM2::TrackSelector::m_offlineTool
ToolHandle< InDet::IInDetTrackSelectionTool > m_offlineTool
Definition
TrigMonitoring/TrigIDR4Monitoring/src/TrackSelector.h:55
IDTPM2::TrackSelector::m_useOfflineTool
BooleanProperty m_useOfflineTool
Definition
TrigMonitoring/TrigIDR4Monitoring/src/TrackSelector.h:53
IDTPM2::TrackSelector::m_maxD0Vec
FloatArrayProperty m_maxD0Vec
Definition
TrigMonitoring/TrigIDR4Monitoring/src/TrackSelector.h:50
IDTPM2::TrackSelector::m_maxZ0Vec
FloatArrayProperty m_maxZ0Vec
Definition
TrigMonitoring/TrigIDR4Monitoring/src/TrackSelector.h:51
IDTPM2::TrackSelector::m_minHitsVec
UnsignedIntegerArrayProperty m_minHitsVec
Definition
TrigMonitoring/TrigIDR4Monitoring/src/TrackSelector.h:48
IDTPM2::TrackSelector::selectTrack
virtual bool selectTrack(const TrackView &t) const override
just take the baseclass version ... virtual std::vector<TrackView> selectTracks( const std::vector<Tr...
Definition
TrackSelector.cxx:52
TrackView
forward declaration required for function prototype
Definition
TrackView.h:43
find_bin.h
emacs: this is -*- c++ -*-
IDTPM2::bins::find_bin
size_t find_bin(const std::vector< T > &v, const U &x)
Definition
find_bin.h:24
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
xAOD::Electron
Electron_v1 Electron
Definition of the current "egamma version".
Definition
Electron.h:17
Generated on
for ATLAS Offline Software by
1.17.0