ATLAS Offline Software
PerigeeBLPredictionFillerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
17 
18 namespace 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 
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
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
D3PD::PerigeeBLPredictionFillerTool::m_detElementId
std::vector< Identifier32::value_type > * m_detElementId
Definition: PerigeeBLPredictionFillerTool.h:79
D3PD::PerigeeBLPredictionFillerTool::m_phiDistToEdge
std::vector< float > * m_phiDistToEdge
Definition: PerigeeBLPredictionFillerTool.h:78
PixelID::phi_index
int phi_index(const Identifier &id) const
Definition: PixelID.h:658
D3PD::PerigeeBLPredictionFillerTool::m_locX
std::vector< float > * m_locX
Definition: PerigeeBLPredictionFillerTool.h:73
D3PD::PerigeeBLPredictionFillerTool::book
virtual StatusCode book() final
Book variables for this block.
Definition: PerigeeBLPredictionFillerTool.cxx:52
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
D3PD::PerigeeBLPredictionFillerTool::m_x
std::vector< float > * m_x
Variables:
Definition: PerigeeBLPredictionFillerTool.h:70
D3PD::PerigeeBLPredictionFillerTool::fill
virtual StatusCode fill(const Trk::Perigee &p) override
Fill one block — type-safe version.
Definition: PerigeeBLPredictionFillerTool.cxx:82
D3PD::AddVariable::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.
Definition: AddVariable.cxx:85
D3PD::PerigeeBLPredictionFillerTool::m_etaDistToEdge
std::vector< float > * m_etaDistToEdge
Definition: PerigeeBLPredictionFillerTool.h:77
D3PD::PerigeeBLPredictionFillerTool::clearData
void clearData()
Definition: PerigeeBLPredictionFillerTool.cxx:130
PerigeeBLPredictionFillerTool.h
Fill BLayer prediction Info from a Perigee.
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
D3PD::PerigeeBLPredictionFillerTool::m_type
std::vector< int > * m_type
Definition: PerigeeBLPredictionFillerTool.h:82
D3PD::PerigeeBLPredictionFillerTool::m_locY
std::vector< float > * m_locY
Definition: PerigeeBLPredictionFillerTool.h:74
D3PD::PerigeeBLPredictionFillerTool::m_row
std::vector< int > * m_row
Definition: PerigeeBLPredictionFillerTool.h:80
D3PD
Block filler tool for noisy FEB information.
Definition: CaloCellDetailsFillerTool.cxx:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
D3PD::PerigeeBLPredictionFillerTool::m_pixId
const PixelID * m_pixId
Definition: PerigeeBLPredictionFillerTool.h:65
D3PD::PerigeeBLPredictionFillerTool::m_err_locX
std::vector< float > * m_err_locX
Definition: PerigeeBLPredictionFillerTool.h:75
TrackStateOnPixelLayerInfo.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
PixelID::eta_index
int eta_index(const Identifier &id) const
Definition: PixelID.h:664
D3PD::BlockFillerTool
Type-safe wrapper for block filler tools.
Definition: BlockFillerTool.h:65
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
errorcheck.h
Helpers for checking error return status codes and reporting errors.
D3PD::PerigeeBLPredictionFillerTool::PerigeeBLPredictionFillerTool
PerigeeBLPredictionFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition: PerigeeBLPredictionFillerTool.cxx:27
SiDetectorElement.h
D3PD::PerigeeBLPredictionFillerTool::m_col
std::vector< int > * m_col
Definition: PerigeeBLPredictionFillerTool.h:81
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::initialize
virtual StatusCode initialize() override
Standard Gaudi initialize method.
Definition: PerigeeBLPredictionFillerTool.cxx:39
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
D3PD::PerigeeBLPredictionFillerTool::m_z
std::vector< float > * m_z
Definition: PerigeeBLPredictionFillerTool.h:72
InDetTestPixelLayerTool.h
D3PD::PerigeeBLPredictionFillerTool::m_err_locY
std::vector< float > * m_err_locY
Definition: PerigeeBLPredictionFillerTool.h:76
D3PD::PerigeeBLPredictionFillerTool::m_y
std::vector< float > * m_y
Definition: PerigeeBLPredictionFillerTool.h:71
Identifier
Definition: IdentifierFieldParser.cxx:14