Introduccin a GEANT4: componentes - PowerPoint PPT Presentation


PPT – Introduccin a GEANT4: componentes PowerPoint presentation | free to view - id: c8c0-MTA0N


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation

Introduccin a GEANT4: componentes


CSG (Constructed Solid Geometry): G4Box, G4Cons, G4Trap, G4Sphere, G4Polycone, etc. ... GPE: Physics editor based on Java GUI ... – PowerPoint PPT presentation

Number of Views:331
Avg rating:3.0/5.0
Slides: 46
Provided by: din1


Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Introduccin a GEANT4: componentes

Introducción a GEANT4 componentes
  • http//

Pedro Arce Dubois CIEMAT Curso Método de
MonteCarlo CIEMAT - 22 Nov 2005
  • Geometry
  • Magnetic field
  • Particle generator
  • G4Run/G4Event/G4Track/G4Step /G4Trajectory
  • Sensitive detector
  • Electromagnetic physics standard
  • Electromagnetic physics low energy (J.M. Pérez)
  • Production cuts
  • User interface
  • Visualisation
  • Hadronic physics

  • solid shape dimensions
  • CSG (Constructed Solid Geometry) G4Box, G4Cons,
    G4Trap, G4Sphere, G4Polycone, etc.
  • BREP (Boundary REPresented) G4BREPSolidPolycone,
    G4BSplineSurface, etc. (much slower navigation)
  • BOOLEAN a solid is made adding, substracting or
    intersecting two
  • STEP interface to import BREPs from CAD systems

  • Contains all information of a detector element
    except position
  • Minimum solid material
  • Sensitive detector
  • Visualisation
  • Magnetic field
  • User limits
  • Parameterisations of physics
  • ...

  • Information about placement of a volume
  • Several times of placement
  • G4PVPlacement
  • Is is a volume instance positioned once in a
  • G4PVParameterized
  • Parameterized by the copy number
  • Shape, size, material, position and rotation can
    be parameterized
  • G4PVReplica
  • Slicing a volume into smaller pieces (if it has a
  • G4PVDivision
  • Slicing a volume into smaller pieces (if it has a
  • Internally implemented as parameterization (no
  • Allows offset
  • Allows constructor with only number of divisions
    or size of division

Individual copies of a volume
How to identify a volume uniquely? Example -
one LV A placed in 5 positions (5 PV) inside
World - one LV B placed in 12 positions (12 PV)
inside A GEANT4 constructs 512 PV, not 5 PV of A
and 5x1260 PV of B And even a PV can represent
multiple copies (Parameterisations or
Replicas) - How can I have access to the 60
different copies of B (for example, for finding
where is a hit)? ANSWER each of the 60
volumes B will be a distinct G4VTouchable But,
for efficiency reasons, G4VTouchables are only
created at tracking time, when a particle enters
the corresponding volume
Individual copies of a volume
  • How to use touchables (from GEANT4 example
  • G4TouchableHistory (public G4VTouchable) has
    the information of the volume hierarchy at each
    of the two points of the current step

Magnetic Field
(No Transcript)
Magnetic field chords
The path is calculated using the chosen
integration method and then it is broken into
linear chord segments that closely approximate
the curved path The chords are used to
interrogate the Navigator, to see whether the
track has crossed a volume boundary
Particle Generator
Primary Generator
  • G4Event has a list of G4PrimaryVertexs
  • G4double X0, Y0, Z0
  • G4double T0
  • G4double Weight0
  • G4PrimaryVertex has a list of G4PrimaryParticles
  • G4int PDGcode
  • G4ParticleDefinition G4code
  • G4double Px, Py, Pz
  • G4int trackID
  • G4double charge
  • G4double polX, polY, polZ
  • G4double Weight0
  • G4double properTime
  • Geant4 provides some concrete implementations of
  • G4VPrimaryGenerator
  • G4ParticleGun one particle
  • G4HEPEvtInterface reading event particles from
    text files
  • G4GeneralParticleSource big flexibility

  • A concrete implementation of G4VPrimaryGenerator
  • Suitable to /HEPEVT/ common block, which many of
    (FORTRAN) HEP physics generators are compliant
  • ASCII file input
  • A good example for experiment-specific primary
    generator implementation
  • Another interface to HepMC class, which a few new
    (C) HEP physics generators are compliant to, is

  • A concrete implementation of G4VPrimaryGenerator
  • Generate radioactive decay fragments
  • Primary vertex is randomly chosen within a
    surface of a certain volume.
  • spectrum (defined in terms of energy or momentum)
  • angular distribution with respect to a
    user-defined axis or surface normal
  • spatial distribution of particles from 2D or 3D
    planar surfaces or beam line in Gaussian profile
    or generated homogeneously within a volume.
  • It also provides the option of biasing the
    sampling distribution. This is advantageous, for
    example, for sampling the area of a spacecraft
    where greater sensitivity to radiation effects is
    expected (e.g. where radiation detectors are
    located) or increasing the number of high-energy
    particles simulated, since these may produce
    greater numbers of secondaries.

G4Run /G4Event / G4Track / G4StepG4Trajectory
(No Transcript)
(No Transcript)
(No Transcript)
(No Transcript)
  • Step
  • Step has two points and also deltainformation
    of a particle (energy loss on the step,
    time-of-flight spent in the step, etc.)
  • Each point knows the volume. In case a step is
    limited by a volume boundary, the end point
    physically stands on the boundary, and it
    logically belongs to the next volume
  • Current volume G4TrackGetNextVolume()
  • G4StepGetPostStepPoint()-GetPhysicalVolume()
  • Previous volume G4TrackGetVolume()
  • G4StepGetPreStepPoint()-GetPhysicalVolume()
  • What you see with /tracking/verbose 1 is the
    current volume

  • Trajectory
  • Trajectory is a record of a track history. It
    stores some information of all steps done by the
    track as objects of G4VTrajectoryPoint class
  • The user can create its own trajectory class
    deriving from G4VTrajectory and
    G4VTrajectoryPoint base classes for storing any
    aditional information
  • While Tracks are killed when its tracking
    finishes, Trajectories are kept for an event
  • Think of your favorite application....

Attaching user information
  • Abstract classes
  • User can use his/her own class derived from the
    provided base class
  • G4Run, G4VHit, G4VDigit, G4VTrajectory,
  • Concrete classes
  • User can attach a user information class object
  • G4Event - G4VUserEventInformation
  • G4Track - G4VUserTrackInformation
  • G4PrimaryVertex - G4VUserPrimaryVertexInformation
  • G4PrimaryParticle - G4VUserPrimaryParticleInformat
  • G4Region - G4VUserRegionInformation
  • User information class object is deleted when
    associated Geant4 class object is deleted

Sensitive Detector
Detector sensitivity
  • A logical volume becomes sensitive if it has a
    pointer to a concrete class derived from
  • A sensitive detector either
  • constructs one or more hit objects or
  • accumulates values to existing hits
  • using information given in a G4Step object.
  • NOTE you must get the volume information from
    the PreStepPoint.

Sensitive detector and Hit
  • Each Logical Volume can have a pointer to a
    sensitive detector
  • Hit is a snapshot of the physical interaction of
    a track or an accumulation of interactions of
    tracks in the sensitive region of your detector
  • A sensitive detector creates hit(s) using the
    information given in G4Step object. The user has
    to provide his/her own implementation of the
    detector response
  • Hit objects, which still are the users class
    objects, are collected in a G4Event object at the
    end of an event

Hit class
  • Hit is a user-defined class derived from G4VHit.
  • You can store various types information by
    implementing your own concrete Hit class.
  • For example
  • Position and time of the step
  • Momentum and energy of the track
  • Energy deposition of the step
  • Geometrical information
  • or any combination of above

  • A G4Event object has a G4HCofThisEvent object at
    the end of (successful) event processing.
    G4HCofThisEvent object stores all hits
    collections made within the event.
  • Pointer(s) may be NULL if collection(s) are not
    created in the particular event.
  • Hits collections are stored by pointers of
    G4VHitsCollection base class. Thus, you have to
    cast them to types of individual concrete classes.

Electromagnetic Physics Standard
Physics in Geant4
  • Geant4 provides sets of alternative physics
    models so that the user can freely choose
    appropriate models according to the type of
    his/her application.
  • For example, some models are coarse but fast,
    while alternatives are most precise.
  • Each cross-section table or physics model (final
    state generation) has its own applicable energy
  • Combining more than one tables / models, one
    physics process can have enough coverage of
    energy range for wide variety of simulation
  • Several individual universities / physicists
    groups are contributing their physics models to
    Geant4. Given the modular structure of Geant4,
    contribution of each physics model are well
    recognized and credited.

Physics Process
  • OOD allow to implement or modify any physics
    process without affecting other parts of the
  • Tracking is independent from physics processes
    (Transportation is also a process)
  • The generation of the final state is independent
    from the access and use of cross sections
  • Transparent access via virtual functions to
  • cross sections (formulas, data sets, etc.)
  • models underlying physics processes
  • G4VProcess base class for all processes

Standard e.m. Physics Processes
Cover physics from 10 keV up to PeV
Features of Standard e.m. processes
  • Multiple scattering
  • new model
  • computes mean free path length and lateral
  • Ionisation features
  • optimise the generation of d-rays near boundaries
  • Variety of models for ionisation and energy loss
  • including the PhotoAbsorption Interaction model
  • Differential and Integral approach
  • for ionisation, Bremsstrahlung, positron
    annihilation, energy loss and multiple scattering

Multiple scattering 6.56 MeV proton , 92.6 mm Si
J.Vincour and P.Bem Nucl.Instr.Meth. 148. (1978)
(No Transcript)
Photo Absorption Ionisation Model
Ionisation energy loss produced by charged
particles in thin layers of absorbers
3 GeV/c p in 1.5 cm ArCH4
5 GeV/c p in 20.5 mm Si
  • Ionisation energy loss distribution produced by
    pions, PAI model
  • Gallery of electromagnetic physics documentation
    and results
  • http//

Electromagnetic physics Low energy(ver
charla de J.M. Perez Morales)
Production cuts
What are the (production) cuts?
  • - Some electromagnetic processes have diverging
    cross sections at low energy
  • Ionisation producing delta rays
  • Bremsstrahlung producing gammas
  • ? Need to put a cut produce only secondaries
    from some energy up
  • - GEANT3 cuts per energy
  • - GEANT4 cuts per range
  • ? more uniform treatment in different materials
  • - But cuts are converted to energy in each
    material and always used in energy

cut, step length and number of 2ary particles
  • Secondary particles are only produced above the
    energy cut ? Primary gives the step in which it
    would loose enough energy to produce a secondary
  • GEANT4 secondaries that would live for a length
    above range cut
  • Example Tracking of a muon with a cut of 1 mm in
  • Energy of secondary electron/positron to live 1mm
    in iron 1 GeV
  • Energy of secondary gamma to live 1mm in iron 10
  • Calculate in which step length the sum of the
    energies of all delta rays produced by the muon
    (ionisation is in reality a continuous process
    ocurring at atomic lengths) is enough to
    produce an electron of 1 GeV
  • Same for gammas from bremmstrahlung adding up to
    10 MeV
  • Same for ee- from pair production adding up to 1
  • Choose between the three the smallest step
    length make a step of this length
  • Bigger cut ? bigger step (? logarithmically)

Other Cuts in GEANT4
  • All cuts are always set by particle type
  • Tracking cuts
  • Not needed as in GEANT3, cross sections are
    calculated down to zero energy
  • UserLimits / G4UserSpecialCuts process
  • Define the step length
  • Kill particle if track length too big, time of
    flight too big, energy too small, range too small
  • User can define other conditions
  • An extra process that is attached to a
  • BUT just proposes an step, that competes with
    other processes
  • ? For example if in a volume there is an small
    electron cut ( produce delta rays every small
    step) and in the same volume a UserLimits selects
    a bigger step, this UserLimit have no effect,
    because ionisation proposes smaller steps than
    UserLimits process (and always the smallest step
    is chosen)

User Interface
GEANT4 User Interface
  • Several Graphical User Interfaces (GAG, MOMO,
  • G4UIterminal C-shell like character terminal
  • G4Utcsh G4UItcsh tcsh-like character terminal
    with command completion, history, etc
  • G4UIGAG Java based GUI
  • G4UIOPACS OPACS-based GUI, command completion,
  • G4UIXm Motif-based GUI, command completion,
  • G4UIBatch Batch job with macro file
  • Reading a file with a list of commands
  • Write filename as executable argument

Environmental Variables
  • Users can select and plug in (G)UI by setting
    environmental variables before compilation
  • setenv G4UI_USE_GUINAME
  • Example (G4UIterminal, GAG, and Motif)
  • setenv G4UI_USE_TERMINAL 1
  • setenv G4UI_USE_GAG 1
  • setenv G4UI_USE_XM 1
  • Note that Geant4 library should be installed
    with setting the corresponding environmental

Useful GUI Tools Released by Geant4 Developers
  • GGE Geometry editor based on Java GUI
  • http//
  • GPE Physics editor based on Java GUI
  • http//
  • OpenScientist, OPACS Flexible
    analysis environments
  • http//
  • http//

GEANT4 commands
  • Commands control what your job will do
  • /run/initialize
  • /run/beamOn
  • /tracking/verbose
  • /run/particle/dumpCutValues
  • ...
  • /control/manual prints all available commands
  • Usually they are put in a file and given as name
    to the executable
  • myg4prog mycommands.lis
  • All commands are processed through the singleton
    class G4UImanager
  • ? You can apply any command at any point in your
  • G4UImanager UI G4UImanagerGetUIpointer()
  • UI-ApplyCommand(run/beamOn)
  • New commands are easily created, creating a
    messenger and an action (see the many examples in