Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 // ------------------------------------------- 28 // GEANT 4 class implementation file 29 // ------------------------------------------- 30 31 #include "globals.hh" 32 33 #include "G4PhysicalConstants.hh" 34 #include "G4SystemOfUnits.hh" 35 36 #include "G4ErrorPhysicsList.hh" 37 #include "G4ComptonScattering.hh" 38 #include "G4GammaConversion.hh" 39 #include "G4PhotoElectricEffect.hh" 40 41 #include "G4eIonisation.hh" 42 #include "G4eBremsstrahlung.hh" 43 #include "G4eplusAnnihilation.hh" 44 45 #include "G4MuIonisation.hh" 46 #include "G4MuBremsstrahlung.hh" 47 #include "G4MuPairProduction.hh" 48 49 #include "G4hIonisation.hh" 50 51 #include "G4MuIonisation.hh" 52 #include "G4MuBremsstrahlung.hh" 53 #include "G4MuPairProduction.hh" 54 55 #include "G4hIonisation.hh" 56 57 #include "G4ParticleDefinition.hh" 58 #include "G4ProcessManager.hh" 59 #include "G4ProcessVector.hh" 60 #include "G4ParticleTypes.hh" 61 #include "G4ParticleTable.hh" 62 #include "G4Material.hh" 63 #include "G4MaterialTable.hh" 64 #include "G4ios.hh" 65 #include "G4PhysicsTable.hh" 66 #include "G4Transportation.hh" 67 68 #include "G4ErrorEnergyLoss.hh" 69 70 //-------------------------------------------- 71 G4ErrorPhysicsList::G4ErrorPhysicsList() 72 : G4VUserPhysicsList() 73 { 74 defaultCutValue = 75 1.0E+9 * cm; // set big step so that Alon 76 } 77 78 //-------------------------------------------- 79 G4ErrorPhysicsList::~G4ErrorPhysicsList() {} 80 81 //-------------------------------------------- 82 void G4ErrorPhysicsList::ConstructParticle() 83 { 84 // In this method, static member functions s 85 // for all particles which you want to use. 86 // This ensures that objects of these partic 87 // created in the program. 88 // gamma 89 G4Gamma::GammaDefinition(); 90 // e+/- 91 G4Electron::ElectronDefinition(); 92 G4Positron::PositronDefinition(); 93 // mu+/- 94 G4MuonPlus::MuonPlusDefinition(); 95 G4MuonMinus::MuonMinusDefinition(); 96 97 // pi+/- 98 G4PionPlus::PionPlusDefinition(); 99 G4PionMinus::PionMinusDefinition(); 100 101 // proton 102 G4Proton::ProtonDefinition(); 103 } 104 105 //-------------------------------------------- 106 void G4ErrorPhysicsList::ConstructProcess() 107 { 108 G4Transportation* theTransportationProcess = 109 110 #ifdef G4VERBOSE 111 if(verboseLevel >= 4) 112 { 113 G4cout << "G4VUserPhysicsList::ConstructPr 114 } 115 #endif 116 117 // loop over all particles in G4ParticleTabl 118 auto myParticleIterator = GetParticleIterato 119 myParticleIterator->reset(); 120 while((*myParticleIterator)()) 121 { // Loop checking, 06.08.2015, G.Cosmo 122 G4ParticleDefinition* particle = myParticl 123 G4ProcessManager* pmanager = particle- 124 if(!particle->IsShortLived()) 125 { 126 G4cout << particle << "G4ErrorPhysicsLis 127 << particle->GetParticleName() << 128 << particle->GetProcessManager() 129 // Add transportation process for all pa 130 if(pmanager == 0) 131 { 132 // Error !! no process manager 133 G4String particleName = particle->GetP 134 G4Exception("G4ErrorPhysicsList::Const 135 "No process manager", RunM 136 } 137 else 138 { 139 // add transportation with ordering = 140 pmanager->AddProcess(theTransportation 141 pmanager->SetProcessOrderingToFirst(th 142 id 143 pmanager->SetProcessOrderingToFirst(th 144 id 145 } 146 } 147 else 148 { 149 // shortlived particle case 150 } 151 } 152 153 ConstructEM(); 154 } 155 156 //-------------------------------------------- 157 #include "G4eBremsstrahlung.hh" 158 #include "G4eIonisation.hh" 159 160 #include "G4eIonisation.hh" 161 162 #include "G4MuBremsstrahlung.hh" 163 #include "G4MuIonisation.hh" 164 #include "G4MuPairProduction.hh" 165 166 #include "G4PhysicsTable.hh" 167 168 #include "G4MuIonisation.hh" 169 170 #include "G4ErrorStepLengthLimitProcess.hh" 171 #include "G4ErrorMagFieldLimitProcess.hh" 172 #include "G4ErrorMessenger.hh" 173 174 void G4ErrorPhysicsList::ConstructEM() 175 { 176 G4ErrorEnergyLoss* eLossProcess = new G4Erro 177 G4ErrorStepLengthLimitProcess* stepLengthLim 178 new G4ErrorStepLengthLimitProcess; 179 G4ErrorMagFieldLimitProcess* magFieldLimitPr 180 new G4ErrorMagFieldLimitProcess; 181 new G4ErrorMessenger(stepLengthLimitProcess, 182 eLossProcess); 183 184 auto myParticleIterator = GetParticleIterato 185 myParticleIterator->reset(); 186 while((*myParticleIterator)()) 187 { // Loop checking, 06.08.2015, G.Cosmo 188 G4ParticleDefinition* particle = myParticl 189 G4ProcessManager* pmanager = particle- 190 G4String particleName = particle- 191 192 if(particleName == "gamma") 193 { 194 // gamma 195 pmanager->AddDiscreteProcess(new G4Gamma 196 pmanager->AddDiscreteProcess(new G4Compt 197 pmanager->AddDiscreteProcess(new G4Photo 198 199 // } else if (particleName == "e-" || 200 // || particleName == "mu+ 201 } 202 else if(!particle->IsShortLived() && parti 203 { 204 pmanager->AddContinuousProcess(eLossProc 205 pmanager->AddDiscreteProcess(stepLengthL 206 pmanager->AddDiscreteProcess(magFieldLim 207 208 /* } else if ((!particle->IsShortLiv 209 (particle->GetPDGCharge() != 0. 210 (particle->GetParticleName() != 211 // all others charged particles except ge 212 // G4VProcess* aMultipleScattering = n 213 G4VProcess* anIonisation = new G4h 214 ////G4VProcess* theUserCuts = new G4User 215 216 // 217 // add processes 218 pmanager->AddProcess(anIonisation); 219 // pmanager->AddProcess(aMultipleScatte 220 ////pmanager->AddProcess(theUserCuts); 221 222 // 223 // set ordering for AlongStepDoIt 224 // pmanager->SetProcessOrdering(aMultip 225 pmanager->SetProcessOrdering(anIonisation 226 227 // 228 // set ordering for PostStepDoIt 229 // pmanager->SetProcessOrdering(aMultip 230 pmanager->SetProcessOrdering(anIonisation 231 ////pmanager->SetProcessOrdering(theUserC 232 */ 233 } 234 } 235 } 236 237 //-------------------------------------------- 238 void G4ErrorPhysicsList::SetCuts() 239 { 240 // " G4VUserPhysicsList::SetCutsWithDefault 241 // the default cut value or all particle t 242 SetCutsWithDefault(); 243 // if (verboseLevel>0) 244 // DumpCutValuesTable(); 245 } 246