[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 | // The code was written by : |
---|
| 27 | // *Louis Archambault louis.archambault@phy.ulaval.ca, |
---|
| 28 | // *Luc Beaulieu beaulieu@phy.ulaval.ca |
---|
| 29 | // +Vincent Hubert-Tremblay at tigre.2@sympatico.ca |
---|
| 30 | // |
---|
| 31 | // |
---|
| 32 | // *Centre Hospitalier Universitaire de Quebec (CHUQ), |
---|
| 33 | // Hotel-Dieu de Quebec, departement de Radio-oncologie |
---|
| 34 | // 11 cote du palais. Quebec, QC, Canada, G1R 2J6 |
---|
| 35 | // tel (418) 525-4444 #6720 |
---|
| 36 | // fax (418) 691 5268 |
---|
| 37 | // |
---|
| 38 | // + Université Laval, Québec (QC) Canada |
---|
| 39 | // |
---|
| 40 | // History: 30.11.07 P.Arce default cut changed to 1 mm |
---|
| 41 | //******************************************************* |
---|
| 42 | |
---|
| 43 | #include "DicomPhysicsList.hh" |
---|
| 44 | |
---|
| 45 | #include "G4ParticleDefinition.hh" |
---|
| 46 | #include "G4ParticleWithCuts.hh" |
---|
| 47 | #include "G4ProcessManager.hh" |
---|
| 48 | #include "G4ParticleTypes.hh" |
---|
| 49 | #include "G4ParticleTable.hh" |
---|
| 50 | #include "G4Material.hh" |
---|
| 51 | #include "G4UnitsTable.hh" |
---|
| 52 | #include "G4ios.hh" |
---|
| 53 | |
---|
| 54 | DicomPhysicsList::DicomPhysicsList(): G4VUserPhysicsList() |
---|
| 55 | { |
---|
| 56 | defaultCutValue = 1.e-3*mm; |
---|
| 57 | cutForGamma = 1.e-3*mm; |
---|
| 58 | cutForElectron = defaultCutValue; |
---|
| 59 | cutForPositron = defaultCutValue; |
---|
| 60 | |
---|
| 61 | SetVerboseLevel(0); |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | DicomPhysicsList::~DicomPhysicsList() |
---|
| 65 | {} |
---|
| 66 | |
---|
| 67 | void DicomPhysicsList::ConstructParticle() |
---|
| 68 | { |
---|
| 69 | // In this method, static member functions should be called |
---|
| 70 | // for all particles which you want to use. |
---|
| 71 | // This ensures that objects of these particle types will be |
---|
| 72 | // created in the program. |
---|
| 73 | |
---|
| 74 | ConstructBosons(); |
---|
| 75 | ConstructLeptons(); |
---|
| 76 | } |
---|
| 77 | |
---|
| 78 | void DicomPhysicsList::ConstructBosons() |
---|
| 79 | { |
---|
| 80 | // gamma |
---|
| 81 | G4Gamma::GammaDefinition(); |
---|
| 82 | |
---|
| 83 | } |
---|
| 84 | |
---|
| 85 | void DicomPhysicsList::ConstructLeptons() |
---|
| 86 | { |
---|
| 87 | // leptons |
---|
| 88 | G4Electron::ElectronDefinition(); |
---|
| 89 | G4Positron::PositronDefinition(); |
---|
| 90 | } |
---|
| 91 | |
---|
| 92 | void DicomPhysicsList::ConstructProcess() |
---|
| 93 | { |
---|
| 94 | AddTransportation(); |
---|
| 95 | ConstructEM(); |
---|
| 96 | } |
---|
| 97 | |
---|
| 98 | #include "G4MultipleScattering.hh" |
---|
| 99 | // gamma |
---|
| 100 | #include "G4LowEnergyRayleigh.hh" |
---|
| 101 | #include "G4LowEnergyPhotoElectric.hh" |
---|
| 102 | #include "G4LowEnergyCompton.hh" |
---|
| 103 | #include "G4LowEnergyGammaConversion.hh" |
---|
| 104 | // e- |
---|
| 105 | #include "G4LowEnergyIonisation.hh" |
---|
| 106 | #include "G4LowEnergyBremsstrahlung.hh" |
---|
| 107 | // e+ |
---|
| 108 | #include "G4eIonisation.hh" |
---|
| 109 | #include "G4eBremsstrahlung.hh" |
---|
| 110 | #include "G4eplusAnnihilation.hh" |
---|
| 111 | |
---|
| 112 | void DicomPhysicsList::ConstructEM() |
---|
| 113 | { |
---|
| 114 | theParticleIterator->reset(); |
---|
| 115 | while( (*theParticleIterator)() ) |
---|
| 116 | { |
---|
| 117 | G4ParticleDefinition* particle = theParticleIterator->value(); |
---|
| 118 | G4ProcessManager* pmanager = particle->GetProcessManager(); |
---|
| 119 | G4String particleName = particle->GetParticleName(); |
---|
| 120 | |
---|
| 121 | //processes |
---|
| 122 | lowePhot = new G4LowEnergyPhotoElectric("LowEnPhotoElec"); |
---|
| 123 | loweIon = new G4LowEnergyIonisation("LowEnergyIoni"); |
---|
| 124 | loweBrem = new G4LowEnergyBremsstrahlung("LowEnBrem"); |
---|
| 125 | |
---|
| 126 | if (particleName == "gamma") |
---|
| 127 | { |
---|
| 128 | //gamma |
---|
| 129 | pmanager->AddDiscreteProcess(new G4LowEnergyRayleigh); |
---|
| 130 | pmanager->AddDiscreteProcess(lowePhot); |
---|
| 131 | pmanager->AddDiscreteProcess(new G4LowEnergyCompton); |
---|
| 132 | pmanager->AddDiscreteProcess(new G4LowEnergyGammaConversion); |
---|
| 133 | |
---|
| 134 | } |
---|
| 135 | else if (particleName == "e-") |
---|
| 136 | { |
---|
| 137 | //electron |
---|
| 138 | pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); |
---|
| 139 | pmanager->AddProcess(loweIon, -1, 2,2); |
---|
| 140 | pmanager->AddProcess(loweBrem, -1,-1,3); |
---|
| 141 | |
---|
| 142 | } |
---|
| 143 | else if (particleName == "e+") |
---|
| 144 | { |
---|
| 145 | //positron |
---|
| 146 | pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); |
---|
| 147 | pmanager->AddProcess(new G4eIonisation, -1, 2,2); |
---|
| 148 | pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,3); |
---|
| 149 | pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); |
---|
| 150 | |
---|
| 151 | } |
---|
| 152 | } |
---|
| 153 | } |
---|
| 154 | #include "G4Decay.hh" |
---|
| 155 | void DicomPhysicsList::ConstructGeneral() |
---|
| 156 | { |
---|
| 157 | // Add Decay Process |
---|
| 158 | G4Decay* theDecayProcess = new G4Decay(); |
---|
| 159 | theParticleIterator->reset(); |
---|
| 160 | while( (*theParticleIterator)() ) |
---|
| 161 | { |
---|
| 162 | G4ParticleDefinition* particle = theParticleIterator->value(); |
---|
| 163 | G4ProcessManager* pmanager = particle->GetProcessManager(); |
---|
| 164 | if (theDecayProcess->IsApplicable(*particle)) |
---|
| 165 | { |
---|
| 166 | pmanager ->AddProcess(theDecayProcess); |
---|
| 167 | // set ordering for PostStepDoIt and AtRestDoIt |
---|
| 168 | pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep); |
---|
| 169 | pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest); |
---|
| 170 | } |
---|
| 171 | } |
---|
| 172 | } |
---|
| 173 | |
---|
| 174 | void DicomPhysicsList::SetCuts() |
---|
| 175 | { |
---|
| 176 | if (verboseLevel >0) |
---|
| 177 | { |
---|
| 178 | G4cout << "DicomPhysicsList::SetCuts:"; |
---|
| 179 | G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl; |
---|
| 180 | } |
---|
| 181 | |
---|
| 182 | // set cut values for gamma at first and for e- second and next for e+, |
---|
| 183 | // because some processes for e+/e- need cut values for gamma |
---|
| 184 | SetCutValue(cutForGamma, "gamma"); |
---|
| 185 | SetCutValue(cutForElectron, "e-"); |
---|
| 186 | SetCutValue(cutForPositron, "e+"); |
---|
| 187 | |
---|
| 188 | |
---|
| 189 | if (verboseLevel>0) |
---|
| 190 | DumpCutValuesTable(); |
---|
| 191 | } |
---|
| 192 | |
---|
| 193 | void DicomPhysicsList::SetGammaCut(G4double val) |
---|
| 194 | { |
---|
| 195 | ResetCuts(); |
---|
| 196 | cutForGamma = val; |
---|
| 197 | } |
---|
| 198 | |
---|
| 199 | void DicomPhysicsList::SetElectronCut(G4double val) |
---|
| 200 | { |
---|
| 201 | // ResetCuts(); |
---|
| 202 | cutForElectron = val; |
---|
| 203 | } |
---|
| 204 | |
---|
| 205 | void DicomPhysicsList::SetPositronCut(G4double val) |
---|
| 206 | { |
---|
| 207 | // ResetCuts(); |
---|
| 208 | cutForPositron = val; |
---|
| 209 | } |
---|
| 210 | |
---|