8 #include "montecarlo/scoring/GGSUniqueTouchableIDComputer.h"
16 G4TouchableHandle touchable = aStep->GetPreStepPoint()->GetTouchableHandle();
17 G4ThreeVector volPos = touchable->GetTranslation();
28 int historyDepth = touchable->GetHistoryDepth();
33 for (
int iDepth = 0; iDepth < historyDepth; iDepth++) {
35 touchableID += totMult * touchable->GetCopyNumber(iDepth);
37 if (iDepth != historyDepth - 1) {
39 if (!(touchable->GetVolume(iDepth)->IsReplicated())) {
41 auto storedMult = _multMap.find(touchable->GetVolume(iDepth));
42 if (storedMult == _multMap.end()) {
44 G4LogicalVolume *currLogVol = touchable->GetVolume(iDepth)->GetLogicalVolume();
45 G4LogicalVolume *motherLogVol = touchable->GetVolume(iDepth)->GetMotherLogical();
46 int nDaughters = motherLogVol->GetNoDaughters();
47 for (
int iDaughter = 0; iDaughter < nDaughters; iDaughter++) {
48 if (motherLogVol->GetDaughter(iDaughter)->GetLogicalVolume() == currLogVol)
52 _multMap[touchable->GetVolume(iDepth)] = currVolMult;
55 currVolMult = storedMult->second;
61 G4double width, offset;
63 touchable->GetVolume(iDepth)->GetReplicationData(axis, nReplicas, width, offset, consuming);
64 currVolMult = nReplicas;
66 totMult *= currVolMult;
A class that computes unique IDs for each touchable.
int ComputeTouchableID(G4Step *aStep)
Computes the touchable ID in a unique way.