8#include "G4ThreeVector.hh"
14#include "GaudiKernel/SystemOfUnits.h"
15#include "GeoModelKernel/throwExcept.h"
22 constexpr double tolerance = 10. * Gaudi::Units::micrometer;
34 const G4TouchableHistory* touchHist =
static_cast<const G4TouchableHistory*
>(aStep->GetPreStepPoint()->GetTouchable());
42 <<touchHist->GetHistory()->GetTopVolume()->GetName()
70 <<
" gasGap: "<< (std::abs(locHitPos.z()) / readOutEle->
gasGapPitch()) + 1);
72 const int gasGap = std::round(std::abs(locHitPos.z()) / readOutEle->
gasGapPitch()) + 1;
76 const G4TouchableHistory* touchHist)
const {
80 const std::string& stationVolume = touchHist->GetVolume(3)->GetName();
82 const std::vector<std::string> volumeTokens =
tokenize(stationVolume.substr(stationVolume.rfind(
"Q")),
"_");
84 if (volumeTokens.size() != 4) {
88 const std::string stName = volumeTokens[0][1] ==
'S' ?
"STS" :
"STL";
89 const int stationEta =
atoi(volumeTokens[2]);
90 const int stationPhi =
atoi(volumeTokens[3]);
98 if (!readOutElemMl1 || !readOutElemMl2) {
100 <<
m_detMgr->idHelperSvc()->toStringDetEl(detElIdMl1)<<
" "<<stationVolume);
107 return std::abs(centerMl2.z()) -
tolerance <= std::abs(transformCenter.z()) ? readOutElemMl2 : readOutElemMl1;
#define ATH_MSG_VERBOSE(x)
sTgcIdHelper::sTgcChannelTypes chType
bool is_valid() const
Check if id is in a valid state.
const MuonGMR4::MuonDetectorManager * m_detMgr
Pointer to the underlying detector manager.
xAOD::MuonSimHit * propagateAndSaveStrip(const Identifier &hitId, const Amg::Transform3D &toGasGap, const G4Step *hitStep)
bool processStep(const G4Step *step) const
Checks whether the current step shall be processed at all.
ActsTrk::GeometryContext getGeoContext() const
Returns the current geometry context in the event.
const MuonGMR4::sTgcReadoutElement * getReadoutElement(const ActsTrk::GeometryContext &gctx, const G4TouchableHistory *touchHist) const
Retrieves the matching readout element to a G4 hit.
Identifier getIdentifier(const ActsTrk::GeometryContext &gctx, const MuonGMR4::sTgcReadoutElement *readOutEle, const Amg::Vector3D &hitAtGapPlane, sTgcIdHelper::sTgcChannelTypes chType) const
virtual G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist) override final
member functions
Amg::Transform3D globalToLocalTransform(const ActsTrk::GeometryContext &ctx) const
Returns the transformation from the global ATLAS coordinate system into the local coordinate system o...
Amg::Vector3D center(const ActsTrk::GeometryContext &ctx) const
Returns the geometrical center point of the readout element.
Identifier identify() const override final
Return the ATLAS identifier.
int multilayer() const
Returns the multilayer of the sTgcReadoutElement.
double gasGapPitch() const
Distance between 2 gas gaps.
int stationNameIndex(const std::string &name) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const
Identifier multilayerID(const Identifier &channeldID) const
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Include the common definitions from the MuonReadoutGeometry.
Amg::Transform3D getTransform(const G4VTouchable *history, unsigned int level)
Extracts the local -> global transformation from a TouchableHistory at a given level.
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
#define THROW_EXCEPTION(MESSAGE)