To better assist the ARD community, please send email to [email protected], so that the PPA team will be able to get to you in a quick and efficient manner. To purchase new hardware or software please fill out the ARD Computer Hardware & Software Request form and get it signed BEFORE giving it to Nick Arias. 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. Unsure which solution is best for your company? Find out which tool is better with a detailed comparison of Jabber & Slack. Use an easy side-by-side layout to quickly compare their features, pricing and integrations.
- Defining materials:
- A very simple geometry
- Command line based scoring
IntroductionIn 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.
Follow the instructions of Hands On 1 to configure with
cmakethe example and build it.
Try out the application:
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: Try
Question 2: Run 10 events.
Exercise 0.b:Now run the application with a macro file as command line argument:
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
HandsOn2direcory do not work until you finish all the exercises.
Important noteThroughout 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|
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 CsIcan be issued at run-time to print the details of CsI. Check the other UI commands available in the
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.
A very simple geometryIn 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.
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 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:
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
Command line based scoringIn 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.
Enable command line scoring.
Instantiate a scoring manager in the
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
helpcommand 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.
Slac Solution For Mac Pro
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.
Slac Solution For Mac High Sierrashows all the UI commands needed in this exercise. It can be used directly to create the output file:
Visualize scored quantities.
Slac Solution For Mac Os
Using UI commands draw on the screen different scored quantities. For example the energy deposit looks like:
SolutionThe macro file
draw.macshows how to draw scored quantities, in also shows how to draw slices using loops in UI commands.
This macro should be executed after