Hello Geant4 Experts,
I am modeling a magnet assembly where electrons are incident on this device and the magnetic field in the apertures of this device will steer these electrons away from the rest of the instrument (it’s downstream of this assembly and measures solar X-rays). The following two figures demonstrate the experimental arrangement.
The first plot shows the magnet assembly (using CADMesh) with a 300-keV electron moving from positive z to negative z. Inside this assembly are Samarium-Cobalt magnets that outline most of the entrance apertures in Figure 1. The magnets are shown alone in Figure 2. In Figure 2, the magnetic field is “on”, and as you can see, the 300-keV electron (yellow track), does not bend. So, therein lies most of my problem.
From a coding perspective, I used the purging magnet algorithm as a starting point, which seemed sensible on two levels:
- It used an OPERA magnetic field map.
- The field was local.
For (2) above, I chose my field to be local because I could not assign the field to a logical volume, as the assembly is composed of many pieces. It appears my field is being read in properly. The magnetic field is in Gauss and spatially it covers an (8-cm,8-cm,8-cm) cube centered at (0,0,0).
The problem as I see it occurs in the routine ‘GetFieldValue’, where position information of the track is fed into the routine, and if the 3-D point in the track is within the region of the magnetic field, an interpolated value of the magnetic field for each dimension is computed and returned. The trouble is, all I get are zeroes because the z-dimension never registers within the +/- 4.0-cm in z!!
Also, when I read in the OPERA data, I assign the magnetic flux gauss units, and all position information (x,y,z) are assigned to centimeters. When I look at the dimensions as the electron is being tracked in each call to ‘GetFieldValue’, the dimensions have increased by a factor of 10, and the units for the magnetic field are extremely small [e.g., a reading of 0.21 G will now be 0.21x10^-6 G) and these Geant4 values will be interpolated if the track registers in the magnetic interaction region.
So, my questions are the following: 1) How can I make the electron track register in the region where the magnetic field is located? Also, how can I make the units of the magnetic field and position information be consistent with what are in the OPERA field map file?
I appreciate any help with this matter and many thanks in advance.