Skip to content

Commit

Permalink
Fixprestepoint (#309)
Browse files Browse the repository at this point in the history
Fixing setting the pre step points coordinates. Setting the track ID to
be non zero (this is a temporary solution, to be further discusses).
Adding missing include in testField.

---------

Co-authored-by: Witold Pokorski <witoldp@omenrtx.dyndns.cern.ch>
  • Loading branch information
WitekPokorski and Witold Pokorski authored Sep 11, 2024
1 parent 2526590 commit 2510a3b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/AdePTGeant4Integration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ void AdePTGeant4Integration::FillG4Step(GPUHit *aGPUHit, G4Step *aG4Step, G4Touc

// G4Track
G4Track *aTrack = aG4Step->GetTrack();
// aTrack->SetTrackID(0); // Missing data
aTrack->SetTrackID(aGPUHit->fParentID); // Missing data
aTrack->SetParentID(aGPUHit->fParentID); // ID of the initial particle that entered AdePT
aTrack->SetPosition(*aPostStepPointPosition); // Real data
// aTrack->SetGlobalTime(0); // Missing data
Expand Down Expand Up @@ -424,19 +424,25 @@ void AdePTGeant4Integration::FillG4Step(GPUHit *aGPUHit, G4Step *aG4Step, G4Touc

// Pre-Step Point
G4StepPoint *aPreStepPoint = aG4Step->GetPreStepPoint();
aPreStepPoint->SetPosition(G4ThreeVector(aGPUHit->fPreStepPoint.fPosition)); // Real data
aPreStepPoint->SetPosition(G4ThreeVector(aGPUHit->fPreStepPoint.fPosition.x(),
aGPUHit->fPreStepPoint.fPosition.y(),
aGPUHit->fPreStepPoint.fPosition.z())); // Real data
// aPreStepPoint->SetLocalTime(0); // Missing data
// aPreStepPoint->SetGlobalTime(0); // Missing data
// aPreStepPoint->SetProperTime(0); // Missing data
aPreStepPoint->SetMomentumDirection(G4ThreeVector(aGPUHit->fPreStepPoint.fMomentumDirection)); // Real data
aPreStepPoint->SetMomentumDirection(G4ThreeVector(aGPUHit->fPreStepPoint.fMomentumDirection.x(),
aGPUHit->fPreStepPoint.fMomentumDirection.y(),
aGPUHit->fPreStepPoint.fMomentumDirection.z())); // Real data
aPreStepPoint->SetKineticEnergy(aGPUHit->fPreStepPoint.fEKin); // Real data
// aPreStepPoint->SetVelocity(0); // Missing data
aPreStepPoint->SetTouchableHandle(aPreG4TouchableHandle); // Real data
aPreStepPoint->SetMaterial(aPreG4TouchableHandle->GetVolume()->GetLogicalVolume()->GetMaterial()); // Real data
aPreStepPoint->SetMaterialCutsCouple(aPreG4TouchableHandle->GetVolume()->GetLogicalVolume()->GetMaterialCutsCouple());
// aPreStepPoint->SetSensitiveDetector(nullptr); // Missing data
// aPreStepPoint->SetSafety(0); // Missing data
aPreStepPoint->SetPolarization(G4ThreeVector(aGPUHit->fPreStepPoint.fPolarization)); // Real data
aPreStepPoint->SetPolarization(G4ThreeVector(aGPUHit->fPreStepPoint.fPolarization.x(),
aGPUHit->fPreStepPoint.fPolarization.y(),
aGPUHit->fPreStepPoint.fPolarization.z())); // Real data
// aPreStepPoint->SetStepStatus(G4StepStatus::fUndefined); // Missing data
// aPreStepPoint->SetProcessDefinedStep(nullptr); // Missing data
// aPreStepPoint->SetMass(0); // Missing data
Expand Down
1 change: 1 addition & 0 deletions test/testField/electrons.cu
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <G4HepEmElectronInteractionIoni.icc>
#include <G4HepEmElectronInteractionUMSC.icc>
#include <G4HepEmPositronInteractionAnnihilation.icc>
#include <G4HepEmElectronEnergyLossFluctuation.icc>

#ifdef CHECK_RESULTS
#include "CompareResponses.h"
Expand Down

0 comments on commit 2510a3b

Please sign in to comment.