![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
9 #include "CLHEP/Units/SystemOfUnits.h"
14 #include "Identifier/Identifier.h"
35 m_geoModelSvc(
"GeoModelSvc",
name),
36 m_detManagerNames{
"Pixel",
"SCT"}
39 declareProperty(
"ModulesOnly", m_modulesOnly =
true,
"Print transforms of modules");
40 declareProperty(
"ExpandId", m_expandId =
true,
"Print fields of identifier");
41 declareProperty(
"NominalPosition", m_nominal =
true,
"Print out nominal geometry");
42 declareProperty(
"AlignedPosition", m_aligned =
false,
"Print out aligned geometry");
43 declareProperty(
"FullRotationMatrix", m_fullRotationMatrix =
false,
"If true prints the 9 elements of the rotation matrix");
44 declareProperty(
"OutputFile", m_outputFileName =
"geometry.dat",
"Output file name");
54 ATH_CHECK(service(
"GeoModelSvc",geoModel));
59 return StatusCode::FAILURE;
72 return StatusCode::SUCCESS;
79 if (managerName==
"Pixel") {
81 elements = *pixelDetEleHandle;
82 if (not pixelDetEleHandle.
isValid() or elements==
nullptr) {
84 return StatusCode::RECOVERABLE;
86 }
else if (managerName==
"SCT") {
88 elements = *sctDetEleHandle;
89 if (not sctDetEleHandle.
isValid() or elements==
nullptr) {
91 return StatusCode::RECOVERABLE;
94 else if (managerName==
"ITkPixel") {
96 elements = *pixelDetEleHandle;
97 if (not pixelDetEleHandle.
isValid() or elements==
nullptr) {
99 return StatusCode::RECOVERABLE;
102 else if (managerName==
"ITkStrip") {
104 elements = *stripDetEleHandle;
105 if (not stripDetEleHandle.
isValid() or elements==
nullptr) {
107 return StatusCode::RECOVERABLE;
110 if (elements==
nullptr) {
111 ATH_MSG_FATAL(
"SiDetectorElementCollection elements is nullptr");
112 return StatusCode::FAILURE;
126 if (element->isPixel()) {
127 const PixelID * pixIdHelper =
dynamic_cast<const PixelID *
>(element->getIdHelper());
137 const SCT_ID * sctIdHelper =
dynamic_cast<const SCT_ID *
>(element->getIdHelper());
154 trans = element->moduleTransform();
155 defTrans = element->defModuleTransform();
159 trans = element->transform();
160 defTrans = element->defTransform();
163 std::ostringstream idstr;
165 idstr << 2 <<
" " <<
det <<
" "
166 <<
bec <<
" " << layer_disk <<
" "
167 << phi_module <<
" " << eta_module <<
" "
168 <<
side <<
" " <<
id <<
" ";
170 idstr << element->getIdHelper()->show_to_string(
id) <<
" ";
180 return StatusCode::SUCCESS;
190 return StatusCode::SUCCESS;
196 return StatusCode::SUCCESS;
203 std::ostringstream ostr;
204 ostr <<
xyz.x() <<
" " <<
xyz.y() <<
" " <<
xyz.z() <<
" ";
206 for (
int i=0;
i < 3;
i++) {
207 for (
int j=0; j < 3; j++) {
208 ostr << trans(
i,j) <<
" ";
214 ostr << alpha <<
" " <<
beta <<
" " <<
gamma;
223 double& alpha,
double&
beta,
double &
gamma)
const
225 double siny = trans(0,2);
230 if ((trans(1,2) == 0) && (trans(2,2) == 0)) {
234 alpha = atan2(trans(1,1),trans(2,1));
236 alpha = atan2(-trans(1,2),trans(2,2));
237 gamma = atan2(-trans(0,1),trans(0,0));
238 if (alpha == 0) alpha = 0;
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_ITkStripDetEleCollKey
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
std::string find(const std::string &s)
return a remapped string
StatusCode printElements(const std::string &managerName)
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
virtual const std::string & pixelVersionOverride() const =0
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int phi_module(const Identifier &id) const
std::string m_outputFileName
void extractAlphaBetaGamma(const Amg::Transform3D &trans, double &alpha, double &beta, double &gamma) const
PrintSiElements(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_ITkPixelDetEleCollKey
::StatusCode StatusCode
StatusCode definition for legacy code.
Eigen::Affine3d Transform3D
virtual const std::string & inDetVersionOverride() const =0
int layer_disk(const Identifier &id) const
int eta_module(const Identifier &id) const
int layer_disk(const Identifier &id) const
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
virtual const std::string & SCT_VersionOverride() const =0
virtual const std::string & TRT_VersionOverride() const =0
std::string printTransform(const Amg::Transform3D &trans) const
#define ATH_MSG_WARNING(x)
std::vector< std::string > m_detManagerNames
int eta_module(const Identifier &id) const
int side(const Identifier &id) const
bool m_fullRotationMatrix
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
int phi_module(const Identifier &id) const
virtual const std::string & atlasVersion() const =0