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 // ------------------------------------------- 24 // -------------------------------------------------------------- 28 // GEANT 4 - ULTRA experiment 25 // GEANT 4 - ULTRA experiment example 29 // ------------------------------------------- 26 // -------------------------------------------------------------- 30 // 27 // 31 // Code developed by: 28 // Code developed by: 32 // B. Tome, M.C. Espirito-Santo, A. Trindade, << 29 // B. Tome, M.C. Espirito-Santo, A. Trindade, P. Rodrigues 33 // 30 // 34 // **************************************** 31 // **************************************************** 35 // * UltraPhysicsList.cc 32 // * UltraPhysicsList.cc 36 // **************************************** 33 // **************************************************** 37 // 34 // 38 // Ultra Physics List class; Standard and L 35 // Ultra Physics List class; Standard and Low Energy EM processes are defined for 39 // the relevant particles. Optical processe 36 // the relevant particles. Optical processes are declared. 40 // 37 // 41 #include "G4ios.hh" 38 #include "G4ios.hh" 42 //#include "iomanip.h" 39 //#include "iomanip.h" 43 #include "globals.hh" 40 #include "globals.hh" 44 41 45 #include "UltraPhysicsList.hh" 42 #include "UltraPhysicsList.hh" 46 43 47 #include "G4ParticleDefinition.hh" 44 #include "G4ParticleDefinition.hh" 48 #include "G4ParticleTypes.hh" 45 #include "G4ParticleTypes.hh" 49 #include "G4ParticleWithCuts.hh" 46 #include "G4ParticleWithCuts.hh" 50 #include "G4ParticleTable.hh" 47 #include "G4ParticleTable.hh" 51 #include "G4Material.hh" 48 #include "G4Material.hh" 52 #include "G4MaterialTable.hh" 49 #include "G4MaterialTable.hh" 53 #include "G4ProcessManager.hh" 50 #include "G4ProcessManager.hh" 54 #include "G4ProcessVector.hh" 51 #include "G4ProcessVector.hh" 55 52 56 #include "G4EmStandardPhysics.hh" << 53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 57 #include "G4EmLivermorePhysics.hh" << 58 #include "G4EmPenelopePhysics.hh" << 59 #include "G4EmLowEPPhysics.hh" << 60 #include "G4DecayPhysics.hh" << 61 #include "G4IonPhysics.hh" << 62 #include "G4EmExtraPhysics.hh" << 63 #include "G4StoppingPhysics.hh" << 64 #include "G4OpticalPhysics.hh" << 65 54 66 #include "G4UnitsTable.hh" << 55 UltraPhysicsList::UltraPhysicsList() : G4VUserPhysicsList() {;} 67 #include "G4SystemOfUnits.hh" << 68 #include "G4LossTableManager.hh" << 69 56 70 UltraPhysicsList::UltraPhysicsList() : G4VMod << 57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 71 fEmPhysicsList(0), << 58 72 fOpPhysicsList(0), << 59 UltraPhysicsList::~UltraPhysicsList() {;} 73 fDecayPhysicsList(0), << 60 74 fVerboseLebel(1), << 61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 75 fMaxNumPhotonStep(20) << 62 >> 63 void UltraPhysicsList::ConstructParticle() 76 { 64 { 77 G4LossTableManager::Instance(); << 65 // In this method, static member functions should be called 78 SetDefaultCutValue(1*mm); << 66 // for all particles which you want to use. >> 67 // This ensures that objects of these particle types will be >> 68 // created in the program. >> 69 >> 70 ConstructBosons(); >> 71 ConstructLeptons(); >> 72 ConstructMesons(); >> 73 ConstructBaryons(); 79 74 80 // fMessenger = new UltraPhysicsListMessenge << 75 } 81 // fStepMaxProcess = new StepMax(); << 82 76 83 // Initilise flags << 77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 84 78 85 SetVerboseLevel(1); << 79 void UltraPhysicsList::ConstructBosons() >> 80 { >> 81 // pseudo-particles >> 82 G4Geantino::GeantinoDefinition(); >> 83 G4ChargedGeantino::ChargedGeantinoDefinition(); 86 84 >> 85 // gamma >> 86 G4Gamma::GammaDefinition(); 87 87 88 // EM physics << 88 // optical photon 89 fEmName = G4String("emstandard"); << 89 G4OpticalPhoton::OpticalPhotonDefinition(); 90 fEmPhysicsList = new G4EmStandardPhysics(); << 91 fOpPhysicsList = new G4OpticalPhysics(); << 92 90 93 // Decay Physics is always defined << 94 fDecayPhysicsList = new G4DecayPhysics(); << 95 } 91 } 96 92 97 UltraPhysicsList::~UltraPhysicsList() << 93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 94 >> 95 void UltraPhysicsList::ConstructLeptons() 98 { 96 { 99 delete fDecayPhysicsList; << 97 // leptons 100 delete fEmPhysicsList; << 98 G4Electron::ElectronDefinition(); 101 delete fOpPhysicsList; << 99 G4Positron::PositronDefinition(); 102 // delete fStepMaxProcess; << 100 G4NeutrinoE::NeutrinoEDefinition(); >> 101 G4AntiNeutrinoE::AntiNeutrinoEDefinition(); >> 102 G4MuonPlus::MuonPlusDefinition(); >> 103 G4MuonMinus::MuonMinusDefinition(); >> 104 G4NeutrinoMu::NeutrinoMuDefinition(); >> 105 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition(); 103 } 106 } 104 107 >> 108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 105 109 106 void UltraPhysicsList::ConstructParticle() << 110 void UltraPhysicsList::ConstructMesons() >> 111 { >> 112 // mesons >> 113 G4PionPlus::PionPlusDefinition(); >> 114 G4PionMinus::PionMinusDefinition(); >> 115 G4PionZero::PionZeroDefinition(); >> 116 } >> 117 >> 118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 119 >> 120 void UltraPhysicsList::ConstructBaryons() 107 { 121 { 108 fDecayPhysicsList->ConstructParticle(); << 122 // barions >> 123 G4Proton::ProtonDefinition(); >> 124 G4AntiProton::AntiProtonDefinition(); >> 125 G4Neutron::NeutronDefinition(); >> 126 G4AntiNeutron::AntiNeutronDefinition(); 109 } 127 } 110 128 >> 129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 111 130 112 void UltraPhysicsList::ConstructProcess() 131 void UltraPhysicsList::ConstructProcess() 113 { 132 { 114 AddTransportation(); 133 AddTransportation(); 115 if (fEmPhysicsList) << 134 ConstructGeneral(); 116 fEmPhysicsList->ConstructProcess(); << 135 ConstructEM(); >> 136 ConstructOp(); >> 137 >> 138 } >> 139 >> 140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 141 >> 142 #include "G4Decay.hh" >> 143 >> 144 void UltraPhysicsList::ConstructGeneral() >> 145 { >> 146 G4Decay* theDecayProcess = new G4Decay(); >> 147 theParticleIterator->reset(); >> 148 while( (*theParticleIterator)() ){ >> 149 G4ParticleDefinition* particle = theParticleIterator->value(); >> 150 G4ProcessManager* pmanager = particle->GetProcessManager(); >> 151 if (theDecayProcess->IsApplicable(*particle)) { >> 152 pmanager->AddDiscreteProcess(theDecayProcess); >> 153 } >> 154 } >> 155 } >> 156 >> 157 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 158 >> 159 #include "G4ComptonScattering.hh" >> 160 #include "G4GammaConversion.hh" >> 161 #include "G4PhotoElectricEffect.hh" >> 162 >> 163 #include "G4MultipleScattering.hh" >> 164 >> 165 #include "G4eIonisation.hh" >> 166 #include "G4eBremsstrahlung.hh" >> 167 #include "G4eplusAnnihilation.hh" >> 168 >> 169 #include "G4MuIonisation.hh" >> 170 #include "G4MuBremsstrahlung.hh" >> 171 #include "G4MuPairProduction.hh" >> 172 >> 173 #include "G4hIonisation.hh" >> 174 >> 175 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 117 176 118 if (fOpPhysicsList) << 177 void UltraPhysicsList::ConstructEM() 119 fOpPhysicsList->ConstructProcess(); << 178 { >> 179 theParticleIterator->reset(); >> 180 while( (*theParticleIterator)() ){ >> 181 G4ParticleDefinition* particle = theParticleIterator->value(); >> 182 G4ProcessManager* pmanager = particle->GetProcessManager(); >> 183 G4String particleName = particle->GetParticleName(); >> 184 >> 185 if (particleName == "gamma") { >> 186 // gamma >> 187 // Construct processes for gamma >> 188 pmanager->AddDiscreteProcess(new G4GammaConversion()); >> 189 pmanager->AddDiscreteProcess(new G4ComptonScattering()); >> 190 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect()); >> 191 >> 192 } else if (particleName == "e-") { >> 193 //electron >> 194 // Construct processes for electron >> 195 pmanager->AddProcess(new G4MultipleScattering(),-1,1,1); >> 196 pmanager->AddProcess(new G4eIonisation(),-1,2,2); >> 197 pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3); >> 198 >> 199 } else if (particleName == "e+") { >> 200 //positron >> 201 // Construct processes for positron >> 202 pmanager->AddProcess(new G4MultipleScattering(),-1,1,1); >> 203 pmanager->AddProcess(new G4eIonisation(),-1,2,2); >> 204 pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3); >> 205 pmanager->AddProcess(new G4eplusAnnihilation(),0,-1,4); >> 206 >> 207 } else if( particleName == "mu+" || >> 208 particleName == "mu-" ) { >> 209 //muon >> 210 // Construct processes for muon >> 211 pmanager->AddProcess(new G4MultipleScattering(),-1,1,1); >> 212 pmanager->AddProcess(new G4MuIonisation(),-1,2,2); >> 213 pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3); >> 214 pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4); >> 215 >> 216 } else { >> 217 if ((particle->GetPDGCharge() != 0.0) && >> 218 (particle->GetParticleName() != "chargedgeantino")) { >> 219 // all others charged particles except geantino >> 220 pmanager->AddProcess(new G4MultipleScattering(),-1,1,1); >> 221 pmanager->AddProcess(new G4hIonisation(),-1,2,2); >> 222 } >> 223 } >> 224 } >> 225 } >> 226 >> 227 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 228 >> 229 #include "G4Cerenkov.hh" >> 230 #include "G4Scintillation.hh" >> 231 #include "G4OpAbsorption.hh" >> 232 #include "G4OpRayleigh.hh" >> 233 #include "G4OpBoundaryProcess.hh" 120 234 121 if (fDecayPhysicsList) << 235 void UltraPhysicsList::ConstructOp() 122 fDecayPhysicsList->ConstructProcess(); << 236 { >> 237 // this Cerenkov Process >> 238 G4Cerenkov* theCerenkovProcess = new G4Cerenkov("Cerenkov"); >> 239 // this is Scintillation process >> 240 G4Scintillation* theScintillationProcess = new G4Scintillation("Scintillation"); >> 241 // this absorption process inside optical media >> 242 G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption(); >> 243 // Rayleigh scattering for optical photons (aerogel radiators) >> 244 G4OpRayleigh* theRayleighScatteringProcess = new G4OpRayleigh(); >> 245 // Boundary process definition Class >> 246 G4OpBoundaryProcess* theBoundaryProcess = new G4OpBoundaryProcess(); >> 247 >> 248 // Chose level 0 (no verbose) >> 249 theCerenkovProcess -> SetVerboseLevel(0); >> 250 theScintillationProcess -> SetVerboseLevel(0); >> 251 theAbsorptionProcess -> SetVerboseLevel(0); >> 252 theRayleighScatteringProcess -> SetVerboseLevel(0); >> 253 theBoundaryProcess -> SetVerboseLevel(0); >> 254 >> 255 >> 256 // Chose MaxNumPhotons that can be generated. Lets ignore this for now >> 257 // G4int MaxNumPhotons = 300; >> 258 // theCerenkovProcess->SetMaxNumPhotonsPerStep(MaxNumPhotons); >> 259 theCerenkovProcess->SetTrackSecondariesFirst(true); >> 260 >> 261 theScintillationProcess->SetTrackSecondariesFirst(true); >> 262 theScintillationProcess->SetScintillationYieldFactor(1.); >> 263 theScintillationProcess->SetScintillationExcitationRatio(0.0); >> 264 >> 265 // Boundary model (UNIFIED OR GLISUR (OLD GEANT3)) For now only GEANT3 >> 266 G4OpticalSurfaceModel themodel = unified; >> 267 theBoundaryProcess->SetModel(themodel); >> 268 >> 269 theParticleIterator->reset(); >> 270 while( (*theParticleIterator)() ){ >> 271 G4ParticleDefinition* particle = theParticleIterator->value(); >> 272 G4ProcessManager* pmanager = particle->GetProcessManager(); >> 273 G4String particleName = particle->GetParticleName(); >> 274 >> 275 if (theCerenkovProcess->IsApplicable(*particle)) { >> 276 // pmanager->AddContinuousProcess(theCerenkovProcess); >> 277 } >> 278 >> 279 if (theScintillationProcess->IsApplicable(*particle)) { >> 280 pmanager->AddProcess(theScintillationProcess); >> 281 pmanager->SetProcessOrderingToLast(theScintillationProcess, idxAtRest); >> 282 pmanager->SetProcessOrderingToLast(theScintillationProcess, idxPostStep); >> 283 } >> 284 >> 285 if (particleName == "opticalphoton") { >> 286 G4cout << ">>>>>>>>>>>>>> AddDiscreteProcess to OpticalPhoton " << G4endl; >> 287 pmanager->AddDiscreteProcess(theAbsorptionProcess); >> 288 pmanager->AddDiscreteProcess(theRayleighScatteringProcess); >> 289 pmanager->AddDiscreteProcess(theBoundaryProcess); >> 290 } >> 291 } 123 } 292 } 124 293 >> 294 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 125 295 126 void UltraPhysicsList::SetCuts() 296 void UltraPhysicsList::SetCuts() 127 { 297 { 128 if (verboseLevel >1){ 298 if (verboseLevel >1){ 129 G4cout << "UltraPhysicsList::SetCuts:"; 299 G4cout << "UltraPhysicsList::SetCuts:"; 130 } << 300 } 131 // " G4VUserPhysicsList::SetCutsWithDefault << 301 // " G4VUserPhysicsList::SetCutsWithDefault" method sets 132 // the default cut value for all particle << 302 // the default cut value for all particle types 133 SetCutsWithDefault(); << 303 SetCutsWithDefault(); 134 } 304 } >> 305 >> 306 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 135 307