Hi,
I want to perform a simulation of x-rays. I’m still at the beginning of my project where I’m using code snippets of other projects. So far, it’s working well, I guess but I’m a bit stuck now where I expect the x-rays to go through the detectors and not being stopped there. This is the code of the detector:
G4bool MySensitiveDetector::ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist)
{
G4Track *track = aStep->GetTrack();track->SetTrackStatus(fStopAndKill);
G4StepPoint *preStepPoint = aStep->GetPreStepPoint();
G4StepPoint *postStepPoint = aStep->GetPostStepPoint(); // leaves detectorG4ThreeVector posPhoton = preStepPoint->GetPosition();
const G4VTouchable *touchable = aStep->GetPreStepPoint()->GetTouchable();
G4int detector_number = touchable->GetCopyNumber();
G4VPhysicalVolume *physVol = touchable->GetVolume();
G4ThreeVector posDetector = physVol->GetTranslation();G4int evt = G4RunManager::GetRunManager()->GetCurrentEvent()->GetEventID();
G4AnalysisManager *man = G4AnalysisManager::Instance();
man->FillNtupleIColumn(0, evt);
man->FillNtupleDColumn(1, posDetector[0]);
man->FillNtupleDColumn(2, posDetector[1]);
man->FillNtupleDColumn(3, posDetector[2]);
man->AddNtupleRow(0);return true;
}
I have identified the line
track->SetTrackStatus(fStopAndKill);
which is responsible for doing so. However, the alternative options Geant4: G4TrackStatus.hh File Reference don’t tell me much which one I should use:
fAlive : Continue the tracking
fStopButAlive : Invoke active rest physics processes and kill the current track afterward
fStopAndKill : Kill the current track
fKillTrackAndSecondaries : Kill the current track and also associated secondaries. Suspend the current track.
fSuspend : Suspend the current track
fPostponeToNextEvent : Postpones the tracking of the current track to the next event