153 {
154
155
156 int pdgId = G4InputTrack.GetDefinition()->GetPDGEncoding();
157
158
159 auto navigator =
s_propagator->GetNavigatorForPropagating();
160
161
162 std::vector<G4FieldTrack> outputStepVector;
163
164
165 G4FieldTrack tmpFieldTrack('0');
166 G4FieldTrackUpdator::Update(&tmpFieldTrack, &G4InputTrack);
167
168 outputStepVector.push_back(tmpFieldTrack);
169
170
171 for (
unsigned int iStep = 0; iStep <
m_maxSteps; iStep++) {
172
173 G4ThreeVector preStepPos = tmpFieldTrack.GetPosition();
174 G4ThreeVector preStepMom = tmpFieldTrack.GetMomentum();
175
176
178
179
180 outputStepVector.push_back(tmpFieldTrack);
181
182
183 auto volume = navigator->LocateGlobalPointAndSetup(
184 tmpFieldTrack.GetPosition(), nullptr);
185
186 if (volume != nullptr) {
187
188 std::string volName = volume->GetName();
189
190
192 break;
193 }
194 } else {
197 <<
"Transport failure for particle PID: " <<
pdgId <<
" at step "
199 << " - PreStep position: " << preStepPos << G4endl
200 << " - PreStep momentum: " << preStepMom << G4endl
201 << " - PostStep position: " << tmpFieldTrack.GetPosition() << G4endl
202 << " - PostStep momentum: " << tmpFieldTrack.GetMomentum() << G4endl
203 << "Possible cause: The transport is likely outside the world volume."
204 << G4endl
205 << "Check if an envelope volume is defined and properly set up."
206 << G4endl << "This issue should not occur during normal operation.";
207 G4Exception("G4CaloTransportTool::transport",
208 "LocateGlobalPointAndSetup failed: Particle may be "
209 "transported outside the world volume.",
211 break;
212 }
213 }
214
215 return outputStepVector;
216}
std::string description
glabal timer - how long have I taken so far?