17#include "GaudiKernel/MsgStream.h"
19#include "Identifier/Identifier.h"
60 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"initialize()" <<
endmsg;
65 msg(MSG::FATAL) <<
"Could not get TRT ID helper" <<
endmsg;
66 return StatusCode::FAILURE;
68 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"got the TRT ID" <<
endmsg;
71 if(
msgLvl(MSG::FATAL))
msg(MSG::FATAL) <<
"Problem retrieving TRT_DetectorManager" <<
endmsg;
72 return StatusCode::FAILURE;
78 msg(MSG::FATAL) <<
"Could not get SCT ID helper" <<
endmsg;
79 return StatusCode::FAILURE;
81 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"got the SCT ID" <<
endmsg;
86 msg(MSG::FATAL) <<
"Could not get Pixel ID helper" <<
endmsg;
87 return StatusCode::FAILURE;
89 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"got the Pixel ID" <<
endmsg;
95 return StatusCode::SUCCESS;
101 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"execute() check global position" <<
endmsg;
108 return StatusCode::SUCCESS;
110 std::cout <<
"========================================================================================" <<std::endl;
111 std::cout <<
"==================== Getting the Inner Detector Positions ==============================" <<std::endl;
112 std::cout <<
"========================================================================================" <<std::endl;
124 return StatusCode::SUCCESS;
134 return StatusCode::SUCCESS;
139 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writePixelPositions()" <<
endmsg;
143 if (not pixelDetEleHandle.
isValid() or elements==
nullptr) {
160 float pix_x = p3d.x();
161 float pix_y = p3d.y();
162 float pix_z = p3d.z();
165 << pix_barrel_ec <<
" "
166 << pix_layer_disk <<
" "
167 << pix_phi_module <<
" "
168 << pix_eta_module <<
" "
177 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"Leaving writePixelPositions()" <<
endmsg;
183 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeSCTPositions()" <<
endmsg;
187 if (not sctDetEleHandle.
isValid() or elements==
nullptr) {
198 int sct_barrel_ec =
m_SCTHelper->barrel_ec(wafer_id);
199 int sct_layer_disk=
m_SCTHelper->layer_disk(wafer_id);
200 int sct_phi_module=
m_SCTHelper->phi_module(wafer_id);
201 int sct_eta_module =
m_SCTHelper->eta_module(wafer_id);
203 float sct_x = p3d.x();
204 float sct_y = p3d.y();
205 float sct_z = p3d.z();
208 << sct_barrel_ec <<
" "
209 << sct_layer_disk <<
" "
210 << sct_phi_module <<
" "
211 << sct_eta_module <<
" "
219 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"Leaving writeSCTPositions()" <<
endmsg;
225 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeTRTPositions()" <<
endmsg;
246 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeTRTPositions()" <<
endmsg;
252 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeSimpleTRTPositions()" <<
endmsg;
255 std::vector<Identifier>::const_iterator trtStrawLayIt =
m_TRTHelper->straw_layer_begin();
256 std::vector<Identifier>::const_iterator trtStrawLayItE =
m_TRTHelper->straw_layer_end();
258 for(; trtStrawLayIt != trtStrawLayItE; ++trtStrawLayIt ) {
262 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeTRTPositions()" <<
endmsg;
268 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeDetailedTRTPositions()" <<
endmsg;
273 for (; trtStrawIt != trtStrawItE; ++trtStrawIt) {
288 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"Leaving writeDetailedTRTPositions()" <<
endmsg;
294 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeTRTPositions()" <<
endmsg;
300 int trt_layer_or_wheel =
m_TRTHelper->layer_or_wheel(trtId);
301 int trt_phi_module =
m_TRTHelper->phi_module(trtId);
302 int trt_straw_layer =
m_TRTHelper->straw_layer(trtId);
304 float trt_x = p3d.x();
305 float trt_y = p3d.y();
306 float trt_z = p3d.z();
309 << trt_barrel_ec <<
" "
310 << trt_layer_or_wheel <<
" "
311 << trt_phi_module <<
" "
312 << trt_straw_layer <<
" ";
322 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"Leaving writeTRTPositions()" <<
endmsg;
332 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeTwoTRTPositions()" <<
endmsg;
335 int trt_layer_or_wheel =
m_TRTHelper->layer_or_wheel(trtId);
336 int trt_phi_module =
m_TRTHelper->phi_module(trtId);
337 int trt_straw_layer =
m_TRTHelper->straw_layer(trtId);
343 float first_X = firstSampling.x();
344 float first_Y = firstSampling.y();
345 float first_Z = firstSampling.z();
349 float second_X = secondSampling.x();
350 float second_Y = secondSampling.y();
351 float second_Z = secondSampling.z();
354 << trt_barrel_ec <<
" "
355 << trt_layer_or_wheel <<
" "
356 << trt_phi_module <<
" "
357 << trt_straw_layer <<
" "
365 << trt_barrel_ec <<
" "
366 << trt_layer_or_wheel <<
" "
367 << trt_phi_module <<
" "
368 << trt_straw_layer <<
" "
376 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"Leaving writeTRTPositions()" <<
endmsg;
#define ATH_CHECK
Evaluate an expression and check for errors.
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
This is an Identifier helper class for the TRT subdetector.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
StatusCode initialize()
initialize
void writeTRTPositions()
Writing the TRT positions (depends on the level of detail)
std::string m_outputFileName
void writeTwoTRTPositions(Identifier const &trtId)
Write the TRT Positions, sampling each straw twice Allows the wire-by-wire alignment to be debugged.
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Pixel Data.
std::ofstream m_outputFile
GetDetectorPositions(const std::string &name, ISvcLocator *pSvcLocator)
Authors: John Alison johnda@hep.upenn.edu
const PixelID * m_PixelHelper
Tools.
const TRT_ID * m_TRTHelper
const SCT_ID * m_SCTHelper
void writePixelPositions()
Functions to get the data.
void writeSimpleTRTPositions()
Writing the Simple (not all straws) TRT Positions.
unsigned int m_detailLevel
Name of the Output file.
StatusCode execute()
execute
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
SCT Data.
void writeDetailedTRTPositions(bool doDoubleSampling=false)
Writing the Detailed (all straws) TRT Positions.
void writeSCTPositions()
Writing the SCT Positions.
StatusCode finalize()
Finalize.
const InDetDD::TRT_DetectorManager * m_TRTDetectorManager
This is a "hash" representation of an Identifier.
Class to hold the SiDetectorElement objects to be put in the detector store.
Class to hold geometrical description of a silicon detector element.
MultiRange::const_identifier_factory const_expanded_id_iterator
Eigen::Matrix< double, 3, 1 > Vector3D