User Tools

Site Tools


software:g4simulation:configuration

This is an old revision of the document!


Simulation configuration

To set the general behaviour of a simulation, a config file mechanism is used. The singleton class PRIMASimulationConfig is responsible for reading the config file and providing the other classes with the specified config settings.

How to define a new command

  1. Add the variable(s) containing the settings information to class PRIMASimulationConfig, implementing the corresponding “get” method.
  2. Initialise these variables in the constructor using their default values.
  3. Add an if block in the while loop inside method PRIMASimulationConfig::ReadConfFile, e.g.
    if(key == "macro-file"){
    	macroFileName = value;
    	macroSpecified = 1;
    	cout<<"macro file name set to: "<<macroFileName<<endl;
          }
  4. Document the new command in this wiki page.


List of commands

  • Specify the root file where the geometry (TGeoManager object) to be used in the simulation is saved.
    geometry-file <filename>
  • Specify the geant4 macro file to be executed. If this command is not used the geant4 interactive shell will be loaded.
    macro-file <geant4 macro file>
  • Specify the root file where the simulation output is written. Attention! The specified file will be overwritten.
    root-output-file test_bwec.root
  • Specify the primary generator to be used
    primary-generator <generator>

    Until now, the following options are available:

    • particleGun: uses the geant4 particle gun which can be set in the macro file
    • p16uniform: generates electron over the surface of proto16, placed at 1.2 m from the particle source. The electron energy is uniformly distributed between 100 MeV and 1500 MeV
    • primaUniform: generates electron over the surface of the PRIMA detector, placed at 1.2 m from the particle source. The electron energy is uniformly distributed between 100 MeV and 1500 MeV
    • Pi0gun: generates any geant4 particle with arbitrary direction, origin 1.2 m from detector (z-direction). The particles energy is uniformly distributed between Emin and Emax. If Emin = Emax, the particles have a constant initial Energy.


  • Explicit config Parameters for “Pi0gun” (distances in mm, Energies in MeV):
    • set particle type
      Pi0_particle gamma
    • set velocity direction, leave dz = 1200 to hit the detectors surface at dx, dy
      #Pi0_dx 200
      #Pi0_dy 200
      #Pi0_dz 1200
    • set the particles initial energy
      Pi0_Emin 1000
      Pi0_Emax 1000

*

 it is also possible to choose the velocity direction by setting the polar angle (that is the angle to the z-axis) of the initial pion, the anzimuth angle is randomly distributed between 0 and 2 pi
Pi_theta 5


  • Specify if the tagger/scintillator is used as sensiteve detector (SD):
    use-tagger <0/1>
  • If there is no scintillator in the geometry, use-tagger needs to be set 0
software/g4simulation/configuration.1595234354.txt.gz · Last modified: 2022/01/14 18:44 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki