9#include "CLHEP/Units/SystemOfUnits.h"
14#include "Identifier/Identifier.h"
56 return StatusCode::FAILURE;
69 return StatusCode::SUCCESS;
76 if (managerName==
"Pixel") {
78 elements = *pixelDetEleHandle;
79 if (not pixelDetEleHandle.
isValid() or elements==
nullptr) {
81 return StatusCode::RECOVERABLE;
83 }
else if (managerName==
"SCT") {
85 elements = *sctDetEleHandle;
86 if (not sctDetEleHandle.
isValid() or elements==
nullptr) {
88 return StatusCode::RECOVERABLE;
91 else if (managerName==
"ITkPixel") {
93 elements = *pixelDetEleHandle;
94 if (not pixelDetEleHandle.
isValid() or elements==
nullptr) {
96 return StatusCode::RECOVERABLE;
99 else if (managerName==
"ITkStrip") {
101 elements = *stripDetEleHandle;
102 if (not stripDetEleHandle.
isValid() or elements==
nullptr) {
104 return StatusCode::RECOVERABLE;
107 if (elements==
nullptr) {
108 ATH_MSG_FATAL(
"SiDetectorElementCollection elements is nullptr");
109 return StatusCode::FAILURE;
123 if (element->isPixel()) {
124 const PixelID * pixIdHelper =
dynamic_cast<const PixelID *
>(element->getIdHelper());
134 const SCT_ID * sctIdHelper =
dynamic_cast<const SCT_ID *
>(element->getIdHelper());
141 side = sctIdHelper->
side(
id);
151 trans = element->moduleTransform();
152 defTrans = element->defModuleTransform();
156 trans = element->transform();
157 defTrans = element->defTransform();
160 std::ostringstream idstr;
162 idstr << 2 <<
" " << det <<
" "
163 << bec <<
" " << layer_disk <<
" "
164 << phi_module <<
" " << eta_module <<
" "
165 << side <<
" " <<
id <<
" ";
167 idstr << element->getIdHelper()->show_to_string(
id) <<
" ";
177 return StatusCode::SUCCESS;
187 return StatusCode::SUCCESS;
193 return StatusCode::SUCCESS;
200 std::ostringstream ostr;
201 ostr <<
xyz.x() <<
" " <<
xyz.y() <<
" " <<
xyz.z() <<
" ";
203 for (
int i=0; i < 3; i++) {
204 for (
int j=0; j < 3; j++) {
205 ostr << trans(i,j) <<
" ";
209 double alpha=0, beta=0, gamma=0;
211 ostr << alpha <<
" " << beta <<
" " << gamma;
220 double& alpha,
double& beta,
double &gamma)
const
222 double siny = trans(0,2);
227 if ((trans(1,2) == 0) && (trans(2,2) == 0)) {
231 alpha = atan2(trans(1,1),trans(2,1));
233 alpha = atan2(-trans(1,2),trans(2,2));
234 gamma = atan2(-trans(0,1),trans(0,0));
235 if (alpha == 0) alpha = 0;
236 if (gamma == 0) gamma = 0;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Class to hold the SiDetectorElement objects to be put in the detector store.
Class to hold geometrical description of a silicon detector element.
This is an Identifier helper class for the Pixel subdetector.
int layer_disk(const Identifier &id) const
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int eta_module(const Identifier &id) const
int phi_module(const Identifier &id) const
std::string m_outputFileName
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
std::vector< std::string > m_detManagerNames
virtual StatusCode initialize() override
virtual StatusCode execute() override
std::string printTransform(const Amg::Transform3D &trans) const
void extractAlphaBetaGamma(const Amg::Transform3D &trans, double &alpha, double &beta, double &gamma) const
virtual StatusCode finalize() override
bool m_fullRotationMatrix
StatusCode printElements(const std::string &managerName)
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_ITkPixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_ITkStripDetEleCollKey
ServiceHandle< IGeoModelSvc > m_geoModelSvc
PrintSiElements(const std::string &name, ISvcLocator *pSvcLocator)
This is an Identifier helper class for the SCT subdetector.
int layer_disk(const Identifier &id) const
int side(const Identifier &id) const
int phi_module(const Identifier &id) const
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int eta_module(const Identifier &id) const
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D