ATLAS Offline Software
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 
14 PixelSiliconConditionsTestAlg::PixelSiliconConditionsTestAlg( const std::string& name, ISvcLocator* pSvcLocator ) :
15  AthAlgorithm( name, pSvcLocator )
16 {
17 }
18 
20 {
23  ATH_CHECK(m_lorentzAngleTool.retrieve());
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)));
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 }
PixelSiliconConditionsTestAlg::initialize
virtual StatusCode initialize() override
Definition: PixelSiliconConditionsTestAlg.cxx:19
PixelSiliconConditionsTestAlg::m_readKeyHV
SG::ReadCondHandleKey< PixelDCSHVData > m_readKeyHV
Definition: PixelSiliconConditionsTestAlg.h:38
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
PixelDistortionData::correctSimulation
Amg::Vector2D correctSimulation(uint32_t hashID, const Amg::Vector2D &locpos, const Amg::Vector3D &direction) const
Definition: PixelDistortionData.cxx:186
PixelDistortionData::correctReconstruction
Amg::Vector2D correctReconstruction(uint32_t hashID, const Amg::Vector2D &locpos, const Amg::Vector3D &direction) const
Definition: PixelDistortionData.cxx:180
PixelSiliconConditionsTestAlg.h
ChargeCalibParameters.h
Structs for holding charge calibration parameterisation and data.
deg
#define deg
Definition: SbPolyhedron.cxx:17
InDetDD::PixelDiodeType::GANGED
@ GANGED
InDetDD::PixelDiodeType::LONG
@ LONG
lumiFormat.i
int i
Definition: lumiFormat.py:92
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
PixelSiliconConditionsTestAlg::m_distortionKey
SG::ReadCondHandleKey< PixelDistortionData > m_distortionKey
Definition: PixelSiliconConditionsTestAlg.h:47
PixelSiliconConditionsTestAlg::execute
virtual StatusCode execute() override
Definition: PixelSiliconConditionsTestAlg.cxx:30
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
PixelSiliconConditionsTestAlg::m_chargeDataKey
SG::ReadCondHandleKey< PixelChargeCalibCondData > m_chargeDataKey
Definition: PixelSiliconConditionsTestAlg.h:44
AthAlgorithm
Definition: AthAlgorithm.h:47
beamspotman.dir
string dir
Definition: beamspotman.py:623
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
IdentifierHash.h
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
PixelSiliconConditionsTestAlg::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: PixelSiliconConditionsTestAlg.h:41
PlotSFuncertainty.calib
calib
Definition: PlotSFuncertainty.py:110
python.PyAthena.v
v
Definition: PyAthena.py:157
PixelDistortionData::getId
unsigned long long getId(uint32_t hashID) const
Definition: PixelDistortionData.cxx:113
PixelDCSHVData::getBiasVoltage
float getBiasVoltage(const int chanNum) const
Definition: PixelDCSHVData.cxx:11
PixelDistortionData::correction
Amg::Vector2D correction(uint32_t hashID, const Amg::Vector2D &locpos, const Amg::Vector3D &direction) const
Definition: PixelDistortionData.cxx:120
PixelSiliconConditionsTestAlg::m_readKeyTemp
SG::ReadCondHandleKey< PixelDCSTempData > m_readKeyTemp
Definition: PixelSiliconConditionsTestAlg.h:35
PixelDistortionData::getDistortionMap
std::vector< float > getDistortionMap(uint32_t id) const
Definition: PixelDistortionData.cxx:100
Amg::AngleAxis3D
Eigen::AngleAxisd AngleAxis3D
Definition: GeoPrimitives.h:45
InDetDD::PixelDiodeType::NORMAL
@ NORMAL
IdentifierHash
Definition: IdentifierHash.h:38
PixelSiliconConditionsTestAlg::PixelSiliconConditionsTestAlg
PixelSiliconConditionsTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: PixelSiliconConditionsTestAlg.cxx:14
PixelDCSTempData::getTemperature
float getTemperature(const int chanNum) const
Definition: PixelDCSTemp.cxx:11