[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 | // |
---|
[1337] | 26 | // $Id: PhysicsList.cc,v 1.19 2010/01/19 17:28:20 maire Exp $ |
---|
| 27 | // GEANT4 tag $Name: geant4-09-04-beta-01 $ |
---|
[807] | 28 | // |
---|
| 29 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 30 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 31 | |
---|
| 32 | #include "PhysicsList.hh" |
---|
| 33 | #include "PhysicsListMessenger.hh" |
---|
| 34 | |
---|
[1230] | 35 | #include "PhysListEmStandard_option0.hh" |
---|
[1337] | 36 | #include "PhysListEmStandard_option2.hh" |
---|
[1230] | 37 | #include "PhysListEmStandard_option3.hh" |
---|
| 38 | #include "PhysListEmStandard_GS.hh" |
---|
[1337] | 39 | #include "PhysListEmStandard_WVI.hh" |
---|
[1230] | 40 | #include "PhysListEmStandard_SS.hh" |
---|
| 41 | |
---|
| 42 | #include "StepMax.hh" |
---|
| 43 | |
---|
[807] | 44 | #include "G4ParticleDefinition.hh" |
---|
| 45 | |
---|
| 46 | #include "G4ProcessManager.hh" |
---|
| 47 | #include "G4LossTableManager.hh" |
---|
| 48 | |
---|
[1230] | 49 | // Bosons |
---|
| 50 | #include "G4ChargedGeantino.hh" |
---|
| 51 | #include "G4Geantino.hh" |
---|
| 52 | #include "G4Gamma.hh" |
---|
| 53 | |
---|
| 54 | // leptons |
---|
| 55 | #include "G4Electron.hh" |
---|
| 56 | #include "G4Positron.hh" |
---|
| 57 | |
---|
| 58 | // Hadrons |
---|
| 59 | #include "G4Proton.hh" |
---|
| 60 | |
---|
| 61 | |
---|
[807] | 62 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 63 | |
---|
| 64 | PhysicsList::PhysicsList(DetectorConstruction* det) |
---|
[1230] | 65 | : G4VModularPhysicsList(), detector(det) |
---|
[807] | 66 | { |
---|
[1230] | 67 | G4LossTableManager::Instance(); |
---|
| 68 | pMessenger = new PhysicsListMessenger(this); |
---|
| 69 | |
---|
| 70 | // EM physics |
---|
| 71 | emName = G4String("standard_opt3"); |
---|
| 72 | emPhysicsList = new PhysListEmStandard_option3(emName,detector); |
---|
| 73 | |
---|
| 74 | defaultCutValue = 10*km; |
---|
| 75 | |
---|
| 76 | SetVerboseLevel(1); |
---|
[807] | 77 | |
---|
[1230] | 78 | G4LossTableManager::Instance(); |
---|
[807] | 79 | } |
---|
| 80 | |
---|
| 81 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 82 | |
---|
| 83 | PhysicsList::~PhysicsList() |
---|
[1230] | 84 | { |
---|
| 85 | delete emPhysicsList; |
---|
| 86 | delete pMessenger; |
---|
| 87 | } |
---|
[807] | 88 | |
---|
| 89 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 90 | |
---|
| 91 | void PhysicsList::ConstructParticle() |
---|
| 92 | { |
---|
[1230] | 93 | // pseudo-particles |
---|
[807] | 94 | G4Geantino::GeantinoDefinition(); |
---|
[1230] | 95 | G4ChargedGeantino::ChargedGeantinoDefinition(); |
---|
| 96 | |
---|
| 97 | // gamma |
---|
[807] | 98 | G4Gamma::GammaDefinition(); |
---|
[1230] | 99 | |
---|
| 100 | // leptons |
---|
[807] | 101 | G4Electron::ElectronDefinition(); |
---|
| 102 | G4Positron::PositronDefinition(); |
---|
| 103 | |
---|
[1230] | 104 | // baryons |
---|
| 105 | G4Proton::ProtonDefinition(); |
---|
[807] | 106 | } |
---|
| 107 | |
---|
| 108 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 109 | |
---|
| 110 | void PhysicsList::ConstructProcess() |
---|
| 111 | { |
---|
| 112 | AddTransportation(); |
---|
[1230] | 113 | emPhysicsList->ConstructProcess(); |
---|
| 114 | |
---|
[807] | 115 | AddStepMax(); |
---|
| 116 | } |
---|
| 117 | |
---|
| 118 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 119 | |
---|
| 120 | void PhysicsList::AddStepMax() |
---|
| 121 | { |
---|
| 122 | // Step limitation seen as a process |
---|
| 123 | StepMax* stepMaxProcess = new StepMax(); |
---|
| 124 | |
---|
| 125 | theParticleIterator->reset(); |
---|
| 126 | while ((*theParticleIterator)()){ |
---|
| 127 | G4ParticleDefinition* particle = theParticleIterator->value(); |
---|
| 128 | G4ProcessManager* pmanager = particle->GetProcessManager(); |
---|
| 129 | |
---|
[1230] | 130 | if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived()) |
---|
[807] | 131 | { |
---|
| 132 | pmanager ->AddDiscreteProcess(stepMaxProcess); |
---|
| 133 | } |
---|
| 134 | } |
---|
| 135 | } |
---|
| 136 | |
---|
| 137 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 138 | |
---|
[1230] | 139 | void PhysicsList::AddPhysicsList(const G4String& name) |
---|
| 140 | { |
---|
| 141 | if (verboseLevel>-1) { |
---|
| 142 | G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl; |
---|
| 143 | } |
---|
| 144 | |
---|
| 145 | if (name == emName) return; |
---|
| 146 | |
---|
| 147 | if (name == "standard_opt0") { |
---|
| 148 | |
---|
| 149 | emName = name; |
---|
| 150 | delete emPhysicsList; |
---|
| 151 | emPhysicsList = new PhysListEmStandard_option0(name,detector); |
---|
| 152 | |
---|
[1337] | 153 | } else if (name == "standard_opt2") { |
---|
| 154 | |
---|
| 155 | emName = name; |
---|
| 156 | delete emPhysicsList; |
---|
| 157 | emPhysicsList = new PhysListEmStandard_option2(name,detector); |
---|
| 158 | |
---|
[1230] | 159 | } else if (name == "standard_opt3") { |
---|
| 160 | |
---|
| 161 | emName = name; |
---|
| 162 | delete emPhysicsList; |
---|
| 163 | emPhysicsList = new PhysListEmStandard_option3(name,detector); |
---|
| 164 | |
---|
| 165 | } else if (name == "standard_GS") { |
---|
| 166 | |
---|
| 167 | emName = name; |
---|
| 168 | delete emPhysicsList; |
---|
| 169 | emPhysicsList = new PhysListEmStandard_GS(name,detector); |
---|
| 170 | |
---|
[1337] | 171 | } else if (name == "standard_WVI") { |
---|
| 172 | |
---|
| 173 | emName = name; |
---|
| 174 | delete emPhysicsList; |
---|
| 175 | emPhysicsList = new PhysListEmStandard_WVI(name,detector); |
---|
| 176 | |
---|
[1230] | 177 | } else if (name == "standard_SS") { |
---|
| 178 | |
---|
| 179 | emName = name; |
---|
| 180 | delete emPhysicsList; |
---|
| 181 | emPhysicsList = new PhysListEmStandard_SS(name,detector); |
---|
| 182 | } else { |
---|
| 183 | |
---|
| 184 | G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" |
---|
| 185 | << " is not defined" |
---|
| 186 | << G4endl; |
---|
| 187 | } |
---|
| 188 | } |
---|
| 189 | |
---|
| 190 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 191 | |
---|
[807] | 192 | #include "G4UnitsTable.hh" |
---|
| 193 | |
---|
| 194 | void PhysicsList::SetCuts() |
---|
| 195 | { |
---|
| 196 | if (verboseLevel >0){ |
---|
| 197 | G4cout << "PhysicsList::SetCuts:"; |
---|
| 198 | G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl; |
---|
| 199 | } |
---|
| 200 | |
---|
| 201 | // set cut values for gamma at first and for e- second and next for e+, |
---|
| 202 | // because some processes for e+/e- need cut values for gamma |
---|
| 203 | SetCutValue(defaultCutValue, "gamma"); |
---|
| 204 | SetCutValue(defaultCutValue, "e-"); |
---|
| 205 | SetCutValue(defaultCutValue, "e+"); |
---|
[1230] | 206 | SetCutValue(defaultCutValue, "proton"); |
---|
[807] | 207 | } |
---|
| 208 | |
---|
| 209 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|