EGS5 Monte Carlo Code: Installation What do you need to install? EGS5 Cygwin CGView gvim (or any editor) EGS5 Monte Carlo Code: Installation Installing CYGWIN Installing EGS5 Running an EGS5 TEST Any trouble you have met? Installing CGVIEW 1
EGS5 Monte Carlo Code: Installation You have now all three of: Which OS is required to run: gvim (or notepad): CGVIEW: EGS5: cygwin is only required for? For your convenience, Create a new folder cal777 EGS5 Monte Carlo Code: Folder Structure Main EGS5 codes are in the folder egs 2
EGS5 Monte Carlo Code: Installation EGS5 main code system: Photon, electron, positron transports and interactions are all written! As a user, which parts you need to write?.. EGS5 User Code Example: ucnaicgv ucnaicgv : the first user code you will go through! The code name indicates? You got three files on this user code: ucnaicgv.data ucnaicgv.f ucnaicgv.inp Copy these into the folder Cal777 3
EGS5 User Code Example: ucnaicgv Open each file with notepad and see its contents: *.data?? *.f?? *.inp?? [*.inp] Let s begin with ucnaicgv.inp See PEGS USER MANUAL for detail!! *.inp is the input card to: i. define materials ii. generate interaction cross section data from the data library. What kinds of parameters do you need to set? i. Materials:?? ii. Interactions:?? 4
[*.inp] Open ucnaicgv.inp with an editor How many materials can you identify:,,? Let s begin with: [*.inp] Aluminum input card Line 1: ELEM Means that the material consists of a single element EGS5 finds the density and the atomic weight for this element Line 2: IRAYL=1,IBOUND=1,INCOH=1,ICPROF=-3,IAPRIM=1 Note: IRAYL,IBOUND, are variables used in EGS5! IAPRIM: For correction to bremsstrahlung cross section. Default(=1): normalizes integrated cross section to ICRU-37 S rad. IRAYL:?? (default=0, ignore!) IBOUND,INCOH,ICPROF options: all related to? (default=0??) IBOUND,INCOH: to include effect? 5
[*.inp] Aluminum input card ICPROF: to include effect? -3 : data is extracted from the EGS5 data library. 3 : You must supply values!!! Lines 3 &4: AL AL AL Format & Variables: 24A1,6X, 24A1 MEDIUM IDSTRN A2,1X ASYM(1) An example: [*.inp] Aluminum input card Lines 5 & 6: ENER &INP AE=0.521,UE=10.511,AP=0.010,UP=10.0 /END AE and AP mean? Current setting sufficient for your purpose? AP and UP mean? What other types of materials you can have??? 6
[*.inp] QUARTZ input card Line 1: COMP Means?? Line 2: &INP NE=2,RHO=2.20, PZ=1,2, IRAYL=1 /END NE : Variable for? RHO : for? PZ(i) : for? Why not turning on the options: IBOUND,INCOH,ICPROF? Line 4: SI O Format & Variable: (A2,1X), (A2,1X), ASYM(1), ASYM(2), [*.inp] Air input card Line 1:?? Line 2: GASP=0.93174?? RHOZ=0.75575,0.23143,0.01282?? How can you define for a mixture? 7
Geometry desired for ucnaicgv.f 8
3-D Geometry Review In 3-D, how can you mathematically describe: Plane: What do you need to define? Eq.? Sphere:?? Cylinder:?? Cone:?? Ellipsoid:?? Torus:?? With CGVIEW, we can do: Example) base and top centers: (2,3,0), (2,3,5) H vector??? 9
5) Torus 10
6) Box (Box) 8) Truncated Elliptical Cylinder (TEC) 7) Right Elliptical Cylinder (REC) 9) 10)... See CGVIEW manual! How can we define a zone (cell or region)? Algebra Called Combinatorial Geometry (CG) in EGS5 For example: 11
CGVIEW format: You can use the operators +, -, OR Examples: +1-2???? + :??? - :????? Now you are ready to build a geometry file! ***Note: The file extension of CGVIEW: *.geo The extension of the geometry file required to run EGS5: *.data When you are coding a geometry, which one?? Once geometry coding is done, what you need to do?? In order to keep the original file safely, Copy ucnaicgv.data into test1.geo 12
Run CGVIEW.exe Open test.geo 1. Body Data Let s draw these!!! 13
2. Zone Data Material 1, 2, 3, 4???? Z0001:? Z0002:?.. Z0006:? Is this necessary??? 3. Plotting Click the box VIEW 14
4. Check Geometry Data Once geometry coding is done, how do you know it is correct?? Select the menu [Environment] [Geometry Check] 15
Open ucnaicgv.f Line 66 Step 1: Initialization 16
Line 103 Line 138 Variable for?? How many?? How can change its number? File for?? For particle trajectory display only! 17
Step 2: PEGS5 call Cross-section data extraction step! How did you define the materials and the energy range? Line 158 Means?? MXMED setting?? How can you find? Do you remember?? MXMED setting?? See the file egs5_h.f 18
Line 187 An (optional) variable related with electron multiple-scattering For selecting an optimal multiple-scattering step-sizes Default = 0; PEGS5 determines multiple-scattering step-sizes based on fractional energy losses. Step 3: Pre-hatch-call-initialization Line 205 Line 231 IEDGFL: Flags for turning on K and L X-rays (default=0) 19
Line 257 Step 4: Determination-of-incident-particle-parameters Line 271 What if: Not point source? Not collimated? Sampling in Step 8!!!???? 20
Line 290 Step 5: Hatch-call Line 344 21
Line 387 Which mode in most cases? Do you want to read the mode like this? Steps 6 & 7 Subroutine HOWFAR : keeping track of the regions in which the particles lie Subroutine AUSGAB : to score and output the results Step 7 Continued Line 418 How many source particles? This means: If ncases=50,000 ncaspb??? Run batch 1 batch 2.. 22
Step 8: Shower-call Line 451 Can you do this in case of incident direction sampling?? In case of source position sampling? Line 476 EGS5 random sampling example Suppose the angular distribution of the source particle emission is isotropic: What do you think is this? 23
Line 500 Line 528 24
Step 9: Output-of-results Line 594 For each batch j, you computed pj Suppose ncases = 50,000 (ncases:??? ) You already set nbatch = 50 for each batch: generate source particles & compute j What happens if you change nbatch?? Any change on What if you don t make any batch (i.e. nbatch = 1)?? In which situation, you must choose this option? How can you estimate the standard deviation? 25
Line 630 Line 656 Step 10: Subroutine ausgab Line 742 26
Line 818 Is this the only way? What if you have 10 NaI detectors? What if you want to compute a spatial dose distribution? Step 11: Subroutine howfar Line 875 What howfar is doing? What you need to do for this subroutine??? As long as you coded geometry using CGVIEW, You don t need to change anything!!! 27