ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetRecTools
InDetTrackSelectionTool
Root
InDetAccessor.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
InDetAccessor.h
"
5
#ifndef XAOD_ANALYSIS
6
#include "
TrkRIO_OnTrack/RIO_OnTrack.h
"
7
#include "
InDetRIO_OnTrack/SiClusterOnTrack.h
"
8
#include "
InDetRIO_OnTrack/SCT_ClusterOnTrack.h
"
9
10
namespace
InDetAccessor
{
11
std::tuple<uint8_t,uint8_t>
getSiHitsTopBottom
(
const
Trk::Track
& track,
const
asg::AsgMessaging
&msgHelper) {
12
std::tuple<uint8_t, uint8_t> top_bottom {0,0};
13
14
const
DataVector<const Trk::MeasurementBase>
* trkMeasurements = track.measurementsOnTrack();
15
if
(!trkMeasurements) {
16
IDTRKSEL_MSG_WARNING
(
"Null pointer to Trk::MeasurementBase vector."
);
17
}
18
else
{
19
// code in here is mostly adapted from InDetCosmicTrackSelectorTool
20
for
(
const
Trk::MeasurementBase
* measurement : *trkMeasurements) {
21
const
Trk::RIO_OnTrack
* rot =
dynamic_cast<
const
Trk::RIO_OnTrack
*
>
(measurement);
22
if
(!rot) {
23
continue
;
24
}
25
const
InDet::SiClusterOnTrack
* siclus
26
=
dynamic_cast<
const
InDet::SiClusterOnTrack
*
>
(rot);
27
if
(!siclus) {
28
continue
;
29
}
30
float
ypos = siclus->
globalPosition
().y();
31
if
(ypos == 0) {
32
continue
;
// neither top nor bottom
33
}
34
35
const
InDet::SCT_ClusterOnTrack
* sctclus
36
=
dynamic_cast<
const
InDet::SCT_ClusterOnTrack
*
>
(siclus);
37
if
(!sctclus) {
38
// Pixel hit
39
if
(ypos > 0) {
40
std::get<0>(top_bottom) +=2;
41
}
42
else
{
43
std::get<1>(top_bottom)+=2;
44
}
45
}
else
{
46
// SCT hit
47
if
(ypos > 0) {
48
std::get<0>(top_bottom)++;
49
}
50
else
{
51
std::get<1>(top_bottom)++;
52
}
53
}
54
}
55
}
56
return
top_bottom;
57
}
58
}
59
#endif
InDetAccessor.h
IDTRKSEL_MSG_WARNING
#define IDTRKSEL_MSG_WARNING(the_msg)
Definition
InDetAccessor.h:24
RIO_OnTrack.h
SCT_ClusterOnTrack.h
SiClusterOnTrack.h
DataVector
Derived DataVector<T>.
Definition
DataVector.h:795
InDet::SCT_ClusterOnTrack
Specific class to represent the SCT measurements.
Definition
SCT_ClusterOnTrack.h:44
InDet::SiClusterOnTrack
RIO_OnTrack base class for Silicon detector in the InnerDetector.
Definition
SiClusterOnTrack.h:39
InDet::SiClusterOnTrack::globalPosition
virtual const Amg::Vector3D & globalPosition() const override
returns global position (gathered through Surface constraint)
Definition
SiClusterOnTrack.h:115
Trk::MeasurementBase
This class is the pure abstract base class for all fittable tracking measurements.
Definition
MeasurementBase.h:58
Trk::RIO_OnTrack
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Definition
RIO_OnTrack.h:70
Trk::Track
The ATLAS Track class.
Definition
Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
asg::AsgMessaging
Class mimicking the AthMessaging class from the offline software.
Definition
AsgMessaging.h:40
InDetAccessor
Definition
InDetTrackSelectionTool.h:34
InDetAccessor::getSiHitsTopBottom
std::tuple< uint8_t, uint8_t > getSiHitsTopBottom(const Trk::Track &track, const asg::AsgMessaging &msgHelper)
Definition
InDetAccessor.cxx:11
Generated on
for ATLAS Offline Software by
1.17.0