Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 /* << 23 // 27 Author: Susanna Guatelli << 24 // Code developed by: 28 */ << 25 // S. Agostinelli, F. Foppiano, S. Garelli , M. Tropeano, S.Guatelli 29 // 26 // 30 // ********************************** 27 // ********************************** 31 // * * 28 // * * 32 // * BrachyPhysicsList.cc * 29 // * BrachyPhysicsList.cc * 33 // * * 30 // * * 34 // ********************************** 31 // ********************************** 35 // 32 // >> 33 // $Id: BrachyPhysicsList.cc,v 1.10 2004/01/08 17:25:13 silvarod Exp $ >> 34 // GEANT4 tag $Name: geant4-07-00-patch-01 $ >> 35 // 36 #include "BrachyPhysicsList.hh" 36 #include "BrachyPhysicsList.hh" 37 #include "BrachyPhysicsListMessenger.hh" << 37 38 #include "G4EmStandardPhysics_option4.hh" << 39 #include "G4EmLivermorePhysics.hh" << 40 #include "G4EmStandardPhysics.hh" << 41 #include "G4EmStandardPhysics_option1.hh" << 42 #include "G4EmStandardPhysics_option2.hh" << 43 #include "G4EmStandardPhysics_option3.hh" << 44 #include "G4EmStandardPhysics_option4.hh" << 45 #include "G4DecayPhysics.hh" << 46 #include "G4RadioactiveDecayPhysics.hh" << 47 #include "G4EmPenelopePhysics.hh" << 48 #include "G4VPhysicsConstructor.hh" << 49 #include "G4ParticleDefinition.hh" 38 #include "G4ParticleDefinition.hh" 50 #include "G4ProductionCutsTable.hh" << 39 #include "G4ParticleWithCuts.hh" 51 #include "G4ProcessManager.hh" 40 #include "G4ProcessManager.hh" 52 #include "G4ParticleTypes.hh" 41 #include "G4ParticleTypes.hh" 53 #include "G4ios.hh" << 42 #include "G4ParticleTable.hh" 54 #include "G4StepLimiter.hh" << 43 #include "G4Material.hh" 55 #include "G4ParticleDefinition.hh" << 44 #include "G4UnitsTable.hh" 56 #include "globals.hh" << 45 #include "G4ios.hh" 57 #include "G4SystemOfUnits.hh" << 46 58 #include "G4UAtomicDeexcitation.hh" << 47 59 #include "G4LossTableManager.hh" << 48 BrachyPhysicsList::BrachyPhysicsList(): G4VUserPhysicsList() 60 << 49 { 61 BrachyPhysicsList::BrachyPhysicsList(): G4VMo << 50 defaultCutValue = 0.1*mm; 62 { << 51 cutForGamma = defaultCutValue; 63 SetVerboseLevel(1); << 52 cutForElectron = defaultCutValue; 64 << 53 cutForPositron = defaultCutValue; 65 G4ProductionCutsTable::GetProductionCutsTable( << 54 66 SetDefaultCutValue(0.05 *mm); << 55 SetVerboseLevel(1); 67 DumpCutValuesTable(); << 68 << 69 // EM physics: default << 70 fEmPhysicsList = new G4EmLivermorePhysics(); << 71 fEmName="emlivermore"; << 72 << 73 // Add Decay << 74 fDecPhysicsList = new G4DecayPhysics(); << 75 fRadDecayPhysicsList = new G4RadioactiveDecayP << 76 fMessenger = new BrachyPhysicsListMessenger(th << 77 } 56 } 78 57 79 BrachyPhysicsList::~BrachyPhysicsList() 58 BrachyPhysicsList::~BrachyPhysicsList() 80 { << 59 { 81 delete fMessenger; << 82 delete fDecPhysicsList; << 83 delete fRadDecayPhysicsList; << 84 delete fEmPhysicsList; << 85 } 60 } 86 61 87 void BrachyPhysicsList::ConstructParticle() 62 void BrachyPhysicsList::ConstructParticle() 88 { 63 { 89 fDecPhysicsList -> ConstructParticle(); << 64 // In this method, static member functions should be called >> 65 // for all particles which you want to use. >> 66 // This ensures that objects of these particle types will be >> 67 // created in the program. >> 68 >> 69 ConstructBosons(); >> 70 ConstructLeptons(); >> 71 } >> 72 >> 73 void BrachyPhysicsList::ConstructBosons() >> 74 { >> 75 // gamma >> 76 G4Gamma::GammaDefinition(); >> 77 >> 78 } >> 79 >> 80 void BrachyPhysicsList::ConstructLeptons() >> 81 { >> 82 // leptons >> 83 G4Electron::ElectronDefinition(); >> 84 G4Positron::PositronDefinition(); 90 } 85 } 91 86 92 void BrachyPhysicsList::ConstructProcess() 87 void BrachyPhysicsList::ConstructProcess() 93 { 88 { 94 AddTransportation(); << 89 AddTransportation(); 95 fEmPhysicsList -> ConstructProcess(); << 90 ConstructEM(); >> 91 } >> 92 >> 93 #include "G4MultipleScattering.hh" >> 94 // gamma >> 95 #include "G4LowEnergyRayleigh.hh" >> 96 #include "G4LowEnergyPhotoElectric.hh" >> 97 #include "G4LowEnergyCompton.hh" >> 98 #include "G4LowEnergyGammaConversion.hh" >> 99 // e- >> 100 #include "G4LowEnergyIonisation.hh" >> 101 #include "G4LowEnergyBremsstrahlung.hh" >> 102 // e+ >> 103 #include "G4eIonisation.hh" >> 104 #include "G4eBremsstrahlung.hh" >> 105 #include "G4eplusAnnihilation.hh" 96 106 97 // decay physics list << 107 void BrachyPhysicsList::ConstructEM() 98 fDecPhysicsList -> ConstructProcess(); << 108 { 99 fRadDecayPhysicsList -> ConstructProcess(); << 109 theParticleIterator->reset(); 100 << 110 while( (*theParticleIterator)() ){ 101 // Deexcitation << 111 G4ParticleDefinition* particle = theParticleIterator->value(); 102 // Both Fluorescence and Auger e- emission act << 112 G4ProcessManager* pmanager = particle->GetProcessManager(); 103 G4VAtomDeexcitation* de = new G4UAtomicDeexcit << 113 G4String particleName = particle->GetParticleName(); 104 G4LossTableManager::Instance()->SetAtomDeexcit << 114 105 de -> SetFluo(true); << 115 //processes 106 de -> SetAuger(true); << 116 107 << 117 if (particleName == "gamma") { 108 // To model full Auger cascade include in the << 118 //gamma 109 // the following UI commands: << 119 lowePhot = new G4LowEnergyPhotoElectric("LowEnPhotoElec"); 110 // process/em/augerCascade true << 120 pmanager->AddDiscreteProcess(new G4LowEnergyRayleigh); 111 // process/em/deexcitationIgnoreCut true << 121 pmanager->AddDiscreteProcess(lowePhot); >> 122 pmanager->AddDiscreteProcess(new G4LowEnergyCompton); >> 123 pmanager->AddDiscreteProcess(new G4LowEnergyGammaConversion); >> 124 >> 125 } else if (particleName == "e-") { >> 126 //electron >> 127 loweIon = new G4LowEnergyIonisation("LowEnergyIoni"); >> 128 loweBrem = new G4LowEnergyBremsstrahlung("LowEnBrem"); >> 129 loweBrem->SetAngularGenerator("tsai"); >> 130 >> 131 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); >> 132 pmanager->AddProcess(loweIon, -1, 2,2); >> 133 pmanager->AddProcess(loweBrem, -1,-1,3); >> 134 >> 135 } else if (particleName == "e+") { >> 136 //positron >> 137 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); >> 138 pmanager->AddProcess(new G4eIonisation, -1, 2,2); >> 139 pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,3); >> 140 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); >> 141 >> 142 } >> 143 } 112 } 144 } 113 145 114 void BrachyPhysicsList::AddPhysicsList(const G << 146 void BrachyPhysicsList::SetCuts() 115 { 147 { >> 148 if (verboseLevel >0){ >> 149 G4cout << "BrachyPhysicsList::SetCuts:"; >> 150 G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl; >> 151 } >> 152 >> 153 SetCutValue(cutForGamma, "gamma"); >> 154 SetCutValue(cutForElectron, "e-"); >> 155 SetCutValue(cutForPositron, "e+"); 116 156 117 if (name == fEmName) return; << 157 if (verboseLevel>0) DumpCutValuesTable(); >> 158 } 118 159 119 if (name == "emstandard_opt0"){ << 160 void BrachyPhysicsList::SetGammaLowLimit(G4double lowcut) 120 fEmName = name; << 161 { 121 delete fEmPhysicsList; << 162 SetGELowLimit(lowcut); 122 fEmPhysicsList = new G4EmStandardPhysics() << 163 } 123 G4cout << "PhysicsList::AddPhysicsList: <" << 164 124 << 165 void BrachyPhysicsList::SetElectronLowLimit(G4double lowcut) 125 } else if (name == "emstandard_opt1"){ << 166 { 126 fEmName = name; << 167 SetGELowLimit(lowcut); 127 delete fEmPhysicsList; << 128 fEmPhysicsList = new G4EmStandardPhysics_o << 129 G4cout << "PhysicsList::AddPhysicsList: <" << 130 } else if (name == "emstandard_opt2"){ << 131 fEmName = name; << 132 delete fEmPhysicsList; << 133 fEmPhysicsList = new G4EmStandardPhysics_o << 134 G4cout << "PhysicsList::AddPhysicsList: <" << 135 } else if (name == "emstandard_opt3"){ << 136 fEmName = name; << 137 delete fEmPhysicsList; << 138 fEmPhysicsList = new G4EmStandardPhysics_o << 139 G4cout << "PhysicsList::AddPhysicsList: <" << 140 } else if (name == "emstandard_opt4"){ << 141 fEmName = name; << 142 delete fEmPhysicsList; << 143 fEmPhysicsList = new G4EmStandardPhysics_o << 144 G4cout << "PhysicsList::AddPhysicsList: <" << 145 } else if (name == "empenelope"){ << 146 fEmName = name; << 147 delete fEmPhysicsList; << 148 fEmPhysicsList = new G4EmPenelopePhysics() << 149 G4cout << "PhysicsList::AddPhysicsList: <" << 150 } else if (name == "emlivermore"){ << 151 fEmName = name; << 152 delete fEmPhysicsList; << 153 fEmPhysicsList = new G4EmLivermorePhysics( << 154 G4cout << "PhysicsList::AddPhysicsList: <" << 155 } else { << 156 << 157 G4cout << "PhysicsList::AddPhysicsList: <" << 158 << " is not defined" << 159 << G4endl; << 160 } << 161 G4cout << "PhysicsList::AddPhysicsList: <" < << 162 << " is activated" << 163 << G4endl; << 164 } 168 } 165 169 >> 170 void BrachyPhysicsList::SetGELowLimit(G4double lowcut) >> 171 { >> 172 if (verboseLevel >0){ >> 173 G4cout << "BrachyPhysicsList::SetCuts:"; >> 174 G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; >> 175 } >> 176 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(lowcut,1e5); >> 177 } >> 178 >> 179 void BrachyPhysicsList::SetGammaCut(G4double val) >> 180 { >> 181 ResetCuts(); >> 182 cutForGamma = val; >> 183 } >> 184 >> 185 void BrachyPhysicsList::SetElectronCut(G4double val) >> 186 { >> 187 cutForElectron = val; >> 188 } >> 189 >> 190 void BrachyPhysicsList::SetPositronCut(G4double val) >> 191 { >> 192 cutForPositron = val; >> 193 } >> 194 >> 195 void BrachyPhysicsList::SetLowEnSecPhotCut(G4double cut) >> 196 { >> 197 G4cout<<"Low energy secondary photons cut is now set to: " >> 198 <<cut*MeV >> 199 <<" (MeV)"<<G4endl; >> 200 >> 201 G4cout<<"for processes LowEnergyPhotoElectric, LowEnergyBremsstrahlung, LowEnergyIonisation"<<G4endl; >> 202 >> 203 lowePhot->SetCutForLowEnSecPhotons(cut); >> 204 loweIon->SetCutForLowEnSecPhotons(cut); >> 205 loweBrem->SetCutForLowEnSecPhotons(cut); >> 206 } >> 207 >> 208 void BrachyPhysicsList::SetLowEnSecElecCut(G4double cut) >> 209 { >> 210 G4cout<<"Low energy secondary electrons cut is now set to: " >> 211 <<cut*MeV >> 212 <<" (MeV)"<<G4endl; >> 213 G4cout<<"for processes LowEnergyIonisation"<<G4endl; >> 214 loweIon->SetCutForLowEnSecElectrons(cut); >> 215 } 166 216