[807] | 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 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 27 | |
---|
| 28 | #include "exrdmPhysicsList.hh" |
---|
| 29 | #include "exrdmPhysicsListMessenger.hh" |
---|
| 30 | |
---|
| 31 | #include "exrdmPhysListParticles.hh" |
---|
| 32 | #include "G4EmStandardPhysics.hh" |
---|
| 33 | #include "exrdmPhysListEmLowEnergy.hh" |
---|
| 34 | #include "exrdmPhysListHadron.hh" |
---|
| 35 | #include "G4RegionStore.hh" |
---|
| 36 | #include "G4Region.hh" |
---|
| 37 | #include "G4ProductionCuts.hh" |
---|
| 38 | #include "G4ProcessManager.hh" |
---|
| 39 | #include "G4ParticleTypes.hh" |
---|
| 40 | #include "G4ParticleTable.hh" |
---|
| 41 | |
---|
| 42 | #include "G4Gamma.hh" |
---|
| 43 | #include "G4Electron.hh" |
---|
| 44 | #include "G4Positron.hh" |
---|
| 45 | |
---|
| 46 | #include "G4UnitsTable.hh" |
---|
| 47 | #include "G4LossTableManager.hh" |
---|
| 48 | |
---|
| 49 | #include "HadronPhysicsQGSP_BERT.hh" |
---|
| 50 | #include "HadronPhysicsQGSP_BIC.hh" |
---|
| 51 | #include "HadronPhysicsQGSP_BERT_HP.hh" |
---|
| 52 | #include "HadronPhysicsQGSP_BIC_HP.hh" |
---|
| 53 | |
---|
| 54 | #include "G4EmExtraPhysics.hh" |
---|
| 55 | #include "G4HadronElasticPhysics.hh" |
---|
| 56 | #include "G4QStoppingPhysics.hh" |
---|
| 57 | #include "G4IonBinaryCascadePhysics.hh" |
---|
| 58 | #include "G4RadioactiveDecayPhysics.hh" |
---|
| 59 | #include "G4NeutronTrackingCut.hh" |
---|
| 60 | #include "G4DecayPhysics.hh" |
---|
| 61 | |
---|
| 62 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 63 | |
---|
| 64 | exrdmPhysicsList::exrdmPhysicsList() : G4VModularPhysicsList() |
---|
| 65 | { |
---|
| 66 | G4LossTableManager::Instance(); |
---|
| 67 | defaultCutValue = 1.*mm; |
---|
| 68 | cutForGamma = defaultCutValue; |
---|
| 69 | cutForElectron = defaultCutValue; |
---|
| 70 | cutForPositron = defaultCutValue; |
---|
| 71 | |
---|
| 72 | DetectorCuts = 0; |
---|
| 73 | TargetCuts = 0; |
---|
| 74 | |
---|
| 75 | pMessenger = new exrdmPhysicsListMessenger(this); |
---|
| 76 | |
---|
[1230] | 77 | SetVerboseLevel(1); |
---|
[807] | 78 | |
---|
| 79 | //default physics |
---|
| 80 | particleList = new G4DecayPhysics(); |
---|
| 81 | |
---|
| 82 | //default physics |
---|
| 83 | raddecayList = new G4RadioactiveDecayPhysics(); |
---|
| 84 | |
---|
| 85 | // EM physics |
---|
| 86 | emPhysicsList = new G4EmStandardPhysics(); |
---|
| 87 | |
---|
| 88 | // Had physics |
---|
[1230] | 89 | hadPhysicsList = 0; |
---|
[807] | 90 | nhadcomp = 0; |
---|
| 91 | |
---|
| 92 | } |
---|
| 93 | |
---|
| 94 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 95 | |
---|
| 96 | exrdmPhysicsList::~exrdmPhysicsList() |
---|
| 97 | { |
---|
| 98 | delete pMessenger; |
---|
| 99 | delete raddecayList; |
---|
| 100 | delete emPhysicsList; |
---|
| 101 | if (hadPhysicsList) delete hadPhysicsList; |
---|
| 102 | if (nhadcomp > 0) { |
---|
| 103 | for(G4int i=0; i<nhadcomp; i++) { |
---|
| 104 | delete hadronPhys[i]; |
---|
| 105 | } |
---|
| 106 | } |
---|
| 107 | } |
---|
| 108 | |
---|
| 109 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 110 | |
---|
| 111 | void exrdmPhysicsList::ConstructParticle() |
---|
| 112 | { |
---|
| 113 | particleList->ConstructParticle(); |
---|
| 114 | } |
---|
| 115 | |
---|
| 116 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 117 | |
---|
| 118 | void exrdmPhysicsList::ConstructProcess() |
---|
| 119 | { |
---|
| 120 | AddTransportation(); |
---|
| 121 | // em |
---|
| 122 | emPhysicsList->ConstructProcess(); |
---|
| 123 | // decays |
---|
| 124 | particleList->ConstructProcess(); |
---|
| 125 | raddecayList->ConstructProcess(); |
---|
| 126 | // had |
---|
| 127 | if (nhadcomp > 0) { |
---|
| 128 | for(G4int i=0; i<nhadcomp; i++) { |
---|
| 129 | (hadronPhys[i])->ConstructProcess(); |
---|
| 130 | } |
---|
| 131 | } |
---|
| 132 | if (hadPhysicsList) hadPhysicsList->ConstructProcess(); |
---|
[1230] | 133 | G4cout << "### exrdmPhysicsList::ConstructProcess is done" << G4endl; |
---|
| 134 | |
---|
[807] | 135 | } |
---|
| 136 | |
---|
| 137 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 138 | |
---|
| 139 | void exrdmPhysicsList::SelectPhysicsList(const G4String& name) |
---|
| 140 | { |
---|
| 141 | if (verboseLevel>1) { |
---|
| 142 | G4cout << "exrdmPhysicsList::SelectPhysicsList: <" << name << ">" << G4endl; |
---|
| 143 | } |
---|
| 144 | // default Had physics |
---|
[1230] | 145 | if (name == "Hadron" && !hadPhysicsList) { |
---|
[807] | 146 | hadPhysicsList = new exrdmPhysListHadron("hadron"); |
---|
| 147 | } else if (name == "QGSP_BERT") { |
---|
| 148 | AddExtraBuilders(false); |
---|
| 149 | hadPhysicsList = new HadronPhysicsQGSP_BERT("std-hadron"); |
---|
[1230] | 150 | } else if (name == "QGSP_BIC" && !hadPhysicsList) { |
---|
[807] | 151 | AddExtraBuilders(false); |
---|
| 152 | hadPhysicsList = new HadronPhysicsQGSP_BIC("std-hadron"); |
---|
[1230] | 153 | } else if (name == "QGSP_BERT_HP" && !hadPhysicsList) { |
---|
[807] | 154 | AddExtraBuilders(true); |
---|
| 155 | hadPhysicsList = new HadronPhysicsQGSP_BERT_HP("std-hadron"); |
---|
[1230] | 156 | } else if (name == "QGSP_BIC_HP" && !hadPhysicsList) { |
---|
[807] | 157 | AddExtraBuilders(true); |
---|
| 158 | hadPhysicsList = new HadronPhysicsQGSP_BIC_HP("std-hadron"); |
---|
| 159 | } else if (name == "LowEnergy_EM") { |
---|
[1230] | 160 | delete emPhysicsList; |
---|
[807] | 161 | emPhysicsList = new exrdmPhysListEmLowEnergy("lowe-em"); |
---|
| 162 | } else if (name == "Standard_EM") { |
---|
[1230] | 163 | delete emPhysicsList; |
---|
[807] | 164 | emPhysicsList = new G4EmStandardPhysics(); |
---|
| 165 | } else { |
---|
| 166 | G4cout << "exrdmPhysicsList WARNING wrong or unkonwn <" |
---|
| 167 | << name << "> Physics " << G4endl; |
---|
| 168 | } |
---|
| 169 | } |
---|
| 170 | |
---|
| 171 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 172 | |
---|
| 173 | void exrdmPhysicsList::AddExtraBuilders(G4bool flagHP) |
---|
| 174 | { |
---|
[1230] | 175 | nhadcomp = 5; |
---|
[807] | 176 | hadronPhys.push_back( new G4EmExtraPhysics("extra EM")); |
---|
| 177 | hadronPhys.push_back( new G4HadronElasticPhysics("elastic",verboseLevel, |
---|
| 178 | flagHP)); |
---|
| 179 | hadronPhys.push_back( new G4QStoppingPhysics("stopping",verboseLevel)); |
---|
| 180 | hadronPhys.push_back( new G4IonBinaryCascadePhysics("ionBIC")); |
---|
| 181 | hadronPhys.push_back( new G4NeutronTrackingCut("Neutron tracking cut")); |
---|
| 182 | } |
---|
| 183 | |
---|
| 184 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 185 | |
---|
| 186 | void exrdmPhysicsList::SetCuts() |
---|
| 187 | { |
---|
| 188 | SetCutValue(cutForGamma, "gamma"); |
---|
| 189 | SetCutValue(cutForElectron, "e-"); |
---|
| 190 | SetCutValue(cutForPositron, "e+"); |
---|
| 191 | G4cout << "world cuts are set" << G4endl; |
---|
| 192 | |
---|
| 193 | if( !TargetCuts ) SetTargetCut(cutForElectron); |
---|
| 194 | G4Region* region = (G4RegionStore::GetInstance())->GetRegion("Target"); |
---|
| 195 | region->SetProductionCuts(TargetCuts); |
---|
| 196 | G4cout << "Target cuts are set" << G4endl; |
---|
| 197 | |
---|
| 198 | if( !DetectorCuts ) SetDetectorCut(cutForElectron); |
---|
| 199 | region = (G4RegionStore::GetInstance())->GetRegion("Detector"); |
---|
| 200 | region->SetProductionCuts(DetectorCuts); |
---|
| 201 | G4cout << "Detector cuts are set" << G4endl; |
---|
| 202 | |
---|
| 203 | if (verboseLevel>0) DumpCutValuesTable(); |
---|
| 204 | } |
---|
| 205 | |
---|
| 206 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 207 | |
---|
| 208 | void exrdmPhysicsList::SetCutForGamma(G4double cut) |
---|
| 209 | { |
---|
| 210 | cutForGamma = cut; |
---|
[1230] | 211 | SetParticleCuts(cutForGamma, G4Gamma::Gamma()); |
---|
[807] | 212 | } |
---|
| 213 | |
---|
| 214 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 215 | |
---|
| 216 | void exrdmPhysicsList::SetCutForElectron(G4double cut) |
---|
| 217 | { |
---|
| 218 | cutForElectron = cut; |
---|
[1230] | 219 | SetParticleCuts(cutForElectron, G4Electron::Electron()); |
---|
[807] | 220 | } |
---|
| 221 | |
---|
| 222 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 223 | |
---|
| 224 | void exrdmPhysicsList::SetCutForPositron(G4double cut) |
---|
| 225 | { |
---|
| 226 | cutForPositron = cut; |
---|
[1230] | 227 | SetParticleCuts(cutForPositron, G4Positron::Positron()); |
---|
[807] | 228 | } |
---|
| 229 | |
---|
| 230 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 231 | |
---|
| 232 | void exrdmPhysicsList::SetTargetCut(G4double cut) |
---|
| 233 | { |
---|
| 234 | if( !TargetCuts ) TargetCuts = new G4ProductionCuts(); |
---|
| 235 | |
---|
| 236 | TargetCuts->SetProductionCut(cut, idxG4GammaCut); |
---|
| 237 | TargetCuts->SetProductionCut(cut, idxG4ElectronCut); |
---|
| 238 | TargetCuts->SetProductionCut(cut, idxG4PositronCut); |
---|
| 239 | |
---|
| 240 | } |
---|
| 241 | |
---|
| 242 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 243 | |
---|
| 244 | void exrdmPhysicsList::SetDetectorCut(G4double cut) |
---|
| 245 | { |
---|
| 246 | if( !DetectorCuts ) DetectorCuts = new G4ProductionCuts(); |
---|
| 247 | |
---|
| 248 | DetectorCuts->SetProductionCut(cut, idxG4GammaCut); |
---|
| 249 | DetectorCuts->SetProductionCut(cut, idxG4ElectronCut); |
---|
| 250 | DetectorCuts->SetProductionCut(cut, idxG4PositronCut); |
---|
| 251 | } |
---|
| 252 | |
---|
| 253 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|