- Timestamp:
- Apr 6, 2009, 12:21:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/xrays/src/G4Scintillation.cc
r819 r961 25 25 // 26 26 // 27 // $Id: G4Scintillation.cc,v 1. 26 2006/06/29 19:56:11 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $27 // $Id: G4Scintillation.cc,v 1.30 2008/10/22 01:19:11 gum Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 //////////////////////////////////////////////////////////////////////// … … 64 64 65 65 #include "G4ios.hh" 66 #include "G4EmProcessSubType.hh" 67 66 68 #include "G4Scintillation.hh" 67 69 … … 88 90 : G4VRestDiscreteProcess(processName, type) 89 91 { 92 SetProcessSubType(fScintillation); 93 90 94 fTrackSecondariesFirst = false; 91 95 … … 101 105 102 106 BuildThePhysicsTable(); 107 108 emSaturation = NULL; 103 109 } 104 110 … … 180 186 G4double ScintillationYield = aMaterialPropertiesTable-> 181 187 GetConstProperty("SCINTILLATIONYIELD"); 188 ScintillationYield *= YieldFactor; 189 182 190 G4double ResolutionScale = aMaterialPropertiesTable-> 183 191 GetConstProperty("RESOLUTIONSCALE"); 184 192 185 ScintillationYield = YieldFactor * ScintillationYield; 186 187 G4double MeanNumberOfPhotons = ScintillationYield * TotalEnergyDeposit; 193 // Birks law saturation: 194 195 G4double constBirks = 0.0; 196 197 constBirks = aMaterial->GetIonisation()->GetBirksConstant(); 198 199 G4double MeanNumberOfPhotons; 200 201 if (emSaturation) { 202 MeanNumberOfPhotons = ScintillationYield* 203 (emSaturation->VisibleEnergyDeposition(&aStep)); 204 } else { 205 MeanNumberOfPhotons = ScintillationYield*TotalEnergyDeposit; 206 } 188 207 189 208 G4int NumPhotons; 190 if (MeanNumberOfPhotons > 10.) { 209 210 if (MeanNumberOfPhotons > 10.) 211 { 191 212 G4double sigma = ResolutionScale * sqrt(MeanNumberOfPhotons); 192 213 NumPhotons = G4int(G4RandGauss::shoot(MeanNumberOfPhotons,sigma)+0.5); 193 214 } 194 else { 215 else 216 { 195 217 NumPhotons = G4int(G4Poisson(MeanNumberOfPhotons)); 196 218 } 197 219 198 if (NumPhotons <= 0) {199 220 if (NumPhotons <= 0) 221 { 200 222 // return unchanged particle and no secondaries 201 223 … … 274 296 for (G4int i = 0; i < Num; i++) { 275 297 276 // Determine photon momentum298 // Determine photon energy 277 299 278 300 G4double CIIvalue = G4UniformRand()*CIImax; 279 G4double sampled Momentum=301 G4double sampledEnergy = 280 302 ScintillationIntegral->GetEnergy(CIIvalue); 281 303 282 304 if (verboseLevel>1) { 283 G4cout << "sampled Momentum = " << sampledMomentum<< G4endl;305 G4cout << "sampledEnergy = " << sampledEnergy << G4endl; 284 306 G4cout << "CIIvalue = " << CIIvalue << G4endl; 285 307 } … … 330 352 photonPolarization.z()); 331 353 332 aScintillationPhoton->SetKineticEnergy(sampled Momentum);354 aScintillationPhoton->SetKineticEnergy(sampledEnergy); 333 355 334 356 // Generate new G4Track object: … … 358 380 new G4Track(aScintillationPhoton,aSecondaryTime,aSecondaryPosition); 359 381 360 aSecondaryTrack->SetTouchableHandle((G4VTouchable*)0); 382 aSecondaryTrack->SetTouchableHandle( 383 aStep.GetPreStepPoint()->GetTouchableHandle()); 384 // aSecondaryTrack->SetTouchableHandle((G4VTouchable*)0); 361 385 362 386 aSecondaryTrack->SetParentID(aTrack.GetTrackID()); … … 417 441 418 442 // Retrieve the first intensity point in vector 419 // of (photon momentum, intensity) pairs443 // of (photon energy, intensity) pairs 420 444 421 445 theFastLightVector->ResetIterator(); … … 427 451 if (currentIN >= 0.0) { 428 452 429 // Create first (photon momentum, Scintillation453 // Create first (photon energy, Scintillation 430 454 // Integral pair 431 455 432 456 G4double currentPM = theFastLightVector-> 433 GetPhoton Momentum();457 GetPhotonEnergy(); 434 458 435 459 G4double currentCII = 0.0; … … 444 468 G4double prevIN = currentIN; 445 469 446 // loop over all (photon momentum, intensity)470 // loop over all (photon energy, intensity) 447 471 // pairs stored for this material 448 472 … … 450 474 { 451 475 currentPM = theFastLightVector-> 452 GetPhoton Momentum();476 GetPhotonEnergy(); 453 477 454 478 currentIN=theFastLightVector-> … … 477 501 478 502 // Retrieve the first intensity point in vector 479 // of (photon momentum, intensity) pairs503 // of (photon energy, intensity) pairs 480 504 481 505 theSlowLightVector->ResetIterator(); … … 487 511 if (currentIN >= 0.0) { 488 512 489 // Create first (photon momentum, Scintillation513 // Create first (photon energy, Scintillation 490 514 // Integral pair 491 515 492 516 G4double currentPM = theSlowLightVector-> 493 GetPhoton Momentum();517 GetPhotonEnergy(); 494 518 495 519 G4double currentCII = 0.0; … … 504 528 G4double prevIN = currentIN; 505 529 506 // loop over all (photon momentum, intensity)530 // loop over all (photon energy, intensity) 507 531 // pairs stored for this material 508 532 … … 510 534 { 511 535 currentPM = theSlowLightVector-> 512 GetPhoton Momentum();536 GetPhotonEnergy(); 513 537 514 538 currentIN=theSlowLightVector->
Note: See TracChangeset
for help on using the changeset viewer.