Generation of a primary event

Similar documents
Primary particle. Geant4 tutorial Paris, 4-8 June Giovanni Santin ESA / ESTEC. Rhea System SA

Geant4 User's Guide for Application Developers

Calculation of Source-detector Solid Angle, Using Monte Carlo Method, for Radioactive Sources with Various Geometries and Cylindrical Detector

Introduction to Hands-on 4 ~Digest of exercise ~

GAMMA-RAY SPECTRA REFERENCES

Appendix A. An Overview of Monte Carlo N-Particle Software

Geant4 User's Guide for Application Developers

Physics 111 Homework Solutions Week #9 - Tuesday

Monte Carlo Simulation for Solid Angle Calculations in Alpha Particle Spectrometry

Introduction to the Monte Carlo method

Atomic and Nuclear Physics Laboratory (Physics 4780)

Main properties of atoms and nucleus

Cathode Ray Tube. Introduction. Functional principle

Chapter 18: The Structure of the Atom

The accurate calibration of all detectors is crucial for the subsequent data

PHOTOELECTRIC EFFECT AND DUAL NATURE OF MATTER AND RADIATIONS

Nuclear Physics. Nuclear Physics comprises the study of:

90 degrees Bremsstrahlung Source Term Produced in Thick Targets by 50 MeV to 10 GeV Electrons

AN INVESTIGATION INTO THE USEFULNESS OF THE ISOCS MATHEMATICAL EFFICIENCY CALIBRATION FOR LARGE RECTANGULAR 3 x5 x16 NAI DETECTORS

Vacuum Evaporation Recap

Mars Atmosphere and Volatile EvolutioN (MAVEN) Mission

Monte Carlo Simulations in Proton Dosimetry with Geant4

Computer Animation of Extensive Air Showers Interacting with the Milagro Water Cherenkov Detector

Other GEANT4 capabilities

Solar Energy. Outline. Solar radiation. What is light?-- Electromagnetic Radiation. Light - Electromagnetic wave spectrum. Electromagnetic Radiation

Interstellar Cosmic-Ray Spectrum from Gamma Rays and Synchrotron

2. Orbits. FER-Zagreb, Satellite communication systems 2011/12

Chapter NP-5. Nuclear Physics. Nuclear Reactions TABLE OF CONTENTS INTRODUCTION OBJECTIVES 1.0 NUCLEAR REACTIONS 2.0 NEUTRON INTERACTIONS

Activitity (of a radioisotope): The number of nuclei in a sample undergoing radioactive decay in each second. It is commonly expressed in curies

Jorge E. Fernández Laboratory of Montecuccolino (DIENCA), Alma Mater Studiorum University of Bologna, via dei Colli, 16, Bologna, Italy

HW6 Solutions Notice numbers may change randomly in your assignments and you may have to recalculate solutions for your specific case.

Nuclear Physics and Radioactivity

Helium-Neon Laser. Figure 1: Diagram of optical and electrical components used in the HeNe laser experiment.

MASS DEFECT AND BINDING ENERGY

LA-UR- Title: Author(s): Submitted to: Approved for public release; distribution is unlimited.

Tutorial 4.6 Gamma Spectrum Analysis

Simulation of Neutron Backgrounds from the ILC Extraction Line Beam Dump. Siva Darbha. Office of Science, SULI Program. University of Toronto

Energy Deposition in MICE Absorbers and Coils

Chapter 8. Low energy ion scattering study of Fe 4 N on Cu(100)

Monday 11 June 2012 Afternoon

[2] At the time of purchase of a Strontium-90 source, the activity is Bq.

2 Absorbing Solar Energy

Lab 8: Ballistic Pendulum

ACCELERATORS AND MEDICAL PHYSICS 2

Gamma Rays OBJECT: READINGS: APPARATUS: BACKGROUND:

Heating & Cooling in Molecular Clouds

Joint Application of Perl Scripts and MCNPX in Solving the Dynamic-Geometry Related Problems in Proton Beam Radiotherapy

AS COMPETITION PAPER 2008

Version 10.0-p01. User Interface II. Makoto Asai (SLAC) Geant4 Tutorial Course

1. Units of a magnetic field might be: A. C m/s B. C s/m C. C/kg D. kg/c s E. N/C m ans: D

Basic Nuclear Concepts

Laue lens for Nuclear Medicine

Geometrical importance sampling in Geant4: from design to verification

How To Understand Light And Color

GCE Physics A. Mark Scheme for June Unit G485: Fields, Particles and Frontiers of Physics. Advanced GCE. Oxford Cambridge and RSA Examinations

Notes on Elastic and Inelastic Collisions

ABSORPTION OF BETA AND GAMMA RADIATION

KE A = PE MAX 1/2M v 2 = k q1 q2 /R

Proton tracking for medical imaging and dosimetry

STUDY OF THE TRANSVERSE BEAM EMITTANCE OF THE BERN MEDICAL CYCLOTRON

Linear accelerator output, CT-data implementation, dose deposition in the presence of a 1.5 T magnetic field.

Synthetic Sensing: Proximity / Distance Sensors

BETA DECAY. transition probability/time

Using Monte Carlo method for simulation of electromagnetic radiation penetration in body ' s tissues

The Basic Principles of Sieve Analysis

07 - Cherenkov and transition radiation detectors

Kinetic Theory of Gases. Chapter 33. Kinetic Theory of Gases

. Tutorial #3 Building Complex Targets

Introduction to Geiger Counters

ENERGY LOSS OF ALPHA PARTICLES IN GASES

Chapter 22: Electric Flux and Gauss s Law

1. Basics of LASER Physics

Magnetic Field and Magnetic Forces

1090 IEEE TRANSACTIONS ON NUCLEAR SCIENCE, VOL. 50, NO. 4, AUGUST Intelligent Gamma-Ray Spectroscopy Using 3-D Position-Sensitive Detectors

Lecture 2 Macroscopic Interactions Neutron Interactions and Applications Spring 2010

Blackbody radiation. Main Laws. Brightness temperature. 1. Concepts of a blackbody and thermodynamical equilibrium.

Pro/ENGINEER Wildfire 4.0 Basic Design

TIME OF COMPLETION NAME SOLUTION DEPARTMENT OF NATURAL SCIENCES. PHYS 3650, Exam 2 Section 1 Version 1 October 31, 2005 Total Weight: 100 points

Angle - a figure formed by two rays or two line segments with a common endpoint called the vertex of the angle; angles are measured in degrees

Variance reduction techniques used in BEAMnrc

Fiber Optics: Fiber Basics

6) How wide must a narrow slit be if the first diffraction minimum occurs at ±12 with laser light of 633 nm?

Medical Applications of radiation physics. Riccardo Faccini Universita di Roma La Sapienza

Presentation of problem T1 (9 points): The Maribo Meteorite

Principles of dosimetry The ionization chamber

Objectives 404 CHAPTER 9 RADIATION

Basics of Nuclear Physics and Fission

P O L Y T E C R.M. S.R.L.

Comparison of approximations to the transition rate in the DDHMS preequilibrium model

Physics 30 Worksheet # 14: Michelson Experiment

Relativistic kinematics basic energy, mass and momentum units, Lorents force, track bending, sagitta. First accelerator: cathode ray tube

WHITE PAPER. Source Modeling for Illumination Design. Zemax A Radiant Zemax Company

* This work is an official contribution of the National Institute of Standards and Technology and

CHAPTER 8, GEOMETRY. 4. A circular cylinder has a circumference of 33 in. Use 22 as the approximate value of π and find the radius of this cylinder.

ELECTRIC FIELD LINES AND EQUIPOTENTIAL SURFACES

Chemistry 1000 Lecture 2: Nuclear reactions and radiation. Marc R. Roussel

An Introduction to Coordinate Systems in South Africa

Use of ROOT in Geant4

Transcription:

Generation of a primary event III International Geant4 and GPU programming school 9-13 November 2015, Catania Data

Outlines Introduction Built-in primary particle generators Particle gun Interface to HEPEVT and HEPCM General particle source

Outlines Introduction Built-in primary particle generators Particle gun Interface to HEPEVT and HEPCM General particle source

User Classes Initialization classes Use G4RunManager::SetUserInitialization() to define Invoked at the initialization G4VUserDetectorConstruction G4VUserPhysicsList Action classes Use G4RunManager::SetUserAction() to define Invoked during an event loop G4VUserPrimaryGeneratorAction G4UserRunAction G4UserEventAction G4UserStackingAction G4UserTrackingAction G4UserSteppingAction G4VUserPhysicsList Classes written in red are mandatory. For these classes only virtual interfaces are provided -> users MUST implement their concrete classes

Primary vertex and primary particle G4VUserPrimaryGeneratorAction is the abstract base class to control the generation of primary vertex/particle...what is a primary particle/vertex? Primary particle means particle with which you start an event. e. g. particles made by primary p-p collision, alpha emitted form radioactive material, gamma-ray from treatment head, etc.. Primary particle has a particle ID, momentum and optionally polarization. Then Geant4 tracks these primary particles in your geometry with physics interaction and generated secondaries, detector responses and /or scorers Primary vertex has position and time. One or more primary particles may be associated with a primary vertex. One event may have one or more primary vertices.

G4VUserPrimaryGeneratorAction It is one of the mandatory user classes and it controls the generation of primary particles! This class does NOT directly generate primaries but invokes the GeneratePrimaryVertex() method to create the initial state It sends the primary particle(s) to the G4Event object It has GeneratePrimaries(G4Event*) method which is purely virtual, so it must be implemented in the user class

G4VUserPrimaryGeneratorAction Where? geant4.10.01.p01-install/include/geant4

G4VUserPrimaryGeneratorAction Constructor: Instantiate primary generator(s) ( i.e. G4ParticleGun() ) particlegun = new G4ParticleGun(n_particle); (Optional, but advisable): set the default values particlegun -> SetParticleEnergy(1.0*GeV); GeneratePrimaries() mandatory method: Invoked at the beginning of each event Randomize particle-by-particle value(s) Set these values to the primary generator(s) Invoke GeneratePrimaryVertex() method of primary generator particlegun->generateprimaryvertex()

The concrete implementation Constructor : Invoked only once MyPrimaryGeneratorAction::MyPrimaryGeneratorAction() : G4VUserPrimaryGeneratorAction(),fParticleGun(0) { G4int n_particle = 1; fparticlegun = new G4ParticleGun(n_particle); // default particle kinematic G4ParticleTable* particletable = G4ParticleTable::GetParticleTable(); G4String particlename; G4ParticleDefinition* particle = particletable->findparticle(particlename="gamma"); fparticlegun->setparticledefinition(particle); fparticlegun->setparticlemomentumdirection(g4threevector(0.,0.,1.)); fparticlegun->setparticleenergy(6.*mev); } //...ooooo0ooooo...ooooo0ooooo... MyPrimaryGeneratorAction::~MyPrimaryGeneratorAction() { delete fparticlegun; }.cc private: G4ParticleGun* fparticlegun; // pointer a to G4 gun class.hh

The concrete implementation GeneratePrimaries: Invoked once per each event void MyPrimaryGeneratorAction::GeneratePrimaries(G4Event* anevent) { } G4double size = 0.8*cm; G4double z0 = 5*cm; G4double x0 = size *(G4UniformRand()-0.5); G4double y0 = size * (G4UniformRand()-0.5); G4double z0 = size * (G4UniformRand()-0.5)+z0; fparticlegun->setparticleposition(g4threevector(x0,y0,z0)); fparticlegun->generateprimaryvertex(anevent);

Outlines Introduction Built-in primary particle generators Particle gun Interface to HEPEVT and HEPCM General particle source

Built-in concrete classes of G4VPrimaryGenerators Geant4 provides three G4VPrimaryGenerators G4ParticleGun G4HEPEvtInterface & G4HepMCInterface G4GeneralParticleSource

G4ParticleGun Concrete implementation of G4VPrimaryGenerator It shoots one primary particle of a given energy from a given point at a given time to a given direction Various Set methods are available (see../source/event/include/ G4ParticleGun.hh) Intercoms commands are also available for setting initial values void SetParticleDefinition(G4ParticleDefinition*) void SetParticleMomentum(G4ParticleMomentum) void SetParticleMomentumDirection(G4ThreeVector) void SetParticleEnergy(G4double) void SetParticleTime(G4double) void SetParticlePosition(G4ThreeVector) void SetParticlePolarization(G4ThreeVector) void SetNumberOfParticles(G4int)

What to do and where to do 1. In the constructor of your UserPrimaryGeneratorAction Instantiate G4ParticleGun Set default values by Set methods of G4ParticleGun: Particle type, kinetic energy, position and direction 2. In the GeneratePrimaries() method Shoot random numbers and prepare the values of kinetic energy, position, direction... Use set methods of G4ParticleGun to set such values Then invoke GeneratePrimaryVertex() method of G4ParticleGun 3. In your macro file or from your interactive terminal session Set values for a run

The concrete implementation of G4ParticleGun void T01PrimaryGeneratorAction::GeneratePrimaries(G4Event* anevent) { G4ParticleDefinition* particle; G4int i = (int)(5.*g4uniformrand()); switch(i) { case 0: particle = positron; break;... } particlegun->setparticledefinition(particle); G4double pp = momentum+(g4uniformrand()-0.5)*sigmamomentum; G4double mass = particle->getpdgmass(); G4double Ekin = sqrt(pp*pp+mass*mass)-mass; particlegun->setparticleenergy(ekin); G4double angle = (G4UniformRand()-0.5)*sigmaAngle; particlegun->setparticlemomentumdirection (G4ThreeVector(sin(angle),0.,cos(angle))); particlegun->generateprimaryvertex(anevent); } You can repeat this for generating more than one primary particles.

Outlines Introduction Built-in primary particle generators Particle gun Interface to HEPEVT and HEPCM General particle source

Interface to HEPEvt? Almost all event generators in use are written in FORTRAN!...but Geant4 does not link with any external FORTRAN code However Geant4 provides an ASCII file interface for such event generators G4HEPEvtInterface reads an ASCII file produced by an Event generator and reproduce the G4PrimaryParticle objects.

Interfaces to HEPEvt and HepMC Concrete implementations of G4VPrimaryGenerator Primary G4HEPEvtInterface G4HepMCInterface - Suitable to /HEPEVT/ common block, which many of Fortran generators are compliant to - ASCII file input An interface to HepMC class, which a few new (C++) HEP physics generators are compliant to. ASCII file input or direct linking to a generator through HepMC. For more details see: https://geant4.web.cern.ch/geant4/userdocumentation/usersguides/ ForApplicationDeveloper/html/ch03s06.html As example see: examples/extended/runandevent/re01/src/ RE01PrimaryGeneratorAction.cc

Outlines Introduction Built-in primary particle generators Particle gun Interface to HEPEVT and HEPCM General particle source

G4GeneralParticleSource Concrete implementation of G4VPrimaryGenerator Suitable especially to space and medical applications Is designed to replace the G4ParticleGun class It is designed to allow specification of multiple particle sources each with independent definition of particle type, position, direction and energy distribution Some beam features can be randomly defined Distributions are defined by UI commands

The concrete implementation of G4GeneralParticleSource MyPrimaryGeneratorAction:: MyPrimaryGeneratorAction() { generator = new G4GeneralParticleSource; } Very simple! void MyPrimaryGeneratorAction:: GeneratePrimaries(G4Event* anevent) { } generator->generateprimaryvertex(anevent);

Summary of gps features Primary vertex can be randomly positioned with several options Emission from point, plane, Angular emission Several distributions; isotropic, cosine-law, focused, With some additional parameters (min/max-theta, min/max-phi, ) Kinetic energy of the primary particle can also be randomized. Common options (e.g. mono-energetic, power-law), some extra shapes (e.g. black-body) or user defined Multiple sources With user defined relative intensity # beam #1 # default intensity is 1,! # now change to 5. /gps/source/intensity 5.... # beam #2 # 2x the intensity of beam #1 /gps/source/add 10...

Position distributions /gps/pos/... Point E.g. /gps/pos/type Point!! /gps/pos/centre 0. 0. 0. cm Beam E.g. /gps/pos/type Beam!! /gps/pos/shape Circle!! /gps/pos/radius 1. mm!! /gps/pos/sigma_r 2. mm Plane Shape: Circle, Annulus, Ellipsoid, Square or Rectangle E.g. /gps/pos/type Plane!! /gps/pos/shape Rectangle!! /gps/pos/halfx 50 cm!! /gps/pos/halfy 70 cm Surface or Volume Shape: Sphere, Ellipsoid, Cylinder or Para Surface: zenith automatically oriented as normal to surface at point E.g. /gps/pos/type Surface!! /gps/pos/shape Sphere!! /gps/pos/radius 1. m

Angular distribution /gps/ang/... Isotropic (iso) Cosine-law (cos) See next slides for more information Planar wave (planar) Standard emission in one direction (it s also implicitly set by /gps/direction x y z) Accelerator beam 1-d or 2-d gaussian emission, beam1d or beam2d Focusing to a point (focused) User-defined (user)

Energy distributions /gps/ene/... Kinetic energy of the primary particle can also be randomized, with several predefined options: Common options (e.g. mono-energetic, power-law, exponential, gaussian, etc) mono-energetic (Mono) linear (Lin) power-law (Pow) exponential (Exp) gaussian (Gauss) Some extra predefined spectral shapes (bremsstrahlung, black-body, cosmic diffuse gamma ray, ) bremsstrahlung (Brem) black-body (Bbody) cosmic diffuse gamma ray (Cdg) User defined user-defined histogram (User) arbitrary point-wise spectrum (Arb) and user-defined energy per nucleon histogram (Epn)

Example(1) Spherical surface, isotropic radiation, black-body energy spectrum Macro! /gps/particle geantino! /gps/pos/type Surface /gps/pos/shape Sphere /gps/pos/centre -2. 2. 2. cm /gps/pos/radius 2.5 cm! /gps/ang/type iso! /gps/ene/type Bbody /gps/ene/min 2. MeV /gps/ene/max 10. MeV /gps/ene/temp 2e10 /gps/ene/calculate

Example(2) Cylindrical surface, cosine-law radiation, cosmic diffuse energy spectrum Macro! /gps/particle gamma! /gps/pos/type Surface /gps/pos/shape Cylinder /gps/pos/centre 2. 2. 2. cm /gps/pos/radius 2.5 cm /gps/pos/halfz 5. cm! /gps/ang/type cos! /gps/ene/type Cdg /gps/ene/min 20. kev /gps/ene/max 1. MeV /gps/ene/calculate

Examples & Online Manual Examples also exists for GPS examples/extended/eventgenerator/exgps On line manual: http://geant4.web.cern.ch/geant4/ UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ ch02s07.html#sect.g4gps.commands Very nice and useful link: http://hurel.hanyang.ac.kr/geant4/ Geant4_GPS/reat.space.qinetiq.com/gps/examples/examples.html

Particle Gun vs General Particle Source Particle Gun General Particle Source - Simple and naïve Shoot one track at a time Easy to handle. Powerful Controlled by UI commands. Capability of shooting particles from a surface of a volume. Capability of randomizing kinetic energy, position and/or direction following a user-specified distribution (histogram). If you need to shoot primary particles from a surface of a volume, either outward or inward, GPS is the choice. If you need a complicated distribution, not flat or simple Gaussian, GPS is the choice. Otherwise, use Particle Gun.

From Particle Gun to General Particle Source Example of isotropic emission in UserPrimaryGenerator code: examples/advanced/human_phantom/src/g4humanphantomprimarygeneratoraction.cc Gun Particle G4double a,b,c; G4double n; do { a = (G4UniformRand()-0.5)/0.5; b = (G4UniformRand()-0.5)/0.5; c = (G4UniformRand()-0.5)/0.5; n = a*a+b*b+c*c; } while (n > 1 n == 0.0); n = std::sqrt(n); a /= n; b /= n; c /= n; G4ThreeVector direction(a,b,c); particlegun->setparticlemomentumdirection(direction); GPS /gps/ang/type iso

Hands-on section Task 2 - Primary Particles and User Interface Particle gun General Particle source

Two beam source definition, Gaussian profile plane, cosine-law Two-beam source definition direction, linear energy spectrum (multiple sources) Gaussian profile Can be focused / defocused Macro # beam #1 # default intensity is 1,! # now change to 5. /gps/source/intensity 5. /gps/particle proton /gps/pos/type Beam # the incident surface is! # in the y-z plane /gps/pos/rot1 0 1 0 /gps/pos/rot2 0 0 1 # the beam spot is centered! # at the origin and is # of 1d gaussian shape! # with a 1 mm central plateau /gps/pos/shape Circle /gps/pos/centre 0. 0. 0. mm /gps/pos/radius 1. mm /gps/pos/sigma_r.2 mm! # the beam is travelling! # along the X_axis! # with 5 degrees dispersion /gps/ang/rot1 0 0 1 /gps/ang/rot2 0 1 0 /gps/ang/type beam1d /gps/ang/sigma_r 5. deg # the beam energy is in! # gaussian profile centered! # at 400 MeV /gps/ene/type Gauss /gps/ene/mono 400 MeV /gps/ene/sigma 50. MeV # beam #2 # 2x the instensity of beam #1 /gps/source/add 10. # this is a electron beam...