Code for download: session8_start.tar.gz
Exercise 8a:
- Rotate Tube 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 withB=1.0*tesla
in the y-direction and which is limited to the Tube 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.
- Add changes necessary for multi-threading and activate
G4MTRunManager
inmain()
.
Hint: Use G4AutoDelete to get magnetic field safely deleted in MT mode:
// Register the field and its manager for deleting
G4AutoDelete::Register(fMagneticField);
G4AutoDelete::Register(fFieldMgr); - When the magnetic field is implemented you can activate its visualization with the UI command:
/vis/scene/add/magneticField
Exercise 8b:
- 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.
- Note: After adding the divisions in y axis (cells), the sensitive detector
Solution: session8_solution.tar.gz