Hands-on
Code for download: session8_start.tar.gz
Hands-on 8a:
-
Rotate the Tube volume so that the tube symmetry axis is parallel with y-axis of the world reference frame.
- Hint: See slide #20 in the geometry presentation from Monday.
-
Complete the
MagneticFieldandDetectorConstructionclasses to define a magnetic field withB=1.0*teslain the y-direction and which is limited to the Tube volume.- Update the
MagneticFieldclass first; follow the comments in the code - Hint: See the slide with an example of a local magnetic field and adapt this code sample to our case
- Update the
-
After including the magnetic field, charged particles do not reach the second arm of the detector. Rotate the second arm by 30 degree around Y axis and check that particles are again detected in the second arm.
- Hint: You can use the
rotateY(G4double angle)function defined for G4ThreeVector to apply the rotation to the second arm position to place it where needed:G4ThreeVector secondArmPosition(0, 0, zpos); secondArmPosition.rotateY(-armAngle);
- Hint: You can use the
-
Add the changes necessary for multi-threading and activate the multi-threading mode by setting
G4RunManagerType::Defaultinmain(). -
When the magnetic field is implemented you can activate its visualization with the UI command:
/vis/scene/add/magneticFieldinvis.mac.
Hands-on 8b:
-
Re-implement calorimeter layers with use of
G4PVReplica. -
Then add an additional level of 3 divisions in
yaxis.- Note: After adding the divisions in
yaxis (cells), the sensitive detectorEmCalorimeterSDhas 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