Skip to content

BNLNPPS/esi-g4-optical

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The ESI Optical Testbed

About

This repository is meant for testing a variety of the Geant4 functionality related to optical processes, mainly Cherenkov photon generation and propagation.

Building

It strongly recommended to use the "out of source" build pattern. For example, in the folder optical1 one first creates a folder named "build", then runs CMake and finally the build itself using make, from the build folder itself. This can look as follows:

cd optical1
mkdir build
cmake -B build
cd build/
make # or, you can use the multithreaded -j option to make it work quicker
make -j8 

The auxiliary header-only library lyra.hpp that is used for the CLI argument parsing is in the include folder of the project.

Running

To run the application, the Geant4 environment needs to be properly set by using its setup scripts in the bin folder of the respective installation.

"./Opt -m run1.mac" then the run1.mac macro is called, otherwise "./Opt" visualizes the event.

OpenGL under WSL2

To get graphics working when running under WSL2, it may be necessary to apply this setting:

export LIBGL_ALWAYS_INDIRECT=

Outline of the Geant logic and workflow

Main

  • Create the G4UIExecutive and the runManager
  • Initialize the runManager with the DetectorConstruction
  • Create the physicsList which includes optical physics
  • Call ActionInitialization

PrimaryGeneratorAction

This is created in the "Build" method of ActionInitialization. Various particle generation parameters are stored here, as well as a reference to the ParticleGun.

RunAction

Generates the "Run" object, and calls "EndOfRun" in the end.

CADMesh

This software is a proposed tool to import CAD models (PLY, OBJ, STL) directly as a "G4TessellatedSolid" without the need for any intermediary conversion (eg. GDML). https://github.com/christopherpoole/CADMesh

CADMesh version 1.1 was tested for this project. Each CAD volume needs to be imported in DetectorConstruction. The material, orientation and position must be specified by the user.

How to build CADMesh:

Output

One can pick between csv, root and hdf5 format for file output. The CSV output units are the following:

Energy X Y Z X_dir Y_dir Z_dir

The units:

[MeV] [mm] [mm] [mm] [1] [1] [1]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages