[1316] | 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: TstVAPhysicsList.cc,v 1.6 2006/06/29 18:34:41 gunter Exp $ |
---|
[1347] | 28 | // GEANT4 tag $Name: geant4-09-04-ref-00 $ |
---|
[1316] | 29 | // |
---|
| 30 | // -------------------------------------------------------------- |
---|
| 31 | |
---|
| 32 | #include "globals.hh" |
---|
| 33 | #include "G4ios.hh" |
---|
| 34 | #include <iomanip> |
---|
| 35 | |
---|
| 36 | #include "TstVAPhysicsList.hh" |
---|
| 37 | #include "G4ParticleDefinition.hh" |
---|
| 38 | #include "G4ParticleWithCuts.hh" |
---|
| 39 | #include "G4ProcessManager.hh" |
---|
| 40 | #include "G4ProcessVector.hh" |
---|
| 41 | #include "G4ParticleTypes.hh" |
---|
| 42 | #include "G4ParticleTable.hh" |
---|
| 43 | #include "G4BosonConstructor.hh" |
---|
| 44 | #include "G4LeptonConstructor.hh" |
---|
| 45 | #include "G4MesonConstructor.hh" |
---|
| 46 | #include "G4BaryonConstructor.hh" |
---|
| 47 | #include "G4IonConstructor.hh" |
---|
| 48 | #include "G4Material.hh" |
---|
| 49 | #include "G4MaterialTable.hh" |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | TstVAPhysicsList::TstVAPhysicsList(): G4VUserPhysicsList() |
---|
| 53 | { |
---|
| 54 | SetVerboseLevel(1); |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | TstVAPhysicsList::~TstVAPhysicsList() |
---|
| 58 | { |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | void TstVAPhysicsList::ConstructParticle() |
---|
| 62 | { |
---|
| 63 | // In this method, static member functions should be called |
---|
| 64 | // for all particles which you want to use. |
---|
| 65 | // This ensures that objects of these particle types will be |
---|
| 66 | // created in the program. |
---|
| 67 | |
---|
| 68 | ConstructBosons(); |
---|
| 69 | ConstructLeptons(); |
---|
| 70 | ConstructMesons(); |
---|
| 71 | ConstructBaryons(); |
---|
| 72 | |
---|
| 73 | } |
---|
| 74 | |
---|
| 75 | void TstVAPhysicsList::ConstructBosons() |
---|
| 76 | { |
---|
| 77 | // pseudo-particles |
---|
| 78 | G4Geantino::GeantinoDefinition(); |
---|
| 79 | G4ChargedGeantino::ChargedGeantinoDefinition(); |
---|
| 80 | |
---|
| 81 | // gamma |
---|
| 82 | G4Gamma::GammaDefinition(); |
---|
| 83 | |
---|
| 84 | // optical photon |
---|
| 85 | G4OpticalPhoton::OpticalPhotonDefinition(); |
---|
| 86 | } |
---|
| 87 | |
---|
| 88 | void TstVAPhysicsList::ConstructLeptons() |
---|
| 89 | { |
---|
| 90 | // Construct all leptons |
---|
| 91 | G4LeptonConstructor pConstructor; |
---|
| 92 | pConstructor.ConstructParticle(); |
---|
| 93 | } |
---|
| 94 | |
---|
| 95 | void TstVAPhysicsList::ConstructMesons() |
---|
| 96 | { |
---|
| 97 | // Construct all mesons |
---|
| 98 | G4MesonConstructor pConstructor; |
---|
| 99 | pConstructor.ConstructParticle(); |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | void TstVAPhysicsList::ConstructBaryons() |
---|
| 103 | { |
---|
| 104 | // Construct all baryons |
---|
| 105 | G4BaryonConstructor pConstructor; |
---|
| 106 | pConstructor.ConstructParticle(); |
---|
| 107 | } |
---|
| 108 | |
---|
| 109 | void TstVAPhysicsList::ConstructIons() |
---|
| 110 | { |
---|
| 111 | // Construct light ions |
---|
| 112 | G4IonConstructor pConstructor; |
---|
| 113 | pConstructor.ConstructParticle(); |
---|
| 114 | } |
---|
| 115 | |
---|
| 116 | void TstVAPhysicsList::ConstructProcess() |
---|
| 117 | { |
---|
| 118 | AddTransportation(); |
---|
| 119 | ConstructEM(); |
---|
| 120 | ConstructLeptHad(); |
---|
| 121 | ConstructHad(); |
---|
| 122 | ConstructGeneral(); |
---|
| 123 | } |
---|
| 124 | |
---|
| 125 | #include "G4ComptonScattering.hh" |
---|
| 126 | #include "G4GammaConversion.hh" |
---|
| 127 | #include "G4PhotoElectricEffect.hh" |
---|
| 128 | |
---|
| 129 | #include "G4MultipleScattering.hh" |
---|
| 130 | |
---|
| 131 | #include "G4eIonisation.hh" |
---|
| 132 | #include "G4eBremsstrahlung.hh" |
---|
| 133 | #include "G4eplusAnnihilation.hh" |
---|
| 134 | |
---|
| 135 | #include "G4MuIonisation.hh" |
---|
| 136 | #include "G4MuBremsstrahlung.hh" |
---|
| 137 | #include "G4MuPairProduction.hh" |
---|
| 138 | |
---|
| 139 | #include "G4hIonisation.hh" |
---|
| 140 | void TstVAPhysicsList::ConstructEM() |
---|
| 141 | { |
---|
| 142 | theParticleIterator->reset(); |
---|
| 143 | while( (*theParticleIterator)() ){ |
---|
| 144 | G4ParticleDefinition* particle = theParticleIterator->value(); |
---|
| 145 | G4ProcessManager* pmanager = particle->GetProcessManager(); |
---|
| 146 | G4String particleName = particle->GetParticleName(); |
---|
| 147 | |
---|
| 148 | if (particleName == "gamma") { |
---|
| 149 | // gamma |
---|
| 150 | // Construct processes for gamma |
---|
| 151 | pmanager->AddDiscreteProcess(new G4GammaConversion()); |
---|
| 152 | pmanager->AddDiscreteProcess(new G4ComptonScattering()); |
---|
| 153 | pmanager->AddDiscreteProcess(new G4PhotoElectricEffect()); |
---|
| 154 | |
---|
| 155 | } else if (particleName == "e-") { |
---|
| 156 | //electron |
---|
| 157 | // Construct processes for electron |
---|
| 158 | pmanager->AddProcess(new G4MultipleScattering(),-1,1,1); |
---|
| 159 | pmanager->AddProcess(new G4eIonisation(),-1,2,2); |
---|
| 160 | pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3); |
---|
| 161 | |
---|
| 162 | } else if (particleName == "e+") { |
---|
| 163 | //positron |
---|
| 164 | // Construct processes for positron |
---|
| 165 | pmanager->AddProcess(new G4MultipleScattering(),-1,1,1); |
---|
| 166 | |
---|
| 167 | pmanager->AddProcess(new G4eIonisation(),-1,2,2); |
---|
| 168 | pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3); |
---|
| 169 | pmanager->AddProcess(new G4eplusAnnihilation(),0,-1,4); |
---|
| 170 | |
---|
| 171 | } else if( particleName == "mu+" || |
---|
| 172 | particleName == "mu-" ) { |
---|
| 173 | //muon |
---|
| 174 | // Construct processes for muon+ |
---|
| 175 | pmanager->AddProcess(new G4MultipleScattering(),-1,1,1); |
---|
| 176 | pmanager->AddProcess(new G4MuIonisation(),-1,2,2); |
---|
| 177 | pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3); |
---|
| 178 | pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4); |
---|
| 179 | |
---|
| 180 | } else { |
---|
| 181 | if ((particle->GetPDGCharge() != 0.0) && |
---|
| 182 | (particle->GetParticleName() != "chargedgeantino")) { |
---|
| 183 | // all others charged particles except geantino |
---|
| 184 | pmanager->AddProcess(new G4MultipleScattering(),-1,1,1); |
---|
| 185 | pmanager->AddProcess(new G4hIonisation(),-1,2,2); |
---|
| 186 | } |
---|
| 187 | } |
---|
| 188 | } |
---|
| 189 | } |
---|
| 190 | |
---|
| 191 | void TstVAPhysicsList::ConstructHad() |
---|
| 192 | {;} |
---|
| 193 | |
---|
| 194 | void TstVAPhysicsList::ConstructLeptHad() |
---|
| 195 | {;} |
---|
| 196 | |
---|
| 197 | #include "G4Decay.hh" |
---|
| 198 | void TstVAPhysicsList::ConstructGeneral() |
---|
| 199 | { |
---|
| 200 | G4Decay* theDecayProcess = new G4Decay(); |
---|
| 201 | theParticleIterator->reset(); |
---|
| 202 | while( (*theParticleIterator)() ){ |
---|
| 203 | G4ParticleDefinition* particle = theParticleIterator->value(); |
---|
| 204 | G4ProcessManager* pmanager = particle->GetProcessManager(); |
---|
| 205 | if (theDecayProcess->IsApplicable(*particle)) { |
---|
| 206 | pmanager->AddProcess(theDecayProcess, INT_MAX, -1, INT_MAX); |
---|
| 207 | } |
---|
| 208 | } |
---|
| 209 | } |
---|
| 210 | |
---|
| 211 | void TstVAPhysicsList::SetCuts() |
---|
| 212 | { |
---|
| 213 | if (verboseLevel >1){ |
---|
| 214 | G4cout << "TstVAPhysicsList::SetCuts:"; |
---|
| 215 | } |
---|
| 216 | // " G4VUserPhysicsList::SetCutsWithDefault" method sets |
---|
| 217 | // the default cut value for all particle types |
---|
| 218 | SetCutsWithDefault(); |
---|
| 219 | } |
---|
| 220 | |
---|
| 221 | |
---|