Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // >> 26 // $Id: $ 26 // 27 // 27 /// \file Par02PhysicsList.cc 28 /// \file Par02PhysicsList.cc 28 /// \brief Implementation of the Par02PhysicsL 29 /// \brief Implementation of the Par02PhysicsList class 29 30 30 #include "Par02PhysicsList.hh" 31 #include "Par02PhysicsList.hh" >> 32 #include "globals.hh" >> 33 #include "G4ParticleDefinition.hh" >> 34 #include "G4ProcessManager.hh" >> 35 #include "G4ProcessVector.hh" >> 36 #include "G4ParticleTypes.hh" >> 37 #include "G4ParticleTable.hh" >> 38 #include "G4Material.hh" >> 39 #include "G4MaterialTable.hh" >> 40 #include "G4ios.hh" >> 41 #include "G4SystemOfUnits.hh" >> 42 #include <iomanip> >> 43 #include "G4FastSimulationManagerProcess.hh" 31 44 32 #include "G4BaryonConstructor.hh" << 33 #include "G4ComptonScattering.hh" << 34 #include "G4Decay.hh" 45 #include "G4Decay.hh" 35 #include "G4FastSimulationManagerProcess.hh" << 36 #include "G4GammaConversion.hh" << 37 #include "G4IonConstructor.hh" << 38 #include "G4LeptonConstructor.hh" 46 #include "G4LeptonConstructor.hh" 39 #include "G4Material.hh" << 40 #include "G4MaterialTable.hh" << 41 #include "G4MesonConstructor.hh" 47 #include "G4MesonConstructor.hh" 42 #include "G4MuBremsstrahlung.hh" << 48 #include "G4BaryonConstructor.hh" 43 #include "G4MuIonisation.hh" << 49 #include "G4IonConstructor.hh" 44 #include "G4MuMultipleScattering.hh" << 50 45 #include "G4MuPairProduction.hh" << 51 #include "G4ComptonScattering.hh" 46 #include "G4ParticleDefinition.hh" << 52 #include "G4GammaConversion.hh" 47 #include "G4ParticleTable.hh" << 48 #include "G4ParticleTypes.hh" << 49 #include "G4PhotoElectricEffect.hh" 53 #include "G4PhotoElectricEffect.hh" 50 #include "G4ProcessManager.hh" << 54 51 #include "G4ProcessVector.hh" << 52 #include "G4SystemOfUnits.hh" << 53 #include "G4eBremsstrahlung.hh" << 54 #include "G4eIonisation.hh" << 55 #include "G4eMultipleScattering.hh" 55 #include "G4eMultipleScattering.hh" 56 #include "G4eplusAnnihilation.hh" << 56 #include "G4MuMultipleScattering.hh" 57 #include "G4hIonisation.hh" << 58 #include "G4hMultipleScattering.hh" 57 #include "G4hMultipleScattering.hh" 59 #include "G4ios.hh" << 60 #include "globals.hh" << 61 58 62 #include <iomanip> << 59 #include "G4eIonisation.hh" >> 60 #include "G4eBremsstrahlung.hh" >> 61 #include "G4eplusAnnihilation.hh" >> 62 >> 63 #include "G4MuIonisation.hh" >> 64 #include "G4MuBremsstrahlung.hh" >> 65 #include "G4MuPairProduction.hh" >> 66 >> 67 #include "G4hIonisation.hh" 63 68 64 //....oooOO0OOooo........oooOO0OOooo........oo 69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 65 70 66 Par02PhysicsList::Par02PhysicsList() : G4VUser << 71 Par02PhysicsList::Par02PhysicsList() : G4VUserPhysicsList() { 67 { << 72 SetVerboseLevel( 1 ); 68 SetVerboseLevel(1); << 73 defaultCutValue = 0.1*m; 69 defaultCutValue = 0.1 * m; << 70 } 74 } 71 75 72 //....oooOO0OOooo........oooOO0OOooo........oo 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 73 77 74 Par02PhysicsList::~Par02PhysicsList() = defaul << 78 Par02PhysicsList::~Par02PhysicsList() {} 75 79 76 //....oooOO0OOooo........oooOO0OOooo........oo 80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 77 81 78 void Par02PhysicsList::ConstructParticle() << 82 void Par02PhysicsList::ConstructParticle() { 79 { << 80 // In this method, static member functions s 83 // In this method, static member functions should be called for all particles 81 // which you want to use. 84 // which you want to use. 82 // This ensures that objects of these partic 85 // This ensures that objects of these particle types will be created in the program. 83 ConstructBosons(); 86 ConstructBosons(); 84 ConstructLeptons(); 87 ConstructLeptons(); 85 ConstructMesons(); 88 ConstructMesons(); 86 ConstructBaryons(); 89 ConstructBaryons(); 87 ConstructIons(); 90 ConstructIons(); 88 } 91 } 89 92 90 //....oooOO0OOooo........oooOO0OOooo........oo 93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 91 94 92 void Par02PhysicsList::ConstructBosons() << 95 void Par02PhysicsList::ConstructBosons() { 93 { << 94 G4Geantino::GeantinoDefinition(); 96 G4Geantino::GeantinoDefinition(); 95 G4ChargedGeantino::ChargedGeantinoDefinition 97 G4ChargedGeantino::ChargedGeantinoDefinition(); 96 G4Gamma::GammaDefinition(); 98 G4Gamma::GammaDefinition(); 97 G4OpticalPhoton::OpticalPhotonDefinition(); 99 G4OpticalPhoton::OpticalPhotonDefinition(); 98 } 100 } 99 101 100 //....oooOO0OOooo........oooOO0OOooo........oo 102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 101 103 102 void Par02PhysicsList::ConstructLeptons() << 104 void Par02PhysicsList::ConstructLeptons() { 103 { << 104 G4LeptonConstructor pConstructor; 105 G4LeptonConstructor pConstructor; 105 pConstructor.ConstructParticle(); 106 pConstructor.ConstructParticle(); 106 } 107 } 107 108 108 //....oooOO0OOooo........oooOO0OOooo........oo 109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 109 110 110 void Par02PhysicsList::ConstructMesons() << 111 void Par02PhysicsList::ConstructMesons() { 111 { << 112 G4MesonConstructor pConstructor; 112 G4MesonConstructor pConstructor; 113 pConstructor.ConstructParticle(); 113 pConstructor.ConstructParticle(); 114 } 114 } 115 115 116 //....oooOO0OOooo........oooOO0OOooo........oo 116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 117 117 118 void Par02PhysicsList::ConstructBaryons() << 118 void Par02PhysicsList::ConstructBaryons() { 119 { << 119 G4BaryonConstructor pConstructor; 120 G4BaryonConstructor pConstructor; << 121 pConstructor.ConstructParticle(); 120 pConstructor.ConstructParticle(); 122 } 121 } 123 122 124 //....oooOO0OOooo........oooOO0OOooo........oo 123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 125 124 126 void Par02PhysicsList::ConstructIons() << 125 void Par02PhysicsList::ConstructIons() { 127 { << 128 G4IonConstructor pConstructor; 126 G4IonConstructor pConstructor; 129 pConstructor.ConstructParticle(); 127 pConstructor.ConstructParticle(); 130 } 128 } 131 129 132 //....oooOO0OOooo........oooOO0OOooo........oo 130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 133 131 134 void Par02PhysicsList::ConstructProcess() << 132 void Par02PhysicsList::ConstructProcess() { 135 { << 136 AddTransportation(); 133 AddTransportation(); 137 AddParameterisation(); 134 AddParameterisation(); 138 ConstructGeneral(); 135 ConstructGeneral(); 139 } 136 } 140 137 141 //....oooOO0OOooo........oooOO0OOooo........oo 138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 142 139 143 void Par02PhysicsList::AddTransportation() << 140 void Par02PhysicsList::AddTransportation() { 144 { << 141 //UseCoupledTransportation(); 145 // UseCoupledTransportation(); << 146 G4VUserPhysicsList::AddTransportation(); 142 G4VUserPhysicsList::AddTransportation(); 147 } 143 } 148 144 149 //....oooOO0OOooo........oooOO0OOooo........oo 145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 150 146 151 void Par02PhysicsList::ConstructGeneral() << 147 void Par02PhysicsList::ConstructGeneral() { 152 { << 148 G4Decay* theDecayProcess = new G4Decay(); 153 auto theDecayProcess = new G4Decay(); << 149 theParticleIterator->reset(); 154 auto particleIterator = GetParticleIterator( << 150 while ( (*theParticleIterator)() ) { 155 particleIterator->reset(); << 151 G4ParticleDefinition* particle = theParticleIterator->value(); 156 while ((*particleIterator)()) { << 157 G4ParticleDefinition* particle = particleI << 158 G4ProcessManager* pmanager = particle->Get 152 G4ProcessManager* pmanager = particle->GetProcessManager(); 159 if (theDecayProcess->IsApplicable(*particl << 153 if ( theDecayProcess->IsApplicable( *particle ) ) { 160 pmanager->AddProcess(theDecayProcess); << 154 pmanager->AddProcess( theDecayProcess ); 161 // set ordering for PostStepDoIt and AtR 155 // set ordering for PostStepDoIt and AtRestDoIt 162 pmanager->SetProcessOrdering(theDecayPro << 156 pmanager->SetProcessOrdering( theDecayProcess, idxPostStep ); 163 pmanager->SetProcessOrdering(theDecayPro << 157 pmanager->SetProcessOrdering( theDecayProcess, idxAtRest ); 164 } 158 } 165 } 159 } 166 } 160 } 167 161 168 //....oooOO0OOooo........oooOO0OOooo........oo 162 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 169 163 170 void Par02PhysicsList::AddParameterisation() << 164 void Par02PhysicsList::AddParameterisation() { 171 { << 165 G4FastSimulationManagerProcess* fastSimProcess = 172 G4FastSimulationManagerProcess* fastSimProce << 166 new G4FastSimulationManagerProcess( "G4FSMP" ); 173 167 174 // Registers the fastSimProcess with all the 168 // Registers the fastSimProcess with all the particles as a discrete and 175 // continuous process (this works in all cas 169 // continuous process (this works in all cases; in the case that parallel 176 // geometries are not used, as in this examp 170 // geometries are not used, as in this example, it would be enough to 177 // add it as a discrete process). 171 // add it as a discrete process). 178 auto particleIterator = GetParticleIterator( << 172 theParticleIterator->reset(); 179 particleIterator->reset(); << 173 while ( (*theParticleIterator)() ) { 180 while ((*particleIterator)()) { << 174 G4ParticleDefinition* particle = theParticleIterator->value(); 181 G4ParticleDefinition* particle = particleI << 182 G4ProcessManager* pmanager = particle->Get 175 G4ProcessManager* pmanager = particle->GetProcessManager(); 183 // pmanager->AddDiscreteProcess( fastSimPr << 176 //pmanager->AddDiscreteProcess( fastSimProcess ); // No parallel geometry 184 pmanager->AddProcess(fastSimProcess, -1, 0 << 177 pmanager->AddProcess( fastSimProcess, -1, 0, 0 ); // General 185 } 178 } 186 } 179 } 187 180 188 //....oooOO0OOooo........oooOO0OOooo........oo 181 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 189 182 190 void Par02PhysicsList::SetCuts() << 183 void Par02PhysicsList::SetCuts() { 191 { << 184 if ( verboseLevel > 1 ) { 192 if (verboseLevel > 1) { << 193 G4cout << "Par02PhysicsList::SetCuts:"; 185 G4cout << "Par02PhysicsList::SetCuts:"; 194 } 186 } 195 SetCutsWithDefault(); 187 SetCutsWithDefault(); 196 } 188 } 197 189 198 //....oooOO0OOooo........oooOO0OOooo........oo 190 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 191 199 192