Skip to content

TTU-HEP/DREAMSim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

cd8349b · Dec 30, 2024

History

77 Commits
Nov 6, 2024
Nov 6, 2024
Nov 23, 2024
Dec 30, 2024
Oct 2, 2024
Nov 17, 2024
Sep 16, 2024

Repository files navigation

HG-DREAM G4 simulation: dream 2.06

Environment:

For machines with cvmfs mounted, can directly source the environment

source /cvmfs/sft.cern.ch/lcg/views/LCG_106/x86_64-el9-gcc13-dbg/setup.sh

Change the path according to the OS.

On HPCC, everything (ROOT and GEANT4) is compiled inside the singularity environment. Log into the interactive node (more information) with e.g.

interactive -p nocona

From there run the singularity container with the following command:

singularity run --cleanenv --bind /lustre:/lustre /lustre/work/yofeng/SimulationEnv/alma9forgeant4_sbox/

The corresponding docker image can be found here, with the build file here.

If running with Docker on your local machine, firstly pull the docker image

docker pull yongbinfeng/alma9geant:latest

Then run the container with the following command:

docker run -it --rm -h dreamsim -v /path/to/DREAMSIM:/DREAMSIM yongbinfeng/alma9geant:latest

Note if you have conda installed, exit the conda environment before running the singularity container, otherwise it might cause conflicts with different ROOT versions etc.

Compile:

Inside the singularity environment, build program in "build" area,

cd /path/to/DREAMSIM/directory
cd sim
mkdir build
cd build
cmake ..
make -j 4

Structure of software:

  • sim/exampleB4b.cc: main program
  • sim/src/B4DetectorConstruction.cc:definition of the detector
  • sim/src/B4bSteppingAction.cc:access hits at each step
  • sim/src/CaloTree.cc:analysis and hit handling

Run the code

./exampleB4b -b paramBatch03_single.mac  \
    -jobName testjob -runNumber 001 -runSeq 003  \
    -numberOfEvents 10  -eventsInNtupe 100    \
    -gun_particle e+ -gun_energy_min 100.0 -gun_energy_max 100.0 \
    -sipmType 1

The output files are:

  • root: histograms
  • csv: hits in each readout cell (2D and 3D)

Run parameters:

  • All run parameters are defined in "paramBatch03_single.mac" and may be overloaded in "runBatch03_single_param.sh".

Job submission on HPCC

the script jobs/jobSubmission.py handles that. Run

cd jobs
python jobSubmission.py
# It will produce the shell scripts to submit and run the jobs on HPCC.
bash submit_all.sh

to submit the jobs, which can then be monitored with squeue -u $USER. More information on the HPCC batch system can be found here.

Analysis

The script plotter/makePlotsRDF.py handles this. It runs on multithreads with ROOT's RDataFrame. Therefore, from the login node, log to an interactive node with mutliple cores, e.g.

interactive -p nocona -c 4

Then run the script

cd plotter
python makePlotsRDF.py

under the singularity environment.

To run makePlotsOptics.py for the optics study, compile the helper functions in plotter/macros first with

cd plotter/macros
root -b -q -e ".L functions.cc+"

Then run the script

python makePlotsOptics.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published