[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 | |
---|
| 77 | SetVerboseLevel(2); |
---|
| 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 |
---|
| 89 | hadPhysicsList = new exrdmPhysListHadron("hadron"); |
---|
| 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(); |
---|
| 133 | } |
---|
| 134 | |
---|
| 135 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 136 | |
---|
| 137 | void exrdmPhysicsList::SelectPhysicsList(const G4String& name) |
---|
| 138 | { |
---|
| 139 | if (verboseLevel>1) { |
---|
| 140 | G4cout << "exrdmPhysicsList::SelectPhysicsList: <" << name << ">" << G4endl; |
---|
| 141 | } |
---|
| 142 | // default Had physics |
---|
| 143 | if (name == "Hadron" && nhadcomp == 0) { |
---|
| 144 | if (hadPhysicsList) delete hadPhysicsList; |
---|
| 145 | hadPhysicsList = new exrdmPhysListHadron("hadron"); |
---|
| 146 | } else if (name == "QGSP_BERT") { |
---|
| 147 | AddExtraBuilders(false); |
---|
| 148 | hadPhysicsList = new HadronPhysicsQGSP_BERT("std-hadron"); |
---|
| 149 | } else if (name == "QGSP_BIC" && nhadcomp == 0) { |
---|
| 150 | AddExtraBuilders(false); |
---|
| 151 | hadPhysicsList = new HadronPhysicsQGSP_BIC("std-hadron"); |
---|
| 152 | } else if (name == "QGSP_BERT_HP" && nhadcomp == 0) { |
---|
| 153 | AddExtraBuilders(true); |
---|
| 154 | hadPhysicsList = new HadronPhysicsQGSP_BERT_HP("std-hadron"); |
---|
| 155 | } else if (name == "QGSP_BIC_HP" && nhadcomp == 0) { |
---|
| 156 | AddExtraBuilders(true); |
---|
| 157 | hadPhysicsList = new HadronPhysicsQGSP_BIC_HP("std-hadron"); |
---|
| 158 | } else if (name == "LowEnergy_EM") { |
---|
| 159 | if (!hadPhysicsList ||(hadPhysicsList->GetPhysicsName()=="hadron") ) { |
---|
| 160 | if (emPhysicsList) delete emPhysicsList; |
---|
| 161 | emPhysicsList = new exrdmPhysListEmLowEnergy("lowe-em"); |
---|
| 162 | } else { |
---|
| 163 | G4cout << "exrdmPhysicsList: using EM comes with Std-hadron" <<G4endl; |
---|
| 164 | } |
---|
| 165 | } else if (name == "Standard_EM") { |
---|
| 166 | if (!hadPhysicsList ||(hadPhysicsList->GetPhysicsName()=="hadron") ) { |
---|
| 167 | if (emPhysicsList) delete emPhysicsList; |
---|
| 168 | emPhysicsList = new G4EmStandardPhysics(); |
---|
| 169 | } else { |
---|
| 170 | G4cout << "exrdmPhysicsList: using EM comes with Std-hadron" <<G4endl; |
---|
| 171 | } |
---|
| 172 | } else { |
---|
| 173 | G4cout << "exrdmPhysicsList WARNING wrong or unkonwn <" |
---|
| 174 | << name << "> Physics " << G4endl; |
---|
| 175 | } |
---|
| 176 | } |
---|
| 177 | |
---|
| 178 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 179 | |
---|
| 180 | void exrdmPhysicsList::AddExtraBuilders(G4bool flagHP) |
---|
| 181 | { |
---|
| 182 | if (emPhysicsList) delete emPhysicsList; |
---|
| 183 | emPhysicsList = new G4EmStandardPhysics(); |
---|
| 184 | |
---|
| 185 | if (hadPhysicsList) { |
---|
| 186 | delete hadPhysicsList; |
---|
| 187 | hadPhysicsList = 0; |
---|
| 188 | } |
---|
| 189 | nhadcomp = 6; |
---|
| 190 | |
---|
| 191 | hadronPhys.push_back( new G4EmExtraPhysics("extra EM")); |
---|
| 192 | hadronPhys.push_back( new G4HadronElasticPhysics("elastic",verboseLevel, |
---|
| 193 | flagHP)); |
---|
| 194 | hadronPhys.push_back( new G4QStoppingPhysics("stopping",verboseLevel)); |
---|
| 195 | hadronPhys.push_back( new G4IonBinaryCascadePhysics("ionBIC")); |
---|
| 196 | hadronPhys.push_back( new G4RadioactiveDecayPhysics("radioactiveDecay")); |
---|
| 197 | hadronPhys.push_back( new G4NeutronTrackingCut("Neutron tracking cut")); |
---|
| 198 | } |
---|
| 199 | |
---|
| 200 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 201 | |
---|
| 202 | void exrdmPhysicsList::SetCuts() |
---|
| 203 | { |
---|
| 204 | |
---|
| 205 | SetCutValue(cutForGamma, "gamma"); |
---|
| 206 | SetCutValue(cutForElectron, "e-"); |
---|
| 207 | SetCutValue(cutForPositron, "e+"); |
---|
| 208 | G4cout << "world cuts are set" << G4endl; |
---|
| 209 | |
---|
| 210 | if( !TargetCuts ) SetTargetCut(cutForElectron); |
---|
| 211 | G4Region* region = (G4RegionStore::GetInstance())->GetRegion("Target"); |
---|
| 212 | region->SetProductionCuts(TargetCuts); |
---|
| 213 | G4cout << "Target cuts are set" << G4endl; |
---|
| 214 | |
---|
| 215 | if( !DetectorCuts ) SetDetectorCut(cutForElectron); |
---|
| 216 | region = (G4RegionStore::GetInstance())->GetRegion("Detector"); |
---|
| 217 | region->SetProductionCuts(DetectorCuts); |
---|
| 218 | G4cout << "Detector cuts are set" << G4endl; |
---|
| 219 | |
---|
| 220 | if (verboseLevel>0) DumpCutValuesTable(); |
---|
| 221 | } |
---|
| 222 | |
---|
| 223 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 224 | |
---|
| 225 | void exrdmPhysicsList::SetCutForGamma(G4double cut) |
---|
| 226 | { |
---|
| 227 | cutForGamma = cut; |
---|
| 228 | } |
---|
| 229 | |
---|
| 230 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 231 | |
---|
| 232 | void exrdmPhysicsList::SetCutForElectron(G4double cut) |
---|
| 233 | { |
---|
| 234 | cutForElectron = cut; |
---|
| 235 | } |
---|
| 236 | |
---|
| 237 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 238 | |
---|
| 239 | void exrdmPhysicsList::SetCutForPositron(G4double cut) |
---|
| 240 | { |
---|
| 241 | cutForPositron = cut; |
---|
| 242 | } |
---|
| 243 | |
---|
| 244 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 245 | |
---|
| 246 | void exrdmPhysicsList::SetTargetCut(G4double cut) |
---|
| 247 | { |
---|
| 248 | if( !TargetCuts ) TargetCuts = new G4ProductionCuts(); |
---|
| 249 | |
---|
| 250 | TargetCuts->SetProductionCut(cut, idxG4GammaCut); |
---|
| 251 | TargetCuts->SetProductionCut(cut, idxG4ElectronCut); |
---|
| 252 | TargetCuts->SetProductionCut(cut, idxG4PositronCut); |
---|
| 253 | |
---|
| 254 | } |
---|
| 255 | |
---|
| 256 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 257 | |
---|
| 258 | void exrdmPhysicsList::SetDetectorCut(G4double cut) |
---|
| 259 | { |
---|
| 260 | if( !DetectorCuts ) DetectorCuts = new G4ProductionCuts(); |
---|
| 261 | |
---|
| 262 | DetectorCuts->SetProductionCut(cut, idxG4GammaCut); |
---|
| 263 | DetectorCuts->SetProductionCut(cut, idxG4ElectronCut); |
---|
| 264 | DetectorCuts->SetProductionCut(cut, idxG4PositronCut); |
---|
| 265 | } |
---|
| 266 | |
---|
| 267 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|