Changeset 1230 for trunk/examples/extended/electromagnetic/TestEm3/src
- Timestamp:
- Jan 8, 2010, 3:02:48 PM (14 years ago)
- Location:
- trunk/examples/extended/electromagnetic/TestEm3/src
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/electromagnetic/TestEm3/src/DetectorConstruction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: DetectorConstruction.cc,v 1.2 0 2007/03/19 20:10:38 vnivanchExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: DetectorConstruction.cc,v 1.23 2009/03/04 18:49:17 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 105 105 G4Element* H = manager->FindOrBuildElement(1); 106 106 G4Element* C = manager->FindOrBuildElement(6); 107 G4Element* N = manager->FindOrBuildElement(7); 107 108 G4Element* O = manager->FindOrBuildElement(8); 108 109 G4Element* Si = manager->FindOrBuildElement(14); … … 164 165 Sci->AddElement(C, natoms=9); 165 166 Sci->AddElement(H, natoms=10); 167 168 Sci->GetIonisation()->SetBirksConstant(0.126*mm/MeV); 166 169 167 170 G4Material* Lct = … … 199 202 BGO->AddElement(Bi, natoms= 4); 200 203 204 //SiNx 205 density= 3.1 *g/cm3; 206 G4Material* SiNx= new G4Material("SiNx", density, ncomponents=3); 207 SiNx-> AddElement(Si, 300); 208 SiNx-> AddElement(N, 310); 209 SiNx-> AddElement(H, 6); 210 201 211 // 202 212 // define gaseous materials using G4 NIST database … … 205 215 206 216 G4Material* Air = manager->FindOrBuildMaterial("G4_AIR"); 207 manager->ConstructNewGasMaterial("Air20","G4_AIR",293.*kelvin, 217 manager->ConstructNewGasMaterial("Air20","G4_AIR",293.*kelvin,1.*atmosphere); 208 218 209 219 G4Material* lAr = manager->FindOrBuildMaterial("G4_lAr"); … … 242 252 kStateGas, temperature= 273*kelvin, pressure= 1*atmosphere); 243 253 steam->AddMaterial(H2O, fractionmass=1.); 244 254 255 new G4Material("ArgonGas", z=18, a=39.948*g/mole, density= 1.782*mg/cm3, 256 kStateGas, 273.15*kelvin, 1*atmosphere); 245 257 // 246 258 // examples of vacuum -
trunk/examples/extended/electromagnetic/TestEm3/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.11 2006/06/29 16:52:26 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/TestEm3/src/EmAcceptance.cc
r807 r1230 25 25 // 26 26 // $Id: EmAcceptance.cc,v 1.6 2006/06/29 16:52:28 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/TestEm3/src/EventAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: EventAction.cc,v 1.1 5 2007/04/22 16:25:21vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: EventAction.cc,v 1.16 2008/05/29 16:59:27 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 71 71 //initialize EnergyDeposit per event 72 72 // 73 for (G4int k=0; k<MaxAbsor; k++) 73 for (G4int k=0; k<MaxAbsor; k++) { 74 74 energyDeposit[k] = trackLengthCh[k] = 0.0; 75 } 75 76 } 76 77 -
trunk/examples/extended/electromagnetic/TestEm3/src/EventActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.4 2006/06/29 16:52:38 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/TestEm3/src/HistoManager.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoManager.cc,v 1.1 4 2007/11/12 17:04:55maire Exp $27 // GEANT4 tag $Name: $26 // $Id: HistoManager.cc,v 1.17 2009/03/04 18:49:17 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] = "testem3"; 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++) { … … 241 241 void HistoManager::PrintHisto(G4int ih) 242 242 { 243 if (ih < MaxHisto) ascii[ih] = true;243 if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; } 244 244 else 245 245 G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih … … 254 254 { 255 255 #ifdef G4ANALYSIS_USE 256 256 257 if (!ascii[0]) return; 258 257 259 G4String name = fileName[0] + ".ascii"; 258 260 std::ofstream File(name, std::ios::out); … … 267 269 for (G4int iBin=0; iBin<Nbins[ih]; iBin++) { 268 270 File << " " << iBin << "\t" 269 << histo[ih]->binMean(iBin) << "\t" 271 << 0.5*(histo[ih]->axis().binLowerEdge(iBin) + 272 histo[ih]->axis().binUpperEdge(iBin)) << "\t" 270 273 << histo[ih]->binHeight(iBin) 271 274 << G4endl; -
trunk/examples/extended/electromagnetic/TestEm3/src/HistoMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.cc,v 1.9 2007/11/12 17:04:55 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/TestEm3/src/PhysListEmStandard.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysListEmStandard.cc,v 1. 14 2007/06/22 09:22:05maire Exp $27 // GEANT4 tag $Name: $26 // $Id: PhysListEmStandard.cc,v 1.23 2009/11/13 17:01:44 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" 52 57 … … 85 90 } else if (particleName == "e-") { 86 91 //electron 87 pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1); 88 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 89 pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3); 92 G4eMultipleScattering* msc = new G4eMultipleScattering(); 93 msc->AddEmModel(0, new G4UrbanMscModel93()); 94 pmanager->AddProcess(msc, -1, 1, 1); 95 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 96 pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3); 90 97 91 98 } else if (particleName == "e+") { 92 99 //positron 93 pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1); 94 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 95 pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3); 96 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4); 100 G4eMultipleScattering* msc = new G4eMultipleScattering(); 101 msc->AddEmModel(0, new G4UrbanMscModel93()); 102 pmanager->AddProcess(msc, -1, 1, 1); 103 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 104 pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3); 105 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4); 97 106 98 } else if( particleName == "mu +" ||99 particleName == "mu -" ) {107 } else if( particleName == "mu-" || 108 particleName == "mu+" ) { 100 109 //muon 101 pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1); 102 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2); 103 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3); 104 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4); 110 pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1); 111 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2); 112 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3); 113 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4); 114 115 } else if( particleName == "proton" || 116 particleName == "pi-" || 117 particleName == "pi+" ) { 118 //proton 119 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 120 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 121 pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3); 122 pmanager->AddProcess(new G4hPairProduction, -1, 4, 4); 105 123 106 124 } else if( particleName == "alpha" || 107 125 particleName == "He3" || 108 particleName == "GenericIon" ) { 109 pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1); 110 pmanager->AddProcess(new G4ionIonisation, -1, 2, 2); 126 particleName == "GenericIon" ) { 127 //Ions 128 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 129 pmanager->AddProcess(new G4ionIonisation, -1, 2, 2); 111 130 112 131 } else if ((!particle->IsShortLived()) && … … 114 133 (particle->GetParticleName() != "chargedgeantino")) { 115 134 //all others charged particles except geantino 116 pmanager->AddProcess(new G4 MultipleScattering, -1, 1, 1);117 pmanager->AddProcess(new G4hIonisation, -1, 2, 2);135 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 136 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 118 137 } 119 138 } … … 121 140 // Em options 122 141 // 142 // Main options and setting parameters are shown here. 143 // Several of them have default values. 144 // 123 145 G4EmProcessOptions emOptions; 124 125 // coulomb scattering146 147 //physics tables 126 148 // 127 emOptions.SetMscStepLimitation(fUseDistanceToBoundary); 128 emOptions.SetSkin(2.); 129 149 emOptions.SetMinEnergy(100*eV); //default 150 emOptions.SetMaxEnergy(100*TeV); //default 151 emOptions.SetDEDXBinning(12*20); //default=12*7 152 emOptions.SetLambdaBinning(12*20); //default=12*7 153 emOptions.SetSplineFlag(true); //default 154 155 //multiple coulomb scattering 156 // 157 emOptions.SetMscStepLimitation(fUseDistanceToBoundary); //default=fUseSafety 158 emOptions.SetMscRangeFactor(0.04); //default 159 emOptions.SetMscGeomFactor (2.5); //default 160 emOptions.SetSkin(3.); //default 161 130 162 //energy loss 131 163 // 132 emOptions.Set LinearLossLimit(1.e-6);133 emOptions.Set StepFunction(0.2, 100*um);164 emOptions.SetStepFunction(0.2, 100*um); //default=(0.2, 1*mm) 165 emOptions.SetLinearLossLimit(1.e-2); //default 134 166 135 167 //ionization 136 168 // 137 emOptions.SetSubCutoff( true);169 emOptions.SetSubCutoff(false); //default=false 138 170 } 139 171 -
trunk/examples/extended/electromagnetic/TestEm3/src/PhysicsList.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.cc,v 1. 20 2007/11/13 14:37:05 vnivanchExp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsList.cc,v 1.30 2009/11/13 17:01:44 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 34 34 35 35 #include "PhysListEmStandard.hh" 36 #include "PhysListEmStandardIG.hh"37 #include "PhysListEmLivermore.hh"38 #include "PhysListEmPenelope.hh"39 36 40 37 #include "G4EmStandardPhysics.hh" 41 38 #include "G4EmStandardPhysics_option1.hh" 42 39 #include "G4EmStandardPhysics_option2.hh" 43 44 #include "G4LossTableManager.hh" 40 #include "G4EmStandardPhysics_option3.hh" 41 #include "G4EmLivermorePhysics.hh" 42 #include "G4EmPenelopePhysics.hh" 43 45 44 #include "G4UnitsTable.hh" 45 #include "G4UrbanMscModel.hh" 46 46 47 47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 49 49 PhysicsList::PhysicsList() : G4VModularPhysicsList() 50 50 { 51 G4LossTableManager::Instance();52 51 currentDefaultCut = 1.0*mm; 53 52 cutForGamma = currentDefaultCut; … … 60 59 61 60 // EM physics 62 emName = G4String(" standard");61 emName = G4String("local"); 63 62 emPhysicsList = new PhysListEmStandard(emName); 64 63 … … 214 213 if (name == emName) return; 215 214 216 if (name == " standard") {215 if (name == "local") { 217 216 218 217 emName = name; … … 220 219 emPhysicsList = new PhysListEmStandard(name); 221 220 222 } else if (name == "emstandard ") {221 } else if (name == "emstandard_opt0") { 223 222 224 223 emName = name; … … 237 236 delete emPhysicsList; 238 237 emPhysicsList = new G4EmStandardPhysics_option2(); 239 240 } else if (name == " standardIG") {241 242 emName = name; 243 delete emPhysicsList; 244 emPhysicsList = new PhysListEmStandardIG(name);245 246 } else if (name == " livermore") {247 248 emName = name; 249 delete emPhysicsList; 250 emPhysicsList = new PhysListEmLivermore(name);251 252 } else if (name == " penelope") {253 254 emName = name; 255 delete emPhysicsList; 256 emPhysicsList = new PhysListEmPenelope(name);238 239 } else if (name == "emstandard_opt3") { 240 241 emName = name; 242 delete emPhysicsList; 243 emPhysicsList = new G4EmStandardPhysics_option3(); 244 245 } else if (name == "emlivermore") { 246 247 emName = name; 248 delete emPhysicsList; 249 emPhysicsList = new G4EmLivermorePhysics(); 250 251 } else if (name == "empenelope") { 252 253 emName = name; 254 delete emPhysicsList; 255 emPhysicsList = new G4EmPenelopePhysics(); 257 256 258 257 } else { … … 288 287 289 288 void PhysicsList::SetCuts() 290 { 291 289 { 292 290 if (verboseLevel >0){ 293 291 G4cout << "PhysicsList::SetCuts:"; … … 306 304 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 307 305 308 #include "G4Gamma.hh"309 #include "G4Electron.hh"310 #include "G4Positron.hh"311 312 306 void PhysicsList::SetCutForGamma(G4double cut) 313 307 { -
trunk/examples/extended/electromagnetic/TestEm3/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 16:52:57 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/TestEm3/src/PrimaryGeneratorAction.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.7 2006/06/29 16:53:00 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/TestEm3/src/PrimaryGeneratorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.cc,v 1.3 2006/06/29 16:53:02 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/TestEm3/src/RunAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1.3 4 2007/04/24 13:05:14vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: RunAction.cc,v 1.37 2008/05/29 16:59:27 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 131 131 G4cout << "\n------------------------------------------------------------\n"; 132 132 G4cout << std::setw(14) << "material" 133 << std::setw(17) << " Total Edep"133 << std::setw(17) << "Edep RMS" 134 134 << std::setw(33) << "sqrt(E0(GeV))*rmsE/Emean" 135 135 << std::setw(23) << "total tracklen \n \n"; … … 139 139 MeanEAbs = sumEAbs[k]*norm; 140 140 MeanEAbs2 = sum2EAbs[k]*norm; 141 rmsEAbs = std::sqrt(std::fabs(MeanEAbs2 - MeanEAbs*MeanEAbs)); 142 141 rmsEAbs = std::sqrt(std::abs(MeanEAbs2 - MeanEAbs*MeanEAbs)); 142 //G4cout << "k= " << k << " RMS= " << rmsEAbs 143 // << " applyLimit: " << applyLimit << G4endl; 143 144 if(applyLimit) { 144 145 G4int nn = 0; … … 159 160 MeanEAbs = sume*norm1; 160 161 MeanEAbs2 = sume2*norm1; 161 rmsEAbs = std::sqrt(std:: fabs(MeanEAbs2 - MeanEAbs*MeanEAbs));162 rmsEAbs = std::sqrt(std::abs(MeanEAbs2 - MeanEAbs*MeanEAbs)); 162 163 } 163 164 … … 171 172 MeanLAbs = sumLAbs[k]*norm; 172 173 MeanLAbs2 = sum2LAbs[k]*norm; 173 rmsLAbs = std::sqrt(std:: fabs(MeanLAbs2 - MeanLAbs*MeanLAbs));174 rmsLAbs = std::sqrt(std::abs(MeanLAbs2 - MeanLAbs*MeanLAbs)); 174 175 175 176 //print … … 178 179 << std::setw(14) << Detector->GetAbsorMaterial(k)->GetName() << ": " 179 180 << std::setprecision(5) 180 << std::setw(6) << G4BestUnit(MeanEAbs,"Energy") << " +-"181 << std::setw(6) << G4BestUnit(MeanEAbs,"Energy") << " : " 181 182 << std::setprecision(4) 182 183 << std::setw(5) << G4BestUnit( rmsEAbs,"Energy") … … 189 190 } 190 191 G4cout << "\n------------------------------------------------------------\n"; 192 193 G4cout << " Beam particle " 194 << Primary->GetParticleGun()-> 195 GetParticleDefinition()->GetParticleName() 196 << " E = " << G4BestUnit(beamEnergy,"Energy") << G4endl; 191 197 192 198 //Energy flow -
trunk/examples/extended/electromagnetic/TestEm3/src/RunActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: RunActionMessenger.cc,v 1.13 2007/04/25 10:07:27 vnivanch 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/TestEm3/src/StepMax.cc
r807 r1230 25 25 // 26 26 // $Id: StepMax.cc,v 1.4 2006/06/29 16:53:19 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/TestEm3/src/StepMaxMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.cc,v 1.3 2006/06/29 16:53: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/TestEm3/src/SteppingAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: SteppingAction.cc,v 1.2 5 2006/06/29 16:53:23 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: SteppingAction.cc,v 1.28 2008/05/29 16:59:27 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 47 47 :G4UserSteppingAction(),detector(det),runAct(run),eventAct(evt), 48 48 histoManager(hist) 49 { }49 { } 50 50 51 51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 81 81 G4double stepl = 0.; 82 82 if (particle->GetPDGCharge() != 0.) stepl = aStep->GetStepLength(); 83 83 84 // G4cout << "Nabs= " << absorNum << " edep(keV)= " << edep << G4endl; 85 84 86 // sum up per event 85 87 eventAct->SumEnergy(absorNum,edep,stepl); 86 88 87 89 //longitudinal profile of edep per absorber 88 if (edep>0.) histoManager->FillHisto(MaxAbsor+absorNum, layerNum+1., edep); 90 if (edep>0.) histoManager->FillHisto(MaxAbsor+absorNum, 91 G4double(layerNum+1), edep); 89 92 90 93 //energy flow … … 108 111 109 112 //// example of Birk attenuation 110 /// /G4double destep = aStep->GetTotalEnergyDeposit();111 /// / G4double response = BirkAttenuation(aStep);112 /// /G4cout << " Destep: " << destep/keV << " keV"113 /// / << " response after Birk: "<< response/keV << " keV" << G4endl;113 ///G4double destep = aStep->GetTotalEnergyDeposit(); 114 ///G4double response = BirksAttenuation(aStep); 115 ///G4cout << " Destep: " << destep/keV << " keV" 116 /// << " response after Birks: " << response/keV << " keV" << G4endl; 114 117 } 115 118 116 119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 117 120 118 G4double SteppingAction::Birk Attenuation(const G4Step* aStep)121 G4double SteppingAction::BirksAttenuation(const G4Step* aStep) 119 122 { 120 123 //Example of Birk attenuation law in organic scintillators. 121 124 //adapted from Geant3 PHYS337. See MIN 80 (1970) 239-244 122 125 // 123 const G4String myMaterial = "Scintillator"; 124 const G4double birk1 = 0.013*g/(MeV*cm2); 125 // 126 G4Material* material = aStep->GetTrack()->GetMaterial(); 127 G4double birk1 = material->GetIonisation()->GetBirksConstant(); 126 128 G4double destep = aStep->GetTotalEnergyDeposit(); 127 G4 Material* material = aStep->GetTrack()->GetMaterial();129 G4double stepl = aStep->GetStepLength(); 128 130 G4double charge = aStep->GetTrack()->GetDefinition()->GetPDGCharge(); 129 131 // 130 132 G4double response = destep; 131 if ( (material->GetName()==myMaterial)&&(charge!=0.))133 if (birk1*destep*stepl*charge != 0.) 132 134 { 133 G4double correction = 134 birk1*destep/((material->GetDensity())*(aStep->GetStepLength())); 135 response = destep/(1. + correction); 135 response = destep/(1. + birk1*destep/stepl); 136 136 } 137 137 return response; -
trunk/examples/extended/electromagnetic/TestEm3/src/SteppingVerbose.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.4 2006/06/29 16:53:25 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/TestEm3/src/TrackingAction.cc
r807 r1230 26 26 // 27 27 // $Id: TrackingAction.cc,v 1.2 2006/06/29 16:53:27 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracChangeset
for help on using the changeset viewer.