ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetConditions
PixelConditionsAlgorithms
src
PixelSiliconConditionsTestAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "CLHEP/Units/SystemOfUnits.h"
6
#include "
PixelSiliconConditionsTestAlg.h
"
7
8
#include "Identifier/Identifier.h"
9
#include "
Identifier/IdentifierHash.h
"
10
#include "
PixelConditionsData/ChargeCalibParameters.h
"
11
12
13
14
PixelSiliconConditionsTestAlg::PixelSiliconConditionsTestAlg
(
const
std::string& name, ISvcLocator* pSvcLocator ) :
15
AthAlgorithm
( name, pSvcLocator )
16
{
17
}
18
19
StatusCode
PixelSiliconConditionsTestAlg::initialize
()
20
{
21
ATH_CHECK
(
m_readKeyTemp
.initialize());
22
ATH_CHECK
(
m_readKeyHV
.initialize());
23
ATH_CHECK
(
m_lorentzAngleTool
.retrieve());
24
ATH_CHECK
(
m_chargeDataKey
.initialize());
25
ATH_CHECK
(
m_distortionKey
.initialize());
26
27
return
StatusCode::SUCCESS;
28
}
29
30
StatusCode
PixelSiliconConditionsTestAlg::execute
(
const
EventContext& ctx){
31
32
SG::ReadCondHandle<PixelDCSHVData>
hv(
m_readKeyHV
, ctx);
33
SG::ReadCondHandle<PixelDCSTempData>
temp(
m_readKeyTemp
, ctx);
34
SG::ReadCondHandle<PixelChargeCalibCondData>
calib(
m_chargeDataKey
, ctx);
35
SG::ReadCondHandle<PixelDistortionData>
distortion(
m_distortionKey
, ctx);
36
37
for
(
int
i=0; i<2048; i++) {
38
ATH_MSG_INFO
(
"Module "
<< i <<
" "
39
<< hv->getBiasVoltage(i) <<
" "
40
<< temp->getTemperature(i) <<
" "
41
<<
m_lorentzAngleTool
->getLorentzShift(
IdentifierHash
(i), ctx));
42
for
(
int
j=0; j<16; j++) {
43
try
{
44
// ignore invalid FEs
45
[[maybe_unused]]
const
auto
&v = calib->getThresholds(
InDetDD::PixelDiodeType::NORMAL
, i, j).value;
46
}
catch
(
const
std::range_error &) {
47
continue
;
48
}
49
ATH_MSG_INFO
(
"FE "
<< j <<
" "
50
<< calib->getThresholds(
InDetDD::PixelDiodeType::NORMAL
, i, j).value <<
" "
51
<< calib->getThresholds(
InDetDD::PixelDiodeType::NORMAL
, i, j).sigma <<
" "
52
<< calib->getThresholds(
InDetDD::PixelDiodeType::NORMAL
, i, j).noise <<
" "
53
<< calib->getThresholds(
InDetDD::PixelDiodeType::NORMAL
, i, j).inTimeValue <<
" "
54
<< calib->getThresholds(
InDetDD::PixelDiodeType::LONG
, i, j).value <<
" "
55
<< calib->getThresholds(
InDetDD::PixelDiodeType::LONG
, i, j).sigma <<
" "
56
<< calib->getThresholds(
InDetDD::PixelDiodeType::LONG
, i, j).noise <<
" "
57
<< calib->getThresholds(
InDetDD::PixelDiodeType::LONG
, i, j).inTimeValue <<
" "
58
<< calib->getThresholds(
InDetDD::PixelDiodeType::GANGED
, i, j).value <<
" "
59
<< calib->getThresholds(
InDetDD::PixelDiodeType::GANGED
, i, j).sigma <<
" "
60
<< calib->getThresholds(
InDetDD::PixelDiodeType::GANGED
, i, j).noise <<
" "
61
<< calib->getThresholds(
InDetDD::PixelDiodeType::GANGED
, i, j).inTimeValue <<
" "
62
<< calib->getLegacyFitParameters(
InDetDD::PixelDiodeType::NORMAL
, i, j).A <<
" "
63
<< calib->getLegacyFitParameters(
InDetDD::PixelDiodeType::NORMAL
, i, j).E <<
" "
64
<< calib->getLegacyFitParameters(
InDetDD::PixelDiodeType::NORMAL
, i, j).C <<
" "
65
<< calib->getLegacyFitParameters(
InDetDD::PixelDiodeType::GANGED
, i, j).A <<
" "
66
<< calib->getLegacyFitParameters(
InDetDD::PixelDiodeType::GANGED
, i, j).E <<
" "
67
<< calib->getLegacyFitParameters(
InDetDD::PixelDiodeType::GANGED
, i, j).C);
68
}
69
70
71
if
(distortion->getId(i) != 0) {
72
ATH_MSG_INFO
(
"Distortion parameters for module 0x"
<< std::hex << distortion->getId(i) << std::dec);
73
74
std::vector<float>
map
= distortion->getDistortionMap(i);
75
std::stringstream s;
76
for
(
float
f :
map
)
77
s << f <<
" "
;
78
ATH_MSG_INFO
(s.str());
79
80
Amg::Vector2D
point1(-0.123, 0.456);
81
Amg::Vector2D
point2(1.789, -5.678);
82
Amg::Vector3D
dir(0,0,1);
//unit z direction
83
const
Amg::Transform3D
rotateAboutX(
Amg::AngleAxis3D
(45 * CLHEP::deg, Amg::Vector3D::UnitX()));
84
const
Amg::Transform3D
rotateAboutY(
Amg::AngleAxis3D
(45 * CLHEP::deg, Amg::Vector3D::UnitY()));
85
const
Amg::Transform3D
totalTransform = rotateAboutX * rotateAboutY;
86
dir = totalTransform.linear() * dir;
87
Amg::Vector2D
corr;
88
corr = distortion->correction(i, point1, dir);
89
ATH_MSG_INFO
(
" Point 1: "
<<
"("
<< point1[0] <<
", "
<< point1[1] <<
")"
90
<<
", correction: "
<<
"("
<< corr.x() <<
", "
<< corr.y() <<
")"
);
91
corr = distortion->correction(i, point2, dir);
92
ATH_MSG_INFO
(
" Point 2: "
<<
"("
<< point2[0] <<
", "
<< point2[1] <<
")"
93
<<
", correction: "
<<
"("
<< corr.x() <<
", "
<< corr.y() <<
")"
);
94
Amg::Vector2D
newPoint2sim = distortion->correctSimulation(i, point2, dir);
95
ATH_MSG_INFO
(
" Point 2 after correction in simul: "
<<
"("
<< newPoint2sim[0] <<
", "
<< newPoint2sim[1] <<
")"
);
96
Amg::Vector2D
newPoint2rec = distortion->correctReconstruction(i, point2, dir);
97
ATH_MSG_INFO
(
" Point 2 after correction in reco: "
<<
"("
<< newPoint2rec[0] <<
", "
<< newPoint2rec[1] <<
")"
);
98
}
99
}
100
101
return
StatusCode::SUCCESS;
102
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ChargeCalibParameters.h
Structs for holding charge calibration parameterisation and data.
IdentifierHash.h
PixelSiliconConditionsTestAlg.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
PixelSiliconConditionsTestAlg::m_readKeyTemp
SG::ReadCondHandleKey< PixelDCSTempData > m_readKeyTemp
Definition
PixelSiliconConditionsTestAlg.h:35
PixelSiliconConditionsTestAlg::initialize
virtual StatusCode initialize() override
Definition
PixelSiliconConditionsTestAlg.cxx:19
PixelSiliconConditionsTestAlg::execute
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Definition
PixelSiliconConditionsTestAlg.cxx:30
PixelSiliconConditionsTestAlg::PixelSiliconConditionsTestAlg
PixelSiliconConditionsTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
PixelSiliconConditionsTestAlg.cxx:14
PixelSiliconConditionsTestAlg::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition
PixelSiliconConditionsTestAlg.h:41
PixelSiliconConditionsTestAlg::m_chargeDataKey
SG::ReadCondHandleKey< PixelChargeCalibCondData > m_chargeDataKey
Definition
PixelSiliconConditionsTestAlg.h:44
PixelSiliconConditionsTestAlg::m_distortionKey
SG::ReadCondHandleKey< PixelDistortionData > m_distortionKey
Definition
PixelSiliconConditionsTestAlg.h:47
PixelSiliconConditionsTestAlg::m_readKeyHV
SG::ReadCondHandleKey< PixelDCSHVData > m_readKeyHV
Definition
PixelSiliconConditionsTestAlg.h:38
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
map
STL class.
Amg::AngleAxis3D
Eigen::AngleAxisd AngleAxis3D
Definition
GeoPrimitives.h:45
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition
GeoPrimitives.h:46
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition
GeoPrimitives.h:48
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
InDetDD::PixelDiodeType::NORMAL
@ NORMAL
Definition
PixelReadoutDefinitions.h:30
InDetDD::PixelDiodeType::LONG
@ LONG
Definition
PixelReadoutDefinitions.h:31
InDetDD::PixelDiodeType::GANGED
@ GANGED
Definition
PixelReadoutDefinitions.h:32
Generated on
for ATLAS Offline Software by
1.17.0