Skip to content
Snippets Groups Projects

User primary generator action adding plugin functionality

The Gean4 provides an interface to the user's custom primary generator. It is very needed in some cases, for example for reading primary vertexes data from an external file, or for writing generator data into an output analysis file.

The main goal of changes in this branch is to provide the functionality to use G4VUserPrimaryGeneratorAction from FSLUserActionPlugin. So that one could be able to implement one's own primary generator action.

On the side of FSL, a new type of generator has been added (with the name "User Primary Generator"). If chosen generators with the names "Particle Gun" or "Pythia", the primary generator in FSLUserActionPlugin will be ignored. If chosen "User Primary Generator", the generator in the user plugin will be used.

Here is a picture of the changes in the FSL window. Screenshot_from_2022-09-10_19-23-59

Here is an example of a user plugin with a custom primary generator https://gitlab.cern.ch/dklekots/denys-klekots-summer-student-project/-/tree/master/FSLExamplePrimaryGeneratorPlugin

Edited by Denys Klekots

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Denys Klekots requested review from @dellacqu

    requested review from @dellacqu

  • assigned to @mbandier

  • Denys Klekots changed the description

    changed the description

  • Author Developer

    Dear @mbandier,

    The code was put under the test, and the result for worker 16 threads and for 1 worker thread is perfectly the same.

    The condition of testing

    • Geometry file (lead cube but with unusual low density) LeadCube.db LeadCube.gdml

    • The plugin to formate an output analysis file can be found at the link

    • The plugin for the User's primary generator action can be found at the link

    • The file with particle properties (should be in the directory in which you run fullSimLight) ParticleGunInputData.txt. The file contains 128 entries, so please don't make more than 128 events.

    Drawing of events

    The result of the simulations has been analysed, and the tracks at 118'th event have been displayed (the pictures are exactly the same) viewer1viewer16

    The root script to visualise the event is DrawTraclsInOGL.C (please note at the input .root file, which is output from the simulation at 70'th lines of code, and the .gdml geometry input file at 174'th line of code)

    Output histograms

    The result of deposited energy depends on track length and the X coordinate is also analysed. The result is the same for both simulations. unnamed1.pdfunnamed16.pdf

    Here is a ROOT script for analysing BuildPlots_eDep_vs_trkLen.cpp (please note at 27 and 14 lines of code, there needed to specify the .root input file, which is an output from the simulation)

    Detail of multithreading condition

    For testing, the number of threads has been specified in the FSL window. (The GeoModel has been built with an activated G4MULTITHREADED flag)

    @mbandier please let me know if the condition of testing is sufficient, and does I need to test it with unactivated G4MULTITHREADED during the GeoModel building.

    Geant4 version

    For the testing, the GeoModel build with Geant4-11 has been used

    Edited by Denys Klekots
  • Author Developer

    Please note. All of the functionalities of this branch have been implemented in the "Atlas extensions" and added to the master with a merge request !154.

  • closed

Please register or sign in to reply
Loading