Message: Re: particles list from an external file Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: particles list from an external file 

Keywords: data input
Forum: Particles
Re: None particles list from an external file (Andres)
Date: 02 Jul, 2005
From: Tore Ersmark <Tore Ersmark>

Hi Andres,

The G4GeneralParticleSource is what you are looking for. It
is available as a part of Geant4. The documentation is located 

Quick example setup:

Replace G4ParticleGun with G4GeneralParticleSource in your
"PrimaryGeneratorAction" (have a look at the advanced example
"xray_telescope"). You now have a "/gps/" menu available
in your application.

The GPS can then eg. generate an isotropic flux of protons
(according to SPENVIS/AP8-MIN) inside a spherical volume:
/gps/pos/type Surface
/gps/pos/shape Sphere
/gps/pos/centre 0. 0. 0. cm
/gps/pos/radius 5 m
/gps/ang/type cos
/gps/ang/surfnorm true
/gps/particle proton
/gps/ene/type Arb
/gps/hist/type arb
/gps/hist/point 1.0000E-01 9.3495E+02
/gps/hist/point 1.5000E-01 7.4930E+02
/gps/hist/point 2.0000E-01 5.7599E+02
/gps/hist/point 3.0000E-01 3.4861E+02
/gps/hist/point 4.0000E-01 2.2705E+02
/gps/hist/point 5.0000E-01 1.5053E+02
/gps/hist/point 6.0000E-01 1.0933E+02
/gps/hist/point 7.0000E-01 8.0514E+01
/gps/hist/point 1.0000E+00 4.2727E+01
/gps/hist/point 1.5000E+00 1.9945E+01
/gps/hist/point 2.0000E+00 1.2883E+01
/gps/hist/point 3.0000E+00 6.5495E+00
/gps/hist/point 4.0000E+00 3.8972E+00
/gps/hist/point 5.0000E+00 2.3967E+00
/gps/hist/point 6.0000E+00 1.5682E+00
/gps/hist/point 7.0000E+00 1.0267E+00
/gps/hist/point 1.0000E+01 5.4614E-01
/gps/hist/point 1.5000E+01 2.2480E-01
/gps/hist/point 2.0000E+01 1.4532E-01
/gps/hist/point 3.0000E+01 9.6825E-02
/gps/hist/point 4.0000E+01 8.1300E-02
/gps/hist/point 5.0000E+01 7.5740E-02
/gps/hist/point 6.0000E+01 7.4412E-02
/gps/hist/point 7.0000E+01 6.9227E-02
/gps/hist/point 1.0000E+02 5.2639E-02
/gps/hist/point 1.5000E+02 3.0612E-02
/gps/hist/point 2.0000E+02 1.6195E-02
/gps/hist/point 3.0000E+02 5.1693E-03
/gps/hist/point 4.0000E+02 0.0000E+00
/gps/hist/inter Lin

Good luck!


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

1 None: Re: particles list from an external file   (Andres - 22 Feb, 2007)
 Add Message Add Message
to: "Re: particles list from an external file"

 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 ]