7 #include "G4ThreeVector.hh"
9 #include "G4Geantino.hh"
10 #include "G4ChargedGeantino.hh"
17 #include "GaudiKernel/SystemOfUnits.h"
18 #include "GeoModelKernel/throwExcept.h"
28 G4bool RpcSensitiveDetector::ProcessHits(G4Step* aStep,G4TouchableHistory*) {
30 if (!processStep(aStep)) {
33 const G4TouchableHistory* touchHist =
static_cast<const G4TouchableHistory*
>(aStep->GetPreStepPoint()->GetTouchable());
43 <<touchHist->GetHistory()->GetTopVolume()->GetName()
51 const std::optional<double> lambda = Amg::intersect<3>(locPreStep, locStepDir, Amg::Vector3D::UnitX(), 0.);
52 Amg::Vector3D gapCentreCross = localToGlobal * ( (lambda ? 1. : 0.) *locPreStep + lambda.value_or(0.) * locStepDir);
53 const Identifier etaHitID = getIdentifier(gctx, readOutEle, gapCentreCross,
false);
54 if (!etaHitID.is_valid()) {
60 propagateAndSaveStrip(etaHitID, toGasGap, aStep);
67 const RpcIdHelper& idHelper{m_detMgr->idHelperSvc()->rpcIdHelper()};
77 ATH_MSG_VERBOSE(
"Detector element: "<<m_detMgr->idHelperSvc()->toStringDetEl(firstChan)
80 <<
" gap width: "<<gapHalfWidth
81 <<
" gap length: "<<gapHalfLength);
86 return idHelper.channelID(readOutEle->
identify(),
92 const std::string stationVolume = touchHist->GetVolume(3)->GetName();
94 const std::vector<std::string> volumeTokens =
tokenize(stationVolume,
"_");
96 if (volumeTokens.size() != 7) {
97 THROW_EXCEPTION(
" Cannot deduce the station name from "<<stationVolume);
101 const std::string stName = volumeTokens[0].substr(0,3);
102 const int stationEta =
atoi(volumeTokens[2]);
103 const int stationPhi =
atoi(volumeTokens[3]);
106 const int doubletZ =
atoi(volumeTokens[6]);
107 const RpcIdHelper& idHelper{m_detMgr->idHelperSvc()->rpcIdHelper()};
109 const Identifier detElId = idHelper.padID(idHelper.stationNameIndex(stName),
114 <<m_detMgr->idHelperSvc()->toStringDetEl(detElId)<<
" "<<stationVolume);