Proton Calorimetry/Detector Simulation: Difference between revisions

From PBTWiki
Jump to navigation Jump to search
Line 26: Line 26:
** After verification, in expanded Xerces folder execute: <code>./configure</code>, <code>sudo make</code> and then <code>sudo make install</code>
** After verification, in expanded Xerces folder execute: <code>./configure</code>, <code>sudo make</code> and then <code>sudo make install</code>
* Install GEANT4 [http://geant4.web.cern.ch/support/download]
* Install GEANT4 [http://geant4.web.cern.ch/support/download]
** See installation guide [[http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/InstallationGuide/html/installguide.html here]
** See installation guide [http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/InstallationGuide/html/installguide.html here]
** Enable additional build options: multithreading, install data, GDML, QT, OpenGL, RayTracer, zlib
** Enable additional build options: multithreading, install data, GDML, QT, OpenGL, RayTracer, zlib
** Apparently system CLHEP should not be used unless absolutely necessary
** Apparently system CLHEP should not be used unless absolutely necessary

Revision as of 14:35, 16 March 2020

This page contains information on the Geant4 code that form the Proton Calorimetry detector simulation.

In order to run Geant4 simulations, you will either need to download and install the software yourself or make use of the existing installation on the UCL HEP Linux cluster. To use the existing installation, follow this dedicated page.

Local Installation of GEANT4 on MacOS

Correct for MacOS High Sierra 10.13.6

  • Install Xcode 10 or higher from Mac App Store and install command line tools by executing in a terminal window xcode-select --install. Agree to the Xcode license: sudo xcodebuild -license
  • Install MacPorts appropriate for your system [1].
  • Install CMake 3.8 or higher [2]
    • After installation, execute: sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install
  • Optional: Install CLHEP 2.4.1.0 or higher [3] (see README for build/install instructions)
    • <source_code_dir> is the directory where the README is located.
    • <build_directory> can be any folder you like (can be deleted after installation).
    • <install_directory> should be the default: /usr/local
  • Install Expat 2.0.1 or higher [4] (see README for build/install instructions)
    • Execute ./buildconf.sh and then ./configure in the directory <download_directory>/expat
      • If autoreconf is not found, install autoconf by executing: sudo port install automake autoconf libtool
    • Might need to use sudo when executing make install
  • Install zlib 1.2.3 or higher [5] (see README for build/install instructions)
    • Might need to use sudo when executing make install</code.>
  • Install Xerces-C++ headers and library 3 or higher [6]
    • Will need to install GPG [7] to verify KEYS, see here for instructions: [8]
    • After verification, in expanded Xerces folder execute: ./configure, sudo make and then sudo make install
  • Install GEANT4 [9]
    • See installation guide here
    • Enable additional build options: multithreading, install data, GDML, QT, OpenGL, RayTracer, zlib
    • Apparently system CLHEP should not be used unless absolutely necessary

Running QUARC Detector Simulation

  • You can copy the simulation files from this path on the HEP cluster: /unix/pbt/users/sshaikh/Simulation
  • In the folder 'build', execute: sudo cmake -DCMAKE_PREFIX_PATH=/usr/local/lib/Geant4-<YOUR VERSION HERE>/ <YOUR PATH TO SIMULATION FOLDER>
  • Then, execute: sudo make
  • To run the simulation with the default macro, inter.mac, execute: ./ProtonSimulation
  • To run the simulation with a different macro, e.g. interactive.mac, execute: ./ProtonSimulation ../macros/interactive.mac

General Notes

  • In output file EdepAccurate, each number represents the energy deposited in the user-defined sheet thickness, divided by spatial resolution (not in file name)
    • e.g. EdepAccurate_252.7MeV_200x2_500mustep_100p_refl.out represents 252.7 MeV beam, 200 sheets of 2mm thickness, 500 micron StepMax, 100 protons, reflection allowed.
    • StepMax represents the minimum resolution in GEANT4’s tracking of particles, characteristics are calculated in distance intervals. If undefined, GEANT4 will choose a step size that represents the finest increment required by the various physics lists. Default value might be ~2mm.
  • Can choose to record number of photons produced or number of photons that reach the edge of the scintillator. In the latter, allowing reflections is necessary.
    • Number of photons produced is stored in NPhoton
    • Number of photons that reach edge of scintillator is stored in NPhotonTop
  • In file Hits, there is a list of all protons produced in simulation with their energy, 2 mystery numbers and their stopping depth.
    • Small numbers are indicative of a nuclear interaction, which results in a proton being deflected sufficient to warrant a new particle ID.
  • The parameter rangeCut defines the minimum range of a secondary particle (electrons, positrons & gammas) such that it is tracked until it stops. Such particles with ranges below rangeCut just have their energy deposited in place and are then deleted. This is such to avoid long-computation times.
    • This does not however apply to any other secondaries, e.g. neutrons or alpha particles.
  • Notation: e.g. /control/multiply x {y} {z}
    • x = y times z
    • Brackets are required when using previously defined variables
  • Positional origin of simulation is in middle of scintillator
  • It is more important to have sufficient numbers of protons in simulation in order to accurately simulate the energy deposition curve. While in reality approx. 10000 photons per MeV lost in protons is produced, this would take far too long to simulate and would require reducing the number of protons. However, the depth-light curve can only ever be as good as the energy deposition curve – so sampling more photons with only few protons will NOT give a good depth-light curve.

Existing Issues

  • The macros, e.g. inter.mac attempt to define aspects of the detector geometry, but fail do so. It appears that GEANT4 defines a geometry based on PTDetectorConstruction and then does not allow the macro to update the geometry. See ProtonSimulation.cc: the macro is called after the geometry is defined. Find some code where a macro redefines the geometry successfully to find out where to place the macro-defined geometry parameters. Probably needs work in the Messenger source files or PTDetectorConstruction::UpdateGeometry().