Git Product home page Git Product logo

light_transport_geant4's Introduction

(M)odular (P)ixelated (N)eutron (D)etector Geant4 Simulation

Introduction

Adapted from https://github.com/micahfolsom/mgg4

Dependencies

Geant4, ROOT

Available Geometries

  1. singlepixel: a single scintillator pixel
  • Default: 2x2x2 mm
  1. pixelarray: an array of pixels
  • Default: 8x8 array of 2x2x2mm pixels

UI Commands

Geometry Commands

Geometry-related commands defined in the [GeometryMessenger](@ref MPND::GeometryMessenger)
Command directory: /mpnd/geometry/

General Commands
/mpnd/geometry/reload
Arguments: none
Description: clears out all geometric objects and rebuilds them based on the current parameters. Must run after changing a physical detector parameter.

/mpnd/geometry/config
Arguments: singlepixel pixelarray
Description: switch between detector geometries.
Default: singlepixel

/mpnd/geometry/singlepixel/dimensions
Arguments: [x] [y] [z] [units]
Description: set the pixel size.
Default: (2, 2, 2) mm

/mpnd/geometry/singlepixel/material
Arguments: [material name]
Description: set the scintillator material.
Default: ej200

/mpnd/geometry/pixelarray/dimensions
Arguments: [x] [y] [z] [units]
Description: set the pixel size.
Default: (2, 2, 2) mm

/mpnd/geometry/pixelarray/nx
Arguments: [nx]
Description: set the number of X pixels in the array.
Default: 8

/mpnd/geometry/pixelarray/ny
Arguments: [ny]
Description: set the number of Y pixels in the array.
Default: 8

Gun Commands

This code uses the built-in Geant4 General Particle Source (G4GeneralParticleSource). I am not aware of a good tutorial for GPS, but if you look around online you can find various examples. It also helps to look at the source code: https://geant4.kek.jp/Reference/10.06.p01/classG4GeneralParticleSource.html

/gps/particle
Arguments: gamma neutron opticalphoton e- proton alpha
Description: defines the particle type using Geant4 naming convention
Default: geantino

/gps/pos/type/
Arguments: Point Plane Beam Surface Volume
Description: set the source positional distribution type

/gps/pos/shape
Arguments: Circle Annulus Ellipse Square Rectangle for a Plane]
Sphere Ellipsoid Cylinder, Para (parallelpiped) [For Surface or Volume]
Descriptions: sets the source shape type after gps/pos/type.

/gps/direction
Arguments: [Px] [Py] [Pz]
Description: set the momentum direction of generated particles using direction cosines.
Default: (1, 0, 0)

/gps/position
Arguments: [x] [y] [z] [units]
Description: sets the center coordinates (x,y,z) of the source.
Default: (0, 0, 0) cm

/gps/pos/halfx
Arguments:
Description: sets the half-length in x of the source for Square/Rectangle shape.
Default: 0 cm

/gps/pos/halfy
Arguments:
Description: sets the half-length in y of the source Square/Rectangle shape.
Default: 0 cm

/gps/ang/type
Arguments: iso cos planar beam1d beam2d focused user
Description: sets the angular distribution type.
Default: iso

/gps/ene/type
Arguments: Mono Lin Pow Exp Gauss Brem Bbody
Description: sets the energy distribution type.
Default: Mono (mono-energetic)

/gps/ene/min
Arguments: [Emin] [unit]
Description: sets the minimum for the energy distribution
Default: 0 keV

/gps/ene/max
Arguments: [Emax] [unit]
Description: sets the maximum for the energy distribution
Default: 0 keV

/gps/ene/alpha
Arguments: [alpha]
Description: sets the exponent alpha for a power-law distribution.
Default: 0

Tracking/Filter Commands

Commands to modify the different filters applied to the sensitive detectors. This controls the interaction information that is written to disk. Defined in [SDMessenger](@ref MPND::SDMessenger)
Command directory: /mpnd/sd/

/mpnd/sd/select_sd
Arguments: [sd_name]
Description: change current selection to specified SD.
Default: scintillator_sd

/mpnd/sd/particle/add
Arguments: [particle name]
Description: add a particle to the filter for the current SD.

/mpnd/sd/particle/remove
Arguments: [particle name]
Description: remove a particle from the filter for the current SD.

/mpnd/sd/particle/clear
Description: clear the particle filter for the current SD.

/mpnd/sd/particle/print
Description: print the particle filter for the current SD.

/mpnd/sd/energy/add
Arguments: [min, max)
Description: add an energy window to the filter for the current SD.

/mpnd/sd/energy/remove
Arguments: [index]
Description: remove an energy window from the filter for the current SD.

/mpnd/sd/energy/clear
Description: clear the energy filter for the current SD.

/mpnd/sd/energy/print
Description: print the energy filter for the current SD.

Run Commands

General run (file path, etc) commands defined in the [RunMessenger](@ref MPND::RunMessenger)
Command directory: /mpnd/run/

/mpnd/run/path
Arguments: [path/to/file.root]
Description: specify the save file path for the simulation data.
Default: sim.root

/mpnd/run/write_data
Arguments: true false
Description: toggle writing simulation data to disk.
Default: true

/mpnd/run/buffer_limit
Arguments: [number of events] (> 0)
Description: number of events to hold before emptying the event buffer. The FileManager will block as it empties the queue so if you are doing a short run, this should be set larger than the number of events being run, and if a long run, something reasonable (ie. 1000), depending on how long you expect each write to take.
Default: 1000

/mpnd/run/max_file_size
Arguments: [GB] (> 0)
Description: set the maximum file size allowed before automatic file splitting by ROOT. Calls TTree::SetMaxTreeSize().
Default: 100 GB

Other Notes

  1. Do not #include G4SystemOfUnits.hh in header (.hpp) files! You must only #include it from .cpp files. Doing it in the headers can cause name conflicts with ROOT which will break things. If you see complaints about a shadow declaration of variable s in ROOT headers, this is why.

light_transport_geant4's People

Contributors

suannchong avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.