Skip to content

schwarzmario/g4simple

 
 

Repository files navigation

Some fancy LAr simulation for checking efficiency of LAr veto in L200, scanning attenuation lengths while still looking a bit into WLSR dimensions but never touching LAr veto dimensions. That we will do for L1000 ;)

TODO: 1. Change title.

My Idea for naming/simulating convention:

  1. Simulation Campaign: set of several simulation programs running in parallel (or serial) and scanning individual voxels of the geometry for one fixed attenuation/WLSR size/LAr veto (the latter we swore to never touch)
  2. RunSeries: All which is covered in one single program execution. I suspect to pack several voxels into one RunSeries to minimize overhead to start a large number of single jobs.
  3. Run: =G4Run, i.e. one execution of /run/beamOn with a fixed nr of events to be simulated. ParticleGun setting (--> position, i.e. voxel) is fixed (save maybe for direction change or potential distribution within one voxel) as well as all the rest. Sure we don't touch LAr veto here either.
  4. Event: =G4Event, i.e. all stuff simulated after one single particle gun shot. This is one single 128 nm photon in our case.
  5. Hit: A single hit of the LAr veto instrumenation. By construction: an Event leads to 0 or 1 hit. Want to save position by giving a volumeID. cumulative hits in a single run are added up and stored at a voxel position.

And please use cmake. the makefile is unmaintained as of now

based on g4simple, see here:

g4simple

Perhaps the simplest fully-featured G4 application.

Based on one-file simulation by Jason Detwiler.

Installation: Compile geant4 with GDML support (and optionally HDF5 support), then do:

source (g4install_path)/share/(g4version)/geant4make/geant4make.sh

(or source (g4install_path)/share/(g4version)/geant4make/geant4make.csh)

make

Physics List: uses Geant4's named physics lists, set them using macro commands (see example run.mac)

Generator: uses Geant4's GPS. Set it up using macro commands (see example run.mac).

Geometry: uses GDML (see example run.mac). Can use materials from Geant4's NIST Material Database (note: the GDML parser will complain that the materials have not been defined, but Geant4 will still run without error). Also supports Geant4's text file geometry scheme.

Output: uses Geant4's analysis manager (root, hdf5, xml, csv), with several configurable options for output format, sensitive volumes (including regex-based pattern matching / replacement), etc. (see example run.mac). Records event/track/step numbers, PIDs (see also the python package particle), positions, energies, etc.

Visualization: uses avaialable options in your G4 build (see example vis.mac).

Postprocessing: you will want to postprocess the output to apply the detector response. See example code that runs on the output of run.mac.

See similar project by Jing Liu at https://github.com/jintonic/gears .

About

A simple Geant4 simulation suite

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 96.1%
  • Python 1.3%
  • CMake 1.1%
  • Other 1.5%