Simulation of the Thomas Jefferson National Accelerator Facility's Hall A Moller Polarimeter.
This Geant4 application must be compiled with an up-to-date version of GCC. If running on the iFarm you MUST do the following in order to be establish the proper software environment to compile the MolPol application.
source /apps/root/6.18.00/setroot_CUE source /site/12gev_phys/softenv.csh 2.4
You can then proceed as usual. --Eric King
Note: It's unclear why but MolPol doesn't function properly with SoftEnv version 2.6 so be sure to use 2.4 --Eric 01/17/2024
Packages required to build this program:
Geant 4.10.7 or better cmake v. 3.0 or better (old versions of cmake being depricated, no problems noted requiring 3.0+) root 5.31 or better
Additional packages may be required for your system or particular options selected during Geant4 or Root installations.
Program can be cloned from github with git clone command from command line. After being downloaded you can enter the halla_molpol_sim and do the following. Create a build directory, use cmake & make to build the Geant4 application.
mkdir build
cd build
cmake [path to MolPol]
make
Compiling the application this way should automatically copy the macros folder. You can start with the macro example named runexmaple.mac.
To run in batch mode perform the following:
./MolPol runexample.mac
MolPol.cc revised, Qt visualization now default. Individuals using 4.10.7 having internal G4 errors compiling, so updated visualization code to manner in which it is now done in remoll. Visualization can be changed to Xm by modifying string pass. --Eric King 06/23/2021
To run with visualization, simply execute the MolPol program ./MolPol and this will bring up the Qt/OGL Display. From here, as standard with G4 you can execute a macro with control/execute yourMacro
Note: You shouldn't run with an excessive amount of events in visualization mode. It would be advisable to use custom MolPol macro options such as krypteffect and onlymollers to cut down on the number of rays which need to be drawn.
The following is a table of the current MolPol macros. --dericking 02/05/2020
| Command | Type | Description |
|---|---|---|
| GENERAL | ||
| /MolPol/gen | String | moller: moller scatter generator; LUND: generates from LUND file; beam: single beam |
| /MolPol/filename | String | output file name for results |
| GENERATOR EFFECTS | ||
| /MolPol/calculateLevchuk | Boolean | Introduce Levchuk Effect: true or false |
| /MolPol/targetPolPct | Double no unit | Target polarization. Currently 0.08012 |
| /MolPol/radCorrections | Boolean | Calculate all four (4) radiative corrections in moller diagram |
| /MolPol/remollMS | Boolean | Use REMOLL scattering model within target pre-generative. |
| /MolPol/seed | Integer | The seed for the simulation. |
| STEPPING ACTION OPTIONS | ||
| /MolPol/Step/krypteffect | Boolean | Stepping action, treat all materials besides target and dipoel exit windows as kryptonite. |
| /MolPol/Step/onlymollers | Boolean | Kill any particles that aren't the original two mollers. |
| EVENT ACTION OPTIONS | ||
| /MolPol/Event/recordOnlyEventsWithHits | Boolean | Record only events with hits to ROOT file. True: only events with hits; False: record all events (default). A proper asymmetry cannot be calculated unless all event data is recorded. |
| GENERATED PHASE SPACE | ||
| /MolPol/thcommin | Dbl w/ Unit | Center of mass theta minimum for moller generation. |
| /MolPol/thcommax | Dbl w/ Unit | Center of mass theta maximum for moller generation. |
| /MolPol/phimin | Dbl w/ Unit | Phi minimum for moller generation. |
| /MolPol/phimax | Dbl w/ Unit | Phi maximum for moller generation. |
| BEAM INFORMATION | ||
| /MolPol/fx | Dbl w/ Unit | X origin of beam in the global coordinate system. |
| /MolPol/fy | Dbl w/ Unit | Y origin of beam in the global coordinate system. |
| /MolPol/fz | Dbl w/ Unit | Z origin of beam in the global coordinate system. |
| /MolPol/xsmear | Dbl w/ Unit | X Sigma of gaussian smear in beam profile. |
| /MolPol/ysmear | Dbl w/ Unit | Y Sigma of gaussian smear in beam profile. |
| /MolPol/beamRotZX | Dbl w/ Unit | Small angle beam-kick from Z->X in radians or degrees. |
| /MolPol/beamRotZY | Dbl w/ Unit | Small angle beam-kick from Z->Y in radians or degrees. |
| /MolPol/beamE | Dbl w/ Unit | Beam energy (for 'beam' simulation or 'moller') |
| GEOMETRY MODIFIABLES | ||
| /MolPol/Geo/jawWidth | Double w/ Unit | Total Pb jaw opening width |
| /MolPol/Geo/targetPosition | Double w/ Unit | Target position on the beamline |
| /MolPol/Geo/targetThickness | Double w/ Unit | Target thickness, can be modified to near zero (0) but not zero. |
| /MolPol/Geo/activateFluxTrackingVPs | String | Enable/disable sensitive detectors for flux virtual planes (detectors 1-8, 13-15). Use 'true' or 'false'. Default: false |
| /MolPol/Geo/useCollimatingMask | Activate collimating mask material (MolPol_WCuMix) and visual attributes (WCuNiVisAtt) |
|
| /MolPol/Geo/activateInternalDipoleVPs | String | Enable/disable sensitive detectors for dipole internal virtual planes (detectors 100-191). Use 'true' or 'false'. Default: false |
| /MolPol/Geo/activatePaddleVPs | String | Enable/disable sensitive detectors for paddle virtual planes (detectors 11-12). Use 'true' or 'false'. Default: false |
| /MolPol/Geo/GEM1X | Double w/ Unit (cm) | X position of GEM1 (upstream tracker) |
| /MolPol/Geo/GEM1Y | Double w/ Unit (cm) | Y position of GEM1 (upstream tracker) |
| /MolPol/Geo/GEM1Z | Double w/ Unit (cm) | Z position of GEM1 (upstream tracker) |
| /MolPol/Geo/GEM2X | Double w/ Unit (cm) | X position of GEM2 (middle tracker) |
| /MolPol/Geo/GEM2Y | Double w/ Unit (cm) | Y position of GEM2 (middle tracker) |
| /MolPol/Geo/GEM2Z | Double w/ Unit (cm) | Z position of GEM2 (middle tracker) |
| /MolPol/Geo/GEM3X | Double w/ Unit (cm) | X position of GEM3 (downstream tracker) |
| /MolPol/Geo/GEM3Y | Double w/ Unit (cm) | Y position of GEM3 (downstream tracker) |
| /MolPol/Geo/GEM3Z | Double w/ Unit (cm) | Z position of GEM3 (downstream tracker) |
| /MolPol/Geo/trackingUS_Pos_z | Double w/ Unit (cm) | Z position of upstream GEM tracker (alias for GEM1Z) |
| /MolPol/Geo/trackingMD_Pos_z | Double w/ Unit (cm) | Z position of middle GEM tracker (alias for GEM2Z) |
| /MolPol/Geo/trackingDS_Pos_z | Double w/ Unit (cm) | Z position of downstream GEM tracker (alias for GEM3Z) |
| /MolPol/Geo/buildTracking | Activate GEM tracking geometry/materials and move trackers from parked to active positions | |
| /MolPol/Geo/activateTrackingSD | String | Enable/disable GEM tracking sensitive detector assignment. Use 'true' or 'false'. Requires /MolPol/Geo/buildTracking first |
| FIELD INFORMATION | ||
| /field/MagSourceMode | Int | Souce Mode, 1: Using ideal pole tips |
| /field/setQ1T | Double No Unit | Pole tip of Q1 in teslas. |
| /field/setQ2T | Double No Unit | Pole tip of Q2 in teslas. |
| /field/setQ3T | Double No Unit | Pole tip of Q3 in teslas. |
| /field/setQ4T | Double No Unit | Pole tip of Q4 in teslas. |
| /field/setQ5T | Double No Unit | Pole tip of dipole in teslas. |
| /field/setQ6T | Double No Unit | Field strength for superconducting helmholt coils |
| /field/update | Update/Initialize Moller magnet fields. | |
| MAGNET OFFSETS | ||
| /field/setQ1XOffset | Double w/ Unit | Offset for Q1 field in X direction. |
| /field/setQ1YOffset | Double w/ Unit | Offset for Q1 field in Y direction. |
| /field/setQ2XOffset | Double w/ Unit | Offset for Q2 field in X direction. |
| /field/setQ2YOffset | Double w/ Unit | Offset for Q2 field in Y direction. |
| /field/setQ3XOffset | Double w/ Unit | Offset for Q3 field in X direction. |
| /field/setQ3YOffset | Double w/ Unit | Offset for Q3 field in Y direction. |
| /field/setQ4XOffset | Double w/ Unit | Offset for Q4 field in X direction. |
| /field/setQ4YOffset | Double w/ Unit | Offset for Q4 field in Y direction. |
| /field/setQ6XOffset | Double w/ Unit | Offset for Helmholtz field in X direction. |
| /field/setQ6YOffset | Double w/ Unit | Offset for Helmholtz field in Y direction. |
| /field/setQ6XRot | Double w/ Unit | Offset for Helmholtz field in Y direction. |
| /field/setQ6YRot | Double w/ Unit | Offset for Helmholtz field in Y direction. |
The following is a table of the Virtual "flux" Planes (VP) in the simulation
| Detector Number | Description | Macro Control |
|---|---|---|
| 1 | VP Quad 1 Entrance | /MolPol/Geo/activateFluxTrackingVPs |
| 2 | VP Quad 1 Exit | /MolPol/Geo/activateFluxTrackingVPs |
| 3 | VP Quad 2 Entrance | /MolPol/Geo/activateFluxTrackingVPs |
| 4 | VP Quad 2 Exit | /MolPol/Geo/activateFluxTrackingVPs |
| 5 | VP Quad 3 Entrance | /MolPol/Geo/activateFluxTrackingVPs |
| 6 | VP Quad 3 Exit | /MolPol/Geo/activateFluxTrackingVPs |
| 7 | VP Quad 4 Entrance | /MolPol/Geo/activateFluxTrackingVPs |
| 8 | VP Quad 4 Exit | /MolPol/Geo/activateFluxTrackingVPs |
| 9 | VP Detector (Full Size) | Always active |
| 10 | Currently Unused | N/A |
| 11 | VP Hodoscope 1 | /MolPol/Geo/activatePaddleVPs |
| 12 | VP Hodoscope 2 | /MolPol/Geo/activatePaddleVPs |
| 13 | VP Detector Box | /MolPol/Geo/activateFluxTrackingVPs |
| 14 | VP Dipole Entrance | /MolPol/Geo/activateFluxTrackingVPs |
| 15 | VP Dipole Exit | /MolPol/Geo/activateFluxTrackingVPs |
| 100/101 - 190/191 | Left/Right Series of Flux Planes Through Dipole | /MolPol/Geo/activateInternalDipoleVPs |
| 200 | Upstream GEM tracker (GEM1) | /MolPol/Geo/activateTrackingSD |
| 201 | Middle GEM tracker (GEM2) | /MolPol/Geo/activateTrackingSD |
| 202 | Downstream GEM tracker (GEM3) | /MolPol/Geo/activateTrackingSD |
Notes:
1-8: The quadrupole flux planes. Controlled by /MolPol/Geo/activateFluxTrackingVPs macro command (default: disabled). Use true to enable, false to disable.
9: Detector flux plane. This covers the frontal area of the lead/spaghetti fibre detector. Always active - not controlled by any macro command.
11-12: Hodoscope paddles. Controlled by /MolPol/Geo/activatePaddleVPs macro command (default: disabled). Use true to enable, false to disable.
13-15: Controlled by /MolPol/Geo/activateFluxTrackingVPs macro command (default: disabled). Detector 13 covers the front of the detector box. Detector 14 is the dipole entrance fixed to end of beam pipe. Detector 15 is the dipole exit, square plane placed just past the titanium dipole exit windows.
100-191: Series of flux planes in the dipole which can be essential in understanding how the electron envelope moves through the dipole. Controlled by /MolPol/Geo/activateInternalDipoleVPs macro command (default: disabled). Use true to enable, false to disable.
200-202: GEM trackers (upstream, middle, downstream). First run /MolPol/Geo/buildTracking to activate tracker mass in the simulation (move from parked positions and apply physical GEM materials). Then run /MolPol/Geo/activateTrackingSD true to attach sensitive detectors and record GEM hits. Use /MolPol/Geo/activateTrackingSD false to disable GEM SD assignment while keeping tracker mass active.
Collimating mask: Initialized as air with a white wireframe visual. Running /MolPol/Geo/useCollimatingMask switches the mask to MolPol_WCuMix and applies the standard mask visual attributes.
Results of the simulation are stored in a root file. Details on the data structure of this file can be found in variables.md