Changeset 1230 for trunk/examples/extended/electromagnetic/TestEm0/src
- Timestamp:
- Jan 8, 2010, 3:02:48 PM (14 years ago)
- Location:
- trunk/examples/extended/electromagnetic/TestEm0/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/electromagnetic/TestEm0/src/DetectorConstruction.cc
r807 r1230 26 26 27 27 // 28 // $Id: DetectorConstruction.cc,v 1. 9 2006/12/08 16:38:38maire Exp $29 // GEANT4 tag $Name: $28 // $Id: DetectorConstruction.cc,v 1.10 2009/11/14 18:04:20 maire Exp $ 29 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 30 30 // 31 31 // … … 83 83 84 84 G4Element* H = new G4Element("Hydrogen" ,"H" , z= 1., a= 1.01*g/mole); 85 G4Element* C = new G4Element("Carbon" ,"C" , z= 6., a= 12.01*g/mole); 85 86 G4Element* N = new G4Element("Nitrogen" ,"N" , z= 7., a= 14.01*g/mole); 86 87 G4Element* O = new G4Element("Oxygen" ,"O" , z= 8., a= 16.00*g/mole); 87 88 G4Element* Ge = new G4Element("Germanium","Ge", z=32., a= 72.59*g/mole); 89 G4Element* Pb = new G4Element("Lead" ,"Pb", z=82., a= 207.19*g/mole); 88 90 G4Element* Bi = new G4Element("Bismuth" ,"Bi", z=83., a= 208.98*g/mole); 89 91 … … 110 112 ///H2O->SetChemicalFormula("H_2O"); 111 113 H2O->GetIonisation()->SetMeanExcitationEnergy(75.0*eV); 112 114 113 115 G4Material* steam = 114 116 new G4Material("WaterSteam", density= 1.0*mg/cm3, ncomponents=1); … … 132 134 new G4Material("Lead" , z=82., a=207.19*g/mole, density= 11.35*g/cm3); 133 135 new G4Material("Uranium" , z=92., a=238.03*g/mole, density= 18.95*g/cm3); 134 135 136 137 G4Material* ams = 138 new G4Material("ams", density= 7.409*g/cm3, ncomponents=3); 139 ams->AddElement(Pb, fractionmass = 94.81*perCent); 140 ams->AddElement(C , fractionmass = 4.79*perCent); 141 ams->AddElement(H , fractionmass = 0.40*perCent); 142 136 143 G4cout << *(G4Material::GetMaterialTable()) << G4endl; 137 144 } -
trunk/examples/extended/electromagnetic/TestEm0/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.2 2006/06/29 16:35:48 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm0/src/PhysListEmStandard.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysListEmStandard.cc,v 1. 2 2006/06/29 16:35:50 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: PhysListEmStandard.cc,v 1.3 2009/11/14 18:04:20 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 39 39 #include "G4PhotoElectricEffect.hh" 40 40 41 #include "G4MultipleScattering.hh" 42 41 #include "G4eMultipleScattering.hh" 43 42 #include "G4eIonisation.hh" 44 43 #include "G4eBremsstrahlung.hh" 45 44 #include "G4eplusAnnihilation.hh" 46 45 46 #include "G4MuMultipleScattering.hh" 47 47 #include "G4MuIonisation.hh" 48 48 #include "G4MuBremsstrahlung.hh" 49 49 #include "G4MuPairProduction.hh" 50 50 51 #include "G4hMultipleScattering.hh" 51 52 #include "G4hIonisation.hh" 52 53 #include "G4ionIonisation.hh" … … 83 84 } else if (particleName == "e-") { 84 85 //electron 85 pmanager->AddProcess(new G4 MultipleScattering, -1, 1,1);86 pmanager->AddProcess(new G4eIonisation, -1, 2,2);87 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);86 pmanager->AddProcess(new G4eMultipleScattering, -1, 1,1); 87 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 88 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 88 89 89 90 } else if (particleName == "e+") { 90 91 //positron 91 pmanager->AddProcess(new G4 MultipleScattering, -1, 1,1);92 pmanager->AddProcess(new G4eIonisation, -1, 2,2);93 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);94 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);92 pmanager->AddProcess(new G4eMultipleScattering, -1, 1,1); 93 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 94 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 95 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); 95 96 96 97 } else if( particleName == "mu+" || 97 98 particleName == "mu-" ) { 98 99 //muon 99 pmanager->AddProcess(new G4Mu ltipleScattering,-1, 1,1);100 pmanager->AddProcess(new G4MuIonisation, -1, 2,2);101 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3);102 pmanager->AddProcess(new G4MuPairProduction, -1, 4,4);100 pmanager->AddProcess(new G4MuMultipleScattering,-1, 1,1); 101 pmanager->AddProcess(new G4MuIonisation, -1, 2,2); 102 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3); 103 pmanager->AddProcess(new G4MuPairProduction, -1, 4,4); 103 104 104 105 } else if( particleName == "alpha" || particleName == "GenericIon" ) { 105 pmanager->AddProcess(new G4 MultipleScattering,-1, 1,1);106 pmanager->AddProcess(new G4ionIonisation, -1, 2,2);106 pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1); 107 pmanager->AddProcess(new G4ionIonisation, -1, 2,2); 107 108 108 109 } else if ((!particle->IsShortLived()) && … … 110 111 (particle->GetParticleName() != "chargedgeantino")) { 111 112 //all others charged particles except geantino 112 pmanager->AddProcess(new G4 MultipleScattering,-1,1,1);113 pmanager->AddProcess(new G4hIonisation, -1,2,2);113 pmanager->AddProcess(new G4hMultipleScattering,-1,1,1); 114 pmanager->AddProcess(new G4hIonisation, -1,2,2); 114 115 } 115 116 } -
trunk/examples/extended/electromagnetic/TestEm0/src/PhysicsList.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysicsList.cc,v 1. 5 2006/08/17 13:50:45 vnivanchExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02$27 // $Id: PhysicsList.cc,v 1.8 2009/11/17 22:48:26 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 35 36 36 #include "PhysListEmStandard.hh" 37 #include "G4EmLivermorePhysics.hh" 38 #include "G4EmPenelopePhysics.hh" 37 39 38 40 #include "G4LossTableManager.hh" … … 180 182 // Em options 181 183 // 184 // Main options and setting parameters are shown here. 185 // Several of them have default values. 186 // 182 187 G4EmProcessOptions emOptions; 183 emOptions.SetBuildCSDARange(true); 188 189 //physics tables 190 // 191 emOptions.SetMinEnergy(100*eV); //default 192 emOptions.SetMaxEnergy(100*TeV); //default 193 emOptions.SetDEDXBinning(12*20); //default=12*7 194 emOptions.SetLambdaBinning(12*20); //default=12*7 195 196 emOptions.SetBuildCSDARange(true); 184 197 emOptions.SetMaxEnergyForCSDARange(100*TeV); 185 emOptions.SetDEDXBinningForCSDARange(120); 198 emOptions.SetDEDXBinningForCSDARange(12*20); 199 200 emOptions.SetSplineFlag(true); //default 201 186 202 emOptions.SetVerbose(0); 187 203 } … … 202 218 delete emPhysicsList; 203 219 emPhysicsList = new PhysListEmStandard(name); 220 221 } else if (name == "penelope"){ 222 emName = name; 223 delete emPhysicsList; 224 emPhysicsList = new G4EmPenelopePhysics(); 225 226 } else if (name == "livermore"){ 227 emName = name; 228 delete emPhysicsList; 229 emPhysicsList = new G4EmLivermorePhysics(); 204 230 205 231 } else { … … 218 244 219 245 void PhysicsList::SetCuts() 220 { 246 { 247 // fixe lower limit for cut 248 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100*eV, 1*GeV); 249 221 250 // set cut values for gamma at first and for e- second and next for e+, 222 251 // because some processes for e+/e- need cut values for gamma -
trunk/examples/extended/electromagnetic/TestEm0/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.2 2006/06/29 16:35:55 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm0/src/PrimaryGeneratorAction.cc
r807 r1230 26 26 // 27 27 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:35:58 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm0/src/RunAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1. 9 2006/12/08 16:38:38maire Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: RunAction.cc,v 1.10 2007/12/17 17:22:44 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 59 59 //set precision for printing 60 60 G4int prec = G4cout.precision(6); 61 61 62 //instanciate EmCalculator 63 G4EmCalculator emCal; 64 // emCal.SetVerbose(2); 65 62 66 // get particle 63 67 G4ParticleDefinition* particle = primary->GetParticleGun() … … 77 81 << material->GetName() << " (density: " 78 82 << G4BestUnit(density,"Volumic Mass") << "; radiation length: " 79 << G4BestUnit(radl, "Length") << ")" << G4endl; 83 << G4BestUnit(radl, "Length") << ")" << G4endl; 80 84 81 85 // get cuts … … 90 94 << G4endl; 91 95 } 92 96 97 // max energy transfert 98 if (charge != 0.) { 99 G4double Mass_c2 = particle->GetPDGMass(); 100 G4double moverM = electron_mass_c2/Mass_c2; 101 G4double gamM1 = energy/Mass_c2, gam = gamM1 + 1., gamP1 = gam + 1.; 102 G4double Tmax = 103 (2*electron_mass_c2*gamM1*gamP1)/(1.+2*gam*moverM+moverM*moverM); 104 G4double range = emCal.GetCSDARange(Tmax,G4Electron::Electron(),material); 105 106 G4cout << "\n Max_energy _transferable : " << G4BestUnit(Tmax,"Energy") 107 << " (" << G4BestUnit(range,"Length") << ")" << G4endl; 108 } 109 93 110 // get processList and extract EM processes (but not MultipleScattering) 94 111 G4ProcessVector* plist = particle->GetProcessManager()->GetProcessList(); … … 114 131 G4cout << "\t" << std::setw(13) << emName[j] << "\t"; 115 132 G4cout << "\t" << std::setw(13) <<"total"; 116 117 //instanciate EmCalculator118 G4EmCalculator emCal;119 // emCal.SetVerbose(2);120 133 121 134 //compute cross section per atom (only for single material)
Note: See TracChangeset
for help on using the changeset viewer.