Tags:
create new tag
view all tags

PIONEER Beamline Simulations

Intro to G4beamline

The PIONEER beamline simulation is built using G4beamline (G4BL), a free open-source toolkit built on top of GEANT4. The latest (3.06) source and prebuilt binaries can be downloaded from here. Included in the download is the comprehensive user's guide (G4beamlineUsersGuide.pdf) that is immensely useful when getting started.

An overview guide for the PIONEER simulation is available here.

Every G4beamline simulation script needs at minimum a physics definition and beam definition. Beyond that, the user can define their own parameters using the param keyword along with the -unset option to allow the param to be overriden later in the script. Users can also build assets using predefined devices or custom boolean geometries and place these in the world using the place command.

The πE5 beamline in G4beamline

The πE5 simulation in G4BL was originially developed for the Mu3e Compact Muon Beam Line (CMBL), and has been modified for use in the MEGII experiment, and now for the PIONEER experiment. The magenetic elements in the simulation (quadrupoles, dipoles, sextupoles) rely on either existing field maps or calculations from geometry and coil windings. The QSK and HSC elements do not have field maps, and the QSF elements use the QSM field map.

The simulation relies on several pre-defined files in the original piE5 simulation.

  • Positions.txt >
    • In world element positions
  • feldxxx.dat
    • Magnetic field maps, should not be edited
  • Scalefactors.txt
    • Current scaling and set values
  • DeltaCurrents.txt
    • Current offsets, none used As well as one file for PIONEER specific placements: PositionsPIONEER.txt
The πE5 G4BL scripts and field maps are available here.
The PIONEER G4BL example scripts for pion production and pion transport simulations are available here.

Using the HiMB Pion Production Model

The HiMB Pion Production Model implemtents a parameterized production cross section the details of which are described here. G4Beamline must be built from source and the GEANT4 and G4Beamline source modification must be applied before building. The HiMB model source code is available here.

The model can be enabled through the physics command in G4BL.

physics QGSP_BIC_HIMB_HYBRID_HP_EMY

The model also provides a mechanism for biasing or splitting pions to generate a larger sample of pions and muons produced from proton interactions in the production target. This splitting can be enabled by the following command in the G4BL script:

physics QGSP_BIC_HIMB_HYBRID_HP_BIAS_EMY splittingFactor=100

where the splitting factor can be defined by the user. A factor of N generates an additional N pions from proton interactions and N muons from pion decay.

Pion Production Simulation Data Sets

Several collections of primary pion production simulations are available in varying states of completeness. The G4BL script used to generate the file is located in the same directory and has the file name PIONEER{JobName}_part_{id}.i.

Each ROOT file has two virtual detector ntuples:

VirtualDetector/DetEMuPiFromTarget has 300 mm radius and located 150 mm from Target E center at 165° relative to proton beam axis (πE5 channel axis).

VirtualDetector/DetFSH41 has 250 mm radius and located at the FSH41 slit system position in the πE5 channel.

File locations on the CENPA-ROCKS cluster:

Pion production from incident protons on a graphite 5° Slanted Target E.
Each file corresponds to 100M protons on target.
Total PoT =1E9.

/data/g2/users/zhodge/g4blsim/SlabTgtE_PionProduction1E9/SlabTgtE_PionProduction1E9/PIONEER_SlabTgtE_part_1/PIONEER_SlabTgtE_20220207_part_1.root
/data/g2/users/zhodge/g4blsim/SlabTgtE_PionProduction1E9/SlabTgtE_PionProduction1E9/PIONEER_SlabTgtE_part_2/PIONEER_SlabTgtE_20220207_part_2.root
/data/g2/users/zhodge/g4blsim/SlabTgtE_PionProduction1E9/SlabTgtE_PionProduction1E9/PIONEER_SlabTgtE_part_3/PIONEER_SlabTgtE_20220218_part_3.root
/data/g2/users/zhodge/g4blsim/SlabTgtE_PionProduction1E9/SlabTgtE_PionProduction1E9/PIONEER_SlabTgtE_part_4/PIONEER_SlabTgtE_20220218_part_4.root
/data/g2/users/zhodge/g4blsim/SlabTgtE_PionProduction1E9/SlabTgtE_PionProduction1E9/PIONEER_SlabTgtE_part_5/PIONEER_SlabTgtE_20220218_part_5.root
/data/g2/users/zhodge/g4blsim/SlabTgtE_PionProduction1E9/SlabTgtE_PionProduction1E9/PIONEER_SlabTgtE_part_6/PIONEER_SlabTgtE_20220224_part_6.root
/data/g2/users/zhodge/g4blsim/SlabTgtE_PionProduction1E9/SlabTgtE_PionProduction1E9/PIONEER_SlabTgtE_part_7/PIONEER_SlabTgtE_20220224_part_7.root
/data/g2/users/zhodge/g4blsim/SlabTgtE_PionProduction1E9/SlabTgtE_PionProduction1E9/PIONEER_SlabTgtE_part_8/PIONEER_SlabTgtE_20220224_part_8.root
/data/g2/users/zhodge/g4blsim/SlabTgtE_PionProduction1E9/SlabTgtE_PionProduction1E9/PIONEER_SlabTgtE_part_9/PIONEER_SlabTgtE_20220224_part_9.root
/data/g2/users/zhodge/g4blsim/SlabTgtE_PionProduction1E9/SlabTgtE_PionProduction1E9/PIONEER_SlabTgtE_part_10/PIONEER_SlabTgtE_20220225_part_10.root

Pion production from incident protons on a graphite 8° Slanted Target E.
Each file corresponds to 1E8 protons on target.
The collection is incomplete as several jobs crashed (1,3,4,5,6).
Total PoT =5E8.

/data/g2/users/zhodge/g4blsim/SlabTgtE_8deg_PionProduction1E9/SlabTgtE_8deg_PionProduction1E9/PIONEER_SlabTgtE_8deg_part_2/PIONEER_SlabTgtE_8deg_20220225_part_2.root
/data/g2/users/zhodge/g4blsim/SlabTgtE_8deg_PionProduction1E9/SlabTgtE_8deg_PionProduction1E9/PIONEER_SlabTgtE_8deg_part_7/PIONEER_SlabTgtE_8deg_20220225_part_7.root
/data/g2/users/zhodge/g4blsim/SlabTgtE_8deg_PionProduction1E9/SlabTgtE_8deg_PionProduction1E9/PIONEER_SlabTgtE_8deg_part_8/PIONEER_SlabTgtE_8deg_20220225_part_8.root
/data/g2/users/zhodge/g4blsim/SlabTgtE_8deg_PionProduction1E9/SlabTgtE_8deg_PionProduction1E9/PIONEER_SlabTgtE_8deg_part_9/PIONEER_SlabTgtE_8deg_20220225_part_9.root
/data/g2/users/zhodge/g4blsim/SlabTgtE_8deg_PionProduction1E9/SlabTgtE_8deg_PionProduction1E9/PIONEER_SlabTgtE_8deg_part_10/PIONEER_SlabTgtE_8deg_20220225_part_10.root

Pion production from incident protons on a graphite Standard Target E.
Each file corresponds to 1E8 protons on target.
The collection originally intended to have 100 files, but it crashed after 22.
Total PoT =2.2E9.

/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_1/PIONEERTgtEProd_part_1_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_2/PIONEERTgtEProd_part_2_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_3/PIONEERTgtEProd_part_3_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_4/PIONEERTgtEProd_part_4_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_5/PIONEERTgtEProd_part_5_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_6/PIONEERTgtEProd_part_6_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_7/PIONEERTgtEProd_part_7_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_8/PIONEERTgtEProd_part_8_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_9/PIONEERTgtEProd_part_9_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_10/PIONEERTgtEProd_part_10_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_11/PIONEERTgtEProd_part_11_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_12/PIONEERTgtEProd_part_12_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_13/PIONEERTgtEProd_part_13_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_14/PIONEERTgtEProd_part_14_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_15/PIONEERTgtEProd_part_15_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_16/PIONEERTgtEProd_part_16_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_17/PIONEERTgtEProd_part_17_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_18/PIONEERTgtEProd_part_18_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_19/PIONEERTgtEProd_part_19_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_20/PIONEERTgtEProd_part_20_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_21/PIONEERTgtEProd_part_21_output.root
/data/g2/users/zhodge/g4blsim/PionProduction1E10/PIONEERTgtEProd_part_22/PIONEERTgtEProd_part_22_output.root

Other Scripts

My personal simulations directory is located at /home/zhodge/pioneer and copied to /data/eliza2/g2/users/zhodge/pioneer/

The script ConvertRootToBLTrack2.cpp takes a text file list of .root files and converts all tracks within the defined VirtualDetector to a BLTrackFile2 format for use as a starting beam file in G4BL.
Usage:
$>root "ConvertRootToBLTrack2.cpp(\"RootFileList.txt\")"

The bash scripts in PionProduction will generate G4BL files and submit the to the cluster. This is not very portable as the directory locations are hard coded in the bash scripts. The runprodjobs.sh script calls createjobfile.sh which creates a G4BL script and modifies the corresponding parameters within the file.
Usage:
$>./runprodjobs.sh -j <number_of_jobs> -c <number_of_cpu_per_job> -n <job_name> -s <starting_part_ID>

The cluster submission script subclu_g4blmpi is typically located in my ~/.local/bin which is added to my $PATH by a setup script. This script submits the G4BL simulation to the cluster using the qsub method.

-- Zachary Hodge - 2022-03-04

Comments

I hate this formatter

Topic revision: r9 - 2022-03-05 - ZacharyHodge
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.StudiesZach.