Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through...
Transcript of Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through...
![Page 1: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/1.jpg)
Short Introduction to Geant4
principle: step by step and particle by particle geometries: rebuilding a setup in the computer particles: from Geantinos to heavy ions processes: and the winner is ... random visualization: blue ions and green rays
![Page 2: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/2.jpg)
Step by Step – For Each Particle
produce particle with a particle gun fix particle type, Ekin, momentum direction, ...
go through the world in steps step size determined by cross sections steps end at volume borders apply processes
may create, change, destroy particles
continue until no particles are left or all outside the world volume
![Page 3: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/3.jpg)
Geometries
Geant4 handles geometrical, logical, and “physical” volumes separately geometrical volumes specify shapes logical volumes specify materials physical volumes specify placements in the setup
organization in a tree world volume mother volume ... volume
![Page 4: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/4.jpg)
Geometrical Volumes
“solids” in Geant4 parlance
construction from simple shapes many simple shapes available
see Geant4 Documentation shapes may be combined:
intersection, union, ...
construction from CAD data is also possible(I never tried this)
G4Tubs
G4ExtrudedSolid
G4Box
![Page 5: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/5.jpg)
Logical Volumes
association of shape and material grouping of child volumes
must be completely inside the mother volume
allows for repeated placement e.g. 8 Si detectors, but only one logical volume
assignment of visualization attributes e.g. color, transparency
“sensitive detector” for data readout (later)
![Page 6: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/6.jpg)
Physical Volumes
placement of logical volumes
each “replica” has its number for identification in data readout
![Page 7: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/7.jpg)
Example: a CACTUS NaI Crystal
G4VSolid* s = new G4Tubs(“s_nai_crystal”, 0, r, l/2, 0, 360*deg);
G4LogicalVolume* l = new G4LogicalVolume(s,GetMat("NaI"), "l_nai_crystal");
new G4PVPlacement(TranslateZ3D(l/2), l, "nai_crystal", mother, false, 0 );
![Page 8: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/8.jpg)
Sensitive Detectors
need to get information from interaction of particles with detector material
done using a “sensitive detector” for each particle passing, some information may
be collected and stored e.g. energy loss of a single particle e.g. A, Z of an ion
(i.e. information not accessible in an experiment)
data storage not directly included in Geant4(I use ROOT)
![Page 9: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/9.jpg)
Particles
many predefined particles: ions by A, Z with mass, ... photons ... “Geantino” for testing purposes
![Page 10: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/10.jpg)
Physics = Processes
each particle has a list of processes that apply list has to be made for each particle in the
simulation program best to look at examples provided with Geant4
different types of processes AlongStep, PostStep, AtRest
many processes already implemented
![Page 11: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/11.jpg)
AlongStep Processes
apply for all steps of the particle continuous processes
also those where a microscopic model is not feasible or too slow
example energy loss of ions in matter
![Page 12: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/12.jpg)
AtRest Processes
apply if the particle is at rest selection by remaining lifetime example
radioactive decay(seems to be implemented only for particles at rest in present Geant4 versions)
![Page 13: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/13.jpg)
PostStep Processes
apply for moving particles selection by interaction length examples:
elastic scattering already implemented in Geant4
knockout, inflight ray emission, ... processes may be added by the user
![Page 14: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/14.jpg)
Process Selection (PostStep)
choose n.o. interaction lengths (IL) randomly, ex distribution
current IL depends on material of volume here is the cross section angular distributions etc. defined by the process
process with shortest remaining IL wins this length is the step length new step, subtract from n.o. ILs left
reaching the volume border is also a “process”
![Page 15: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/15.jpg)
Visualization
several types of viewers DAWN – PostScript, noninteractive VRML, HepRep – 3D, interactive
most viewers not included in Geant4 display of geometries, but also of events
![Page 16: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/16.jpg)
Some (Partial) Examples
program structure script for viewing the geometry script for running a simulation
![Page 17: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/17.jpg)
need to define user classes: MyConstruction – create the detector geometry MyPhysicsList – assign processes to particles MyPrimaryGeneratorAction – create particles MyEventAction – read out data for each event
Program Structureint main(int argc,char* argv[]){ G4RunManager* runManager = new G4RunManager; runManager>SetUserInitialization( new MyConstruction ); runManager>SetUserInitialization( new MyPhysicsList ); runManager>SetUserAction(new MyPrimaryGeneratorAction); runManager>SetUserAction( new MyEventAction ); UI>ApplyCommand(G4String(“/control/execute ”)+argv[1]); delete runManager;}
![Page 18: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/18.jpg)
Visualization script
switch off debug messages
initialize run manager test for overlapping
volumes draw to VRML2
viewer: e.g. freewrl
/run/verbose 0/event/verbose 0/tracking/verbose 0
/run/initialize
/geometry/test/grid_test true
/vis/scene/create/vis/scene/add/volume world/vis/scene/add/axes/vis/open VRML2FILE/vis/viewer/flush
![Page 19: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/19.jpg)
Visualization Example
screenshot of CACTUS SiRi target support structures
with freewrl viewer
![Page 20: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/20.jpg)
Simulation script
set detector parameters
initialize run manager select output file select primaries
60Co, 2 rays
run (i.e. wait )
/GamSim/cactus/enable true/GamSim/beamtube/enable true/GamSim/beamtube/diameter 12.7 cm/GamSim/target/enable true/GamSim/target/material Cobalt/GamSim/target/size 14 mm/GamSim/target/thickness 0.5 mm
/run/initialize
/E450/roottree/filename cactus_60Co.root
/E450/gun/ion 0 0/E450/gun/eKin 0 MeV/E450/gun/product 0 0/E450/gun/beamDiameter 1 cm/E450/gun/beamUniform true/E450/gun/zRange 0.5 mm
/E450/gun/addEnergy 1173 1/E450/gun/addEnergy 1332 1
/run/beamOn 20000000
![Page 21: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/21.jpg)
Simulation Example 1
60Co source 200.000 rays
50% 1173 keV 50% 1332 keV
gaussian resolution preliminary artificial (while storing)
![Page 22: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/22.jpg)
Simulation Example 2
4He beam, 30 MeV 100 ions drawing trajectories
ions rays electrons
![Page 23: Short Introduction to Geant4 · e.g. reaction in the target, most particles would just go through examples Geant4 includes a lot of examples, also for “physics lists” (i.e. process](https://reader030.fdocuments.us/reader030/viewer/2022040910/5e8345c694a71a48092cbc19/html5/thumbnails/23.jpg)
Other Topics
biasing often it is necessary to enhance the desired
process e.g. reaction in the target, most particles would just go
through
examples Geant4 includes a lot of examples, also for “physics
lists” (i.e. process assignments to particles)
problems Geant4 does not like some geometries
(intersections) – trial and error