Coder Social home page Coder Social logo

mkandemirr / opsim Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 319 KB

OpSim is a set of additions to the Geant4 toolkit that simplify the implementation of optical photon applications and enhance the flexibility and maintainability of developed applications.

License: Other

C++ 96.73% CMake 3.27%
geant4-simulation scintillation-detector scintillator light-collection material-optical-properties optical-applications optical-photon photon-transportation

opsim's Introduction

OPSim

OPSim is a set of additions to the Geant4 toolkit that facilitate the implementation of optical photon applications and increase the flexibility and maintainability of developed applications. It also provides interfaces for creating reusable and portable material build code. This tool has been created according to users' needs and perspectives, considering frequently asked questions, most encountered challenges, and evolving needs over time in the optical category of the Geant4 official forum page.

The package structure:

OPSim: This directory includes the header and implementation files of OPSim.

examples: To demonstrate how to use OPSim in an application, we choose OpNovice, one of the examples in Geant4's optical category. This directory contains two versions of the selected application.

examples/OpNovice : This is the original version provided by the Geant4 team.

examples/OpNoviceEx01: This example shows the usage of MaterialPropertiesTable and OpticalSurface classes and their implementations via user interface commands. Only the OPNoviceDetectorConstruction.cc file has been modified from the source files of OPNovice. All other implementation files are the same as in OpNovice. Also, different from the original version, directories named data, macros, and OPSim have been added to the project source directory.

examples/OpNoviceEx02: This example shows how to use VMaterialBuilder class to decouple a material build code from the detector construction code. This example also shows users how to create an app-independent reusable material build code while working on their projects. Only the OPNoviceDetectorConstruction.cc file has been modified from the source files of OPNovice. All other implementation files are the same as in OpNovice. Also, different from the original version, directories named data, macros, reusableMaterials, and OPSim have been added to the project source directory. The directory named reusableMaterials is now application-independent and can be moved across projects.

examples/output: This directory contains one output from every three examples. It should be noted here that the output of all three examples(i.e., printed output of material properties table) is the same as expected.

Tested on

  • Os: Linux (Ubuntu 22.04.2 LTS)
  • Architecture: x86_64
  • Compiler: GCC 11.3.0
  • Geant4.11.1.1

How to use OPSim in a Geant4 optical application?

Copy the OPSim directory to the project source directory, where your CMakeList.txt file is located, and add the following two lines of code to the appropriate place of your CMakeList.txt file (for help, you can examine the CMakeList.txt files in the provided example applications).

before the executable target is created:

  add_subdirectory(OPSim)

after the executable target is created:

   target_link_libraries(yourExecutableTarget OPSim ${Geant4_LIBRARIES} )

How to run the provided example applications?

  1. Go to the directory where you installed the OpNovice in your system.
 cd path/To/OpNovice
  1. Create a directory named OpNovice-build in the same directory as OpNovice.
 mkdir OpNovice-build
  1. Now go inside this build directory and run CMake to generate the Makefiles needed to build the application. Two arguments are passed to CMake. The first argument to CMake is the path to the source directory that includes the CMakeList.txt file. The second argument is the path to the build directory where the generated make files will be located. CMake will now run to configure the build and generate Makefiles.
  cd OpNovice-build
  cmake -S ../OpNovice -B .
  1. With the Makefile available, you can now build by simply running make:
 make  
  1. The application is now ready to run. If you now list the contents of your build directory, you will notice that the executable OPNovice has been created. The program can be executed in two modes: interactive and batch. To run in an interactive mode:
 ./OPNovice

All versions of OPNovice run in the same way.

Contacts

If you have any questions or wish to notify of updates and/or modifications please contact:
Mustafa Kandemir ([email protected])

Citation

@article{KANDEMIR2023108873,
title = {OPSimTool: A custom tool for optical photon simulation in Geant4},
journal = {Computer Physics Communications},
volume = {292},
pages = {108873},
year = {2023},
issn = {0010-4655},
doi = {https://doi.org/10.1016/j.cpc.2023.108873},
url = {https://www.sciencedirect.com/science/article/pii/S0010465523002187},
author = {Mustafa Kandemir},
keywords = {Scintillators, Scintillation photon, Light collection, Material optical properties, Eljen scintillators}
}

opsim's People

Contributors

mkandemirr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.