9 #include "CLHEP/Units/SystemOfUnits.h"
14 #include "Identifier/Identifier.h"
35 m_detManagerNames{
"Pixel",
"SCT"}
38 declareProperty(
"ModulesOnly", m_modulesOnly =
true,
"Print transforms of modules");
39 declareProperty(
"ExpandId", m_expandId =
true,
"Print fields of identifier");
40 declareProperty(
"NominalPosition", m_nominal =
true,
"Print out nominal geometry");
41 declareProperty(
"AlignedPosition", m_aligned =
false,
"Print out aligned geometry");
42 declareProperty(
"FullRotationMatrix", m_fullRotationMatrix =
false,
"If true prints the 9 elements of the rotation matrix");
43 declareProperty(
"OutputFile", m_outputFileName =
"geometry.dat",
"Output file name");
44 declareProperty(
"DetectorManagerNames", m_detManagerNames);
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());
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) <<
" ";
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));