Difference between revisions of "Simulations of Particle Interactions with Matter"

From New IAC Wiki
Jump to navigation Jump to search
(33 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Class Admin==
 
==Class Admin==
===[[Forest_SimPart_Syllabus]]===
 
  
The ability to simulate nature using a computer has become a useful skill for physicists who work in disciplines ranging from basic research to video games.  This class will teach you these fundamentals using a practical approach, based on a specific UNIX based programming environment, to simulate fundamental physics processes ranging from ionization and the photoelectric effect to producing anti-matter.
 
 
===Homework===
 
Homework is due at the beginning of class on the assigned day. If you have a documented excuse for your absence, then you will have 24 hours to hand in the homework after released by your doctor.
 
 
=== Class Policies===
 
http://wiki.iac.isu.edu/index.php/Forest_Class_Policies
 
 
=== Instructional Objectives ===
 
 
;Course Catalog Description
 
: Simulations of Particle Interactions with Matter 3 credits. Lecture course with monte-carlo computation requirements. Topics include: Stopping power, interactions of electrons and photons with matter, hadronic interactions, and radiation detection devices.
 
Prequisites:Math 3360. Phys 3301 or 5561.
 
;Course Description
 
: A practical course applying theoretical descriptions of fundamental particle interactions such as the photoelectric effect, compton scattering and pair production to describe multiple interactions of particles with matter using the montecarlo method. A software package known as [http://geant4.web.cern.ch/geant4/ GEANT from CERN] will be used that is freely available under the UNIX environment. The course assumes that the student has very limited experience with the UNIX environment and no experience with GEANT. Homework problems involve modifying and compiling example programs written in C++. A final project is required in which the student chooses a process to compare the predictions of GEANT with experimental data. A report is written in a format that would be publishable in a scientific journal. Publishing the report is not required but left as an option for the student.
 
 
===Objectives and Outcomes===
 
 
[[SPIM_ObjectiveNoutcomes]]
 
  
 +
[[TF_SPIM_ClassAdmin]]
  
 
== Homework Problems==
 
== Homework Problems==
Line 42: Line 23:
 
= Hadronic Interactions =
 
= Hadronic Interactions =
  
=== Proton Bremsstrahlung===
+
[[TF_SPIM_HadronicInteractions]]
  
:<math>\sigma_{class}|_{90^o} = 2.1\times 10^{-31} cm^2/sterad</math> = cross section for dipole radiation emitted at 90 degrees with respect to incident beam of particles scattered in a Coulomb field.
+
= Final Project=
  
[[File:ProtonBrem_Drell_Huang_PhysRev_v99_n3_1955_pg686.pdf]]
+
A final project will be submitted that will be graded with the following metrics:
  
 +
1.) The document must be less than 15 pages.
  
=== Pluto event generator===
+
2.) The document must contain references in a bibliography (5 points) .
  
[http://arxiv.org/abs/0708.2382 A ROOT based Hadronic Simulation package based on Pluto]
+
3.) A comparison must be made between GEANT4's prediction and either the prediction of someone else or an experimental result(30 points).
  
I installed Pluto V 5.14.1 on inca
+
4.) The graphs must be of publication quality with font sizes similar or larger than the 12 point font (10 points).
  
I needed to set the environmental variables under tcsh
+
5.) The document must be grammatically correct (5 points).
  
setenv ROOTSYS ~/src/ROOT/root
+
6.) The document format must contain the following sections: An abstract of 5 sentences (5 points) , an Introduction(10 points), a Theory section (20 points) , if applicable a section describing the experiment that was simulated, a section delineating the comparisons that were made, and a conclusion( 15 points).
setenv PATH ${PATH}:${ROOTSYS}/bin
 
setenv LD_LIBRARY_PATH $ROOTSYS/lib
 
  
 +
=Resources=
  
There is a subdirectory called "macros"
+
[http://geant4.web.cern.ch/geant4/  GEANT4 Home Page]
  
cd macros
+
[http://root.cern.ch ROOT Home page]
  
Go to that subdirectory and type root, this will run the contents of the file "rootlogin.C"
+
[http://conferences.fnal.gov/g4tutorial/g4cd/Documentation/WorkshopExercises/  Fermi Lab Example]
  
cd macros
 
  
inca:~/src/Pluto/pluto_v5.14.1/macros> root
+
[http://physics.nist.gov/PhysRefData/Star/Text/ESTAR.html NIST Range Tables]
  *******************************************
 
  *                                        *
 
  *        W E L C O M E  to  R O O T      *
 
  *                                        *
 
  *  Version  5.17/03    30 August 2007  *
 
  *                                        *
 
  *  You are welcome to visit our Web site  *
 
  *          http://root.cern.ch            *
 
  *                                        *
 
  *******************************************
 
Compiled on 5 September 2007 for linux with thread support.
 
CINT/ROOT C/C++ Interpreter version 5.16.24, July 26, 2007
 
Type ? for help. Commands must be C++ statements.
 
Enclose multiple statements between { }.
 
  *********************************************************
 
  * The Pluto event generator                             
 
  * (C) HADES collaboration and all contributing AUTHORS 
 
  * www-hades.gsi.de/computing/pluto/html/PlutoIndex.html
 
  * Version: 5.14.1
 
  * Compiled on 10 December 2008
 
  *********************************************************
 
Shared library Pluto.so loaded
 
  
to run a pp elastic model type
+
[http://ie.lbl.gov/xray/  X-ray specturm]
  
root [0] .x pp_elastic.C
+
[[Installing_GEANT4.9.3_Fsim]]
  
a root ntuple is generate called "pp_elastic.root"
+
== Saving/restoring Random number seed==
  
you can then analyze the data in the root file with
+
You save the current state of the random number generator with the command
  
data->MakeClass();
+
/random/setSavingFlag 1
  
the above command within root generates an analysis skeleton program.
+
/run/beamOn 100
  
using t.Show you can see the structure of the events within the ntuple.  A few functions are also stored in the root tree which you can use.
+
/random/saveThisRun
You can use the root file event to create an input file which GEANT4 can then use as its event generator.  GEANT4 then reads the events in and propagates them through your geometry.
 
  
=== Neutron Interactions ===
+
A file is created called
  
{| border="3"  cellpadding="20" cellspacing="0"
+
currentEvent.rndm
| Name || Energy
 
|-
 
|Cold Neutron ||  micro eV
 
|-
 
|Thermal || <math>\sim \frac{1}{40}</math> eV
 
|-
 
|epithermal || <math> \frac{1}{40}  eV \rightarrow 100 keV</math>
 
|-
 
|fast || <math>100 keV \rightarrow 100 MeV</math>
 
|-
 
|high energy || <math> > 100 MeV</math>
 
|-
 
|}<br>
 
  
'''Note:''' Interaction length for neutrons is ~<math>10^{-13}</math> .<br>
+
/control/shell mv currentEvent.rndm currentEvent10.rndm
Neutrons are even better than photons for penetrating matter.<br>
 
  
==== Elastic scattering====
 
  
 +
You can restore the random number generator and begin generating random number from the last save time
  
[[Image:Elastic_scattering_from_Nuclei.jpg]]<br>
+
/random/resetEngineFrom currentEvent.rndm
  
<math>v_{CM} = \frac{m_n v_L + M(0)}{m_n + M} = \frac{v_0}{1 + \frac{M}{m_n}} = \frac{v_0}{1+A} =</math> velocity of CM frame<br>
+
==Building GEANT4.10==
  
<math>{v_L}^' = </math> Magnitude of Neutron velocity in CM frame before and after collision<br> <math>= v_c - v_{CM} = v_0 -\frac{v_0}{1+A} = \frac{(1+A)-1}{1+A} v_0 = \frac{A}{1+A} v_0</math><br>
+
===4.10.02===
  
<math> v = </math> Magnitude of Nucleus  velocity in CM frame before and after collision<br>
+
[[TF_GEANT4.10.2]]
<math>= v_{CM} = \frac{v_0}{1+A}</math><br>
+
===4.10.01===
  
 +
[[TF_GEANT4.10.1]]
  
'''Note:'''  In elastic collision only the particles direction changes.<br>
+
==Building GEANT4.9.6==
  
<math>\vec{v}_L = {\vec{v}_L}^' + \vec{v}_{CM}</math> <br>
+
[[TF_GEANT4.9.6]]
  
[[Image:Rule_of_cosines.jpg]]<br>
+
==Building GEANT4.9.5==
 +
 
 +
[[TF_GEANT4.9.5]]
 +
 
 +
An old version of Installation notes for versions prior to 9.5
  
;;;<math>c^2 = a^2 + b^2 - 2abcos \theta</math><br>
+
[http://brems.iac.isu.edu/~tforest/NucSim/Day3/ Old Install Notes]
  
<math>(v_L)^2 = ({v_L}^')^2 + (v_{CM})^2 - 2 v_{CM} {v_L}^' cos(\pi - {\theta}_{CM})=</math><br>
 
;;<math>= ({v_L}^')^2 + (V)^2 - 2 V {v_L}^' cos(\pi - {\theta}_{CM})=</math><br>
 
  
where<br>
+
Visualization Libraries:
  
;;<math>({v_L}^')^2 = (\frac{A}{1+A})^2 {v_0}^2</math><br>
+
[http://www.opengl.org/ OpenGL]
;;<math>(V)^2 = (\frac{1}{1+A})^2 {v_0}^2</math><br>
 
  
After substitution we get following:<br>
+
[http://geant4.kek.jp/~tanaka/DAWN/About_DAWN.html  DAWN]
  
<math>(\frac{v_L}{v_0})^2 = \frac{A^2 +1 - 2 A cos(\pi - {\theta}_{CM})}{(1+A)^2} = \frac{A^2 +1 + 2 A cos({\theta}_{CM})}{(1+A)^2}</math><br>
 
  
<math>
+
[http://doc.coin3d.org/Coin/  Coin3D]
cos(A+/-B) = cosAcosB -/+ sinAsinB</math><br>
 
  
<math>\frac{E}{E_0} = \frac{A^2 + 1 + 2Acos({\theta}_{CM})}{(1+A)^2}</math>
+
==Compiling G4 with ROOT==
  
when <math>{\theta}_{CM}=0</math>, <math>E_{max} = E_0</math>. <br>
+
These instruction describe how you can create a tree within ExN02SteppingVerbose to store tracking info in an array (max number of steps in a track is set to 100 for the desired particle)
  
 +
[[G4CompileWRootforTracks]]
  
<math>E_{min} = \frac{(A-1)^2}{(A+1)^2} E_0 = (\frac{A-1}{A+1}) E_0 =</math> Minimum energy of scattered Neutron in LAB frame.<br>
+
==Using SLURM==
  
[[Image:Rule_of_cosines_1.jpg]]<br>
+
http://slurm.schedmd.com/quickstart.html
  
<math>({v_L}^')^2 = (v_L)^2 + (v_{CM})^2 - 2 v_{CM} v_L cos(\pi - {\theta}_{CM})=</math><br>
 
;;<math>= (v_L)^2 + (V)^2 - 2 V v_L cos({\theta}_{L})=</math><br>
 
  
<math>(\frac{Av_0}{1+A})^2 = {v_L}^2 + (\frac{v_0}{1+A})^2 - 2 v_L (\frac{v_0}{1+A}) cos({\theta}_L)</math><br>
+
https://rc.fas.harvard.edu/resources/documentation/convenient-slurm-commands/
  
After substituting <math>v_L</math><br>
+
===simple batch script for one process job===
  
<math>cos{\theta}_L = [\frac{A^2 + 1 + 2 A cos{\theta}_{CM}}{(1+A)^2} + (\frac{1}{1+A})^2 - (\frac{A}{1+A})^2] \times \frac{(1+A)^2}{2\sqrt{A^2 +1 + 2Acos{\theta}_{CM}}} = </math><br>
+
create the file submit.sbatch below
  
<math>= \frac{[A^2 +1 + 2Acos{\theta}_{CM} + 1 - A^2]}{2\sqrt{A^2 +1 + 2Acos{\theta}_{CM}}} = \frac{1 + Acos{\theta}_{CM}}{\sqrt{A^2 +1 + 2Acos{\theta}_{CM}}}
+
<pre>
</math><br>
+
#!/bin/sh
 +
#SBATCH --time=1
 +
cd src/PI
 +
./PI_MC 100000000000000
 +
</pre>
  
'''Note:'''  <math> {E_A}^{CM} = \frac{1}{2} M_A V^2 = \frac{1}{2} A m_n (\frac{v_0}{1+A})^2 = \frac{A}{(1+A)^2} \frac{m_n {v_0}^2}{2}= </math><br>
+
the execute
  
<math> = \frac{A}{(1+A)^2}E_0 = </math> Energy of recoil Nuclei in CM frame.<br>
+
:sbatch submit.sbatch
  
'''Conservation of Energy:''' <math>E_0 = E + E_A</math> <br>
+
check if its running with
  
;;;<math> E_A = E_0 - E = E_0 - \frac{A^2 + 1 + 2Acos{\theta}_{CM}}{(1+A)^2} E_0 = </math><br>
+
:squeue
  
;;;;<math>\frac{(1+A)^2 - (A^2 +1 + 2Acos{\theta}_{CM})}{(1+A)^2}E_0 =</math><br>
+
to kill a batch job
  
==== Inelastic Scattering====
+
:scancel JOBID
  
==Resources==
+
===On minerve===
[http://geant4.web.cern.ch/geant4/  GEANT4 Home Page]
+
 
 +
Sample script to submit 10 batch jobs.
 +
 
 +
the filename is minervesubmit and you run like
 +
source minervesubmit
 +
 
 +
<pre>
 +
cd /home/foretony/src/GEANT4/geant4.9.5/Simulations/N02wROOT/batch
 +
qsub submit10mil
 +
qsub submit20mil
 +
qsub submit30mil
 +
qsub submit40mil
 +
qsub submit50mil
 +
qsub submit60mil
 +
qsub submit70mil
 +
qsub submit80mil
 +
qsub submit90mil
 +
qsub submit100mil
 +
</pre>
 +
 
 +
The file submit10mil looks like this
 +
<pre>
 +
#!/bin/sh
 +
#PBS -l nodes=1
 +
#PBS -A FIAC
 +
#PBS -M foretony@isu.edu
 +
#PBS -m abe
 +
#
 +
source /home/foretony/src/GEANT4/geant4.9.5/geant4.9.6-install/bin/geant4.sh
 +
cd /home/foretony/src/GEANT4/geant4.9.5/Simulations/N02wROOT/batch/10mil
 +
../../exampleN02 run1.mac > /dev/null
 +
</pre>
 +
 
 +
 
 +
use
 +
 
 +
  qstat
  
[http://root.cern.ch ROOT Home page]
+
to check that the process is still running
  
[http://conferences.fnal.gov/g4tutorial/g4cd/Documentation/WorkshopExercises/  Fermi Lab Example]
+
use
  
 +
qdel jobID#
  
[http://physics.nist.gov/PhysRefData/Star/Text/ESTAR.html NIST Range Tables]
+
if you want to kill the batch job, the jobID number shows up when you do stat.
  
[http://ie.lbl.gov/xray/  X-ray specturm]
+
for example
 +
<pre>
 +
[foretony@minerve HW10]$ qstat
 +
Job id                    Name            User            Time Use S Queue
 +
------------------------- ---------------- --------------- -------- - -----
 +
27033.minerve            submit          foretony        00:41:55 R default       
 +
[foretony@minerve HW10]$ qdel 27033
 +
[foretony@minerve HW10]$ qstat
 +
</pre>
  
[[Installing_GEANT4.9.3_Fsim]]
+
==Definitions of Materials==
  
===Building GEANT4.9.5===
+
[[File:MCNP_Compendium_of_Material_Composition.pdf]]
  
[[TF_GEANT4.9.5]]
+
==Minerve2 GEANT 4.10.1 Xterm error==
  
An old version of Installation notes for versions prior to 9.5
 
  
[http://brems.iac.isu.edu/~tforest/NucSim/Day3/ Old Install Notes]
+
On OS X El Capitan V 10.11.4 using XQuartz
  
 +
~/src/GEANT4/geant4.10.1/Simulations/B2/B2a/exsmpleB2a
  
Visualization Libraries:
+
<pre>
  
[http://www.opengl.org/ OpenGL]
+
# Use this open statement to create an OpenGL view:
 +
/vis/open OGL 600x600-0+0
 +
/vis/sceneHandler/create OGL
 +
/vis/viewer/create ! ! 600x600-0+0
 +
libGL error: failed to load driver: swrast
 +
X Error of failed request:  BadValue (integer parameter out of range for operation)
 +
  Major opcode of failed request:  150 (GLX)
 +
  Minor opcode of failed request:  3 (X_GLXCreateContext)
 +
  Value in failed request:  0x0
 +
  Serial number of failed request:  25
 +
  Current serial number in output stream:  26
 +
</pre>
  
[http://geant4.kek.jp/~tanaka/DAWN/About_DAWN.html  DAWN]
 
  
  
[http://doc.coin3d.org/Coin/  Coin3D]
 
  
  
 
[[TF_SPIM_OLD]]
 
[[TF_SPIM_OLD]]

Revision as of 19:53, 26 April 2019

Class Admin

TF_SPIM_ClassAdmin

Homework Problems

HomeWork_Simulations_of_Particle_Interactions_with_Matter

Introduction

TF_SPIM_Intro

Energy Loss

TF_SPIM_StoppingPower

Ann. Phys. vol. 5, 325, (1930)

Interactions of Electrons and Photons with Matter

TF_SPIM_e-gamma

Hadronic Interactions

TF_SPIM_HadronicInteractions

Final Project

A final project will be submitted that will be graded with the following metrics:

1.) The document must be less than 15 pages.

2.) The document must contain references in a bibliography (5 points) .

3.) A comparison must be made between GEANT4's prediction and either the prediction of someone else or an experimental result(30 points).

4.) The graphs must be of publication quality with font sizes similar or larger than the 12 point font (10 points).

5.) The document must be grammatically correct (5 points).

6.) The document format must contain the following sections: An abstract of 5 sentences (5 points) , an Introduction(10 points), a Theory section (20 points) , if applicable a section describing the experiment that was simulated, a section delineating the comparisons that were made, and a conclusion( 15 points).

Resources

GEANT4 Home Page

ROOT Home page

Fermi Lab Example


NIST Range Tables

X-ray specturm

Installing_GEANT4.9.3_Fsim

Saving/restoring Random number seed

You save the current state of the random number generator with the command

/random/setSavingFlag 1

/run/beamOn 100

/random/saveThisRun

A file is created called

currentEvent.rndm

/control/shell mv currentEvent.rndm currentEvent10.rndm


You can restore the random number generator and begin generating random number from the last save time

/random/resetEngineFrom currentEvent.rndm

Building GEANT4.10

4.10.02

TF_GEANT4.10.2

4.10.01

TF_GEANT4.10.1

Building GEANT4.9.6

TF_GEANT4.9.6

Building GEANT4.9.5

TF_GEANT4.9.5

An old version of Installation notes for versions prior to 9.5

Old Install Notes


Visualization Libraries:

OpenGL

DAWN


Coin3D

Compiling G4 with ROOT

These instruction describe how you can create a tree within ExN02SteppingVerbose to store tracking info in an array (max number of steps in a track is set to 100 for the desired particle)

G4CompileWRootforTracks

Using SLURM

http://slurm.schedmd.com/quickstart.html


https://rc.fas.harvard.edu/resources/documentation/convenient-slurm-commands/

simple batch script for one process job

create the file submit.sbatch below

#!/bin/sh
#SBATCH --time=1
cd src/PI
./PI_MC 100000000000000

the execute

sbatch submit.sbatch

check if its running with

squeue

to kill a batch job

scancel JOBID

On minerve

Sample script to submit 10 batch jobs.

the filename is minervesubmit and you run like

source minervesubmit
cd /home/foretony/src/GEANT4/geant4.9.5/Simulations/N02wROOT/batch
qsub submit10mil
qsub submit20mil
qsub submit30mil
qsub submit40mil
qsub submit50mil
qsub submit60mil
qsub submit70mil
qsub submit80mil
qsub submit90mil
qsub submit100mil

The file submit10mil looks like this

#!/bin/sh
#PBS -l nodes=1
#PBS -A FIAC
#PBS -M foretony@isu.edu
#PBS -m abe
#
source /home/foretony/src/GEANT4/geant4.9.5/geant4.9.6-install/bin/geant4.sh
cd /home/foretony/src/GEANT4/geant4.9.5/Simulations/N02wROOT/batch/10mil
../../exampleN02 run1.mac > /dev/null 


use

qstat

to check that the process is still running

use

qdel jobID#

if you want to kill the batch job, the jobID number shows up when you do stat.

for example

[foretony@minerve HW10]$ qstat
Job id                    Name             User            Time Use S Queue
------------------------- ---------------- --------------- -------- - -----
27033.minerve             submit           foretony        00:41:55 R default        
[foretony@minerve HW10]$ qdel 27033
[foretony@minerve HW10]$ qstat

Definitions of Materials

File:MCNP Compendium of Material Composition.pdf

Minerve2 GEANT 4.10.1 Xterm error

On OS X El Capitan V 10.11.4 using XQuartz

~/src/GEANT4/geant4.10.1/Simulations/B2/B2a/exsmpleB2a


# Use this open statement to create an OpenGL view:
/vis/open OGL 600x600-0+0
/vis/sceneHandler/create OGL
/vis/viewer/create ! ! 600x600-0+0
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  150 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  25
  Current serial number in output stream:  26



TF_SPIM_OLD