Message: Re: Scoring particles inside a sensitive volumen Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Scoring particles inside a sensitive volumen 

Forum: Biasing and Scoring
Re: Question Scoring particles inside a sensitive volumen (Balder)
Date: 15 May, 2014
From: Tsukasa Aso <Tsukasa Aso>


Three steps will be needed.

1) Checking the track really passed the scoring volume.
     The example code is in the source/digits_hits/scorer/src/ in G4 source code.
     The G4PSPassageCellCurrent::IsPassed() is the method to check a passage of track.

     The code is rather complicated. We have to continuously check the trackID from entering to exiting of the track through the scoring volume, because the step might be limited several times inside the scoring volume.     

2) Checking the track has no interaction inside the scoring volume.
     This can be done, for example, by checking the energy deposit of the track.
     This can be obtained by G4double G4Step::GetTotalEnergyDeposit().
     If the return value is greater than zero, we can think the interaction has occur. 

3) Checking the particle type for all tracks
     The particle identification number (PID) can be used. This is an integer number.
      For example, PDG code is usually used in Geant4 to identify the particle. (

   For the object aStep of G4Step,
   G4int pid =  aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
   Or you can get the particle name by
   const G4String& name  =  aStep->GetTrack()->GetDefinition()->GetParticleName();

Best regards,


 Add Message Add Message
to: "Re: Scoring particles inside a sensitive volumen"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews