NOTE: SLAC web training is compatible with Windows computers using the Internet Explorer, Chrome or Firefox browsers and Mac computers using Safari only. As more companies continue to collaborate with external, as well as internal people, Slack has begun working on new solutions. For instance, the Shared Channels feature on Slack makes it possible to share specific channels in your workspace with another company's slack account.
- Introduction:
- Defining materials:
- A very simple geometry
- Command line based scoring
Back to Agenda
Introduction
In this first hands on you will learn:
- How to define materials
- How to define a very simple geometry
- How to use command line scoring to: record,store and display simulation results
$ cd #change to your working directory |
A directory HandsOn2 will be created containing the code. Important: If you untar the solution tar-ball this will overwrite the content of HandsOn2 deleting your code! Follow the instructions of Hands On 1 to configure with
cmake
the example and build it.Hint: Remember the cmake comamnd line option:
-DGeant4_DIR=
to specify where the Geant4 lib/Geant4-10.0.1
directory is located. The last argument of cmake is the location of the source code, in our case: /HandsOn2
.Try out the application:
$ cd #If needed, do NOT do the next in HandsOn2 directory (Where the code of the exercise is. |
[Debug|Releaase|RelWithDebInfo]
).The following should appear:
Familiarize with the application GUI (if enabled). In particular note the menu with different actions. It is possible to execute UI commands directly form the menu.
The default behavior of the application when started without command line arguments is to start the GUI (if enabled) and execute the macro init_vis.mac
(init.mac
if no support for visualization has been enabled in G4).
If visualization is enabled and the UI session is graphical the additional macro gui.mac
is also executed.
Www.profilevisitors.net finally see who has visited. You can start the application withotu graphics and execute directly a macro file, passing to SlacTut
a macro name, for example: ./SlacTut run1.mac
Exercise 0.a:
Find out where in the code the default macros are executed (hint: check the main function). How the default behavior is obtained?Exercise 0.b:
What is the role ofgui.mac
macro? Check the syntax of the commands in the application GUI (help panel), or type: help |
Exercise 0.c:
Modify the run1.mac
macro file.
Modify some parameters of the simulation: number of events, the particle type.
Defining Materials
In this example, we have created a specific methodDetectorConstruction::ConstructMaterials()
where all materials that are used in the application are built. Such method is not mandatory, but it may help to organize your code. Throughout this tutorial the exercises are clearly marked in the code itself: search the commented lines: // |
Exercise 1.a:
Create a CsI (Cesium Iodide) material starting from the elements.
Some properties:
Slac Solution For Mac High Sierra
- For Cs: A=55 Zeff=132.9*g/mol
- For I : A=53 , Zeff=126.9*g/mol
- Density of crystal of CsI is: rho=4.51*g/cm^3
The materials defined are :
. At the end of the method DetectorConstruction::ConstructMaterials()
there is a line that prints on screen the complete list of materials defined. Note the paragraph relative to CsI and its properties.The UI command:
/material/g4/printMaterial [name|all]
can be issued at run time to print the material table. Solution
DetectorConstruction.cc File: |
G4Element* el_i = new G4Element('Iodine','I', 53,126.9*g/mole); |
Exercise 1.b:
Use NIST database to create Lead material.
Hint: You can use UI command /material/nist/listMaterials
to dump on screen the list of all known Geant4-NIST compounds. Search for the name relative to lead.
Build again the application and run it again. Note that now the list of materials includes lead with all naturally abundant isotopes.
Solution
DetectorConstruction.cc File: |
nistManager->FindOrBuildMaterial('G4_Pb'); |
A very simple geometry
In this example we will create a very simple geometry. The goal of this exercise is to show how to define a shape, a logical volume and a simple placement.
Exercise 2.a
Add a box of to the setup.
The box has full dimensions (X times Y times Z): 300x60x100 cm, select CsI as material. Place the box inside the logical volume second arm. It should be placed at the very back of the mother volume. At the end of the tutorials this simple box will become a calorimeter.
Re-compile and check that you obtain the correct behavior:
Solution
DetectorConstruction.cc File: |
G4Material* material = G4Material::GetMaterial('CsI'); |
Exercise 2.b
Change material of the box and observe effect on physics simulation.
Modify the material of the box: instead of CsI, use the scintillator. Simulate a single electron. Note how the material affects the shower dimensions:
Command line based scoring
In this exercise we will collect simulation information using command line scoring. A scoring mesh will be defined on top of the volume created in Exercise 2.a, different quantities will be recorded, and we will show how to display and store the scored quantities.
Exercise 3.a
Enable command line scoring.
Instantiate a scoring manager in the main()
function.
Solution
tutorial.cc File: |
// Activate UI-command base scorer |
Exercise 3.b
Score some quantities: energy deposit, number of steps of gammas and use some filters.
Using UI commands create a box mesh that is placed on top of the box you created. The mesh should have the same dimension as the box and it has (X times Y times Z) 30x6x10 voxels. Score the following quantities:
- Energy deposits
- Number of steps for gammas
- Number of steps for e-
- Number of steps for e+
Hint: use the help
command to understand the format of command line scoring UI commands.
Solution
The macroscoring.mac
shows all the UI commands needed in this exercise.be used directly to create the output file: $ ./SlacTut scorer.mac |
scoring.mac File: |
/run/initialize |
Exercise 3.c
Visualize scored quantities.
Using UI commands draw on the screen different scored quantities. Schedule server 2003 backup batch file. For example the energy deposit looks like:
Solution
The macro filedraw.mac
shows how to draw scored quantities, in also shows how to draw slices using loops in UI commands.This macro should be executed after
Slac Solution For Mac Os
scoring.mac
: Slac Solution For Mac Pro
$ ./SlacTut |
draw.mac File: |
######################################## |
3 March 2014
The Selective Liberal Arts Consortium is comprised of 8 highly selective colleges. All of our member schools are listed among the Best National Liberal Arts Colleges by U.S. News and World Report., and 3 are ranked in the top 15.
Slac Solution For Mac Os
Since 1987, we have helped top-notch employers recruit students with diverse backgrounds, knowledge, and skills in a manner that is efficient and cost-effective.
Slac Solution For Mac Installer
School Representatives
Megan Nicklaus SLAC Executive Director Gabrielle Kearns SLAC Recruiting Coordinator selectiveliberalartsconsort@gmail.com Ph: 516-695-8668 |
Bard College Career Development Office Maureen Aurigemma Associate Director maurigem@bard.edu Ph: 845-758-7189 30 Campus Road Annandale-on-Hudson, NY 12504 |
Bates College Center for Purposeful Work Hoi Ning Ngai, Ph.D. Associate Director, Employer Engagement and Business Advising hngai@bates.edu Ph: 1-207-786-6234 146 Wood Street Lewiston, ME 04240 |
Bryn Mawr College Career and Professional Development Sarah Sultzer Assistant Director of Employer Relations, Career and Professional Development ssultzer@brynmawr.edu Ph: 610-526-5174 | Fx: 610-526-5197 101 North Merion Ave Bryn Mawr, PA 19010 |
Colorado College Career Center Megan Nicklaus Director mnicklaus@coloradocollege.edu Ph: 719-389-6424 | Fx: 719-389-6804 14 E. Cache La Poudre Colorado Springs, CO 80903 |
Grinnell College Center for Careers, Life, and Service Kelly N. Harris Assistant Dean and Director of Employer Engagement harriske@grinnell.edu Ph: 641-269-4026 | Fx: 641-269-4828 1026 Park Street Grinnell, IA 50112 |
Haverford College Center for Career and Professional Advising Laura Reiter, Associate Director for Employer and Institutional Partnerships lreiter@haverford.edu Ph: 610-896-1181 | Fx: 610-896-4230 370 Lancaster Avenue Haverford, PA 19041 |
St. Olaf College Piper Center for Vocation and Career Kirsten Cahoon Senior Associate Director, Employer and Alumni Relations cahoon@st.olaf.edu Ph: 507-786-3268 1520 St. Olaf Avenue Northfield, MN 55057 |
Vassar College Career Development Aimée Heinly Assistant Director of Employer Relations aiheinly@vassar.edu Ph: 845-437-5285 | Fx: 845-437-7257 124 Raymond Ave, Box 7 Poughkeepsie, NY 12604-0007 |