17#include "GaudiKernel/MsgStream.h"
19#include "Identifier/Identifier.h"
61 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"initialize()" <<
endmsg;
66 msg(MSG::FATAL) <<
"Could not get TRT ID helper" <<
endmsg;
67 return StatusCode::FAILURE;
69 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"got the TRT ID" <<
endmsg;
72 if(
msgLvl(MSG::FATAL))
msg(MSG::FATAL) <<
"Problem retrieving TRT_DetectorManager" <<
endmsg;
73 return StatusCode::FAILURE;
79 msg(MSG::FATAL) <<
"Could not get SCT ID helper" <<
endmsg;
80 return StatusCode::FAILURE;
82 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"got the SCT ID" <<
endmsg;
87 msg(MSG::FATAL) <<
"Could not get Pixel ID helper" <<
endmsg;
88 return StatusCode::FAILURE;
90 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"got the Pixel ID" <<
endmsg;
96 return StatusCode::SUCCESS;
102 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"execute() check global position" <<
endmsg;
109 return StatusCode::SUCCESS;
111 std::cout <<
"========================================================================================" <<std::endl;
112 std::cout <<
"==================== Getting the Inner Detector Positions ==============================" <<std::endl;
113 std::cout <<
"========================================================================================" <<std::endl;
125 return StatusCode::SUCCESS;
135 return StatusCode::SUCCESS;
140 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writePixelPositions()" <<
endmsg;
144 if (not pixelDetEleHandle.
isValid() or elements==
nullptr) {
161 float pix_x = p3d.x();
162 float pix_y = p3d.y();
163 float pix_z = p3d.z();
166 << pix_barrel_ec <<
" "
167 << pix_layer_disk <<
" "
168 << pix_phi_module <<
" "
169 << pix_eta_module <<
" "
178 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"Leaving writePixelPositions()" <<
endmsg;
184 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeSCTPositions()" <<
endmsg;
188 if (not sctDetEleHandle.
isValid() or elements==
nullptr) {
199 int sct_barrel_ec =
m_SCTHelper->barrel_ec(wafer_id);
200 int sct_layer_disk=
m_SCTHelper->layer_disk(wafer_id);
201 int sct_phi_module=
m_SCTHelper->phi_module(wafer_id);
202 int sct_eta_module =
m_SCTHelper->eta_module(wafer_id);
204 float sct_x = p3d.x();
205 float sct_y = p3d.y();
206 float sct_z = p3d.z();
209 << sct_barrel_ec <<
" "
210 << sct_layer_disk <<
" "
211 << sct_phi_module <<
" "
212 << sct_eta_module <<
" "
220 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"Leaving writeSCTPositions()" <<
endmsg;
226 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeTRTPositions()" <<
endmsg;
247 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeTRTPositions()" <<
endmsg;
253 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeSimpleTRTPositions()" <<
endmsg;
256 std::vector<Identifier>::const_iterator trtStrawLayIt =
m_TRTHelper->straw_layer_begin();
257 std::vector<Identifier>::const_iterator trtStrawLayItE =
m_TRTHelper->straw_layer_end();
259 for(; trtStrawLayIt != trtStrawLayItE; ++trtStrawLayIt ) {
263 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeTRTPositions()" <<
endmsg;
269 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeDetailedTRTPositions()" <<
endmsg;
274 for (; trtStrawIt != trtStrawItE; ++trtStrawIt) {
289 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"Leaving writeDetailedTRTPositions()" <<
endmsg;
295 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeTRTPositions()" <<
endmsg;
301 int trt_layer_or_wheel =
m_TRTHelper->layer_or_wheel(trtId);
302 int trt_phi_module =
m_TRTHelper->phi_module(trtId);
303 int trt_straw_layer =
m_TRTHelper->straw_layer(trtId);
305 float trt_x = p3d.x();
306 float trt_y = p3d.y();
307 float trt_z = p3d.z();
310 << trt_barrel_ec <<
" "
311 << trt_layer_or_wheel <<
" "
312 << trt_phi_module <<
" "
313 << trt_straw_layer <<
" ";
323 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"Leaving writeTRTPositions()" <<
endmsg;
333 if (
msgLvl(MSG::VERBOSE))
msg(MSG::VERBOSE) <<
"In writeTwoTRTPositions()" <<
endmsg;
336 int trt_layer_or_wheel =
m_TRTHelper->layer_or_wheel(trtId);
337 int trt_phi_module =
m_TRTHelper->phi_module(trtId);
338 int trt_straw_layer =
m_TRTHelper->straw_layer(trtId);
344 float first_X = firstSampling.x();
345 float first_Y = firstSampling.y();
346 float first_Z = firstSampling.z();
350 float second_X = secondSampling.x();
351 float second_Y = secondSampling.y();
352 float second_Z = secondSampling.z();
355 << trt_barrel_ec <<
" "
356 << trt_layer_or_wheel <<
" "
357 << trt_phi_module <<
" "
358 << trt_straw_layer <<
" "
366 << trt_barrel_ec <<
" "
367 << trt_layer_or_wheel <<
" "
368 << trt_phi_module <<
" "
369 << trt_straw_layer <<
" "
377 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.
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.
StatusCode execute(const EventContext &ctx)
execute
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.
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