58{
59 if (verboseLevel>5) G4cout << "Process Hit" << G4endl;
60
61 G4double edep = aStep->GetTotalEnergyDeposit();
62 edep *= CLHEP::MeV;
63 if(edep==0.) {
64 if(aStep->GetTrack()->GetDefinition() != G4Geantino::GeantinoDefinition() &&
65 aStep->GetTrack()->GetDefinition() != G4ChargedGeantino::ChargedGeantinoDefinition())
66 return false;
67 }
68
69
70
71
72
73 const G4TouchableHistory *myTouch = dynamic_cast<const G4TouchableHistory*>(aStep->GetPreStepPoint()->GetTouchable());
74 if (not myTouch) {
75 G4cout << "PixelSensorGmxSD::ProcessHits bad dynamic_cast" << G4endl;
76 return false;
77 }
78 if(verboseLevel>5){
79 for (
int i=0;
i<myTouch->GetHistoryDepth();
i++){
80 std::string detname=myTouch->GetVolume(i)->GetLogicalVolume()->GetName();
81 int copyno=myTouch->GetVolume(i)->GetCopyNo();
82 G4cout << "Volume " <<detname <<" Copy Nr. " << copyno << G4endl;
83 }
84 }
85
86
87
88 G4ThreeVector coord1 = aStep->GetPreStepPoint()->GetPosition();
89 G4ThreeVector coord2 = aStep->GetPostStepPoint()->GetPosition();
90
91
92
93
94
95 const G4AffineTransform transformation = myTouch->GetHistory()->GetTopTransform();
96 G4ThreeVector localPosition1 = transformation.TransformPoint(coord1);
97 G4ThreeVector localPosition2 = transformation.TransformPoint(coord2);
98
99 HepGeom::Point3D<double> lP1,lP2;
103
107
108 TrackHelper trHelp(aStep->GetTrack());
110
112
113 std::string physVolName = myTouch->GetVolume(0)->GetName();
114
116
117
119 lP2,
120 edep,
121 aStep->GetPreStepPoint()->GetGlobalTime(),
122 std::move(mcParticleLink),
123 hitIdOfWafer);
124 return true;
125
126 }
127
128
129
130 int id = myTouch->GetVolume()->GetCopyNo();
131
133 lP2,
134 edep,
135 aStep->GetPreStepPoint()->GetGlobalTime(),
136 std::move(mcParticleLink),
137 id);
138 return true;
139}
int buildHitIdFromStringITk(int part, const std::string &) const
static const SiHitIdHelper * GetHelper()