Geant4 Cross Reference |
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 /// \file Par02PhysicsList.cc 28 /// \brief Implementation of the Par02PhysicsList class 29 30 #include "Par02PhysicsList.hh" 31 32 #include "G4BaryonConstructor.hh" 33 #include "G4ComptonScattering.hh" 34 #include "G4Decay.hh" 35 #include "G4FastSimulationManagerProcess.hh" 36 #include "G4GammaConversion.hh" 37 #include "G4IonConstructor.hh" 38 #include "G4LeptonConstructor.hh" 39 #include "G4Material.hh" 40 #include "G4MaterialTable.hh" 41 #include "G4MesonConstructor.hh" 42 #include "G4MuBremsstrahlung.hh" 43 #include "G4MuIonisation.hh" 44 #include "G4MuMultipleScattering.hh" 45 #include "G4MuPairProduction.hh" 46 #include "G4ParticleDefinition.hh" 47 #include "G4ParticleTable.hh" 48 #include "G4ParticleTypes.hh" 49 #include "G4PhotoElectricEffect.hh" 50 #include "G4ProcessManager.hh" 51 #include "G4ProcessVector.hh" 52 #include "G4SystemOfUnits.hh" 53 #include "G4eBremsstrahlung.hh" 54 #include "G4eIonisation.hh" 55 #include "G4eMultipleScattering.hh" 56 #include "G4eplusAnnihilation.hh" 57 #include "G4hIonisation.hh" 58 #include "G4hMultipleScattering.hh" 59 #include "G4ios.hh" 60 #include "globals.hh" 61 62 #include <iomanip> 63 64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 65 66 Par02PhysicsList::Par02PhysicsList() : G4VUserPhysicsList() 67 { 68 SetVerboseLevel(1); 69 defaultCutValue = 0.1 * m; 70 } 71 72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 73 74 Par02PhysicsList::~Par02PhysicsList() = default; 75 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 77 78 void Par02PhysicsList::ConstructParticle() 79 { 80 // In this method, static member functions should be called for all particles 81 // which you want to use. 82 // This ensures that objects of these particle types will be created in the program. 83 ConstructBosons(); 84 ConstructLeptons(); 85 ConstructMesons(); 86 ConstructBaryons(); 87 ConstructIons(); 88 } 89 90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 91 92 void Par02PhysicsList::ConstructBosons() 93 { 94 G4Geantino::GeantinoDefinition(); 95 G4ChargedGeantino::ChargedGeantinoDefinition(); 96 G4Gamma::GammaDefinition(); 97 G4OpticalPhoton::OpticalPhotonDefinition(); 98 } 99 100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 101 102 void Par02PhysicsList::ConstructLeptons() 103 { 104 G4LeptonConstructor pConstructor; 105 pConstructor.ConstructParticle(); 106 } 107 108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 109 110 void Par02PhysicsList::ConstructMesons() 111 { 112 G4MesonConstructor pConstructor; 113 pConstructor.ConstructParticle(); 114 } 115 116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 117 118 void Par02PhysicsList::ConstructBaryons() 119 { 120 G4BaryonConstructor pConstructor; 121 pConstructor.ConstructParticle(); 122 } 123 124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 125 126 void Par02PhysicsList::ConstructIons() 127 { 128 G4IonConstructor pConstructor; 129 pConstructor.ConstructParticle(); 130 } 131 132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 133 134 void Par02PhysicsList::ConstructProcess() 135 { 136 AddTransportation(); 137 AddParameterisation(); 138 ConstructGeneral(); 139 } 140 141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 142 143 void Par02PhysicsList::AddTransportation() 144 { 145 // UseCoupledTransportation(); 146 G4VUserPhysicsList::AddTransportation(); 147 } 148 149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 150 151 void Par02PhysicsList::ConstructGeneral() 152 { 153 auto theDecayProcess = new G4Decay(); 154 auto particleIterator = GetParticleIterator(); 155 particleIterator->reset(); 156 while ((*particleIterator)()) { 157 G4ParticleDefinition* particle = particleIterator->value(); 158 G4ProcessManager* pmanager = particle->GetProcessManager(); 159 if (theDecayProcess->IsApplicable(*particle)) { 160 pmanager->AddProcess(theDecayProcess); 161 // set ordering for PostStepDoIt and AtRestDoIt 162 pmanager->SetProcessOrdering(theDecayProcess, idxPostStep); 163 pmanager->SetProcessOrdering(theDecayProcess, idxAtRest); 164 } 165 } 166 } 167 168 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 169 170 void Par02PhysicsList::AddParameterisation() 171 { 172 G4FastSimulationManagerProcess* fastSimProcess = new G4FastSimulationManagerProcess("G4FSMP"); 173 174 // Registers the fastSimProcess with all the particles as a discrete and 175 // continuous process (this works in all cases; in the case that parallel 176 // geometries are not used, as in this example, it would be enough to 177 // add it as a discrete process). 178 auto particleIterator = GetParticleIterator(); 179 particleIterator->reset(); 180 while ((*particleIterator)()) { 181 G4ParticleDefinition* particle = particleIterator->value(); 182 G4ProcessManager* pmanager = particle->GetProcessManager(); 183 // pmanager->AddDiscreteProcess( fastSimProcess ); // No parallel geometry 184 pmanager->AddProcess(fastSimProcess, -1, 0, 0); // General 185 } 186 } 187 188 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 189 190 void Par02PhysicsList::SetCuts() 191 { 192 if (verboseLevel > 1) { 193 G4cout << "Par02PhysicsList::SetCuts:"; 194 } 195 SetCutsWithDefault(); 196 } 197 198 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 199