The construction of the FASER2 spectrometer magnet (magnet itself and the tracking stations) is moved to an external class. geometry/SpectrometerMagnetConstruction.cc. This can be the prototype for adding other external classes, so the main detector construction class only deals with the volume placements.
-- The class returns a single G4AssemblyVolumefor easy placement.
-- The class also returns the logical volumes needed to set sensitive detectors and add the magnetic field (both of these things need to happen within ConstructSDandField()).
A new magnet option based on Toshiba crystal-pulling magnets has been added. This magnet geometry can be selected via .mac. files, using the command \det\magnetGeom\.
-- The full list of new commands is in README.md.
-- If no commands are specified, the SAMURAI design is picked by default (with the usual default size).
-- Since the two magnet designs don't share the same variables, the only commands truly needed to switch to the CrystalPulling design are \det\magnetGeom\ and \det\magnetField\(as the default is 1T for SAMURAI, instead of 0.6T for CrystalPulling). The default values do the rest of the work.
-- The sizes of the tracking stations are adapted to the magnet size in each configuration. The other defaults are fine (or currently useless, such as the segmentation) so no commands are really needed in the .mac files.
-- For the moment both magnets have a B field in the y direction, so particles bend in the x plane. I decided to keep it like this for now, since the circular fitting method assumes that field direction. Most likely the fitting routine is anyway broken by the new multiple magnets option... so I will change the field once I rewrite it.
To better handle geometrical parameters between classes, I added geometry/GeometricalParameters.cc that can be used to store parameters and read them off anywhere is needed. It works similarly to the class for handling detector materials. It is currently filled byFLArEDetectorConstructionMessengerreading off the .mac file, but it also store default values that can be used to build the geometry without specifying any option.
I believe this PR already covers the enhacements of #15 , so it can be closed as we merge this.
This PR contains mainly two new additions:
The construction of the FASER2 spectrometer magnet (magnet itself and the tracking stations) is moved to an external class.
geometry/SpectrometerMagnetConstruction.cc
. This can be the prototype for adding other external classes, so the main detector construction class only deals with the volume placements. -- The class returns a singleG4AssemblyVolume
for easy placement. -- The class also returns the logical volumes needed to set sensitive detectors and add the magnetic field (both of these things need to happen withinConstructSDandField()
).A new magnet option based on Toshiba crystal-pulling magnets has been added. This magnet geometry can be selected via
.mac.
files, using the command\det\magnetGeom\
. -- The full list of new commands is inREADME.md
. -- If no commands are specified, the SAMURAI design is picked by default (with the usual default size). -- Since the two magnet designs don't share the same variables, the only commands truly needed to switch to the CrystalPulling design are\det\magnetGeom\
and\det\magnetField\
(as the default is 1T for SAMURAI, instead of 0.6T for CrystalPulling). The default values do the rest of the work. -- The sizes of the tracking stations are adapted to the magnet size in each configuration. The other defaults are fine (or currently useless, such as the segmentation) so no commands are really needed in the.mac
files. -- For the moment both magnets have a B field in the y direction, so particles bend in the x plane. I decided to keep it like this for now, since the circular fitting method assumes that field direction. Most likely the fitting routine is anyway broken by the new multiple magnets option... so I will change the field once I rewrite it.To better handle geometrical parameters between classes, I added
geometry/GeometricalParameters.cc
that can be used to store parameters and read them off anywhere is needed. It works similarly to the class for handling detector materials. It is currently filled byFLArEDetectorConstructionMessenger
reading off the.mac
file, but it also store default values that can be used to build the geometry without specifying any option.I believe this PR already covers the enhacements of #15 , so it can be closed as we merge this.
Picture of the new magnet option: