I am working with geant4-v11.1.1 on a MacOS.
I have simulated a PET Scanner and a water ellipse in the middle of the scanner.
I simulate now a cylinder insider the water ellipse containing 44Scandium.
I wannt now to flag the photons that were scattered inside the water ellipse. So I thought, the right way to do this is when tracking the particle:
G4double edep = aStep->GetTotalEnergyDeposit();
G4String volumeName = aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName();
procName = aStep->GetPreStepPoint()->GetProcessDefinedStep()->GetProcessName();
if((edep>0 && procName ==“compt”) && ( volumeName == “phantom_physicalV” ) ){
//set flag
actAnalysis->SetScatter(1);}
I use the G4EmStandardPhysics_option4 Physicslist. However, if I track the particle like this, around 90% of the photons are marked as scattered while I would expect that only 20-30% of the photons should be scattered. Where is my mistake?
Thanks a lot for your help.
Elli
Are these annihilation photons marked as scatter and make it to a detector? The 20-30% number is a little low but IIRC comes from the scatter fraction after pairing events within energy windows (effectively it is low angle scatters that are the biggest nuisance in PET).
If you are not tagging these photons you get the following losses which makes that number higher
- Emission outside the solid angle of the PET scanner that still scatters
- Downscatter of one (or both) photons that would be rejected by the coincidence sorting.
- Counting of low angle scattering events that would still sit inside your acceptance energy window (energy resolution of a scintillator based system being >10%)
Hi @PetElli
What i realize is trackID is missing or track def is missing. You should focus on post steps function.
look this reference, Processes using only the PostStepDoIt method.
example: Compton scattering, hadron inelastic interaction. There are virtual methods, which are needed for more accurate tracking of charged particles:
Ref: Physics Processes — Book For Application Developers 11.2 documentation
Also, you can give a try like;
// Look for gammas,
auto* track = step->GetTrack();
if (track->GetDefinition() == G4Gamma::GammaDefinition()) {
auto* pre = step->GetPreStepPoint();
auto* post = step->GetPostStepPoint();
const G4VProcess* proc = post->GetProcessDefinedStep();
auto* vol = pre->GetPhysicalVolume(); // current volume of this step
if (proc && vol &&
proc->GetProcessName() == "compt" &&
vol->GetName() == "phantom_physicalV") {
// mark this gamma as scattered in phantom
// Score Gammas
}
}
I hope this helps.
Dear both,
thanks a lot, both helped. The hint using the PostStepPoint was especially helpful.
Many regards
Great @PetElli . Happy to help. Regards.