ATLAS Offline Software
Loading...
Searching...
No Matches
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
17
18namespace D3PD {
19
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
40{
42 CHECK( m_inDetTestPixelLayerTool.retrieve() );
43 CHECK( detStore()->retrieve(m_pixId, "PixelID") );
44
45 return StatusCode::SUCCESS;
46}
47
48
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
81StatusCode
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
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
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Fill BLayer prediction Info from a Perigee.
This is an Identifier helper class for the Pixel subdetector.
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Type-safe wrapper for block filler tools.
virtual StatusCode book() final
Book variables for this block.
virtual StatusCode fill(const Trk::Perigee &p) override
Fill one block — type-safe version.
virtual StatusCode initialize() override
Standard Gaudi initialize method.
ToolHandle< InDet::IInDetTestPixelLayerTool > m_inDetTestPixelLayerTool
Parameter: Tool to test if the track crosses a dead module on the B-Layer.
PerigeeBLPredictionFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
std::vector< Identifier32::value_type > * m_detElementId
bool is_valid() const
Check if id is in a valid state.
Block filler tool for noisy FEB information.
Ensure that the ATLAS eigen extensions are properly loaded.
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee