|
||||
File indexing completed on 2025-01-31 09:22:21
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 #ifndef PRIMARYGENERATORMMESSENGER_HH 0027 #define PRIMARYGENERATORMMESSENGER_HH 0028 0029 #include "G4UImessenger.hh" 0030 0031 class G4UIdirectory; 0032 class G4UIcmdWithABool; 0033 class G4UIcmdWithAnInteger; 0034 class G4UIcmdWithAString; 0035 class G4UIcmdWithADouble; 0036 class G4UIcmdWithADoubleAndUnit; 0037 class PrimaryGeneratorAction; 0038 0039 /** 0040 * @brief Primary generator messenger 0041 * 0042 * Defines UI commands to set up the primary generator. 0043 * 0044 * By default particle gun is used as the primary generator. It can be 0045 * controlled with standard UI commands (/gun/). 0046 * 0047 * "/HGCalTestbeam/generator/momentumSpread <VALUE>" to change constant 0048 * particle energy to Gaussian distribution with sigma expressed in units of the 0049 * initial energy (e.g. value 0.05 means sigma of 0.05 * E). 0050 * By default it equals to 0 and constant energy value is used. 0051 * "/HGCalTestbeam/generator/beamSpread <none/Gaussian/flat>" to define type of 0052 * beam position spread. By default none is used. 0053 * "/HGCalTestbeam/generator/beamSpreadX <SIZE>" to define size of beam spread 0054 * along x axis. It is sigma of a Gaussian distribution, or half-width of a 0055 * flat distribution. 0056 * "/HGCalTestbeam/generator/beamSpreadY <SIZE>" to define size of beam spread 0057 * along y axis. It is sigma of a Gaussian distribution, or half-width of a 0058 * flat distribution. 0059 * "/HGCalTestbeam/generator/beamZ0 <POSITION>" to define beam position along z 0060 * axis. By default edge of the world volume is used. 0061 * 0062 * If installation was done with ROOT package (CMake was able to locate it), 0063 * an additional option of input read from the ROOT file is enabled. 0064 * It can be activated with "/HGCalTestbeam/generator/readInputFile true". 0065 * "/HGCalTestbeam/generator/pathInputFile <FILE>" sets the path to the input 0066 * file. 0067 * "/HGCalTestbeam/generator/startFromEvent <N>" allows to start simulation from 0068 * Nth event. 0069 * Please note that in current implementation input from file needs to be 0070 * executed in a non-multithreaded mode (or with 1 thread). 0071 * 0072 */ 0073 0074 class PrimaryGeneratorMessenger : public G4UImessenger { 0075 public: 0076 explicit PrimaryGeneratorMessenger(PrimaryGeneratorAction *aPrimaryGeneratorAction); 0077 ~PrimaryGeneratorMessenger(); 0078 0079 public: 0080 void SetNewValue(G4UIcommand *command, G4String newValues); 0081 G4String GetCurrentValue(G4UIcommand *command); 0082 0083 private: 0084 /// Pointer to the primmary generator 0085 PrimaryGeneratorAction *fPrimaryGenerator; 0086 0087 private: 0088 /// Directory for UI commands 0089 G4UIdirectory *fDirectory; 0090 #ifdef WITHROOT 0091 /// Command specyfing if primary event should be read from file 0092 G4UIcmdWithABool *fReadInputCmd; 0093 /// Command to set the path to the input file 0094 G4UIcmdWithAString *fPathInputCmd; 0095 /// Command to set ID of the first event to be read from the file 0096 G4UIcmdWithAnInteger *fStartFromEventCmd; 0097 #endif 0098 /// Command to set the sigma of the Gaussian momentum spread 0099 G4UIcmdWithADouble *fMomentumSpreadCmd; 0100 /// Command to set the type of transverse beam position spread 0101 G4UIcmdWithAString *fBeamSpreadTypeCmd; 0102 /// Command to set the size of beam position spread along X axis 0103 G4UIcmdWithADoubleAndUnit *fBeamSpreadXCmd; 0104 /// Command to set the size of beam position spread along Y axis 0105 G4UIcmdWithADoubleAndUnit *fBeamSpreadYCmd; 0106 /// Command to set the initial beam position size along Z axis 0107 G4UIcmdWithADoubleAndUnit *fBeamZ0Cmd; 0108 }; 0109 0110 #endif /*PRIMARYGENERATORMMESSENGER_HH */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |