Session 7 : Enoncé

Code for download: session7_start.tar.gz


  • Rotate Tubs volume so that the tube symmetry axis is parallel with y-axis of the world reference frame.
  • Complete the EDMagneticField class to define a magnetic field with B=1.0*tesla in the y-direction and which is limited to the Tubs volume.
    Hint: Set magnetic filed with use of
    void G4LogicalVolume::SetFieldManager(G4FieldManager *pFieldMgr, G4bool forceToAllDaughters);
  • After including a magnetic field, charged particles do not reach the second arm of the detector. Rotate the second arm by 30 degree and check that particles are again detected in the second arm.
  • Re-implement calorimeter layers with use of G4PVReplica and add an additional level of 3 divisions in y axis.
    • Note: After adding the divisions in y axis (cells), the sensitive detector EDEmCalorimeterSD has to be associated with the new replica logical volume (cellLV). Also the code used to get the calorimeter layer number has to be adapted for this change in geometry.
  • Add and implement an option in the main program for export of geometry in GDML.Hint: The world volume can be accessed in main in this way: G4LogicalVolume* world = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume());

Solution: session7_solution.tar.gz

Exercise ++:

The exercises marked as ++ are optional; they are recommended for participants who have already some experience with Geant4 and get some time left for practicing more than the basic exercise proposed above.

  • Add an option to download geometry from the GDML file.