Slack for Mac - A new, improved Slack desktop app for Mac '.very popular and cool one' Recommended by iThinker Product Hunt 4.0 - Now with Reviews, Badges, Web Links, and more. Because we’re committed to help you find the right solution for your business needs, we list all software vendors on our website, and give them the opportunity to feature their solutions and collect user reviews. At GetApp, our comprehensive software listings, verified user reviews, product comparison pages, articles and AppFinder, our.
- Introduction:
- Defining materials:
- A very simple geometry
- Command line based scoring
Introduction
In this 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
The code for this hands-on session
'HandsOn2'
is located at $SLACHANDSON
. For your reference, the complete solution 'HandsOn2-solution'
is also availavble in the same directory. Copy the directory to your local area. $ cd <tutorial> #change to your working directory |
Follow the instructions of Hands On 1 to configure with
cmake
the example and build it.Try out the application:
$ cmake . |
The following should appear:
The default behavior of the application when started without command line arguments is to start the (G)UI (if enabled). You should find
Idle>
prompt on your terminal screen. Familiarize with the Geant4 UI.Exercise 0.a:
Question 1: Tryls
, help
and help <UI_command>
.Question 2: Run 10 events.
Idle> /run/beamOn 10 |
Exercise 0.b:
Now run the application with a macro file as command line argument: $ ./SLACtut run1.mac |
Check the content of the macro file
run1.mac
, start the application again interactively and using the help system check the syntax of the few commands used in the macro file.Note: Other macro files in the
HandsOn2
direcory do not work until you finish all the exercises. Defining Materials
Important note
Throughout this tutorial, where to edit the code is clearly marked in the corresponding file. Open the specified file and search a comment line that matches to the exercise name. That is the place you should add your code. If you are working on Exercise X.Y, here is the place.File name to be edited |
// |
Exercise 1.a:
In this example, we have a specific method DetectorConstruction::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.
Create a CsI (Cesium Iodide) material starting from the elements.
Some of its properties:
- For Cs: Z=55 , Aeff=132.9*g/mol
- For I : Z=53 , Aeff=126.9*g/mol
- Density of crystal of CsI is: rho=4.51*g/cm^3
Observe Geant4 output, at the beginning of the application the list of materials will be shown, starting from the line
The materials defined are :
. At the end of the method DetectorConstruction::ConstructMaterials()
there is a line that prints on screen the complete list of defined materials. Note the paragraph relative to CsI and its properties.The UI command:
/material/g4/printMaterial CsI
can be issued at run-time to print the details of CsI. Check the other UI commands available in the /material
directory. 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 Gean4-NIST compounds' materials. Search for the name relative to lead.
Build again the application and run it again. Note that now the list of materials includes lead element with all isotopes with natural abundances.
Hint: You can always use the command /material/g4/printMaterial <name>
to print interactively the information on a specific material of your interest.
Solution
DetectorConstruction.cc File: |
nistManager->FindOrBuildMaterial('G4_Pb'); |
A very simple geometry
In this example we will create a first geometry element. The goal of this exercise is to show how to define a shape, a logical volume and a placement.Exercise 2.a
Add a box of to the setup.
Slac Solution For Mac Download
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 this 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 material scintillator. Simulate a single electron. Note how the material affects the shower dimensions:
The material is already created in the ConstructMaterials
method, it has a long name becasue it is a particular type of plastic. You need just to retrieve it by name when using it in the G4LogicalVolume
.
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 save in a text file.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.
Using only UI commands create a scoring box mesh that is placed on top of the calorimeter box. The mesh should have the same dimension as the calorimeter and have (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. Starting from the content of the file scoring.mac
reproduce in an interactive session the various steps used to score the quantities. Some of the UI commands used here depends on the UI commands used before. For example the commands used to define a particle filter are used in combination with the preceding command defining the quantity to score. The command /score/close
signals that all scoring volumes and associated quantities are now completed and configured.
There are two separate concepts to grasp when scoring: one is the scoring mesh (e.g. the shape, dimension and number of bins of the used 3D grid), the other is the list of quantities measured in each cell of the grid.
You can have multiple quantities associated to a given mesh, but you can also have multiple meshes in the same application even with different geometries and possibily overlapping.
Solution
The macroscoring.mac
shows all the UI commands needed in this exercise. It can be used directly to create the output file: $ ./SLACtut scoring.mac |
scoring.mac File: |
/run/initialize |
Exercise 3.c
Visualize scored quantities.
Using UI commands draw on the screen different scored quantities. For example the energy deposit looks like:
Solution
Slac Solution For Mac Osx
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
scoring.mac
: $ ./SLACtut |
draw.mac File: |
######################################## |
Slac Solution For Mac Os
The macro files perform several views at the same time (/score/drawProjection commands), try out the views one at the time in the command line. Created by: Andrea Dotti (adotti AT slac DOT stanford DOT edu) May 2018Updated by: Makoto Asai (asai AT slac DOT stanford DOT edu) August 2019
The TMO instrument is situated on one of the newly installed soft X-ray lines at LCLS. It delivers intense ultra-short X-rays pulses from the FEL using state-of-the-art variable gap soft X-ray undulators. These ultra-intense, ultra-short pulses enable the TMO instrument to support many fields of AMO science ranging from strong-field physics, nonlinear dynamics, charged particle spectroscopies, and attosecond to few femtosecond science cases.
NEH 1.1 Home | Science Drivers | Early Science | Experimental Methods | Layout | Specifications | Run 19 Capabilities