[1199] | 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 | // |
---|
| 27 | // $Id: XrayFluoPhysicsList.cc |
---|
| 28 | // GEANT4 tag $Name: xray_fluo-V03-02-00 |
---|
| 29 | // |
---|
| 30 | // Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it) |
---|
| 31 | // |
---|
| 32 | // History: |
---|
| 33 | // ----------- |
---|
| 34 | // 28 Nov 2001 Elena Guardincerri Created |
---|
| 35 | // |
---|
| 36 | // ------------------------------------------------------------------- |
---|
| 37 | |
---|
| 38 | #include "XrayFluoPhysicsList.hh" |
---|
| 39 | #include "XrayFluoPhysicsListMessenger.hh" |
---|
| 40 | #include "XrayFluoDetectorConstruction.hh" |
---|
| 41 | |
---|
| 42 | #include "G4ParticleDefinition.hh" |
---|
| 43 | #include "G4ParticleWithCuts.hh" |
---|
| 44 | #include "G4ProcessManager.hh" |
---|
| 45 | #include "G4ParticleTypes.hh" |
---|
| 46 | #include "G4ParticleTable.hh" |
---|
| 47 | #include "G4ios.hh" |
---|
| 48 | #include "XrayFluoDetectorConstruction.hh" |
---|
| 49 | |
---|
| 50 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 51 | |
---|
| 52 | XrayFluoPhysicsList::XrayFluoPhysicsList(XrayFluoDetectorConstruction* p) |
---|
| 53 | : G4VUserPhysicsList() |
---|
| 54 | { |
---|
| 55 | pDet = p; |
---|
| 56 | defaultCutValue = 0.00001*mm; |
---|
| 57 | |
---|
| 58 | cutForGamma = defaultCutValue; |
---|
| 59 | cutForElectron = defaultCutValue; |
---|
| 60 | cutForProton = 0.00001*mm; |
---|
| 61 | SetVerboseLevel(1); |
---|
| 62 | physicsListMessenger = new XrayFluoPhysicsListMessenger(this); |
---|
| 63 | } |
---|
| 64 | |
---|
| 65 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 66 | |
---|
| 67 | XrayFluoPhysicsList::~XrayFluoPhysicsList() |
---|
| 68 | { |
---|
| 69 | delete physicsListMessenger; |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 73 | |
---|
| 74 | void XrayFluoPhysicsList::ConstructParticle() |
---|
| 75 | { |
---|
| 76 | // In this method, static member functions should be called |
---|
| 77 | // for all particles which you want to use. |
---|
| 78 | // This ensures that objects of these particle types will be |
---|
| 79 | // created in the program. |
---|
| 80 | |
---|
| 81 | ConstructBosons(); |
---|
| 82 | ConstructLeptons(); |
---|
| 83 | ConstructBarions(); |
---|
| 84 | ConstructIons(); |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 88 | |
---|
| 89 | void XrayFluoPhysicsList::ConstructBosons() |
---|
| 90 | { |
---|
| 91 | |
---|
| 92 | // gamma |
---|
| 93 | G4Gamma::GammaDefinition(); |
---|
| 94 | |
---|
| 95 | } |
---|
| 96 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 97 | |
---|
| 98 | void XrayFluoPhysicsList::ConstructLeptons() |
---|
| 99 | { |
---|
| 100 | // leptons |
---|
| 101 | G4Electron::ElectronDefinition(); |
---|
| 102 | G4Positron::PositronDefinition(); |
---|
| 103 | } |
---|
| 104 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 105 | |
---|
| 106 | void XrayFluoPhysicsList::ConstructBarions() |
---|
| 107 | { |
---|
| 108 | G4Proton::ProtonDefinition(); |
---|
| 109 | } |
---|
| 110 | void XrayFluoPhysicsList::ConstructIons() |
---|
| 111 | { |
---|
| 112 | // Ions |
---|
| 113 | G4Alpha::AlphaDefinition(); |
---|
| 114 | } |
---|
| 115 | |
---|
| 116 | void XrayFluoPhysicsList::ConstructProcess() |
---|
| 117 | { |
---|
| 118 | AddTransportation(); |
---|
| 119 | ConstructEM(); |
---|
| 120 | } |
---|
| 121 | |
---|
| 122 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 123 | |
---|
| 124 | #include "G4LowEnergyCompton.hh" |
---|
| 125 | #include "G4LowEnergyGammaConversion.hh" |
---|
| 126 | #include "G4LowEnergyPhotoElectric.hh" |
---|
| 127 | #include "G4LowEnergyRayleigh.hh" |
---|
| 128 | |
---|
| 129 | // e+ |
---|
| 130 | #include "G4MultipleScattering.hh" |
---|
| 131 | #include "G4eIonisation.hh" |
---|
| 132 | #include "G4eBremsstrahlung.hh" |
---|
| 133 | #include "G4eplusAnnihilation.hh" |
---|
| 134 | |
---|
| 135 | #include "G4LowEnergyIonisation.hh" |
---|
| 136 | #include "G4LowEnergyBremsstrahlung.hh" |
---|
| 137 | #include "G4hLowEnergyIonisation.hh" |
---|
| 138 | |
---|
| 139 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 140 | |
---|
| 141 | void XrayFluoPhysicsList::ConstructEM() |
---|
| 142 | { |
---|
| 143 | theParticleIterator->reset(); |
---|
| 144 | while( (*theParticleIterator)() ){ |
---|
| 145 | G4ParticleDefinition* particle = theParticleIterator->value(); |
---|
| 146 | G4ProcessManager* pmanager = particle->GetProcessManager(); |
---|
| 147 | G4String particleName = particle->GetParticleName(); |
---|
| 148 | |
---|
| 149 | if (particleName == "gamma") { |
---|
| 150 | |
---|
| 151 | // gamma |
---|
| 152 | pmanager->AddDiscreteProcess(new G4LowEnergyCompton); |
---|
| 153 | |
---|
| 154 | LePeprocess = new G4LowEnergyPhotoElectric(); |
---|
| 155 | pmanager->AddDiscreteProcess(LePeprocess); |
---|
| 156 | |
---|
| 157 | pmanager->AddDiscreteProcess(new G4LowEnergyRayleigh); |
---|
| 158 | |
---|
| 159 | } else if (particleName == "e-") { |
---|
| 160 | //electron |
---|
| 161 | pmanager->AddProcess(new G4MultipleScattering,-1, 1,1); |
---|
| 162 | |
---|
| 163 | LeIoprocess = new G4LowEnergyIonisation(); |
---|
| 164 | pmanager->AddProcess(LeIoprocess, -1, 2, 2); |
---|
| 165 | |
---|
| 166 | LeBrprocess = new G4LowEnergyBremsstrahlung(); |
---|
| 167 | pmanager->AddProcess(LeBrprocess, -1, -1, 3); |
---|
| 168 | |
---|
| 169 | } else if (particleName == "e+") { |
---|
| 170 | //positron |
---|
| 171 | pmanager->AddProcess(new G4MultipleScattering,-1, 1,1); |
---|
| 172 | pmanager->AddProcess(new G4eIonisation, -1, 2,2); |
---|
| 173 | pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,3); |
---|
| 174 | pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); |
---|
| 175 | |
---|
| 176 | } |
---|
| 177 | else if (particleName == "proton") { |
---|
| 178 | //proton |
---|
| 179 | pmanager->AddProcess(new G4MultipleScattering,-1,1,1); |
---|
| 180 | pmanager->AddProcess(new G4hLowEnergyIonisation,-1, 2,2); |
---|
| 181 | } |
---|
| 182 | else if ( particleName == "alpha" ) |
---|
| 183 | { |
---|
| 184 | |
---|
| 185 | pmanager->AddProcess(new G4MultipleScattering,-1,1,1); |
---|
| 186 | G4hLowEnergyIonisation* iIon = new G4hLowEnergyIonisation() ; |
---|
| 187 | pmanager->AddProcess(iIon,-1,2,2); |
---|
| 188 | } |
---|
| 189 | |
---|
| 190 | } |
---|
| 191 | |
---|
| 192 | } |
---|
| 193 | |
---|
| 194 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 195 | |
---|
| 196 | void XrayFluoPhysicsList::SetGELowLimit(G4double lowcut) |
---|
| 197 | { |
---|
| 198 | if (verboseLevel >0){ |
---|
| 199 | G4cout << "XrayFluoPhysicsList::SetCuts:"; |
---|
| 200 | G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; |
---|
| 201 | } |
---|
| 202 | |
---|
| 203 | G4Gamma::SetEnergyRange(lowcut,1e5); |
---|
| 204 | G4Electron::SetEnergyRange(lowcut,1e5); |
---|
| 205 | G4Positron::SetEnergyRange(lowcut,1e5); |
---|
| 206 | |
---|
| 207 | } |
---|
| 208 | |
---|
| 209 | void XrayFluoPhysicsList::SetGammaLowLimit(G4double lowcut) |
---|
| 210 | { |
---|
| 211 | if (verboseLevel >0){ |
---|
| 212 | G4cout << "XrayFluoPhysicsList::SetCuts:"; |
---|
| 213 | G4cout << "Gamma cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; |
---|
| 214 | } |
---|
| 215 | |
---|
| 216 | G4Gamma::SetEnergyRange(lowcut,1e5); |
---|
| 217 | |
---|
| 218 | } |
---|
| 219 | |
---|
| 220 | void XrayFluoPhysicsList::SetElectronLowLimit(G4double lowcut) |
---|
| 221 | { |
---|
| 222 | if (verboseLevel >0){ |
---|
| 223 | |
---|
| 224 | G4cout << "XrayFluoPhysicsList::SetCuts:"; |
---|
| 225 | G4cout << "Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; |
---|
| 226 | |
---|
| 227 | } |
---|
| 228 | |
---|
| 229 | G4Electron::SetEnergyRange(lowcut,1e5); |
---|
| 230 | |
---|
| 231 | } |
---|
| 232 | void XrayFluoPhysicsList::SetGammaCut(G4double val) |
---|
| 233 | { |
---|
| 234 | ResetCuts(); |
---|
| 235 | cutForGamma = val; |
---|
| 236 | } |
---|
| 237 | |
---|
| 238 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 239 | |
---|
| 240 | void XrayFluoPhysicsList::SetElectronCut(G4double val) |
---|
| 241 | { |
---|
| 242 | ResetCuts(); |
---|
| 243 | cutForElectron = val; |
---|
| 244 | } |
---|
| 245 | |
---|
| 246 | void XrayFluoPhysicsList::SetCuts(){ |
---|
| 247 | |
---|
| 248 | SetCutValue(cutForGamma,"gamma"); |
---|
| 249 | SetCutValue(cutForElectron,"e-"); |
---|
| 250 | SetCutValue(cutForElectron,"e+"); |
---|
| 251 | SetCutValue(cutForProton, "proton"); |
---|
| 252 | SetCutValueForOthers(cutForProton); |
---|
| 253 | if (verboseLevel>0) DumpCutValuesTable(); |
---|
| 254 | } |
---|
| 255 | |
---|
| 256 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 257 | |
---|
| 258 | void XrayFluoPhysicsList::SetLowEnSecPhotCut(G4double cut){ |
---|
| 259 | |
---|
| 260 | G4cout<<"Low energy secondary photons cut is now set to: "<<cut*MeV<<" (MeV)"<<G4endl; |
---|
| 261 | G4cout<<"for processes LowEnergyBremsstrahlung, LowEnergyPhotoElectric, LowEnergyIonisation"<<G4endl; |
---|
| 262 | LeBrprocess->SetCutForLowEnSecPhotons(cut); |
---|
| 263 | LePeprocess->SetCutForLowEnSecPhotons(cut); |
---|
| 264 | LeIoprocess->SetCutForLowEnSecPhotons(cut); |
---|
| 265 | } |
---|
| 266 | |
---|
| 267 | void XrayFluoPhysicsList::SetLowEnSecElecCut(G4double cut){ |
---|
| 268 | |
---|
| 269 | G4cout<<"Low energy secondary electrons cut is now set to: "<<cut*MeV<<" (MeV)"<<G4endl; |
---|
| 270 | |
---|
| 271 | G4cout<<"for processes LowEnergyIonisation"<<G4endl; |
---|
| 272 | |
---|
| 273 | LeIoprocess->SetCutForLowEnSecElectrons(cut); |
---|
| 274 | } |
---|
| 275 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 276 | |
---|
| 277 | void XrayFluoPhysicsList::SetProtonCut(G4double val) |
---|
| 278 | { |
---|
| 279 | // ResetCuts(); |
---|
| 280 | cutForProton = val; |
---|
| 281 | } |
---|
| 282 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 283 | |
---|
| 284 | |
---|
| 285 | void XrayFluoPhysicsList::SetCutsByEnergy(G4double val) |
---|
| 286 | { |
---|
| 287 | G4ParticleTable* theXrayFluoParticleTable = G4ParticleTable::GetParticleTable(); |
---|
| 288 | G4Material* currMat = pDet->GetSampleMaterial(); |
---|
| 289 | G4ParticleDefinition* part; |
---|
| 290 | G4double cut; |
---|
| 291 | |
---|
| 292 | part = theXrayFluoParticleTable->FindParticle("e-"); |
---|
| 293 | cut = G4EnergyLossTables::GetRange(part,val,currMat); |
---|
| 294 | SetCutValue(cut, "e-"); |
---|
| 295 | |
---|
| 296 | part = theXrayFluoParticleTable->FindParticle("proton"); |
---|
| 297 | cut = G4EnergyLossTables::GetRange(part,val,currMat); |
---|
| 298 | SetCutValue(cut, "proton"); |
---|
| 299 | |
---|
| 300 | } |
---|
| 301 | |
---|
| 302 | |
---|
| 303 | |
---|
| 304 | |
---|
| 305 | |
---|
| 306 | |
---|
| 307 | |
---|
| 308 | |
---|
| 309 | |
---|
| 310 | |
---|
| 311 | |
---|
| 312 | |
---|
| 313 | |
---|
| 314 | |
---|
| 315 | |
---|
| 316 | |
---|
| 317 | |
---|
| 318 | |
---|
| 319 | |
---|
| 320 | |
---|
| 321 | |
---|
| 322 | |
---|
| 323 | |
---|
| 324 | |
---|
| 325 | |
---|
| 326 | |
---|
| 327 | |
---|
| 328 | |
---|
| 329 | |
---|
| 330 | |
---|
| 331 | |
---|
| 332 | |
---|
| 333 | |
---|
| 334 | |
---|
| 335 | |
---|
| 336 | |
---|