![]() |
|
|||
File indexing completed on 2025-02-23 09:19:38
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 /////////////////////////////////////////////////////////////////////////////// 0027 // File: CCalPrimaryGeneratorAction.hh 0028 // Description: Sets up particle beam 0029 // 0030 // By default 1 pi+ is shot from (0,0,0) 0031 // in (1,1,0.1) direction at 100 GeV 0032 // Use /gun/... commands to modify energy,origin,direction at run time. 0033 // or/and 0034 // /CCal/generator/random true/false to have random direction 0035 // /CCal/generator/scan true/false to scan in eta/phi 0036 // Use 0037 // /CCal/generator/minEnergy 0038 // /CCal/generator/maxEnergy 0039 // /CCal/generator/minPhi 0040 // /CCal/generator/maxPhi 0041 // /CCal/generator/minEta 0042 // /CCal/generator/maxEta 0043 // to set the range in energy and direction of particles shot at random. 0044 // Use 0045 // /CCal/generator/stepsPhi 0046 // /CCal/generator/stepsEta 0047 // to set number of steps in Phi and Eta for the scan 0048 // 0049 /////////////////////////////////////////////////////////////////////////////// 0050 0051 #ifndef CCalPrimaryGeneratorAction_h 0052 #define CCalPrimaryGeneratorAction_h 1 0053 0054 #include "G4VUserPrimaryGeneratorAction.hh" 0055 #include "G4ParticleGun.hh" 0056 #include "G4ThreeVector.hh" 0057 #include "G4ios.hh" 0058 #include "G4Event.hh" 0059 #include "G4VPrimaryGenerator.hh" 0060 0061 #include "CCalPrimaryGeneratorMessenger.hh" 0062 0063 enum generatorInputType {singleFixed, singleRandom, singleScan}; 0064 0065 class CCalPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction { 0066 public: 0067 CCalPrimaryGeneratorAction(); 0068 ~CCalPrimaryGeneratorAction(); 0069 0070 public: 0071 void GeneratePrimaries(G4Event* anEvent); 0072 0073 public: 0074 void SetVerboseLevel(G4int val); 0075 void SetRandom(G4String val); 0076 void SetScan(G4String val); 0077 void SetMinimumEnergy(G4double p); 0078 void SetMaximumEnergy(G4double p); 0079 void SetMinimumPhi(G4double p); 0080 void SetMaximumPhi(G4double p); 0081 void SetStepsPhi(G4int val); 0082 void SetMinimumEta(G4double p); 0083 void SetMaximumEta(G4double p); 0084 void SetStepsEta(G4int val); 0085 void SetGunPosition(const G4ThreeVector & pos) const; 0086 void SetRunNo(G4int val); 0087 0088 public: 0089 G4ThreeVector GetParticlePosition() {return particleGun->GetParticlePosition();} 0090 G4double GetParticleEnergy() {return particleGun->GetParticleEnergy();} 0091 0092 private: 0093 CCalPrimaryGeneratorMessenger* gunMessenger; 0094 G4ParticleGun* particleGun; 0095 generatorInputType generatorInput; 0096 0097 G4int verboseLevel; 0098 G4int n_particle; 0099 G4String particleName; 0100 G4double particleEnergy; 0101 G4ThreeVector particlePosition; 0102 G4ThreeVector particleDir; 0103 0104 G4double energyMin,energyMax; 0105 G4double etaMin,etaMax; 0106 G4double phiMin,phiMax; 0107 G4int etaSteps,phiSteps; 0108 0109 G4int isInitialized; 0110 G4double etaValue, phiValue; 0111 G4int scanSteps; 0112 0113 private: 0114 void initialize(); 0115 void print(G4int val); 0116 0117 }; 0118 0119 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |