Creates a new ParticleState from a given ParticleState, universal transport tool.
156{
157
159
160
161
162
163
164
165
166
167
169
170 std::vector<Trk::HitInfo>*
hitVector =
nullptr;
171
172 int absPdg = abs(isp.
pdgCode());
173 bool photon = (absPdg == 22);
175 bool neutrino = (absPdg == 12) || (absPdg == 14) || (absPdg == 16);
177
178
179
181
182
184
185
186 const Trk::ITimedExtrapolator*
processor = &(*m_extrapolator);
187 const ISF::IParticleFilter*
filter =
nullptr;
188
189 if ( photon ) {
190 ATH_MSG_VERBOSE(
"[ fatras transport ] Photon - use transport tool for photons");
192 } else if ( neutrino ) {
193 ATH_MSG_VERBOSE(
"[ fatras transport ] Particle is neutrino -> particle ignored.");
194 return nullptr;
195 } else if ( !charged ){
196 ATH_MSG_VERBOSE(
"[ fatras transport ] Particle not charged - use transport tool for neutrals");
198 } else {
199 ATH_MSG_VERBOSE(
"[ fatras transport ] Particle is a lepton or charged hadron");
201 }
202
203 if (filter)
204 ATH_MSG_DEBUG(
"[ fatras transport ] Determined processor and filter.");
205 else
206 ATH_MSG_DEBUG(
"[ fatras transport ] Determined processor w/o filter.");
207
208
210 ATH_MSG_VERBOSE(
"[ fatras transport ] Filter not passed, ignore particle.");
211 return nullptr;
212 }
213
214 ATH_MSG_VERBOSE(
"[ fatras transport ] The StackParticle passed filter - starting transport.");
215
217
218
220 ATH_MSG_VERBOSE(
"[ fatras transport ] Particle free path : " << freepath);
221
222 double tDec = freepath > 0. ? freepath : -1.;
223 int decayProc = 0;
224
225
228 double beta =
mom/sqrt(mom*mom+mass*mass);
229
230 if ( tDec>0.) {
232 decayProc = 201;
233 }
234
235 Trk::TimeLimit timeLim(tDec,isp.
timeStamp(),decayProc);
236
237
238 if ( freepath>0. && freepath<0.01 ) {
240 ATH_MSG_VERBOSE(
"[ fatras transport ] Decay is triggered for input particle.");
242 }
243
244
246 int endProcess = decayProc;
247 m_validationTool->saveISFParticleInfo(isp,endProcess,&inputPar,timeLim.time,0.);
248 }
249
250 return nullptr;
251 }
252
253
254 Trk::PathLimit pathLim(-1.,0);
256 if (matLimit) {
257 pathLim=Trk::PathLimit( matLimit->
dMax,matLimit->
process);
258 pathLim.updateMat(matLimit->
dCollected,13.,0.);
259 } else if (absPdg!=999 && pHypothesis<99) {
261 }
262
263
264
266
267 std::unique_ptr<const Trk::TrackParameters> eParameters = nullptr;
268
269
272
273 if ( !charged ) {
274
275 eParameters =
processor->transportNeutralsWithPathLimit(inputPar,
276 pathLim,
277 timeLim,
279 pHypothesis,
281 nextGeoID);
282
283 } else {
284
286
288 inputCov.setZero();
289 std::unique_ptr<Trk::TrackParameters> measuredInputPar =
290 inputPar.associatedSurface()
291 .createUniqueTrackParameters(inputPar.parameters()[0],
292 inputPar.parameters()[1],
293 inputPar.parameters()[2],
294 inputPar.parameters()[3],
295 inputPar.parameters()[4],
296 std::move(inputCov));
297
298 eParameters =
processor->extrapolateWithPathLimit(*measuredInputPar,
299 pathLim,
300 timeLim,
301 Trk::alongMomentum,
302 pHypothesis,
304 nextGeoID);
305
306 } else {
307
308 eParameters =
processor->extrapolateWithPathLimit(inputPar,
309 pathLim,
310 timeLim,
312 pHypothesis,
314 nextGeoID);
315 }
316 }
317
318
321
330 }
331
333 }
334
335
337 if (nextGeoID<99) {
339 }
340
341
343
344 int dProc = ( timeLim.tMax>0. && timeLim.tMax<=timeLim.time ) ? timeLim.process : 0;
345 int mProc = ( pathLim.x0Max>0. && ( pathLim.x0Max <= pathLim.x0Collected ||
346 (pathLim.process>100 && pathLim.x0Max <= pathLim.l0Collected))) ? pathLim.process : 0;
347 int endProcess = eParameters ? 0 : ( dProc > mProc ? dProc : mProc );
348
349 m_validationTool->saveISFParticleInfo(isp,endProcess,eParameters.get(),timeLim.time,pathLim.x0Collected);
350
351 }
352
353
355 eParameters->position(),
356 eParameters->momentum(),
358
361 }
362
364
365 ISF::ParticleUserInformation* validInfo = new ISF::ParticleUserInformation();
370 }
371
372
373
374
375
376 if (uisp && timeLim.tMax>0. && timeLim.time >=timeLim.tMax ) {
378 ATH_MSG_VERBOSE(
"[ fatras transport ] Decay is triggered for input particle.");
380 }
381 delete uisp;
382 return nullptr;
383 } else if (uisp) {
384 ATH_MSG_VERBOSE(
"[ fatras transport ] Particle transported to detector boundary, return to stack, timing:" << uisp->
timeStamp());
386 return uisp;
387 }
388
389
390 return nullptr;
391}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define AmgSymMatrix(dim)
std::vector< FPGATrackSimHit > hitVector
static HEPVis_BooleanProcessor processor
double charge() const
charge of the particle
void setUserInformation(ParticleUserInformation *userInfo)
const ParticleUserInformation * getUserInformation() const
get/set ParticleUserInformation
const Amg::Vector3D & momentum() const
The current momentum vector of the ISFParticle.
void setNextGeoID(AtlasDetDescr::AtlasRegion geoID)
register the next AtlasDetDescr::AtlasRegion
double timeStamp() const
Timestamp of the ISFParticle.
const Amg::Vector3D & position() const
The current position of the ISFParticle.
int pdgCode() const
PDG value.
AtlasDetDescr::AtlasRegion nextGeoID() const
next geoID the particle will be simulated in
static ParticleClipboard & getInstance()
get the singleton instance
void setParticle(const ISF::ISFParticle &p)
save a particle on the clipboard
const MaterialPathInfo * materialLimit() const
void setGeneration(int gen)
void setProcess(int proc)
AtlasRegion
A simple enum of ATLAS regions and sub-detectors.
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
CurvilinearParametersT< TrackParametersDim, Charged, PlaneSurface > CurvilinearParameters
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.