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