Download presentation
Presentation is loading. Please wait.
Published bySandra Jacobs Modified over 8 years ago
1
Monte Carlo simulations in Geant4 Ivan Sivacek
2
Outline Numerical modeling methods – Origins – Deterministic & Monte Carlo – Variance reduction Geant 4 – a brief introduction “Pixel” program code used for simulations of MASHA focal silicon detector – Description of program classes and they work – How I made my simulations NOTE: Parts of lecturer’s presentations from “Cern-ISOLDE and SASc AUTUMN WORKSHOP ON GEANT 2011 in Casta-Papiernicka, Slovakia” are used.
3
MONTE CARLO A BIG GAME
4
Origin MCNP code for simulation of nuclear processes (diffusion of neutrons and fission, LANL) Idea of statistical sampling - end of 18 th century Stanislaw Ulam turn it into practical tool (on first computers, 1946) MCNPx (particles and heavy ions added) – runs on fortran Geant 4 runs on c++ Radiation shielding, nuclear medicine, space applications, accelerator experiments & many more…
5
Deterministic numerical modeling Time and position dependent set of differential equations and integrals How changes the characteristics of system on input values changes Computed for every time and position Limitations: – how accurately can equations approximate physical reality – discretization of steps
6
Monte Carlo numerical modeling Probable (average) behavior of whole system based on large number of trials at a game of chance Sequence of random numbers determines if something happens (probabilistically) (scatter, decay, absorption…) Ideal for transport particles, ions and rays trough matter Simulation of 10 5 – 10 8 events predicates behavior of 10 15 – 10 25 events
7
Variance reduction techniques Truncation (ignoring aspects of the problem that are irrelevant or inconsequential) Population control (sampling more important portions of the sampled population more often or less important portions less often) Probability modification (sampling from a fictitious but convenient distribution rather than the true distribution and weighting the results) Pseudodeterministic methods (replacing a portion of each random walk by deterministic or expected-value results)
8
GEANT 4 GEometry ANd Tracking toolkit
9
Geant4.cern.ch toolkit for simulating the passage of particles through matter comprehensive range of physics processes (electromagnetic, hadronic, optical) large set of long-lived particles, materials and elements with energies from 250 eV to ~TeV The toolkit has been created exploiting software engineering and object-oriented technology and implemented in the C++ (Linux, Windows, OSx)
10
GEANT 4 offers Most complicated and realistic geometries User choice of physics processes/models User choice of data collecting and visualization systems (outputs) Mandatory classes – DetectorConstruction, PhysicsList, PrimaryGeneratorAction Optional classes – RunAction, EventAction, StackingAction, TrackingAction, SteppingAction, DataCollection, Hits, Managers, Messengers… Очень много возможностей – как програма работает зависит строго от програмиcта
12
Terminology Step – the smallest unit of Geant4 simulation, a particle is transported from one point to another Trajectory and TrajectoryPoint – collection of steps and step points Process – the physics that happens along a step Track – a snapshot of a particle at some point along its path (not the same as trajectory) Event – a collection of info from tracks and particle trajectories Run – a collection of events
16
How does the program run main() method: – Sets the run manager (initialize mandatory + opt. classes and all components that will be used – visualization, data collelction, root..) – Sets input method – batch / (terminal-like) interactive mode / other user interface – Sets visualisation – Starts the session – Terminates session and closes program
17
MASHA FOCAL PLANE DETECTOR Pixel – the program for simulation of
18
Program “Pixel” - structure main(); PhysicsList DataCollection DetectorConstruction SessionStart (batch/interactive) RunAction VisManager EventAction PrimaryGeneratorAction TrackingAction SteppingAction
19
Program “Pixel” - structure main(); PhysicsList DataCollection DetectorConstruction SessionStart (batch/interactive) RunAction VisManager EventAction PrimaryGeneratorAction TrackingAction SteppingAction
20
PixelPhysicsList(); Sets cut values Construct particles Sets RadioactiveDecay process Choses EM physics list – LowEnergy – StandardEM – Penelope model – Livermore model – ICRU 79
21
PixelPhysicsList(); Sets cut values Sets cut values Construct particles Sets RadioactiveDecay process Choses EM physics list – LowEnergy – StandardEM – Penelope model – Livermore model – ICRU 79
23
Cut values
24
PixelPhysicsList(); Sets cut values Construct particles Construct particles Sets RadioactiveDecay process Choses EM physics list – LowEnergy – StandardEM – Penelope model – Livermore model – ICRU 79 calls GetParticleDefinition(); methods for all types of particles (generally used): Electron Positron Neutrino Antineutrino Alpha Generic Ion
25
PixelPhysicsList(); Sets cut values Construct particles Sets RadioactiveDecay process Sets RadioactiveDecay process Choses EM physics list – LowEnergy – StandardEM – Penelope model – Livermore model – ICRU 79 sets radioactive decay properties for all ions available and ordering of decay process* *process ordering will be explained with EM physics
26
PixelPhysicsList(); Sets cut values Construct particles Sets RadioactiveDecay process Choses EM physics list Choses EM physics list – LowEnergy – StandardEM – Penelope model – Livermore model – ICRU 79 removed with version 4.9.5
27
Electromagnetic Physics List ConstructParticle(); ConstructProcess();
28
Electromagnetic Physics List ConstructParticle(); ConstructParticle(); ConstructProcess(); Constructs particles used within this physics list - StandardEM: γ e -, e +, µ -, µ + π -, π +, κ -, κ + p -, p + 2 H, 3 H, 3 He, α, generic ion
29
Electromagnetic Physics List ConstructParticle(); ConstructProcess(); ConstructProcess(); Constructs processes for all particles registered and sets the process ordering
30
Electromagnetic Physics List ConstructParticle(); ConstructProcess(); ConstructProcess(); Constructs processes Constructs processes for all particles registered and sets the process ordering
31
Electromagnetic Physics List ConstructParticle(); ConstructProcess(); ConstructProcess(); process ordering Constructs processes for all particles registered and sets the process ordering
32
Process ordering
34
Electro-Magnetic Physics
35
Multiple Scattering models
37
Program “Pixel” - structure main(); PhysicsList DataCollection DetectorConstruction SessionStart (batch/interactive) RunAction VisManager EventAction PrimaryGeneratorAction TrackingAction SteppingAction
38
Detector Construction 192 focal strips 1,25 x 35 x 0,3 mm (MASHA FPD) 50 nm silicon layer in front of all strips Surrounding material – vacuum at 10 -7 Torr 0 ion beam
39
Geometry
40
Detail view <<< ion <<<
41
Program “Pixel” - structure main(); PhysicsList DataCollection DetectorConstruction SessionStart (batch/interactive) RunAction VisManager EventAction PrimaryGeneratorAction TrackingAction SteppingAction All data collecting is provided each step - in cooperation with stepping action !
42
Data Collection For all strip planes creates G4double fields for data storage (saves disk space) Scans all strip planes for deposited energy and writes it into field (each step) Finds strip with the biggest deposited energy and sends it into.root file Adds random shot from defined gauss spectrum (peak shape) Transfers data from field into.root file
43
Program “Pixel” - structure main(); PhysicsList DataCollection DetectorConstruction SessionStart (batch/interactive) RunAction VisManager EventAction PrimaryGeneratorAction TrackingAction SteppingAction
44
Visualization Manager Manages everything about visualization (if it is ordered by user) Adds colors to detector all parts and particle trajectories
45
Program “Pixel” - structure main(); PhysicsList DataCollection DetectorConstruction SessionStart (batch/interactive) RunAction VisManager EventAction PrimaryGeneratorAction TrackingAction SteppingAction
46
Run Action Adds time-mark to run Initializes data collection Gets number of events to be processed After each run (I use just 1 run) writes down (saves) all data files
47
Program “Pixel” - structure main(); PhysicsList DataCollection DetectorConstruction SessionStart (batch/interactive) RunAction VisManager EventAction PrimaryGeneratorAction TrackingAction SteppingAction
48
Event Action For each event: – Finds maximum deposited energy (data collection) – Randomizes energy (data collection) – Fills eventTree (.root file) Holds information how many events are already processed Sends information to VisManager
49
Program “Pixel” - structure main(); PhysicsList DataCollection DetectorConstruction SessionStart (batch/interactive) RunAction VisManager EventAction PrimaryGeneratorAction TrackingAction SteppingAction
50
Primary Generator Action Generates primary particles (primaries) with user-defined properties – class PrimaryGeneratorAction (transparent, user sees “what is inside” and “how it works”, but he need to code it) – GeneralParticleSource (“black box” which makes what you write, but you do not know how) – mostly used, handled by macro file (or terminal)
51
Program “Pixel” - structure main(); PhysicsList DataCollection DetectorConstruction SessionStart (batch/interactive) RunAction VisManager EventAction PrimaryGeneratorAction TrackingAction SteppingAction
52
Tracking Action Holds information about trajectories and properties of primary particles and secondaries (knows what is happening at the moment) Communicates with VisManager Communicates with SteppingAction
55
Program “Pixel” - structure main(); PhysicsList DataCollection DetectorConstruction SessionStart (batch/interactive) RunAction VisManager EventAction PrimaryGeneratorAction TrackingAction SteppingAction
56
Stepping Action Holds every necessary information about all particles each single step (basic element of MC) – Particle name, particle type – Atomic number, atomic mass – Volume – Total energy deposit – Pre- and post-step points For a given particle characteristic(s) scans all strips and ADDS total energy deposit (from step) into corresponding point in data field
57
Program “Pixel” - structure main(); PhysicsList DataCollection DetectorConstruction SessionStart (batch/interactive) RunAction VisManager EventAction PrimaryGeneratorAction TrackingAction SteppingAction
58
Session Orders stored in batch macro file Sets verbosities (how much to be displayed) Handles almost all visualization properties Sets GeneralParticleSource – Position – vertex, shape, type… – Angular and energy distribution – Types of particles to be shot Generally everything about particle source
59
Summary A SESSION consists of one or more RUNs During each RUN a number of particles are created Each particle inside a RUN represents an EVENT Each EVENT consists of small STEPs (Monte Carlo method is implemented here) Each STEP consists of PARTICLE characteristics, surrounding VOLUME characteristics and PHYSICAL PROCESSES in preStep, postStep or atRest particle states
60
HOW I MADE MY SIMULATIONS ? Let’s see
61
1 st alpha efficiency Alpha-particle source inside dead-layer in front of given strips, isotropic angular distribution Number of detector hits counted Number of escaping particles counted and compared
62
2 nd and 3 rd alpha decay Created user-defined decay chain and energies Events in alpha-peaks counted Repeated with recoils (systematic error ~ 5 % due to scatter = 0. keV energy deposit) Incoming 40 keV ion-beam and also implanted activity inside dead layer (isotropic, 1 eV)
63
Energy Calibration Source of alpha particles in real geometry, 50 nm dead layer + 150 nm TiO 2 layer Single energy per simulation ( 226 Ra decay chain) Energy spectra (peak positions) from all 352 strips simulated and given to Lubos
64
Peak tails Varying of DL thickness (one layer) Isotropic source of alpha particles inside DL + 40 keV ion beam Randomize energy (peaks shaping) Comparing with real data ( 202 Rn)
65
Recent simulation of DL measurement 50 nm DL, 863 nm of BoPET, 150 nm of TiO 2 Comparison of 1 eV 226 Ra inside titanium dioxide and isotropic point source of single alpha line GPS vertex in multiple positions representing various incident angles Simulation with infamous collimator
66
А тепер что делать ? Куда дальше ?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.