Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-05 07:50:02

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file VG01PrimaryGeneratorAction.hh
0027 /// \brief Definition of the VG01PrimaryGeneratorAction class
0028 
0029 //  Generator with multiple modes: uniform, free, axis, fixed)
0030 //
0031 //  Primary generator that can be configured using modes to either:
0032 //    - 'uniform' direction secondaries       (default)
0033 //    - 'free'    which is configured by UI - initialised in con/tor
0034 //    - 'axis'    directing secondaries by rotation to x, y & z axis
0035 //    - 'fixed'   along x axis, and near it ( y = 0.1 or z = 0.1)
0036 //
0037 //  Authors: J. Apostolakis & S. Wenzel (CERN)  2018-2021
0038 //
0039 //  Started from FullCMS code by Mihaly Novak (CERN) 2017
0040 
0041 #ifndef _G01PRIMARYGENERATORACTION_H_
0042 #define _G01PRIMARYGENERATORACTION_H_
0043 
0044 #include "G4VUserPrimaryGeneratorAction.hh"
0045 #include "globals.hh"
0046 
0047 class G4Event;
0048 class G4ParticleGun;
0049 
0050 /// Configurable primary generator action to demonstrate use of
0051 ///   VecGeom Navigation
0052 
0053 class VG01PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
0054 {
0055   public:
0056     enum EGeneratorMode
0057     {
0058       kFixedMode,
0059       kUniformMode,
0060       kAxisMode,
0061       kFreeMode
0062     };
0063     //                     x Axis       random dir    x, y, z     UI directed
0064 
0065     VG01PrimaryGeneratorAction(EGeneratorMode mode = kUniformMode);
0066     ~VG01PrimaryGeneratorAction();
0067 
0068     void GeneratePrimaries(G4Event* anEvent) override;
0069 
0070     void SetGeneratorMode(EGeneratorMode val) { fMode = val; }
0071     EGeneratorMode GetGeneratorMode() { return fMode; }
0072 
0073   private:
0074     G4ParticleGun* fParticleGun;
0075     EGeneratorMode fMode;
0076 };
0077 
0078 #endif