ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
TrackD3PDMaker
src
PerigeeBLPredictionFillerTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
10
11
#include "
PerigeeBLPredictionFillerTool.h
"
12
#include "
InDetTestPixelLayer/InDetTestPixelLayerTool.h
"
13
#include "
InDetTestPixelLayer/TrackStateOnPixelLayerInfo.h
"
14
#include "
AthenaKernel/errorcheck.h
"
15
#include "
InDetReadoutGeometry/SiDetectorElement.h
"
16
#include "
InDetIdentifier/PixelID.h
"
17
18
namespace
D3PD
{
19
26
PerigeeBLPredictionFillerTool::PerigeeBLPredictionFillerTool
27
(
const
std::string&
type
,
28
const
std::string& name,
29
const
IInterface* parent)
30
:
BlockFillerTool
<
Trk
::
Perigee
> (
type
, name, parent)
31
{
32
book
().ignore();
// Avoid coverity warnings.
33
}
34
35
39
StatusCode
PerigeeBLPredictionFillerTool::initialize
()
40
{
41
CHECK
(
BlockFillerTool<Trk::Perigee>::initialize
() );
42
CHECK
(
m_inDetTestPixelLayerTool
.retrieve() );
43
CHECK
( detStore()->retrieve(
m_pixId
,
"PixelID"
) );
44
45
return
StatusCode::SUCCESS;
46
}
47
48
52
StatusCode
PerigeeBLPredictionFillerTool::book
()
53
{
54
55
CHECK
(
addVariable
(
"x"
,
m_x
,
"predicted x global position in the B-layer"
) );
56
CHECK
(
addVariable
(
"y"
,
m_y
,
"predicted y global position in the B-layer"
) );
57
CHECK
(
addVariable
(
"z"
,
m_z
,
"predicted z global position in the B-layer"
) );
58
CHECK
(
addVariable
(
"locX"
,
m_locX
,
"predicted x local position in the B-layer"
) );
59
CHECK
(
addVariable
(
"locY"
,
m_locY
,
"predicted y local position in the B-layer"
) );
60
CHECK
(
addVariable
(
"err_locX"
,
m_err_locX
,
"error on local x prediction in the B-layer"
) );
61
CHECK
(
addVariable
(
"err_locY"
,
m_err_locY
,
"error on local y prediction in the B-layer"
) );
62
CHECK
(
addVariable
(
"etaDistToEdge"
,
m_etaDistToEdge
,
"distance of B-layer prediction to module edge along eta"
) );
63
CHECK
(
addVariable
(
"phiDistToEdge"
,
m_phiDistToEdge
,
"distance of B-layer prediction to module edge along phi"
) );
64
CHECK
(
addVariable
(
"detElementId"
,
m_detElementId
,
"detector element identifier of B-layer prediction"
) );
65
CHECK
(
addVariable
(
"row"
,
m_row
,
""
) );
66
CHECK
(
addVariable
(
"col"
,
m_col
,
""
) );
67
CHECK
(
addVariable
(
"type"
,
m_type
,
""
) );
68
69
return
StatusCode::SUCCESS;
70
}
71
72
81
StatusCode
82
PerigeeBLPredictionFillerTool::fill
(
const
Trk::Perigee
& p) {
83
84
this->
clearData
();
85
86
std::vector<InDet::TrackStateOnPixelLayerInfo> trackStateBlayer;
87
if
(!
m_inDetTestPixelLayerTool
->getTrackStateOnInnermostPixelLayerInfo(&p, trackStateBlayer)){
88
return
StatusCode::SUCCESS;
89
}
90
91
std::vector<InDet::TrackStateOnPixelLayerInfo>::const_iterator itr = trackStateBlayer.begin();
92
std::vector<InDet::TrackStateOnPixelLayerInfo>::const_iterator end = trackStateBlayer.end();
93
for
(; itr!=end; ++itr){
94
Identifier
id
= itr->moduleId();
95
96
if
(
id
.is_valid()){
97
m_detElementId
->push_back(
id
.get_identifier32().get_compact());
98
}
else
{
99
m_detElementId
->push_back(0);
100
}
101
102
m_type
->push_back((
int
)itr->type());
103
104
m_etaDistToEdge
->push_back(itr->distToModuleEdgeEta());
105
m_phiDistToEdge
->push_back(itr->distToModuleEdgePhi());
106
107
Identifier
holeId_c = itr->pixelId();
108
if
(holeId_c.
is_valid
()){
109
m_col
->push_back(
m_pixId
->eta_index(holeId_c));
110
m_row
->push_back(
m_pixId
->phi_index(holeId_c));
111
}
else
{
112
m_col
->push_back(-1);
113
m_row
->push_back(-1);
114
}
115
116
m_x
->push_back(itr->globalPosition().x());
117
m_y
->push_back(itr->globalPosition().y());
118
m_z
->push_back(itr->globalPosition().z());
119
120
m_locX
->push_back(itr->localX());
121
m_locY
->push_back(itr->localY());
122
123
m_err_locX
->push_back(itr->errLocalX());
124
m_err_locY
->push_back(itr->errLocalY());
125
}
126
127
return
StatusCode::SUCCESS;
128
}
129
130
void
PerigeeBLPredictionFillerTool::clearData
(){
131
132
m_x
->clear();
133
m_y
->clear();
134
m_z
->clear();
135
m_locX
->clear();
136
m_locY
->clear();
137
m_err_locX
->clear();
138
m_err_locY
->clear();
139
m_etaDistToEdge
->clear();
140
m_phiDistToEdge
->clear();
141
m_detElementId
->clear();
142
m_row
->clear();
143
m_col
->clear();
144
m_type
->clear();
145
}
146
147
}
// namespace D3PD
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
OfflineHitType::Perigee
@ Perigee
Definition
FPGATrackSimTypes.h:31
InDetTestPixelLayerTool.h
PerigeeBLPredictionFillerTool.h
Fill BLayer prediction Info from a Perigee.
PixelID.h
This is an Identifier helper class for the Pixel subdetector.
SiDetectorElement.h
TrackStateOnPixelLayerInfo.h
D3PD::BlockFillerTool< Trk::Perigee >::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Definition
AddVariable.cxx:85
D3PD::BlockFillerTool
Type-safe wrapper for block filler tools.
Definition
BlockFillerTool.h:65
D3PD::PerigeeBLPredictionFillerTool::m_pixId
const PixelID * m_pixId
Definition
PerigeeBLPredictionFillerTool.h:65
D3PD::PerigeeBLPredictionFillerTool::m_locY
std::vector< float > * m_locY
Definition
PerigeeBLPredictionFillerTool.h:74
D3PD::PerigeeBLPredictionFillerTool::book
virtual StatusCode book() final
Book variables for this block.
Definition
PerigeeBLPredictionFillerTool.cxx:52
D3PD::PerigeeBLPredictionFillerTool::fill
virtual StatusCode fill(const Trk::Perigee &p) override
Fill one block — type-safe version.
Definition
PerigeeBLPredictionFillerTool.cxx:82
D3PD::PerigeeBLPredictionFillerTool::initialize
virtual StatusCode initialize() override
Standard Gaudi initialize method.
Definition
PerigeeBLPredictionFillerTool.cxx:39
D3PD::PerigeeBLPredictionFillerTool::m_y
std::vector< float > * m_y
Definition
PerigeeBLPredictionFillerTool.h:71
D3PD::PerigeeBLPredictionFillerTool::m_err_locY
std::vector< float > * m_err_locY
Definition
PerigeeBLPredictionFillerTool.h:76
D3PD::PerigeeBLPredictionFillerTool::m_inDetTestPixelLayerTool
ToolHandle< InDet::IInDetTestPixelLayerTool > m_inDetTestPixelLayerTool
Parameter: Tool to test if the track crosses a dead module on the B-Layer.
Definition
PerigeeBLPredictionFillerTool.h:63
D3PD::PerigeeBLPredictionFillerTool::PerigeeBLPredictionFillerTool
PerigeeBLPredictionFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition
PerigeeBLPredictionFillerTool.cxx:27
D3PD::PerigeeBLPredictionFillerTool::m_col
std::vector< int > * m_col
Definition
PerigeeBLPredictionFillerTool.h:81
D3PD::PerigeeBLPredictionFillerTool::m_err_locX
std::vector< float > * m_err_locX
Definition
PerigeeBLPredictionFillerTool.h:75
D3PD::PerigeeBLPredictionFillerTool::m_etaDistToEdge
std::vector< float > * m_etaDistToEdge
Definition
PerigeeBLPredictionFillerTool.h:77
D3PD::PerigeeBLPredictionFillerTool::m_locX
std::vector< float > * m_locX
Definition
PerigeeBLPredictionFillerTool.h:73
D3PD::PerigeeBLPredictionFillerTool::clearData
void clearData()
Definition
PerigeeBLPredictionFillerTool.cxx:130
D3PD::PerigeeBLPredictionFillerTool::m_type
std::vector< int > * m_type
Definition
PerigeeBLPredictionFillerTool.h:82
D3PD::PerigeeBLPredictionFillerTool::m_detElementId
std::vector< Identifier32::value_type > * m_detElementId
Definition
PerigeeBLPredictionFillerTool.h:79
D3PD::PerigeeBLPredictionFillerTool::m_z
std::vector< float > * m_z
Definition
PerigeeBLPredictionFillerTool.h:72
D3PD::PerigeeBLPredictionFillerTool::m_phiDistToEdge
std::vector< float > * m_phiDistToEdge
Definition
PerigeeBLPredictionFillerTool.h:78
D3PD::PerigeeBLPredictionFillerTool::m_x
std::vector< float > * m_x
Variables:
Definition
PerigeeBLPredictionFillerTool.h:70
D3PD::PerigeeBLPredictionFillerTool::m_row
std::vector< int > * m_row
Definition
PerigeeBLPredictionFillerTool.h:80
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
D3PD
Block filler tool for noisy FEB information.
Definition
CaloCellDetailsFillerTool.cxx:29
Identifier
Definition
IdentifierFieldParser.cxx:14
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
Trk::Perigee
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
Definition
Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:33
type
Generated on
for ATLAS Offline Software by
1.17.0