Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

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.70 2009/07/29 23:43:27 gum Exp $
     1$Id: History,v 1.71 2010/05/27 20:47:23 gum Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     2022 February 10: P. Gumplinger (xrays-V09-03-00)
     21- Scintillation rise time included, thanks to Martin Goettlich/DESY
    1922
    202329 July 09: P. Gumplinger (xrays-V09-02-00)
  • trunk/source/processes/electromagnetic/xrays/include/G4Scintillation.hh

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4Scintillation.hh,v 1.16 2009/07/29 23:45:20 gum Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     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 $
    2929//
    3030//
     
    146146        // have been tracked, the tracking of the primary resumes.
    147147
     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
    148152        G4bool GetTrackSecondariesFirst() const;
    149153        // Returns the boolean flag for tracking secondaries first.
     154
     155        G4bool GetFiniteRiseTime() const;
     156        // Returns the boolean flag for a finite scintillation rise time.
    150157       
    151158        void SetScintillationYieldFactor(const G4double yieldfactor);
     
    198205
    199206        G4bool fTrackSecondariesFirst;
     207        G4bool fFiniteRiseTime;
    200208
    201209        G4double YieldFactor;
     
    204212
    205213private:
     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);
    206220
    207221        G4EmSaturation* emSaturation;
     
    229243
    230244inline
     245void G4Scintillation::SetFiniteRiseTime(const G4bool state)
     246{
     247        fFiniteRiseTime = state;
     248}
     249
     250inline
    231251G4bool G4Scintillation::GetTrackSecondariesFirst() const
    232252{
    233253        return fTrackSecondariesFirst;
     254}
     255
     256inline
     257G4bool G4Scintillation::GetFiniteRiseTime() const
     258{
     259        return fFiniteRiseTime;
    234260}
    235261
     
    296322}
    297323
     324inline
     325G4double G4Scintillation::single_exp(G4double t, G4double tau2)
     326{
     327         return exp(-1.0*t/tau2)/tau2;
     328}
     329
     330inline
     331G4double 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
    298336#endif /* G4Scintillation_h */
  • trunk/source/processes/electromagnetic/xrays/src/G4Scintillation.cc

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4Scintillation.cc,v 1.30 2008/10/22 01:19:11 gum Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     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 $
    2929//
    3030////////////////////////////////////////////////////////////////////////
     
    3737// Created:     1998-11-07 
    3838// 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
    4043//              > change variable name MeanNumPhotons -> MeanNumberOfPhotons
    4144//              2005-07-28 by Peter Gumplinger
     
    9396
    9497        fTrackSecondariesFirst = false;
     98        fFiniteRiseTime = false;
    9599
    96100        YieldFactor = 1.0;
     
    248252
    249253            G4double ScintillationTime = 0.*ns;
     254            G4double ScintillationRiseTime = 0.*ns;
    250255            G4PhysicsOrderedFreeVector* ScintillationIntegral = NULL;
    251256
     
    255260                   ScintillationTime   = aMaterialPropertiesTable->
    256261                                           GetConstProperty("FASTTIMECONSTANT");
     262                   if (fFiniteRiseTime) {
     263                      ScintillationRiseTime = aMaterialPropertiesTable->
     264                                  GetConstProperty("FASTSCINTILLATIONRISETIME");
     265                   }
    257266                   ScintillationIntegral =
    258267                   (G4PhysicsOrderedFreeVector*)((*theFastIntegralTable)(materialIndex));
     
    261270                   ScintillationTime   = aMaterialPropertiesTable->
    262271                                           GetConstProperty("SLOWTIMECONSTANT");
     272                   if (fFiniteRiseTime) {
     273                      ScintillationRiseTime = aMaterialPropertiesTable->
     274                                  GetConstProperty("SLOWSCINTILLATIONRISETIME");                   }
    263275                   ScintillationIntegral =
    264276                   (G4PhysicsOrderedFreeVector*)((*theSlowIntegralTable)(materialIndex));
     
    276288                 ScintillationTime   = aMaterialPropertiesTable->
    277289                                          GetConstProperty("FASTTIMECONSTANT");
     290                 if (fFiniteRiseTime) {
     291                      ScintillationRiseTime = aMaterialPropertiesTable->
     292                                 GetConstProperty("FASTSCINTILLATIONRISETIME");
     293                 }
    278294                 ScintillationIntegral =
    279295                  (G4PhysicsOrderedFreeVector*)((*theFastIntegralTable)(materialIndex));
     
    284300               ScintillationTime   =   aMaterialPropertiesTable->
    285301                                          GetConstProperty("SLOWTIMECONSTANT");
     302               if (fFiniteRiseTime) {
     303                    ScintillationRiseTime = aMaterialPropertiesTable->
     304                                 GetConstProperty("SLOWSCINTILLATIONRISETIME");
     305               }
    286306               ScintillationIntegral =
    287307                  (G4PhysicsOrderedFreeVector*)((*theSlowIntegralTable)(materialIndex));
     
    369389                         pPostStepPoint->GetVelocity())/2.);
    370390
    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                }
    373399
    374400                G4double aSecondaryTime = t0 + deltaTime;
     
    592618
    593619}
     620
     621G4double 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  
    2626//
    2727// $Id: testG4ForwardXrayTR.cc,v 1.7 2006/06/29 19:56:33 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030
Note: See TracChangeset for help on using the changeset viewer.