Geant4 Cross Reference |
1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // Gorad (Geant4 Open-source Radiation Analysis and Design) 27 // 28 // Author : Makoto Asai (SLAC National Accelerator Laboratory) 29 // 30 // Development of Gorad is funded by NASA Johnson Space Center (JSC) 31 // under the contract NNJ15HK11B. 32 // 33 // ******************************************************************** 34 // 35 // GRPhysicsList.hh 36 // Header file of the Gorad Physics List 37 // 38 // History 39 // September 8th, 2020 : first implementation 40 // 41 // ******************************************************************** 42 43 #ifndef GRPhysicsList_H 44 #define GRPhysicsList_H 1 45 46 #include "G4VModularPhysicsList.hh" 47 class G4PhysListFactory; 48 class GRPhysicsListMessenger; 49 class G4Region; 50 class G4ProductionCuts; 51 52 #include <map> 53 54 class GRPhysicsList : public G4VModularPhysicsList 55 { 56 public: 57 GRPhysicsList(); 58 virtual ~GRPhysicsList(); 59 virtual void ConstructParticle(); 60 virtual void ConstructProcess(); 61 virtual void SetCuts(); 62 63 private: 64 G4String PLName; 65 G4VModularPhysicsList* physList; 66 G4PhysListFactory* factory; 67 GRPhysicsListMessenger* messenger; 68 69 public: 70 const G4String& GetPLName() 71 { return PLName; } 72 73 private: 74 G4String EM_opt; // EM physics option 75 G4String Had_opt; // Hadronic physics option 76 G4bool addHP; // add Neutron_HP 77 G4bool addRDM; // add Radioactive Decay Module 78 G4bool addRMC; // add Reverse Monte Calro 79 G4bool addOptical; // add optical physics 80 G4int stepLimit_opt; // Step limiter option (0:charged, 1:neutral, 2:all, 3:e+/e-) 81 std::map<G4Region*,G4double> localStepLimits; // map of region name and limit value 82 G4double globalCuts[4]; // for e-, e+ gamma, proton 83 std::map<G4Region*,G4ProductionCuts*> localCuts; // map of region name and cuts 84 85 public: 86 void SetEM(G4String& val) { EM_opt = val; } 87 const G4String& GetEM() const { return EM_opt; } 88 void SetHad(G4String& val) { Had_opt = val; } 89 const G4String& GetHad() const { return Had_opt; } 90 void AddHP(G4bool val = true) { addHP = val; } 91 G4bool IfHP() const { return addHP; } 92 void AddRDM(G4bool val = true) { addRDM = val; } 93 G4bool IfRDM() const { return addRDM; } 94 void AddRMC(G4bool val = true) { addRMC = val; } 95 G4bool IfRMC() const { return addRMC; } 96 void AddOptical(G4bool val = true) { addOptical = val; } 97 G4bool IfOptical() const { return addOptical; } 98 void AddStepLimit(G4int val = 0) { stepLimit_opt = val; } 99 G4int IfStepLimit() const { return stepLimit_opt; } 100 void SetGlobalStepLimit(G4double); 101 G4double GetGlobalStepLimit() const; 102 G4Region* SetLocalStepLimit(const G4String&,G4double); 103 G4double GetLocalStepLimit(const G4String&) const; 104 void SetGlobalCuts(G4double); 105 G4double GetGlobalCuts() const { return GetGlobalCut(0); } 106 void SetGlobalCut(G4int, G4double); 107 G4double GetGlobalCut(G4int i) const { return globalCuts[i]; } 108 G4Region* SetLocalCuts(const G4String& reg,G4double val) 109 { 110 G4Region* regPtr = nullptr; 111 for(G4int i=0; i<4; i++) 112 { 113 regPtr = SetLocalCut(reg,i,val); 114 if(!regPtr) return regPtr; 115 } 116 return regPtr; 117 } 118 G4double GetLocalCuts(const G4String& reg) const { return GetLocalCut(reg,0); } 119 G4Region* SetLocalCut(const G4String&,G4int,G4double); 120 G4double GetLocalCut(const G4String&,G4int) const; 121 122 private: 123 void GeneratePLName(); 124 void GeneratePL(); 125 G4Region* FindRegion(const G4String&) const; 126 127 private: 128 G4bool applyGeomImpBias = false; 129 130 public: 131 void ApplyGeomImpBias(G4bool val = true) 132 { applyGeomImpBias = val; } 133 }; 134 135 #endif 136 137