Message: particles exiting volume Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question particles exiting volume  

Forum: Event and Track Management
Date: 09 Feb, 2017
From: A. Hod <A. Hod>

Dear geant4 users,

I have a volume1 containing liquid and three carbon spheres (see attached fig.). The volume1 is irradiated with a planar electron beam.

I would like to calculate the positions (x, y and z), energy and the direction of electrons exiting volume1 and entering volume2.

Volume1 dimension: 800 nm x 800 nm x 500 nm
Volume1 dimension: 800 nm x 800 nm x 30  nm
Shperes: 20 nm diamter

I did it in the SteppinAction in the following way:

if (aStep->GetTrack()->GetTrackID()>=1 && (aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->GetParticleName() == "e-") ) 
 { 
     if ( (aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()=="Phy_volume1") 
|| (aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()== "Phy_Sphere3") 
&& (aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName()== " Phy_volume2")
&& (aStep->GetPostStepPoint()->GetStepStatus() == fGeomBoundary)) // to the particle particles left volume1 and eneter volume2. 

{

    G4StepPoint* postPoint = aStep->GetPostStepPoint(); 
    G4double x1=postPoint->GetPosition().x(); 
    G4double y1=postPoint->GetPosition().y(); 
    G4double z1=postPoint->GetPosition().z(); 

    G4ThreeVector direction = track->GetMomentumDirection(); 
    G4double ux1=direction.x(); 
    G4double uy1=direction.y(); 
    G4double uz1=direction.z(); 

   G4double Energy1 = aStep->GetPostStepPoint()->GetKineticEnergy();  
....
....
....

These output data are used to plot an image and visualize the spheres.

} But the results I obtained are sometimes strange ( I can only see the image of the sphere in the center of volume 1, shpere2) and dramatically affected by the StepMax value. Without SpepMax it works and with StepMax the results are entirely different. Is the above code correct? Thanks for your helps..

Best regards

A.H.

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2017/02/09/07.21-88482-figue01.png

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: particles exiting volume   (Marc Verderi - 09 Feb, 2017)
(_ None: Re: particles exiting volume   (A. Hod - 09 Feb, 2017)
(_ None: Re: particles exiting volume   (michel maire - 10 Feb, 2017)
 Add Message Add Message
to: "particles exiting volume "

 Subscribe Subscribe

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


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]