8 #include "G4ThreeVector.hh"
14 #include "GaudiKernel/SystemOfUnits.h"
15 #include "GeoModelKernel/throwExcept.h"
29 G4bool sTgcSensitiveDetector::ProcessHits(G4Step* aStep,G4TouchableHistory*) {
30 if (!processStep(aStep)) {
34 const G4TouchableHistory* touchHist =
static_cast<const G4TouchableHistory*
>(aStep->GetPreStepPoint()->GetTouchable());
42 <<touchHist->GetHistory()->GetTopVolume()->GetName()
45 const Identifier etaHitID = getIdentifier(gctx, readOutEle, localToGlobal.translation(),
46 sTgcIdHelper::sTgcChannelTypes::Strip);
47 if (!etaHitID.is_valid()) {
53 propagateAndSaveStrip(etaHitID, toGasGap, aStep);
62 const sTgcIdHelper& idHelper{m_detMgr->idHelperSvc()->stgcIdHelper()};
67 ATH_MSG_VERBOSE(
"Detector element: "<<m_detMgr->idHelperSvc()->toStringDetEl(firstChan)
70 <<
" gasGap: "<< (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]);
92 const sTgcIdHelper& idHelper{m_detMgr->idHelperSvc()->stgcIdHelper()};
93 const Identifier detElIdMl1 = idHelper.channelID(idHelper.stationNameIndex(
stName), stationEta, stationPhi, 1, 1,
94 sTgcIdHelper::sTgcChannelTypes::Strip, 1);
95 const Identifier detElIdMl2 = idHelper.multilayerID(detElIdMl1, 2);
96 const sTgcReadoutElement* readOutElemMl1 = m_detMgr->getsTgcReadoutElement(detElIdMl1);
97 const sTgcReadoutElement* readOutElemMl2 = m_detMgr->getsTgcReadoutElement(detElIdMl2);
98 if (!readOutElemMl1 || !readOutElemMl2) {
100 <<m_detMgr->idHelperSvc()->toStringDetEl(detElIdMl1)<<
" "<<stationVolume);
107 return std::abs(centerMl2.z()) -
tolerance <= std::abs(transformCenter.z()) ? readOutElemMl2 : readOutElemMl1;