Exercises and Solutions - Day 2 (May 20th)

Exercises: Exercises of the day

Exercises and solutions - Part III

The solutions are indicated in red.

Part III - Geometry

Exercise 2-4

  1. replace the material of the world volume (worldVolLogic) from vacuum to air
  2. include in the setup a cylinder made of liquid nitrogen, radius = 10 cm, height=20 cm. This volume should be daughter of the world volume and mother of the silicon box
  3. place the nitrogen volume in the centre of the air world volume
  4. rotate the liquid nitrogen volume, in a way that the cylinder axis corresponds to the x-axis, rather than the z-axis (default). This corresponds to rotate the cylinder of pi/2 with respect to the y/axis
  5. this volume is not sensitive.
  6. define detVolPhys as a daugther of the nitrogen cylinder. Keep the same translation as before, namely (0,0,boxLenght*0.5) with respect to the global coordinate system. Be careful: the mother volume is rotated!

#include "G4Tubs.hh"

G4VPhysicalVolume* DetectorConstruction::Construct() {
...
  G4LogicalVolume* worldVolLogic = 
          new G4LogicalVolume(worldVolSolid, // geometrical object
                              air,   // material
                              "World");      // name
...
  G4double nitrogenInnerRadius = 0.0*cm;
  G4double nitrogenOuterRadius = 10.0*cm;
  G4double nitrogenHeight = 20.0*cm;
  G4Tubs* liquidNitrogenTube = new G4Tubs("liquidNitrogenTube",
					  nitrogenInnerRadius,
					  nitrogenOuterRadius,
					  nitrogenHeight/2.,
					  0,
                                          twopi);
  G4LogicalVolume* liquidNitrogenLog = 
    new G4LogicalVolume(liquidNitrogenTube,
                        liquidNitrogen,
			"LiqNitrogenLog");
  G4RotationMatrix* rotationMatrix = new G4RotationMatrix();
  rotationMatrix->rotateY(90*deg);
  G4VPhysicalVolume* liquidNitrogenPhys = 
    new G4PVPlacement(rotationMatrix,
		      G4ThreeVector(),       //no translation
		      "LiquidNitrogen",      // name
		      liquidNitrogenLog,     // logical volume of the detector
		      worldVolPhys,          // physical volume of mother volume
		      false,                 // parameter for future use
		      0);                    // copy number
...

  // Definition of the physical volume of the detector. Notice: the
  // translation of the detVolPhys must be referred to its mother volume
  // coordinate system. Since the mother is rotated, the z axis of the world
  // corresponds to the x axis of the cylinder!

  detVolPhys = new G4PVPlacement(0,            // no rotation
	   G4ThreeVector(boxLength * 0.5,0,0), // translation
           "Detector",                         // name
           detVolLogic,                        // logical volume of the detector
           liquidNitrogenPhys,                 // physical volume of mother volume
           false,                              // parameter for future use
           0);                                 // copy number

}
Source code
Note: the translation vector of a Physical Volume must be always referred to the reference system of its mother volume (that may be different from  the global reference system). Since the liquidNitrogenPhys is rotated (90 degrees around the Y axis), the z axis of the global reference system corresponds to the x axis of the liquidNitrogenPhys. Hence, to have a translation of +boxLength * 0.5 in the global z-axis, one must translate with respect to the mother x-axis!

Exercise 2-5

  1. re-define the material of detVolLogic from silicon to enriched germanium
  2. change the minimum step size in the detVolLogic from 1.0 micrometer to 0.5 micrometer (notice: this can be also changed interactively with the command /detector/maxStepSize). Set the minimum step size in liquid nitrogen to 0.1 mm.
  3. do you need to re-define or update the read-out geometry? Why?

G4VPhysicalVolume* DetectorConstruction::Construct() {
...
 detVolLogic = new G4LogicalVolume(detVolSolid,  // geometrical object
                                    enrGe,       // material
                                    "Detector"); // name
...
 detVolUserLimits = new G4UserLimits(0.5 * micrometer);
 detVolLogic -> SetUserLimits(detVolUserLimits);
 G4UserLimits* liquidNitrogenUserLimits = new G4UserLimits(0.1*mm);
 liquidNitrogenLog->SetUserLimits(liquidNitrogenUserLimits);
}
Source code
It is not necessary to update the read-out geometry, because the dimensions and the position of the sensitive part (namely, the 4cmx4cmx4cm box) are unchanged. Materials have been changed, but this is not relevant, because materials declared in the read-out geometry are not accounted for (they are dummy).