55 if (verboseLevel>5) G4cout <<
"Process Hit" << G4endl;
57 G4double edep = aStep->GetTotalEnergyDeposit();
60 if(aStep->GetTrack()->GetDefinition() != G4Geantino::GeantinoDefinition() &&
61 aStep->GetTrack()->GetDefinition() != G4ChargedGeantino::ChargedGeantinoDefinition())
69 const G4TouchableHistory *myTouch =
dynamic_cast<const G4TouchableHistory*
>(aStep->GetPreStepPoint()->GetTouchable());
71 G4cout <<
"PixelSensorSD::ProcessHits bad dynamic_cast" << G4endl;
75 for (
int i=0;
i<myTouch->GetHistoryDepth();
i++){
76 std::string detname=myTouch->GetVolume(
i)->GetLogicalVolume()->GetName();
77 int copyno=myTouch->GetVolume(
i)->GetCopyNo();
78 G4cout <<
"Volume " <<detname <<
" Copy Nr. " << copyno << G4endl;
84 G4ThreeVector coord1 = aStep->GetPreStepPoint()->GetPosition();
85 G4ThreeVector coord2 = aStep->GetPostStepPoint()->GetPosition();
91 const G4AffineTransform transformation = myTouch->GetHistory()->GetTopTransform();
92 G4ThreeVector localPosition1 = transformation.TransformPoint(coord1);
93 G4ThreeVector localPosition2 = transformation.TransformPoint(coord2);
95 HepGeom::Point3D<double> lP1,lP2;
127 int BEcopyNo = myTouch->GetVolume()->GetCopyNo();
130 if(BEcopyNo == 100) {
133 etaMod = myTouch->GetVolume(1)->GetCopyNo();
137 phiMod = myTouch->GetVolume(2)->GetCopyNo();
141 LayerDisk = myTouch->GetVolume(3)->GetCopyNo();
146 G4cout <<
"In the Pixel Barrel" << G4endl;
147 G4cout <<
"----- Phi Module # " << phiMod << G4endl;
148 G4cout <<
"----- Eta Ladder # " <<
etaMod << G4endl;
149 G4cout <<
"----- Layer # " <<
LayerDisk << G4endl;
153 }
else if (BEcopyNo == 200) {
156 phiMod = myTouch->GetVolume(1)->GetCopyNo();
157 if (phiMod == 48) phiMod = 0;
162 LayerDisk = myTouch->GetVolume(2)->GetCopyNo();
165 BrlEcap = myTouch->GetVolume(3)->GetCopyNo();
171 BrlEcap = (coord1.z() > 0) ? 2 : -2;
176 G4cout <<
"In the Pixel EndCap" << G4endl;
177 G4cout <<
"----- PhiModule # " << phiMod << G4endl;
178 G4cout <<
"----- Disk # " <<
LayerDisk << G4endl;
179 G4cout <<
"----- Endcap # " << BrlEcap << G4endl;
183 }
else if (BEcopyNo == 300) {
186 phiMod = myTouch->GetVolume(1)->GetCopyNo();
189 etaMod = myTouch->GetVolume(2)->GetCopyNo()/2;
192 LayerDisk = myTouch->GetVolume(3)->GetCopyNo();
195 BrlEcap = myTouch->GetVolume(4)->GetCopyNo();
200 G4cout <<
"In the SLHC Pixel EndCap" << G4endl;
201 G4cout <<
"----- PhiModule # " << phiMod << G4endl;
202 G4cout <<
"----- Ring/Eta # " <<
etaMod << G4endl;
203 G4cout <<
"----- Disk # " <<
LayerDisk << G4endl;
204 G4cout <<
"----- Endcap # " << BrlEcap << G4endl;
207 }
else if(BEcopyNo == 400) {
216 LayerDisk = myTouch->GetVolume(1)->GetCopyNo();
219 phiMod = myTouch->GetVolume(3)->GetCopyNo();
222 BrlEcap = myTouch->GetVolume(4)->GetCopyNo();
226 G4cout <<
"In the DBM" << G4endl;
227 G4cout <<
"----- PhiModule # " << phiMod << G4endl;
228 G4cout <<
"----- Ring/Eta # " <<
etaMod << G4endl;
229 G4cout <<
"----- Disk # " <<
LayerDisk << G4endl;
230 G4cout <<
"----- Endcap # " << BrlEcap << G4endl;
233 }
else if(BEcopyNo == 500) {
235 std::string volName = myTouch->GetVolume()->GetName();
240 std::vector<std::string>
v;
241 std::istringstream
s(volName);
249 phiMod =
atoi(
v[2].c_str());
253 G4cout <<
"Volume name " << volName <<G4endl;
254 double xpos = coord1.x();
255 double ypos = coord1.y();
256 double zpos = coord1.z();
257 double r = sqrt(xpos*xpos+ypos*ypos);
258 G4cout <<
"In the Alpine " << G4endl;
259 G4cout <<
"----- PhiModule # " << phiMod << G4endl;
260 G4cout <<
"----- Ring/Eta # " <<
etaMod << G4endl;
261 G4cout <<
"----- Disk # " <<
LayerDisk << G4endl;
262 G4cout <<
"----- Endcap # " << BrlEcap << G4endl;
263 G4cout <<
"----- Pos # " <<
r<<
" "<<zpos << G4endl;
264 G4cout <<
"----- volume " << myTouch->GetVolume()->GetName()<< G4endl;
265 G4cout <<
" " << myTouch->GetVolume(1)->GetName()<<
" "<<
266 myTouch->GetVolume(2)->GetName()<<
" " << myTouch->GetVolume(3)->GetName()<<G4endl;
269 }
else if(BEcopyNo == 600) {
271 std::string volName = myTouch->GetVolume()->GetName();
276 std::vector<std::string>
v;
277 std::istringstream
s(volName);
283 BrlEcap =
atoi(
v[1].c_str());
285 phiMod =
atoi(
v[3].c_str());
289 double xpos = coord1.x();
290 double ypos = coord1.y();
291 double zpos = coord1.z();
292 double r = sqrt(xpos*xpos+ypos*ypos);
293 G4cout <<
"Volume name " << volName <<G4endl;
294 G4cout <<
"In the ITk EC ring " << G4endl;
295 G4cout <<
"----- PhiModule # " << phiMod << G4endl;
296 G4cout <<
"----- Ring/Eta # " <<
etaMod << G4endl;
297 G4cout <<
"----- Disk # " <<
LayerDisk << G4endl;
298 G4cout <<
"----- Endcap # " << BrlEcap << G4endl;
299 G4cout <<
"----- Pos # " <<
r<<
" "<<zpos << G4endl;
300 G4cout <<
"----- volume " << myTouch->GetVolume()->GetName()<< G4endl;
301 G4cout <<
" " << myTouch->GetVolume(1)->GetName()<<
" "<<
302 myTouch->GetVolume(2)->GetName()<<
" " << myTouch->GetVolume(3)->GetName()<<G4endl;
308 description <<
"ProcessHits: Unrecognized geometry in Pixel sensitive detector. Please contact the maintainer of the Pixel Detector Description.";
309 description <<
"If you are processing a GeoModelXML geometry, please ensure a PixelSensorGmxSD instance is used instead of this (PixelSensorSD).";
310 G4Exception(
"PixelSensorSD",
"UnrecognizedPixelGeometry", FatalException,
description);
318 EventContext
const* eventContext{
nullptr};
320 eventContext = &eventInfo->GetEventContext();
326 aStep->GetPreStepPoint()->GetGlobalTime(),
327 eventContext ? trHelp.GenerateParticleLink(*eventContext) : trHelp.GenerateParticleLink(),