Changeset 1230 for trunk/examples/extended/electromagnetic/TestEm5/src
- Timestamp:
- Jan 8, 2010, 3:02:48 PM (15 years ago)
- Location:
- trunk/examples/extended/electromagnetic/TestEm5/src
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/electromagnetic/TestEm5/src/DetectorConstruction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: DetectorConstruction.cc,v 1.1 3 2006/09/25 17:06:29 maireExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: DetectorConstruction.cc,v 1.15 2009/01/22 17:41:43 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 46 46 #include "G4UnitsTable.hh" 47 47 #include "G4NistManager.hh" 48 #include "G4RunManager.hh" 48 49 49 50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 88 89 void DetectorConstruction::DefineMaterials() 89 90 { 90 //This function illustrates the possible ways to define materials91 //This function illustrates the possible ways to define materials 91 92 92 G4String symbol; //a=mass of a mole; 93 G4double a, z, density; //z=mean number of protons; 94 95 G4int ncomponents, natoms; 96 G4double fractionmass; 97 G4double temperature, pressure; 98 99 // 100 // define Elements 101 // 102 103 G4Element* H = new G4Element("Hydrogen",symbol="H", z= 1, a= 1.01*g/mole); 104 G4Element* C = new G4Element("Carbon", symbol="C", z= 6, a= 12.01*g/mole); 105 G4Element* N = new G4Element("Nitrogen",symbol="N", z= 7, a= 14.01*g/mole); 106 G4Element* O = new G4Element("Oxygen", symbol="O", z= 8, a= 16.00*g/mole); 107 G4Element* Na = new G4Element("Sodium", symbol="Na", z=11, a= 22.99*g/mole); 108 G4Element* Ar = new G4Element("Argon", symbol="Ar", z=18, a= 39.95*g/mole); 109 G4Element* I = new G4Element("Iodine", symbol="I" , z=53, a= 126.90*g/mole); 110 G4Element* Xe = new G4Element("Xenon", symbol="Xe", z=54, a= 131.29*g/mole); 111 112 // 113 // define simple materials 114 // 115 116 new G4Material("H2Liq" , z= 1, a= 1.01*g/mole, density= 70.8*mg/cm3); 117 new G4Material("Beryllium", z= 4, a= 9.01*g/mole, density= 1.848*g/cm3); 118 new G4Material("Aluminium", z=13, a=26.98*g/mole, density= 2.700*g/cm3); 119 new G4Material("Silicon" , z=14, a=28.09*g/mole, density= 2.330*g/cm3); 120 121 G4Material* lAr = 122 new G4Material("liquidArgon", density= 1.390*g/cm3, ncomponents=1); 123 lAr->AddElement(Ar, natoms=1); 124 125 new G4Material("Iron", z=26, a= 55.85*g/mole, density= 7.870*g/cm3); 126 new G4Material("Copper", z=29, a= 63.55*g/mole, density= 8.960*g/cm3); 127 new G4Material("Silver", z=47, a=107.87*g/mole, density= 10.50*g/cm3); 128 new G4Material("Tungsten", z=74, a=183.85*g/mole, density= 19.30*g/cm3); 129 new G4Material("Gold", z=79, a=196.97*g/mole, density= 19.32*g/cm3); 130 new G4Material("Lead", z=82, a=207.19*g/mole, density= 11.35*g/cm3); 131 132 // 133 // define a material from elements. case 1: chemical molecule 134 // 135 136 G4Material* H2O = new G4Material("Water", density= 1.000*g/cm3, ncomponents=2); 137 H2O->AddElement(H, natoms=2); 138 H2O->AddElement(O, natoms=1); 139 H2O->GetIonisation()->SetMeanExcitationEnergy(75*eV); 140 141 G4Material* CH = new G4Material("Plastic", density= 1.04*g/cm3, ncomponents=2); 142 CH->AddElement(C, natoms=1); 143 CH->AddElement(H, natoms=1); 144 145 G4Material* NaI = new G4Material("NaI", density= 3.67*g/cm3, ncomponents=2); 146 NaI->AddElement(Na, natoms=1); 147 NaI->AddElement(I , natoms=1); 148 NaI->GetIonisation()->SetMeanExcitationEnergy(452*eV); 149 150 // 151 // define a material from elements. case 2: mixture by fractional mass 152 // 153 154 G4Material* Air = new G4Material("Air", density= 1.290*mg/cm3, ncomponents=2); 155 Air->AddElement(N, fractionmass=0.7); 156 Air->AddElement(O, fractionmass=0.3); 157 158 G4Material* Air20 = 159 new G4Material("Air20", density= 1.205*mg/cm3, ncomponents=2, 160 kStateGas, 293.*kelvin, 1.*atmosphere); 161 Air20->AddElement(N, fractionmass=0.7); 162 Air20->AddElement(O, fractionmass=0.3); 163 164 //Graphite 165 // 166 G4Material* Graphite = 167 new G4Material("Graphite", density= 1.7*g/cm3, ncomponents=1); 168 Graphite->AddElement(C, fractionmass=1.); 169 170 //Havar 171 // 172 G4Element* Cr = new G4Element("Chrome", "Cr", z=25, a= 51.996*g/mole); 173 G4Element* Fe = new G4Element("Iron" , "Fe", z=26, a= 55.845*g/mole); 174 G4Element* Co = new G4Element("Cobalt", "Co", z=27, a= 58.933*g/mole); 175 G4Element* Ni = new G4Element("Nickel", "Ni", z=28, a= 58.693*g/mole); 176 G4Element* W = new G4Element("Tungsten","W", z=74, a= 183.850*g/mole); 177 178 G4Material* Havar = 179 new G4Material("Havar", density= 8.3*g/cm3, ncomponents=5); 180 Havar->AddElement(Cr, fractionmass=0.1785); 181 Havar->AddElement(Fe, fractionmass=0.1822); 182 Havar->AddElement(Co, fractionmass=0.4452); 183 Havar->AddElement(Ni, fractionmass=0.1310); 184 Havar->AddElement(W , fractionmass=0.0631); 185 186 // 187 // examples of gas 188 // 189 new G4Material("ArgonGas", z=18, a=39.948*g/mole, density= 1.782*mg/cm3, 190 kStateGas, 273.15*kelvin, 1*atmosphere); 93 G4String symbol; //a=mass of a mole; 94 G4double a, z, density; //z=mean number of protons; 95 96 G4int ncomponents, natoms; 97 G4double fractionmass; 98 G4double temperature, pressure; 99 100 // 101 // define Elements 102 // 103 104 G4Element* H = new G4Element("Hydrogen",symbol="H", z= 1, a= 1.01*g/mole); 105 G4Element* C = new G4Element("Carbon", symbol="C", z= 6, a= 12.01*g/mole); 106 G4Element* N = new G4Element("Nitrogen",symbol="N", z= 7, a= 14.01*g/mole); 107 G4Element* O = new G4Element("Oxygen", symbol="O", z= 8, a= 16.00*g/mole); 108 G4Element* Na = new G4Element("Sodium", symbol="Na", z=11, a= 22.99*g/mole); 109 G4Element* Ar = new G4Element("Argon", symbol="Ar", z=18, a= 39.95*g/mole); 110 G4Element* I = new G4Element("Iodine", symbol="I" , z=53, a= 126.90*g/mole); 111 G4Element* Xe = new G4Element("Xenon", symbol="Xe", z=54, a= 131.29*g/mole); 112 113 // 114 // define simple materials 115 // 116 117 new G4Material("H2Liq" , z= 1, a= 1.01*g/mole, density= 70.8*mg/cm3); 118 new G4Material("Beryllium", z= 4, a= 9.01*g/mole, density= 1.848*g/cm3); 119 new G4Material("Aluminium", z=13, a=26.98*g/mole, density= 2.700*g/cm3); 120 new G4Material("Silicon" , z=14, a=28.09*g/mole, density= 2.330*g/cm3); 121 122 G4Material* lAr = 123 new G4Material("liquidArgon", density= 1.390*g/cm3, ncomponents=1); 124 lAr->AddElement(Ar, natoms=1); 125 126 new G4Material("Iron", z=26, a= 55.85*g/mole, density= 7.870*g/cm3); 127 new G4Material("Copper", z=29, a= 63.55*g/mole, density= 8.960*g/cm3); 128 new G4Material("Germanium",z=32, a= 72.61*g/mole, density= 5.323*g/cm3); 129 new G4Material("Silver", z=47, a=107.87*g/mole, density= 10.50*g/cm3); 130 new G4Material("Tungsten", z=74, a=183.85*g/mole, density= 19.30*g/cm3); 131 new G4Material("Gold", z=79, a=196.97*g/mole, density= 19.32*g/cm3); 132 new G4Material("Lead", z=82, a=207.19*g/mole, density= 11.35*g/cm3); 133 134 // 135 // define a material from elements. case 1: chemical molecule 136 // 137 138 G4Material* H2O = new G4Material("Water", density= 1.000*g/cm3, ncomponents=2); 139 H2O->AddElement(H, natoms=2); 140 H2O->AddElement(O, natoms=1); 141 H2O->GetIonisation()->SetMeanExcitationEnergy(75*eV); 142 143 G4Material* CH = new G4Material("Plastic", density= 1.04*g/cm3, ncomponents=2); 144 CH->AddElement(C, natoms=1); 145 CH->AddElement(H, natoms=1); 146 147 G4Material* NaI = new G4Material("NaI", density= 3.67*g/cm3, ncomponents=2); 148 NaI->AddElement(Na, natoms=1); 149 NaI->AddElement(I , natoms=1); 150 NaI->GetIonisation()->SetMeanExcitationEnergy(452*eV); 151 152 // 153 // define a material from elements. case 2: mixture by fractional mass 154 // 155 156 G4Material* Air = new G4Material("Air", density= 1.290*mg/cm3, ncomponents=2); 157 Air->AddElement(N, fractionmass=0.7); 158 Air->AddElement(O, fractionmass=0.3); 159 160 G4Material* Air20 = 161 new G4Material("Air20", density= 1.205*mg/cm3, ncomponents=2, 162 kStateGas, 293.*kelvin, 1.*atmosphere); 163 Air20->AddElement(N, fractionmass=0.7); 164 Air20->AddElement(O, fractionmass=0.3); 165 166 //Graphite 167 // 168 G4Material* Graphite = 169 new G4Material("Graphite", density= 1.7*g/cm3, ncomponents=1); 170 Graphite->AddElement(C, fractionmass=1.); 171 172 //Havar 173 // 174 G4Element* Cr = new G4Element("Chrome", "Cr", z=25, a= 51.996*g/mole); 175 G4Element* Fe = new G4Element("Iron" , "Fe", z=26, a= 55.845*g/mole); 176 G4Element* Co = new G4Element("Cobalt", "Co", z=27, a= 58.933*g/mole); 177 G4Element* Ni = new G4Element("Nickel", "Ni", z=28, a= 58.693*g/mole); 178 G4Element* W = new G4Element("Tungsten","W", z=74, a= 183.850*g/mole); 179 180 G4Material* Havar = 181 new G4Material("Havar", density= 8.3*g/cm3, ncomponents=5); 182 Havar->AddElement(Cr, fractionmass=0.1785); 183 Havar->AddElement(Fe, fractionmass=0.1822); 184 Havar->AddElement(Co, fractionmass=0.4452); 185 Havar->AddElement(Ni, fractionmass=0.1310); 186 Havar->AddElement(W , fractionmass=0.0631); 187 188 // 189 // examples of gas 190 // 191 new G4Material("ArgonGas", z=18, a=39.948*g/mole, density= 1.782*mg/cm3, 192 kStateGas, 273.15*kelvin, 1*atmosphere); 191 193 192 new G4Material("XenonGas", z=54, a=131.29*g/mole, density= 5.458*mg/cm3,193 194 new G4Material("XenonGas", z=54, a=131.29*g/mole, density= 5.458*mg/cm3, 195 kStateGas, 293.15*kelvin, 1*atmosphere); 194 196 195 G4Material* CO2 =196 new G4Material("CarbonicGas", density= 1.977*mg/cm3, ncomponents=2);197 CO2->AddElement(C, natoms=1);198 CO2->AddElement(O, natoms=2);199 200 G4Material* ArCO2 =201 new G4Material("ArgonCO2", density= 1.8223*mg/cm3, ncomponents=2);202 ArCO2->AddElement (Ar, fractionmass=0.7844);203 ArCO2->AddMaterial(CO2, fractionmass=0.2156);204 205 //another way to define mixture of gas per volume206 G4Material* NewArCO2 =207 new G4Material("NewArgonCO2", density= 1.8223*mg/cm3, ncomponents=3);208 NewArCO2->AddElement (Ar, natoms=8);209 NewArCO2->AddElement (C, natoms=2);210 NewArCO2->AddElement (O, natoms=4);211 212 G4Material* ArCH4 =213 new G4Material("ArgonCH4", density= 1.709*mg/cm3, ncomponents=3);214 ArCH4->AddElement (Ar, natoms=93);215 ArCH4->AddElement (C, natoms=7);216 ArCH4->AddElement (H, natoms=28);217 218 G4Material* XeCH =219 new G4Material("XenonMethanePropane", density= 4.9196*mg/cm3, ncomponents=3,220 221 XeCH->AddElement (Xe, natoms=875);222 XeCH->AddElement (C, natoms=225);223 XeCH->AddElement (H, natoms=700);224 225 G4Material* steam =226 new G4Material("WaterSteam", density= 1.0*mg/cm3, ncomponents=1);227 steam->AddMaterial(H2O, fractionmass=1.);228 steam->GetIonisation()->SetMeanExcitationEnergy(71.6*eV);229 230 //231 // example of vacuum232 //233 234 density = universe_mean_density; //from PhysicalConstants.h235 pressure = 3.e-18*pascal;236 temperature = 2.73*kelvin;237 new G4Material("Galactic", z=1, a=1.01*g/mole,density,238 197 G4Material* CO2 = 198 new G4Material("CarbonicGas", density= 1.977*mg/cm3, ncomponents=2); 199 CO2->AddElement(C, natoms=1); 200 CO2->AddElement(O, natoms=2); 201 202 G4Material* ArCO2 = 203 new G4Material("ArgonCO2", density= 1.8223*mg/cm3, ncomponents=2); 204 ArCO2->AddElement (Ar, fractionmass=0.7844); 205 ArCO2->AddMaterial(CO2, fractionmass=0.2156); 206 207 //another way to define mixture of gas per volume 208 G4Material* NewArCO2 = 209 new G4Material("NewArgonCO2", density= 1.8223*mg/cm3, ncomponents=3); 210 NewArCO2->AddElement (Ar, natoms=8); 211 NewArCO2->AddElement (C, natoms=2); 212 NewArCO2->AddElement (O, natoms=4); 213 214 G4Material* ArCH4 = 215 new G4Material("ArgonCH4", density= 1.709*mg/cm3, ncomponents=3); 216 ArCH4->AddElement (Ar, natoms=93); 217 ArCH4->AddElement (C, natoms=7); 218 ArCH4->AddElement (H, natoms=28); 219 220 G4Material* XeCH = 221 new G4Material("XenonMethanePropane", density= 4.9196*mg/cm3, ncomponents=3, 222 kStateGas, 293.15*kelvin, 1*atmosphere); 223 XeCH->AddElement (Xe, natoms=875); 224 XeCH->AddElement (C, natoms=225); 225 XeCH->AddElement (H, natoms=700); 226 227 G4Material* steam = 228 new G4Material("WaterSteam", density= 1.0*mg/cm3, ncomponents=1); 229 steam->AddMaterial(H2O, fractionmass=1.); 230 steam->GetIonisation()->SetMeanExcitationEnergy(71.6*eV); 231 232 // 233 // example of vacuum 234 // 235 236 density = universe_mean_density; //from PhysicalConstants.h 237 pressure = 3.e-18*pascal; 238 temperature = 2.73*kelvin; 239 new G4Material("Galactic", z=1, a=1.01*g/mole,density, 240 kStateGas,temperature,pressure); 239 241 } 240 242 … … 300 302 0); //copy number 301 303 302 304 PrintCalorParameters(); 303 305 304 306 //always return the physical World … … 336 338 G4NistManager::Instance()->FindOrBuildMaterial(materialChoice); 337 339 338 if (pttoMaterial) AbsorberMaterial = pttoMaterial; 340 if (pttoMaterial && AbsorberMaterial != pttoMaterial) { 341 AbsorberMaterial = pttoMaterial; 342 if(logicAbsorber) logicAbsorber->SetMaterial(AbsorberMaterial); 343 G4RunManager::GetRunManager()->PhysicsHasBeenModified(); 344 } 339 345 } 340 346 … … 347 353 G4NistManager::Instance()->FindOrBuildMaterial(materialChoice); 348 354 349 if (pttoMaterial) WorldMaterial = pttoMaterial; 355 if (pttoMaterial && WorldMaterial != pttoMaterial) { 356 WorldMaterial = pttoMaterial; 357 if(logicWorld) logicWorld->SetMaterial(WorldMaterial); 358 G4RunManager::GetRunManager()->PhysicsHasBeenModified(); 359 } 350 360 } 351 361 … … 355 365 { 356 366 AbsorberThickness = val; 367 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 357 368 } 358 369 … … 362 373 { 363 374 AbsorberSizeYZ = val; 375 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 364 376 } 365 377 … … 370 382 WorldSizeX = val; 371 383 defaultWorld = false; 384 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 372 385 } 373 386 … … 378 391 WorldSizeYZ = val; 379 392 defaultWorld = false; 393 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 380 394 } 381 395 … … 385 399 { 386 400 XposAbs = val; 401 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 387 402 } 388 403 … … 412 427 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 413 428 414 #include "G4RunManager.hh"415 416 429 void DetectorConstruction::UpdateGeometry() 417 430 { 431 G4RunManager::GetRunManager()->PhysicsHasBeenModified(); 418 432 G4RunManager::GetRunManager()->DefineWorldVolume(ConstructCalorimeter()); 419 433 } -
trunk/examples/extended/electromagnetic/TestEm5/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.4 2006/06/29 16:55:32 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/TestEm5/src/EventAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: EventAction.cc,v 1. 6 2006/06/29 16:55:34 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: EventAction.cc,v 1.7 2009/03/06 18:04:23 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/src/EventMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventMessenger.cc,v 1.5 2006/06/29 16:55:36 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/TestEm5/src/HistoManager.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoManager.cc,v 1.2 1 2007/11/28 12:37:56maire Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: HistoManager.cc,v 1.26 2008/09/13 17:05:40 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 54 54 55 55 fileName[0] = "testem5"; 56 fileType = " hbook";57 fileOption = "--noErrors uncompress";56 fileType = "root"; 57 fileOption = "--noErrors export=root uncompress"; 58 58 // histograms 59 59 for (G4int k=0; k<MaxHisto; k++) { … … 199 199 "dummy","dummy","dummy","dummy","dummy","dummy", //34-39 200 200 "(reflect , neutral) : kinetic energy at exit", //40 201 "(reflect , neutral) : ener fluence: dE(MeV)/dOmega" //41201 "(reflect , neutral) : ener fluence: dE(MeV)/dOmega", //41 202 202 "(reflect , neutral) : space angle: dN/dOmega", //42 203 203 "(reflect , neutral) : projected angle at exit", //43 … … 245 245 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 246 246 247 void HistoManager::Scale(G4int ih, G4double fac) 248 { 249 if (ih > MaxHisto) { 250 G4cout << "---> warning from HistoManager::Scale() : histo " << ih 251 << "does not exist. (fac = " << fac << ")" << G4endl; 252 return; 253 } 254 #ifdef G4ANALYSIS_USE 255 if(exist[ih]) histo[ih]->scale(fac); 256 #endif 257 } 258 259 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 260 247 261 void HistoManager::PrintHisto(G4int ih) 248 262 { 249 if (ih < MaxHisto) ascii[ih] = true;263 if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; } 250 264 else 251 265 G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih … … 260 274 { 261 275 #ifdef G4ANALYSIS_USE 276 277 if (!ascii[0]) return; 262 278 263 279 G4String name = fileName[0] + ".ascii"; … … 273 289 for (G4int iBin=0; iBin<Nbins[ih]; iBin++) { 274 290 File << " " << iBin << "\t" 275 << histo[ih]->binMean(iBin) << "\t" 291 << 0.5*(histo[ih]->axis().binLowerEdge(iBin) + 292 histo[ih]->axis().binUpperEdge(iBin)) << "\t" 276 293 << histo[ih]->binHeight(iBin) 277 294 << G4endl; -
trunk/examples/extended/electromagnetic/TestEm5/src/HistoMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.cc,v 1.8 2007/11/12 17:48:16 maire 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/TestEm5/src/PhysListEmStandard.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysListEmStandard.cc,v 1. 14 2007/11/21 17:41:19maire Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: PhysListEmStandard.cc,v 1.24 2009/11/15 22:10:03 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 38 38 #include "G4PhotoElectricEffect.hh" 39 39 40 #include "G4 MultipleScattering.hh"41 40 #include "G4eMultipleScattering.hh" 41 #include "G4UrbanMscModel93.hh" 42 42 #include "G4eIonisation.hh" 43 43 #include "G4eBremsstrahlung.hh" 44 44 #include "G4eplusAnnihilation.hh" 45 45 46 #include "G4MuMultipleScattering.hh" 46 47 #include "G4MuIonisation.hh" 47 48 #include "G4MuBremsstrahlung.hh" 48 49 #include "G4MuPairProduction.hh" 49 50 51 #include "G4hMultipleScattering.hh" 50 52 #include "G4hIonisation.hh" 53 #include "G4hBremsstrahlung.hh" 54 #include "G4hPairProduction.hh" 55 51 56 #include "G4ionIonisation.hh" 57 #include "G4IonParametrisedLossModel.hh" 58 #include "G4NuclearStopping.hh" 52 59 53 60 #include "G4EmProcessOptions.hh" … … 86 93 } else if (particleName == "e-") { 87 94 //electron 88 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); 89 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 90 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 95 G4eMultipleScattering* msc = new G4eMultipleScattering(); 96 msc->AddEmModel(0, new G4UrbanMscModel93()); 97 pmanager->AddProcess(msc, -1, 1, 1); 98 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 99 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 91 100 92 101 } else if (particleName == "e+") { 93 102 //positron 94 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); 95 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 96 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 97 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); 103 G4eMultipleScattering* msc = new G4eMultipleScattering(); 104 msc->AddEmModel(0, new G4UrbanMscModel93()); 105 pmanager->AddProcess(msc, -1, 1, 1); 106 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 107 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 108 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4); 98 109 99 110 } else if (particleName == "mu+" || 100 111 particleName == "mu-" ) { 101 112 //muon 102 pmanager->AddProcess(new G4Mu ltipleScattering, -1, 1,1);103 pmanager->AddProcess(new G4MuIonisation, -1, 2,2);104 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3);105 pmanager->AddProcess(new G4MuPairProduction, -1, 4,4);113 pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1); 114 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2); 115 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3); 116 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4); 106 117 107 } else if (particleName == "alpha" || particleName == "GenericIon" ) { 108 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); 109 pmanager->AddProcess(new G4ionIonisation, -1, 2,2); 118 } else if( particleName == "proton" || 119 particleName == "pi-" || 120 particleName == "pi+" ) { 121 //proton 122 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 123 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 124 pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3); 125 pmanager->AddProcess(new G4hPairProduction, -1, 4, 4); 110 126 127 } else if( particleName == "alpha" || 128 particleName == "He3" ) { 129 //alpha 130 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 131 pmanager->AddProcess(new G4ionIonisation, -1, 2, 2); 132 pmanager->AddProcess(new G4NuclearStopping, -1, 3,-1); 133 134 } else if( particleName == "GenericIon" ) { 135 //Ions 136 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 137 G4ionIonisation* ionIoni = new G4ionIonisation(); 138 ionIoni->SetEmModel(new G4IonParametrisedLossModel()); 139 pmanager->AddProcess(ionIoni, -1, 2, 2); 140 pmanager->AddProcess(new G4NuclearStopping, -1, 3,-1); 141 111 142 } else if ((!particle->IsShortLived()) && 112 143 (particle->GetPDGCharge() != 0.0) && 113 144 (particle->GetParticleName() != "chargedgeantino")) { 114 145 //all others charged particles except geantino 115 pmanager->AddProcess(new G4 MultipleScattering, -1,1,1);116 pmanager->AddProcess(new G4hIonisation, -1,2,2);146 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 147 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 117 148 } 118 149 } … … 120 151 // Em options 121 152 // 153 // Main options and setting parameters are shown here. 154 // Several of them have default values. 155 // 122 156 G4EmProcessOptions emOptions; 123 124 //coulomb scattering125 //126 emOptions.SetMscStepLimitation(fUseDistanceToBoundary);127 emOptions.SetSkin(4.);128 157 129 158 //physics tables 130 159 // 131 emOptions.SetMinEnergy(100*eV); 132 emOptions.SetMaxEnergy(100*TeV); 133 emOptions.SetDEDXBinning(1200); 134 emOptions.SetLambdaBinning(1200); 135 160 emOptions.SetMinEnergy(100*eV); //default 161 emOptions.SetMaxEnergy(100*TeV); //default 162 emOptions.SetDEDXBinning(12*20); //default=12*7 163 emOptions.SetLambdaBinning(12*20); //default=12*7 164 emOptions.SetSplineFlag(true); //default 165 166 //multiple coulomb scattering 167 // 168 emOptions.SetMscStepLimitation(fUseDistanceToBoundary); //default=fUseSafety 169 emOptions.SetMscRangeFactor(0.04); //default 170 emOptions.SetMscGeomFactor (2.5); //default 171 emOptions.SetSkin(3.); //default 172 136 173 //energy loss 137 174 // 138 emOptions.Set LinearLossLimit(1.e-6);139 emOptions.Set StepFunction(0.2, 100*um);175 emOptions.SetStepFunction(0.2, 100*um); //default=(0.2, 1*mm) 176 emOptions.SetLinearLossLimit(1.e-2); //default 140 177 141 178 //ionization 142 179 // 143 emOptions.SetSubCutoff(false); 180 emOptions.SetSubCutoff(false); //default 144 181 } 145 182 -
trunk/examples/extended/electromagnetic/TestEm5/src/PhysListEmStandardSS.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysListEmStandardSS.cc,v 1. 3 2007/07/31 16:51:29maire Exp $27 // GEANT4 tag $Name: $26 // $Id: PhysListEmStandardSS.cc,v 1.6 2008/11/16 18:51:42 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 31 31 32 32 #include "PhysListEmStandardSS.hh" 33 33 34 #include "G4ParticleDefinition.hh" 34 35 #include "G4ProcessManager.hh" … … 38 39 #include "G4PhotoElectricEffect.hh" 39 40 40 #include "G4 MultipleScattering.hh"41 #include "G4CoulombScattering.hh" 41 42 42 43 #include "G4eIonisation.hh" … … 50 51 #include "G4hIonisation.hh" 51 52 #include "G4ionIonisation.hh" 52 #include "G4CoulombScattering.hh" 53 54 #include "G4EmProcessOptions.hh" 53 55 54 56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 83 85 } else if (particleName == "e-") { 84 86 //electron 85 pmanager->Add Process(new G4eIonisation, -1, 1,1);86 pmanager->AddProcess(new G4e Bremsstrahlung, -1, 2,2);87 pmanager->Add DiscreteProcess(new G4CoulombScattering);87 pmanager->AddDiscreteProcess(new G4CoulombScattering); 88 pmanager->AddProcess(new G4eIonisation, -1, 1, 1); 89 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2); 88 90 89 91 } else if (particleName == "e+") { 90 92 //positron 91 pmanager->Add Process(new G4eIonisation, -1, 1,1);92 pmanager->AddProcess(new G4e Bremsstrahlung, -1, 2,2);93 pmanager->AddProcess(new G4e plusAnnihilation, 0,-1,3);94 pmanager->Add DiscreteProcess(new G4CoulombScattering);93 pmanager->AddDiscreteProcess(new G4CoulombScattering); 94 pmanager->AddProcess(new G4eIonisation, -1, 1, 1); 95 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2); 96 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 3); 95 97 96 98 } else if (particleName == "mu+" || 97 99 particleName == "mu-" ) { 98 //muon 99 pmanager->Add Process(new G4MuIonisation, -1, 1,1);100 pmanager->AddProcess(new G4Mu Bremsstrahlung, -1, 2,2);101 pmanager->AddProcess(new G4Mu PairProduction, -1, 3,3);102 pmanager->Add DiscreteProcess(new G4CoulombScattering);100 //muon 101 pmanager->AddDiscreteProcess(new G4CoulombScattering); 102 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1); 103 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2); 104 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3); 103 105 104 106 } else if (particleName == "alpha" || particleName == "He3") { 105 pmanager->Add Process(new G4ionIonisation, -1, 1,1);106 pmanager->Add DiscreteProcess(new G4CoulombScattering);107 pmanager->AddDiscreteProcess(new G4CoulombScattering); 108 pmanager->AddProcess(new G4ionIonisation, -1, 1, 1); 107 109 108 110 } else if (particleName == "GenericIon" ) { 109 pmanager->AddProcess(new G4ionIonisation, -1, 1,1);110 111 G4CoulombScattering* cs = new G4CoulombScattering(); 111 112 cs->SetBuildTableFlag(false); 112 113 pmanager->AddDiscreteProcess(cs); 113 114 pmanager->AddProcess(new G4ionIonisation, -1, 1, 1); 114 115 115 116 } else if ((!particle->IsShortLived()) && … … 117 118 (particle->GetParticleName() != "chargedgeantino")) { 118 119 //all others charged particles except geantino 119 pmanager->Add Process(new G4hIonisation, -1,1,1);120 pmanager->Add DiscreteProcess(new G4CoulombScattering);120 pmanager->AddDiscreteProcess(new G4CoulombScattering); 121 pmanager->AddProcess(new G4hIonisation, -1, 1, 1); 121 122 } 122 123 } 124 125 // Em options 126 // 127 // Main options and setting parameters are shown here. 128 // Several of them have default values. 129 // 130 G4EmProcessOptions emOptions; 131 132 //physics tables 133 // 134 emOptions.SetMinEnergy(100*eV); //default 135 emOptions.SetMaxEnergy(100*TeV); //default 136 emOptions.SetDEDXBinning(12*20); //default=12*7 137 emOptions.SetLambdaBinning(12*20); //default=12*7 138 emOptions.SetSplineFlag(true); //default 139 140 //energy loss 141 // 142 emOptions.SetStepFunction(0.2, 100*um); //default=(0.2, 1*mm) 143 emOptions.SetLinearLossLimit(1.e-2); //default 144 145 //ionization 146 // 147 emOptions.SetSubCutoff(false); //default 123 148 } 124 149 -
trunk/examples/extended/electromagnetic/TestEm5/src/PhysicsList.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.cc,v 1. 21 2007/11/19 14:57:07 vnivanchExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: PhysicsList.cc,v 1.40 2009/11/15 22:10:03 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 35 #include "PhysListEmStandard.hh" 36 36 #include "PhysListEmStandardSS.hh" 37 #include "PhysListEmStandardIG.hh" 38 #include "PhysListEmLivermore.hh" 39 #include "PhysListEmPenelope.hh" 37 #include "PhysListEmStandardGS.hh" 40 38 41 39 #include "G4EmStandardPhysics.hh" 42 40 #include "G4EmStandardPhysics_option1.hh" 43 41 #include "G4EmStandardPhysics_option2.hh" 44 45 #include "G4HadronElasticPhysics.hh" 46 #include "G4HadronDElasticPhysics.hh" 47 #include "G4HadronHElasticPhysics.hh" 48 #include "G4HadronQElasticPhysics.hh" 49 #include "G4HadronInelasticQBBC.hh" 50 #include "G4IonBinaryCascadePhysics.hh" 51 52 #include "G4LossTableManager.hh" 42 #include "G4EmStandardPhysics_option3.hh" 43 #include "G4EmLivermorePhysics.hh" 44 #include "G4EmPenelopePhysics.hh" 45 46 #include "G4Decay.hh" 47 #include "StepMax.hh" 48 53 49 #include "G4UnitsTable.hh" 54 50 55 51 #include "G4ParticleDefinition.hh" 56 52 #include "G4ProcessManager.hh" 57 #include "G4Decay.hh"58 #include "StepMax.hh"59 53 60 54 // Bosons … … 84 78 PhysicsList::PhysicsList() : G4VModularPhysicsList() 85 79 { 86 G4LossTableManager::Instance();87 80 pMessenger = new PhysicsListMessenger(this); 88 81 89 82 // EM physics 90 emName = G4String(" standard");83 emName = G4String("local"); 91 84 emPhysicsList = new PhysListEmStandard(emName); 92 93 helIsRegisted = false; 94 bicIsRegisted = false; 95 biciIsRegisted = false; 96 97 stepMaxProcess = 0; 98 85 99 86 defaultCutValue = 1.*mm; 87 100 88 cutForGamma = defaultCutValue; 101 89 cutForElectron = defaultCutValue; … … 110 98 { 111 99 delete emPhysicsList; 112 for(size_t i=0; i<hadronPhys.size(); i++) delete hadronPhys[i];113 100 delete pMessenger; 114 101 } … … 118 105 void PhysicsList::ConstructParticle() 119 106 { 120 // pseudo-particles107 // pseudo-particles 121 108 G4Geantino::GeantinoDefinition(); 122 109 G4ChargedGeantino::ChargedGeantinoDefinition(); 123 110 124 // gamma111 // gamma 125 112 G4Gamma::GammaDefinition(); 126 113 127 // optical photon 128 G4OpticalPhoton::OpticalPhotonDefinition(); 129 130 // leptons 114 // leptons 131 115 G4Electron::ElectronDefinition(); 132 116 G4Positron::PositronDefinition(); … … 139 123 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition(); 140 124 141 // mesons125 // mesons 142 126 G4MesonConstructor mConstructor; 143 127 mConstructor.ConstructParticle(); 144 128 145 // barions129 // barions 146 130 G4BaryonConstructor bConstructor; 147 131 bConstructor.ConstructParticle(); 148 132 149 // ions133 // ions 150 134 G4IonConstructor iConstructor; 151 135 iConstructor.ConstructParticle(); … … 158 142 AddTransportation(); 159 143 emPhysicsList->ConstructProcess(); 160 for(size_t i=0; i<hadronPhys.size(); i++) hadronPhys[i]->ConstructProcess();161 144 AddDecay(); 162 145 AddStepMax(); … … 193 176 { 194 177 // Step limitation seen as a process 195 stepMaxProcess = new StepMax();178 StepMax* stepMaxProcess = new StepMax(); 196 179 197 180 theParticleIterator->reset(); … … 217 200 if (name == emName) return; 218 201 219 if (name == " standard") {202 if (name == "local") { 220 203 221 204 emName = name; … … 223 206 emPhysicsList = new PhysListEmStandard(name); 224 207 225 } else if (name == "emstandard ") {208 } else if (name == "emstandard_opt0") { 226 209 227 210 emName = name; … … 240 223 delete emPhysicsList; 241 224 emPhysicsList = new G4EmStandardPhysics_option2(); 242 225 226 } else if (name == "emstandard_opt3") { 227 228 emName = name; 229 delete emPhysicsList; 230 emPhysicsList = new G4EmStandardPhysics_option3(); 231 243 232 } else if (name == "standardSS") { 244 233 … … 246 235 delete emPhysicsList; 247 236 emPhysicsList = new PhysListEmStandardSS(name); 248 249 } else if (name == "standardIG") { 250 251 emName = name; 252 delete emPhysicsList; 253 emPhysicsList = new PhysListEmStandardIG(name); 254 255 } else if (name == "livermore") { 256 257 emName = name; 258 delete emPhysicsList; 259 emPhysicsList = new PhysListEmLivermore(name); 260 261 } else if (name == "penelope") { 262 263 emName = name; 264 delete emPhysicsList; 265 emPhysicsList = new PhysListEmPenelope(name); 266 267 } else if (name == "elastic" && !helIsRegisted) { 268 hadronPhys.push_back( new G4HadronElasticPhysics()); 269 helIsRegisted = true; 270 271 } else if (name == "DElastic" && !helIsRegisted) { 272 hadronPhys.push_back( new G4HadronDElasticPhysics()); 273 helIsRegisted = true; 274 275 } else if (name == "HElastic" && !helIsRegisted) { 276 hadronPhys.push_back( new G4HadronHElasticPhysics()); 277 helIsRegisted = true; 278 279 } else if (name == "QElastic" && !helIsRegisted) { 280 hadronPhys.push_back( new G4HadronQElasticPhysics()); 281 helIsRegisted = true; 282 283 } else if (name == "binary" && !bicIsRegisted) { 284 hadronPhys.push_back(new G4HadronInelasticQBBC()); 285 bicIsRegisted = true; 286 287 } else if (name == "binary_ion" && !biciIsRegisted) { 288 hadronPhys.push_back(new G4IonBinaryCascadePhysics()); 289 biciIsRegisted = true; 290 237 238 } else if (name == "standardGS") { 239 240 emName = name; 241 delete emPhysicsList; 242 emPhysicsList = new PhysListEmStandardGS(name); 243 244 } else if (name == "empenelope"){ 245 emName = name; 246 delete emPhysicsList; 247 emPhysicsList = new G4EmPenelopePhysics(); 248 249 } else if (name == "emlivermore"){ 250 emName = name; 251 delete emPhysicsList; 252 emPhysicsList = new G4EmLivermorePhysics(); 253 291 254 } else { 292 255 … … 301 264 void PhysicsList::SetCuts() 302 265 { 303 304 266 if (verboseLevel >0){ 305 267 G4cout << "PhysicsList::SetCuts:"; … … 341 303 342 304 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 343 -
trunk/examples/extended/electromagnetic/TestEm5/src/PhysicsListMessenger.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsListMessenger.cc,v 1. 6 2006/06/29 16:56:07 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsListMessenger.cc,v 1.8 2009/03/06 18:04:23 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 77 77 allCutCmd->SetRange("cut>0.0"); 78 78 allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 79 79 80 } 80 81 -
trunk/examples/extended/electromagnetic/TestEm5/src/PrimaryGeneratorAction.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.4 2006/06/29 16:56:09 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/TestEm5/src/PrimaryGeneratorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.cc,v 1.4 2006/06/29 16:56:12 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/TestEm5/src/RunAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1.2 5 2007/11/21 17:41:19 maireExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: RunAction.cc,v 1.29 2009/06/18 19:08:18 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 122 122 else rmsStNe = 0.; 123 123 124 G4double Gamma = ( double)nbGamma/TotNbofEvents;125 G4double Elect = ( double)nbElect/TotNbofEvents;126 G4double Posit = ( double)nbPosit/TotNbofEvents;124 G4double Gamma = (G4double)nbGamma/TotNbofEvents; 125 G4double Elect = (G4double)nbElect/TotNbofEvents; 126 G4double Posit = (G4double)nbPosit/TotNbofEvents; 127 127 128 128 G4double transmit[2]; … … 252 252 // compute width of the Gaussian central part of the MultipleScattering 253 253 // 254 if (histoManager->HistoExist(13)) { 255 G4cout << "\n MultipleScattering:" 256 << "\n rms proj angle of transmit primary particle = " 257 << rmsMsc/mrad << " mrad (central part only)" << G4endl; 258 259 G4cout << " computed theta0 (Highland formula) = " 260 << ComputeMscHighland()/mrad << " mrad" << G4endl; 254 G4cout << "\n MultipleScattering:" 255 << "\n rms proj angle of transmit primary particle = " 256 << rmsMsc/mrad << " mrad (central part only)" << G4endl; 257 258 G4cout << " computed theta0 (Highland formula) = " 259 << ComputeMscHighland()/mrad << " mrad" << G4endl; 261 260 262 G4cout << " central part defined as +- " 263 << MscThetaCentral/mrad << " mrad; " 264 << " Tail ratio = " << tailMsc << " %" << G4endl; 265 } 261 G4cout << " central part defined as +- " 262 << MscThetaCentral/mrad << " mrad; " 263 << " Tail ratio = " << tailMsc << " %" << G4endl; 266 264 267 265 G4cout.precision(prec); 268 266 267 // normalize histograms 268 // 269 G4int ih = 1; 270 G4double binWidth = histoManager->GetBinWidth(ih); 271 G4double unit = histoManager->GetHistoUnit(ih); 272 G4double fac = unit/(TotNbofEvents*binWidth); 273 histoManager->Scale(ih,fac); 274 275 ih = 10; 276 binWidth = histoManager->GetBinWidth(ih); 277 unit = histoManager->GetHistoUnit(ih); 278 fac = unit/(TotNbofEvents*binWidth); 279 histoManager->Scale(ih,fac); 280 281 // save histograms 269 282 histoManager->save(); 270 283 -
trunk/examples/extended/electromagnetic/TestEm5/src/StackingAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: StackingAction.cc,v 1. 7 2006/09/25 17:06:29maire Exp $27 // GEANT4 tag $Name: $26 // $Id: StackingAction.cc,v 1.8 2009/03/06 18:04:23 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 79 79 //stack or delete secondaries 80 80 G4ClassificationOfNewTrack status = fUrgent; 81 if (killSecondary) 82 {if (killSecondary == 1) eventaction->AddEnergy(energy); 83 status = fKill;} 81 if (killSecondary) { 82 if (killSecondary == 1) { 83 eventaction->AddEnergy(energy); 84 } 85 status = fKill; 86 } 84 87 85 88 return status; -
trunk/examples/extended/electromagnetic/TestEm5/src/StackingMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: StackingMessenger.cc,v 1.5 2006/09/25 17:06:29 maire 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/TestEm5/src/StepMax.cc
r807 r1230 25 25 // 26 26 // $Id: StepMax.cc,v 1.2 2006/06/29 16:56:21 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/TestEm5/src/StepMaxMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.cc,v 1.3 2006/06/29 16:56:23 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/TestEm5/src/SteppingAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: SteppingAction.cc,v 1. 7 2006/06/29 16:56:25 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: SteppingAction.cc,v 1.8 2009/03/06 18:04:23 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 57 57 if (aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume() 58 58 != detector->GetAbsorber()) return; 59 59 60 60 eventaction->AddEnergy (aStep->GetTotalEnergyDeposit()); 61 61 … … 67 67 eventaction->AddTrakLenNeutr(aStep->GetStepLength()); 68 68 eventaction->CountStepsNeutr(); 69 } 69 } 70 70 } 71 71 -
trunk/examples/extended/electromagnetic/TestEm5/src/SteppingVerbose.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.3 2006/06/29 16:56:27 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/TestEm5/src/TrackingAction.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: TrackingAction.cc,v 1.1 6 2007/11/28 12:37:57maire Exp $28 // GEANT4 tag $Name: $27 // $Id: TrackingAction.cc,v 1.18 2008/08/28 15:28:04 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 65 65 { 66 66 G4ThreeVector position = aTrack->GetPosition(); 67 G4double charge = aTrack->GetDefinition()->GetPDGCharge(); 67 G4ThreeVector vertex = aTrack->GetVertexPosition(); 68 G4double charge = aTrack->GetDefinition()->GetPDGCharge(); 68 69 69 G4bool transmit = ( position.x() >= xendAbs);70 G4bool reflect = (position.x() <= xstartAbs);70 G4bool transmit = ((position.x() >= xendAbs) && (vertex.x() < xendAbs)); 71 G4bool reflect = (position.x() <= xstartAbs); 71 72 G4bool notabsor = (transmit || reflect); 72 73 … … 82 83 //histograms 83 84 // 84 G4int id = 0;85 85 G4bool charged = (charge != 0.); 86 86 G4bool neutral = !charged; … … 88 88 //energy spectrum at exit 89 89 // 90 G4int id = 0; 90 91 if (transmit && charged) id = 10; 91 92 else if (transmit && neutral) id = 20; 92 93 else if (reflect && charged) id = 30; 93 94 else if (reflect && neutral) id = 40; 94 95 96 if (id>0) 95 97 histoManager->FillHisto(id, aTrack->GetKineticEnergy()); 96 98 … … 108 110 //space angle distribution at exit : dN/dOmega 109 111 // 112 G4ThreeVector direction = aTrack->GetMomentumDirection(); 113 id = 0; 110 114 if (transmit && charged) id = 12; 111 115 else if (transmit && neutral) id = 22; … … 113 117 else if (reflect && neutral) id = 42; 114 118 115 G4ThreeVector direction = aTrack->GetMomentumDirection(); 116 if (histoManager->HistoExist(id)) { 119 if (id>0) { 117 120 G4double theta = std::acos(direction.x()); 118 121 G4double dteta = histoManager->GetBinWidth(id); … … 124 127 //energy fluence at exit : dE(MeV)/dOmega 125 128 // 129 id = 0; 126 130 if (transmit && charged) id = 11; 127 131 else if (transmit && neutral) id = 21; … … 129 133 else if (reflect && neutral) id = 41; 130 134 131 if ( histoManager->HistoExist(id)) {135 if (id>0) { 132 136 G4double theta = std::acos(direction.x()); 133 137 G4double dteta = histoManager->GetBinWidth(id); … … 140 144 //projected angles distribution at exit 141 145 // 146 id = 0; 142 147 if (transmit && charged) id = 13; 143 148 else if (transmit && neutral) id = 23; … … 157 162 //projected position and radius at exit 158 163 // 164 id = 0; 159 165 if (transmit && charged) id = 14; 160 166
Note: See TracChangeset
for help on using the changeset viewer.