Ignore:
Timestamp:
Apr 6, 2009, 12:21:12 PM (15 years ago)
Author:
garnier
Message:

update processes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/xrays/src/G4Scintillation.cc

    r819 r961  
    2525//
    2626//
    27 // $Id: G4Scintillation.cc,v 1.26 2006/06/29 19:56:11 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-01-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 $
    2929//
    3030////////////////////////////////////////////////////////////////////////
     
    6464
    6565#include "G4ios.hh"
     66#include "G4EmProcessSubType.hh"
     67
    6668#include "G4Scintillation.hh"
    6769
     
    8890                  : G4VRestDiscreteProcess(processName, type)
    8991{
     92        SetProcessSubType(fScintillation);
     93
    9094        fTrackSecondariesFirst = false;
    9195
     
    101105
    102106        BuildThePhysicsTable();
     107
     108        emSaturation = NULL;
    103109}
    104110
     
    180186        G4double ScintillationYield = aMaterialPropertiesTable->
    181187                                      GetConstProperty("SCINTILLATIONYIELD");
     188        ScintillationYield *= YieldFactor;
     189
    182190        G4double ResolutionScale    = aMaterialPropertiesTable->
    183191                                      GetConstProperty("RESOLUTIONSCALE");
    184192
    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        }
    188207
    189208        G4int NumPhotons;
    190         if (MeanNumberOfPhotons > 10.) {
     209
     210        if (MeanNumberOfPhotons > 10.)
     211        {
    191212          G4double sigma = ResolutionScale * sqrt(MeanNumberOfPhotons);
    192213          NumPhotons = G4int(G4RandGauss::shoot(MeanNumberOfPhotons,sigma)+0.5);
    193214        }
    194         else {
     215        else
     216        {
    195217          NumPhotons = G4int(G4Poisson(MeanNumberOfPhotons));
    196218        }
    197219
    198         if (NumPhotons <= 0) {
    199 
     220        if (NumPhotons <= 0)
     221        {
    200222           // return unchanged particle and no secondaries
    201223
     
    274296            for (G4int i = 0; i < Num; i++) {
    275297
    276                 // Determine photon momentum
     298                // Determine photon energy
    277299
    278300                G4double CIIvalue = G4UniformRand()*CIImax;
    279                 G4double sampledMomentum =
     301                G4double sampledEnergy =
    280302                              ScintillationIntegral->GetEnergy(CIIvalue);
    281303
    282304                if (verboseLevel>1) {
    283                    G4cout << "sampledMomentum = " << sampledMomentum << G4endl;
     305                   G4cout << "sampledEnergy = " << sampledEnergy << G4endl;
    284306                   G4cout << "CIIvalue =        " << CIIvalue << G4endl;
    285307                }
     
    330352                                      photonPolarization.z());
    331353
    332                 aScintillationPhoton->SetKineticEnergy(sampledMomentum);
     354                aScintillationPhoton->SetKineticEnergy(sampledEnergy);
    333355
    334356                // Generate new G4Track object:
     
    358380                new G4Track(aScintillationPhoton,aSecondaryTime,aSecondaryPosition);
    359381
    360                 aSecondaryTrack->SetTouchableHandle((G4VTouchable*)0);
     382                aSecondaryTrack->SetTouchableHandle(
     383                                 aStep.GetPreStepPoint()->GetTouchableHandle());
     384                // aSecondaryTrack->SetTouchableHandle((G4VTouchable*)0);
    361385
    362386                aSecondaryTrack->SetParentID(aTrack.GetTrackID());
     
    417441               
    418442                      // Retrieve the first intensity point in vector
    419                       // of (photon momentum, intensity) pairs
     443                      // of (photon energy, intensity) pairs
    420444
    421445                      theFastLightVector->ResetIterator();
     
    427451                      if (currentIN >= 0.0) {
    428452
    429                          // Create first (photon momentum, Scintillation
     453                         // Create first (photon energy, Scintillation
    430454                         // Integral pair 
    431455
    432456                         G4double currentPM = theFastLightVector->
    433                                                  GetPhotonMomentum();
     457                                                 GetPhotonEnergy();
    434458
    435459                         G4double currentCII = 0.0;
     
    444468                         G4double prevIN  = currentIN;
    445469
    446                          // loop over all (photon momentum, intensity)
     470                         // loop over all (photon energy, intensity)
    447471                         // pairs stored for this material 
    448472
     
    450474                         {
    451475                                currentPM = theFastLightVector->
    452                                                 GetPhotonMomentum();
     476                                                GetPhotonEnergy();
    453477
    454478                                currentIN=theFastLightVector-> 
     
    477501
    478502                      // Retrieve the first intensity point in vector
    479                       // of (photon momentum, intensity) pairs
     503                      // of (photon energy, intensity) pairs
    480504
    481505                      theSlowLightVector->ResetIterator();
     
    487511                      if (currentIN >= 0.0) {
    488512
    489                          // Create first (photon momentum, Scintillation
     513                         // Create first (photon energy, Scintillation
    490514                         // Integral pair
    491515
    492516                         G4double currentPM = theSlowLightVector->
    493                                                  GetPhotonMomentum();
     517                                                 GetPhotonEnergy();
    494518
    495519                         G4double currentCII = 0.0;
     
    504528                         G4double prevIN  = currentIN;
    505529
    506                          // loop over all (photon momentum, intensity)
     530                         // loop over all (photon energy, intensity)
    507531                         // pairs stored for this material
    508532
     
    510534                         {
    511535                                currentPM = theSlowLightVector->
    512                                                 GetPhotonMomentum();
     536                                                GetPhotonEnergy();
    513537
    514538                                currentIN=theSlowLightVector->
Note: See TracChangeset for help on using the changeset viewer.