9 #include "G4StepPoint.hh"
11 #include "G4ThreeVector.hh"
13 #include "CLHEP/Units/GlobalSystemOfUnits.h"
14 #include "CLHEP/Units/GlobalPhysicalConstants.h"
36 unsigned int detId = 0;
38 LogDebug(
"PltSD") <<
" DetID = " << detId;
41 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
44 level = ((touch->GetHistoryDepth()) + 1);
49 G4String sensorName = touch->GetVolume(2)->GetName();
50 G4String telName = touch->GetVolume(3)->GetName();
51 G4String volumeName = touch->GetVolume(4)->GetName();
52 if (sensorName !=
"PLTSensorPlane")
53 std::cout <<
" PltSD::setDetUnitId -w- Sensor name not PLTSensorPlane " << std::endl;
54 if (telName !=
"Telescope")
55 std::cout <<
" PltSD::setDetUnitId -w- Telescope name not Telescope " << std::endl;
56 if (volumeName !=
"PLT")
57 std::cout <<
" PltSD::setDetUnitId -w- Volume name not PLT " << std::endl;
60 int columnNum = touch->GetReplicaNumber(0);
61 int rowNum = touch->GetReplicaNumber(1);
62 int sensorNum = touch->GetReplicaNumber(2);
63 int telNum = touch->GetReplicaNumber(3);
65 int temp = touch->GetReplicaNumber(5);
77 }
else if (telNum == 1) {
79 }
else if (telNum == 2) {
81 }
else if (telNum == 3) {
83 }
else if (telNum == 4) {
85 }
else if (telNum == 5) {
87 }
else if (telNum == 6) {
89 }
else if (telNum == 7) {
94 int halfCarriageNum = -1;
97 if (telNum == 0 || telNum == 1 || telNum == 2 || telNum == 3)
102 if (halfCarriageNum == 1) {
105 }
else if (telNum == 5) {
107 }
else if (telNum == 6) {
109 }
else if (telNum == 7) {
115 10000000 * pltNum + 1000000 * halfCarriageNum + 100000 * telNum + 10000 * sensorNum + 100 * rowNum + columnNum;
124 static const float tolerance2 = (
float)(0.0025 * CLHEP::mm * CLHEP::mm);