57 if (verboseLevel>5) G4cout <<
"Process Hit" << G4endl;
59 G4double edep = aStep->GetTotalEnergyDeposit();
62 if(aStep->GetTrack()->GetDefinition() != G4Geantino::GeantinoDefinition() &&
63 aStep->GetTrack()->GetDefinition() != G4ChargedGeantino::ChargedGeantinoDefinition())
71 const G4TouchableHistory *myTouch =
dynamic_cast<const G4TouchableHistory*
>(aStep->GetPreStepPoint()->GetTouchable());
73 G4cout <<
"PixelSensorSD::ProcessHits bad dynamic_cast" << G4endl;
77 for (
int i=0;i<myTouch->GetHistoryDepth();i++){
78 std::string detname=myTouch->GetVolume(i)->GetLogicalVolume()->GetName();
79 int copyno=myTouch->GetVolume(i)->GetCopyNo();
80 G4cout <<
"Volume " <<detname <<
" Copy Nr. " << copyno << G4endl;
86 G4ThreeVector coord1 = aStep->GetPreStepPoint()->GetPosition();
87 G4ThreeVector coord2 = aStep->GetPostStepPoint()->GetPosition();
93 const G4AffineTransform transformation = myTouch->GetHistory()->GetTopTransform();
94 G4ThreeVector localPosition1 = transformation.TransformPoint(coord1);
95 G4ThreeVector localPosition2 = transformation.TransformPoint(coord2);
97 HepGeom::Point3D<double> lP1,lP2;
129 int BEcopyNo = myTouch->GetVolume()->GetCopyNo();
132 if(BEcopyNo == 100) {
135 etaMod = myTouch->GetVolume(1)->GetCopyNo();
139 phiMod = myTouch->GetVolume(2)->GetCopyNo();
143 LayerDisk = myTouch->GetVolume(3)->GetCopyNo();
148 G4cout <<
"In the Pixel Barrel" << G4endl;
149 G4cout <<
"----- Phi Module # " << phiMod << G4endl;
150 G4cout <<
"----- Eta Ladder # " << etaMod << G4endl;
151 G4cout <<
"----- Layer # " <<
LayerDisk << G4endl;
155 }
else if (BEcopyNo == 200) {
158 phiMod = myTouch->GetVolume(1)->GetCopyNo();
159 if (phiMod == 48) phiMod = 0;
164 LayerDisk = myTouch->GetVolume(2)->GetCopyNo();
167 BrlEcap = myTouch->GetVolume(3)->GetCopyNo();
173 BrlEcap = (coord1.z() > 0) ? 2 : -2;
178 G4cout <<
"In the Pixel EndCap" << G4endl;
179 G4cout <<
"----- PhiModule # " << phiMod << G4endl;
180 G4cout <<
"----- Disk # " <<
LayerDisk << G4endl;
181 G4cout <<
"----- Endcap # " << BrlEcap << G4endl;
185 }
else if (BEcopyNo == 300) {
188 phiMod = myTouch->GetVolume(1)->GetCopyNo();
191 etaMod = myTouch->GetVolume(2)->GetCopyNo()/2;
194 LayerDisk = myTouch->GetVolume(3)->GetCopyNo();
197 BrlEcap = myTouch->GetVolume(4)->GetCopyNo();
202 G4cout <<
"In the SLHC Pixel EndCap" << G4endl;
203 G4cout <<
"----- PhiModule # " << phiMod << G4endl;
204 G4cout <<
"----- Ring/Eta # " << etaMod << G4endl;
205 G4cout <<
"----- Disk # " <<
LayerDisk << G4endl;
206 G4cout <<
"----- Endcap # " << BrlEcap << G4endl;
209 }
else if(BEcopyNo == 400) {
218 LayerDisk = myTouch->GetVolume(1)->GetCopyNo();
221 phiMod = myTouch->GetVolume(3)->GetCopyNo();
224 BrlEcap = myTouch->GetVolume(4)->GetCopyNo();
228 G4cout <<
"In the DBM" << G4endl;
229 G4cout <<
"----- PhiModule # " << phiMod << G4endl;
230 G4cout <<
"----- Ring/Eta # " << etaMod << G4endl;
231 G4cout <<
"----- Disk # " <<
LayerDisk << G4endl;
232 G4cout <<
"----- Endcap # " << BrlEcap << G4endl;
235 }
else if(BEcopyNo == 500) {
237 std::string volName = myTouch->GetVolume()->GetName();
240 std::replace(volName.begin(),volName.end(),
'_',
' ');
242 std::vector<std::string> v;
243 std::istringstream s(volName);
251 phiMod = atoi(v[2].c_str());
252 etaMod = atoi(v[3].c_str());
255 G4cout <<
"Volume name " << volName <<G4endl;
256 double xpos = coord1.x();
257 double ypos = coord1.y();
258 double zpos = coord1.z();
259 double r = sqrt(xpos*xpos+ypos*ypos);
260 G4cout <<
"In the Alpine " << G4endl;
261 G4cout <<
"----- PhiModule # " << phiMod << G4endl;
262 G4cout <<
"----- Ring/Eta # " << etaMod << G4endl;
263 G4cout <<
"----- Disk # " <<
LayerDisk << G4endl;
264 G4cout <<
"----- Endcap # " << BrlEcap << G4endl;
265 G4cout <<
"----- Pos # " <<
r<<
" "<<zpos << G4endl;
266 G4cout <<
"----- volume " << myTouch->GetVolume()->GetName()<< G4endl;
267 G4cout <<
" " << myTouch->GetVolume(1)->GetName()<<
" "<<
268 myTouch->GetVolume(2)->GetName()<<
" " << myTouch->GetVolume(3)->GetName()<<G4endl;
271 }
else if(BEcopyNo == 600) {
273 std::string volName = myTouch->GetVolume()->GetName();
276 std::replace(volName.begin(),volName.end(),
'_',
' ');
278 std::vector<std::string> v;
279 std::istringstream s(volName);
285 BrlEcap = atoi(v[1].c_str());
287 phiMod = atoi(v[3].c_str());
288 etaMod = atoi(v[4].c_str());
291 double xpos = coord1.x();
292 double ypos = coord1.y();
293 double zpos = coord1.z();
294 double r = sqrt(xpos*xpos+ypos*ypos);
295 G4cout <<
"Volume name " << volName <<G4endl;
296 G4cout <<
"In the ITk EC ring " << G4endl;
297 G4cout <<
"----- PhiModule # " << phiMod << G4endl;
298 G4cout <<
"----- Ring/Eta # " << etaMod << G4endl;
299 G4cout <<
"----- Disk # " <<
LayerDisk << G4endl;
300 G4cout <<
"----- Endcap # " << BrlEcap << G4endl;
301 G4cout <<
"----- Pos # " <<
r<<
" "<<zpos << G4endl;
302 G4cout <<
"----- volume " << myTouch->GetVolume()->GetName()<< G4endl;
303 G4cout <<
" " << myTouch->GetVolume(1)->GetName()<<
" "<<
304 myTouch->GetVolume(2)->GetName()<<
" " << myTouch->GetVolume(3)->GetName()<<G4endl;
310 description <<
"ProcessHits: Unrecognized geometry in Pixel sensitive detector. Please contact the maintainer of the Pixel Detector Description.";
311 description <<
"If you are processing a GeoModelXML geometry, please ensure a PixelSensorGmxSD instance is used instead of this (PixelSensorSD).";
312 G4Exception(
"PixelSensorSD",
"UnrecognizedPixelGeometry", FatalException,
description);
323 aStep->GetPreStepPoint()->GetGlobalTime(),