ATLAS Offline Software
Loading...
Searching...
No Matches
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"
7
8#include "Identifier/Identifier.h"
11
12
13
14PixelSiliconConditionsTestAlg::PixelSiliconConditionsTestAlg( const std::string& name, ISvcLocator* pSvcLocator ) :
15 AthAlgorithm( name, pSvcLocator )
16{
17}
18
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
31
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), Gaudi::Hive::currentContext()));
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
Structs for holding charge calibration parameterisation and data.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
This is a "hash" representation of an Identifier.
SG::ReadCondHandleKey< PixelDCSTempData > m_readKeyTemp
PixelSiliconConditionsTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
SG::ReadCondHandleKey< PixelChargeCalibCondData > m_chargeDataKey
SG::ReadCondHandleKey< PixelDistortionData > m_distortionKey
SG::ReadCondHandleKey< PixelDCSHVData > m_readKeyHV
STL class.
Eigen::AngleAxisd AngleAxis3D
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D