Changeset 1315 for trunk/source/processes/electromagnetic/xrays
- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- Location:
- trunk/source/processes/electromagnetic/xrays
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/xrays/History
r1196 r1315 1 $Id: History,v 1.7 0 2009/07/29 23:43:27gum Exp $1 $Id: History,v 1.71 2010/05/27 20:47:23 gum Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 17 17 * Reverse chronological order (last date on top), please * 18 18 ---------------------------------------------------------- 19 20 22 February 10: P. Gumplinger (xrays-V09-03-00) 21 - Scintillation rise time included, thanks to Martin Goettlich/DESY 19 22 20 23 29 July 09: P. Gumplinger (xrays-V09-02-00) -
trunk/source/processes/electromagnetic/xrays/include/G4Scintillation.hh
r1228 r1315 25 25 // 26 26 // 27 // $Id: G4Scintillation.hh,v 1.1 6 2009/07/29 23:45:20gum Exp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4Scintillation.hh,v 1.17 2010/05/27 20:48:35 gum Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30 // … … 146 146 // have been tracked, the tracking of the primary resumes. 147 147 148 void SetFiniteRiseTime(const G4bool state); 149 // If set, the G4Scintillation process expects the user to have 150 // set the constant material property FAST/SLOWSCINTILLATIONRISETIME. 151 148 152 G4bool GetTrackSecondariesFirst() const; 149 153 // Returns the boolean flag for tracking secondaries first. 154 155 G4bool GetFiniteRiseTime() const; 156 // Returns the boolean flag for a finite scintillation rise time. 150 157 151 158 void SetScintillationYieldFactor(const G4double yieldfactor); … … 198 205 199 206 G4bool fTrackSecondariesFirst; 207 G4bool fFiniteRiseTime; 200 208 201 209 G4double YieldFactor; … … 204 212 205 213 private: 214 215 G4double single_exp(G4double t, G4double tau2); 216 G4double bi_exp(G4double t, G4double tau1, G4double tau2); 217 218 // emission time distribution when there is a finite rise time 219 G4double sample_time(G4double tau1, G4double tau2); 206 220 207 221 G4EmSaturation* emSaturation; … … 229 243 230 244 inline 245 void G4Scintillation::SetFiniteRiseTime(const G4bool state) 246 { 247 fFiniteRiseTime = state; 248 } 249 250 inline 231 251 G4bool G4Scintillation::GetTrackSecondariesFirst() const 232 252 { 233 253 return fTrackSecondariesFirst; 254 } 255 256 inline 257 G4bool G4Scintillation::GetFiniteRiseTime() const 258 { 259 return fFiniteRiseTime; 234 260 } 235 261 … … 296 322 } 297 323 324 inline 325 G4double G4Scintillation::single_exp(G4double t, G4double tau2) 326 { 327 return exp(-1.0*t/tau2)/tau2; 328 } 329 330 inline 331 G4double G4Scintillation::bi_exp(G4double t, G4double tau1, G4double tau2) 332 { 333 return exp(-1.0*t/tau2)*(1-exp(-1.0*t/tau1))/tau2/tau2*(tau1+tau2); 334 } 335 298 336 #endif /* G4Scintillation_h */ -
trunk/source/processes/electromagnetic/xrays/src/G4Scintillation.cc
r1228 r1315 25 25 // 26 26 // 27 // $Id: G4Scintillation.cc,v 1.3 0 2008/10/22 01:19:11gum Exp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4Scintillation.cc,v 1.31 2010/05/27 20:49:40 gum Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30 //////////////////////////////////////////////////////////////////////// … … 37 37 // Created: 1998-11-07 38 38 // Author: Peter Gumplinger 39 // Updated: 2005-08-17 by Peter Gumplinger 39 // Updated: 2010-92-22 by Peter Gumplinger 40 // > scintillation rise time included, thanks to 41 // > Martin Goettlich/DESY 42 // 2005-08-17 by Peter Gumplinger 40 43 // > change variable name MeanNumPhotons -> MeanNumberOfPhotons 41 44 // 2005-07-28 by Peter Gumplinger … … 93 96 94 97 fTrackSecondariesFirst = false; 98 fFiniteRiseTime = false; 95 99 96 100 YieldFactor = 1.0; … … 248 252 249 253 G4double ScintillationTime = 0.*ns; 254 G4double ScintillationRiseTime = 0.*ns; 250 255 G4PhysicsOrderedFreeVector* ScintillationIntegral = NULL; 251 256 … … 255 260 ScintillationTime = aMaterialPropertiesTable-> 256 261 GetConstProperty("FASTTIMECONSTANT"); 262 if (fFiniteRiseTime) { 263 ScintillationRiseTime = aMaterialPropertiesTable-> 264 GetConstProperty("FASTSCINTILLATIONRISETIME"); 265 } 257 266 ScintillationIntegral = 258 267 (G4PhysicsOrderedFreeVector*)((*theFastIntegralTable)(materialIndex)); … … 261 270 ScintillationTime = aMaterialPropertiesTable-> 262 271 GetConstProperty("SLOWTIMECONSTANT"); 272 if (fFiniteRiseTime) { 273 ScintillationRiseTime = aMaterialPropertiesTable-> 274 GetConstProperty("SLOWSCINTILLATIONRISETIME"); } 263 275 ScintillationIntegral = 264 276 (G4PhysicsOrderedFreeVector*)((*theSlowIntegralTable)(materialIndex)); … … 276 288 ScintillationTime = aMaterialPropertiesTable-> 277 289 GetConstProperty("FASTTIMECONSTANT"); 290 if (fFiniteRiseTime) { 291 ScintillationRiseTime = aMaterialPropertiesTable-> 292 GetConstProperty("FASTSCINTILLATIONRISETIME"); 293 } 278 294 ScintillationIntegral = 279 295 (G4PhysicsOrderedFreeVector*)((*theFastIntegralTable)(materialIndex)); … … 284 300 ScintillationTime = aMaterialPropertiesTable-> 285 301 GetConstProperty("SLOWTIMECONSTANT"); 302 if (fFiniteRiseTime) { 303 ScintillationRiseTime = aMaterialPropertiesTable-> 304 GetConstProperty("SLOWSCINTILLATIONRISETIME"); 305 } 286 306 ScintillationIntegral = 287 307 (G4PhysicsOrderedFreeVector*)((*theSlowIntegralTable)(materialIndex)); … … 369 389 pPostStepPoint->GetVelocity())/2.); 370 390 371 deltaTime = deltaTime - 372 ScintillationTime * log( G4UniformRand() ); 391 // emission time distribution 392 if (ScintillationRiseTime==0.0) { 393 deltaTime = deltaTime - 394 ScintillationTime * log( G4UniformRand() ); 395 } else { 396 deltaTime = deltaTime + 397 sample_time(ScintillationRiseTime, ScintillationTime); 398 } 373 399 374 400 G4double aSecondaryTime = t0 + deltaTime; … … 592 618 593 619 } 620 621 G4double G4Scintillation::sample_time(G4double tau1, G4double tau2) 622 { 623 // tau1: rise time and tau2: decay time 624 625 while(1) { 626 // two random numbers 627 G4double ran1 = G4UniformRand(); 628 G4double ran2 = G4UniformRand(); 629 // 630 // exponential distribution as envelope function: very efficient 631 // 632 G4double d = (tau1+tau2)/tau2; 633 // make sure the envelope function is 634 // always larger than the bi-exponential 635 G4double t = -1.0*tau2*log(1-ran1); 636 G4double g = d*single_exp(t,tau2); 637 if (ran2 <= bi_exp(t,tau1,tau2)/g) return t; 638 } 639 return -1.0; 640 } -
trunk/source/processes/electromagnetic/xrays/test/testG4ForwardXrayTR.cc
r1199 r1315 26 26 // 27 27 // $Id: testG4ForwardXrayTR.cc,v 1.7 2006/06/29 19:56:33 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30
Note: See TracChangeset
for help on using the changeset viewer.