Download presentation
Presentation is loading. Please wait.
Published byOswald Bridges Modified over 9 years ago
1
Exercises Alberto Ribon Alberto Ribon CERN PH/SFT CERN PH/SFT Geant4 tutorial, 25-26 May 2005
2
Geant4 tutorial: Exercises 2 Introduction Copy the example N03 in your local area Copy the example N03 in your local area Try to build it and run it. Try to build it and run it. For each exercise, do the following: Read carefully the text Read carefully the text Try to solve it, by modifying some files of the example N03 in your area Try to solve it, by modifying some files of the example N03 in your area Look at the solution. Look at the solution.
3
Geant4 tutorial: Exercises 3 Exercise on: Geometry Add a G4Box of dimensions: Add a G4Box of dimensions: 1 mm x CalorSizeYZ x CalorSizeYZ 1 mm x CalorSizeYZ x CalorSizeYZ Material: scintillator, Sci Material: scintillator, Sci Caveat: you need to define a private member variable to store the local variable Sci. Caveat: you need to define a private member variable to store the local variable Sci. Place the box 1 cm in front (i.e. before) of the calorimeter along the x-axis Place the box 1 cm in front (i.e. before) of the calorimeter along the x-axis Hint: the position along the x-axis of the calorimeter starts at x = - CalorThickness/2.0 and the center of the box should be 1 cm before it (i.e at lower x). Hint: the position along the x-axis of the calorimeter starts at x = - CalorThickness/2.0 and the center of the box should be 1 cm before it (i.e at lower x).
4
Geant4 tutorial: Exercises 4 (continuation) The solution is in the directory: The solution is in the directory: geometry/ geometry/ Copy the header files.hh in your local directory include/ and the source files.cc in your local directory src/ Copy the header files.hh in your local directory include/ and the source files.cc in your local directory src/
5
Geant4 tutorial: Exercises 5 Exercise on: B field A global uniform magnetic field is applied along the z-axis. Change it in such a way that the field is applied along the x-axis. A global uniform magnetic field is applied along the z-axis. Change it in such a way that the field is applied along the x-axis. Hint: look at the constructor G4ThreeVector(x,y,z) in the method ExN03DetectorConstruction::SetMagField Hint: look at the constructor G4ThreeVector(x,y,z) in the method ExN03DetectorConstruction::SetMagField Solution is in the directory: bfield/ Solution is in the directory: bfield/
6
Geant4 tutorial: Exercises 6 Exercise on: Physics In the directory: physics_example/ you find how to use the Physics List LHEP. In the directory: physics_example/ you find how to use the Physics List LHEP. Copy the files in your local directory. Copy the files in your local directory. Change it in such a way to use the Physics List QGSP instead of LHEP. Change it in such a way to use the Physics List QGSP instead of LHEP. Hint: look at the main program exampleN03.cc Hint: look at the main program exampleN03.cc Solution is in the directory: physics/ Solution is in the directory: physics/
7
Geant4 tutorial: Exercises 7 Exercise on: Sensitivity In the directory: sensitivity_example/ you find how to make the added scintillator box a sensitive volume. Each deposit of energy in this volume produces a hit which stores that deposited energy. In the directory: sensitivity_example/ you find how to make the added scintillator box a sensitive volume. Each deposit of energy in this volume produces a hit which stores that deposited energy. Copy the files in your local directory. Copy the files in your local directory. Add to the hit the information of the (x,y,z) position of the energy deposit. Add to the hit the information of the (x,y,z) position of the energy deposit. Hint: use G4Step::GetPreStepPoint() and G4StepPoint::GetPosition() Hint: use G4Step::GetPreStepPoint() and G4StepPoint::GetPosition() Solution in the directory: sensitivity/ Solution in the directory: sensitivity/
8
Geant4 tutorial: Exercises 8 Exercise on: Analysis In the directory: analysis_example/ you find a very simple analysis: at the end of each event, the sum of the energy deposits (stored in the hits) in the scintillator box is printed. In the directory: analysis_example/ you find a very simple analysis: at the end of each event, the sum of the energy deposits (stored in the hits) in the scintillator box is printed. Copy the files in your local directory. Copy the files in your local directory. Print also the average distance of these hits from the origin (0,0,0). Print also the average distance of these hits from the origin (0,0,0). Hint: use MyTrackerHit::GetPos() and G4ThreeVector::mag() Hint: use MyTrackerHit::GetPos() and G4ThreeVector::mag() Solution in the directory: analysis/ Solution in the directory: analysis/
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.