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[ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/optical/src/G4OpAbsorption.cc (Version 11.3.0) and /processes/optical/src/G4OpAbsorption.cc (Version 7.1.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                    <<   3 // * DISCLAIMER                                                       *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th <<   5 // * The following disclaimer summarizes all the specific disclaimers *
  6 // * the Geant4 Collaboration.  It is provided <<   6 // * of contributors to this software. The specific disclaimers,which *
  7 // * conditions of the Geant4 Software License <<   7 // * govern, are listed with their locations in:                      *
  8 // * LICENSE and available at  http://cern.ch/ <<   8 // *   http://cern.ch/geant4/license                                  *
  9 // * include a list of copyright holders.      << 
 10 // *                                                9 // *                                                                  *
 11 // * Neither the authors of this software syst     10 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     11 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     12 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     13 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  <<  14 // * use.                                                             *
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                               15 // *                                                                  *
 18 // * This  code  implementation is the result  <<  16 // * This  code  implementation is the  intellectual property  of the *
 19 // * technical work of the GEANT4 collaboratio <<  17 // * GEANT4 collaboration.                                            *
 20 // * By using,  copying,  modifying or  distri <<  18 // * By copying,  distributing  or modifying the Program (or any work *
 21 // * any work based  on the software)  you  ag <<  19 // * based  on  the Program)  you indicate  your  acceptance of  this *
 22 // * use  in  resulting  scientific  publicati <<  20 // * statement, and all its terms.                                    *
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // *******************************************     21 // ********************************************************************
 25 //                                                 22 //
 26 //                                                 23 //
                                                   >>  24 // $Id: G4OpAbsorption.cc,v 1.6 2005/07/28 22:28:04 gum Exp $
                                                   >>  25 // GEANT4 tag $Name: geant4-07-01-patch-01 $
 27 //                                                 26 //
 28 //////////////////////////////////////////////     27 ////////////////////////////////////////////////////////////////////////
 29 // Optical Photon Absorption Class Implementat     28 // Optical Photon Absorption Class Implementation
 30 //////////////////////////////////////////////     29 ////////////////////////////////////////////////////////////////////////
 31 //                                                 30 //
 32 // File:        G4OpAbsorption.cc                  31 // File:        G4OpAbsorption.cc
 33 // Description: Discrete Process -- Absorption <<  32 // Description: Discrete Process -- Absorption of Optical Photons  
 34 // Version:     1.0                                33 // Version:     1.0
 35 // Created:     1996-05-21                         34 // Created:     1996-05-21
 36 // Author:      Juliet Armstrong                   35 // Author:      Juliet Armstrong
 37 // Updated:     2005-07-28 - add G4ProcessType     36 // Updated:     2005-07-28 - add G4ProcessType to constructor
 38 //              2000-09-18 by Peter Gumplinger     37 //              2000-09-18 by Peter Gumplinger
 39 //              > comment out warning - "No Ab <<  38 //              > comment out warning - "No Absorption length specified" 
 40 //              1997-04-09 by Peter Gumplinger     39 //              1997-04-09 by Peter Gumplinger
 41 //              > new physics/tracking scheme      40 //              > new physics/tracking scheme
 42 //              1998-08-25 by Stefano Magni        41 //              1998-08-25 by Stefano Magni
 43 //              > Change process to use G4Mate     42 //              > Change process to use G4MaterialPropertiesTables
 44 //              1998-09-03 by Peter Gumplinger     43 //              1998-09-03 by Peter Gumplinger
 45 //              > Protect G4MaterialPropertyVe     44 //              > Protect G4MaterialPropertyVector* AttenuationLengthVector
                                                   >>  45 // mail:        gum@triumf.ca
                                                   >>  46 //              magni@mi.infn.it
 46 //                                                 47 //
 47 //////////////////////////////////////////////     48 ////////////////////////////////////////////////////////////////////////
 48                                                    49 
 49 #include "G4ios.hh"                                50 #include "G4ios.hh"
 50 #include "G4OpProcessSubType.hh"               << 
 51 #include "G4OpticalParameters.hh"              << 
 52                                                << 
 53 #include "G4OpAbsorption.hh"                       51 #include "G4OpAbsorption.hh"
 54                                                    52 
 55 //....oooOO0OOooo........oooOO0OOooo........oo <<  53 /////////////////////////
 56 G4OpAbsorption::G4OpAbsorption(const G4String& <<  54 // Class Implementation
 57   : G4VDiscreteProcess(processName, type)      <<  55 /////////////////////////
 58 {                                              <<  56 
 59   Initialise();                                <<  57         //////////////
 60   if(verboseLevel > 0)                         <<  58         // Operators
 61   {                                            <<  59         //////////////
 62     G4cout << GetProcessName() << " is created <<  60 
 63   }                                            <<  61 // G4OpAbsorption::operator=(const G4OpAbsorption &right)
 64   SetProcessSubType(fOpAbsorption);            <<  62 // {
 65 }                                              <<  63 // }
                                                   >>  64 
                                                   >>  65         /////////////////
                                                   >>  66         // Constructors
                                                   >>  67         /////////////////
 66                                                    68 
 67 //....oooOO0OOooo........oooOO0OOooo........oo <<  69 G4OpAbsorption::G4OpAbsorption(const G4String& processName, G4ProcessType type)
 68 G4OpAbsorption::~G4OpAbsorption() = default;   <<  70               : G4VDiscreteProcess(processName, type)
 69                                                << 
 70 //....oooOO0OOooo........oooOO0OOooo........oo << 
 71 void G4OpAbsorption::PreparePhysicsTable(const << 
 72 {                                                  71 {
 73   Initialise();                                <<  72         if (verboseLevel>0) {
                                                   >>  73            G4cout << GetProcessName() << " is created " << G4endl;
                                                   >>  74         }
 74 }                                                  75 }
 75                                                    76 
 76 //....oooOO0OOooo........oooOO0OOooo........oo <<  77 // G4OpAbsorption::G4OpAbsorption(const G4OpAbsorpton &right)
 77 void G4OpAbsorption::Initialise()              <<  78 // {
 78 {                                              <<  79 // }
 79   SetVerboseLevel(G4OpticalParameters::Instanc <<  80 
 80 }                                              <<  81         ////////////////
                                                   >>  82         // Destructors
                                                   >>  83         ////////////////
                                                   >>  84 
                                                   >>  85 G4OpAbsorption::~G4OpAbsorption(){}
                                                   >>  86 
                                                   >>  87         ////////////
                                                   >>  88         // Methods
                                                   >>  89         ////////////
 81                                                    90 
 82 //....oooOO0OOooo........oooOO0OOooo........oo <<  91 // PostStepDoIt
 83 G4VParticleChange* G4OpAbsorption::PostStepDoI <<  92 // -------------
 84                                                <<  93 //
                                                   >>  94 G4VParticleChange*
                                                   >>  95 G4OpAbsorption::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
 85 {                                                  96 {
 86   aParticleChange.Initialize(aTrack);          <<  97         aParticleChange.Initialize(aTrack);
 87                                                    98 
 88   const G4DynamicParticle* aParticle = aTrack. <<  99         aParticleChange.ProposeTrackStatus(fStopAndKill);
 89   G4double thePhotonMomentum         = aPartic << 
 90                                                   100 
 91   aParticleChange.ProposeLocalEnergyDeposit(th << 101         if (verboseLevel>0) {
 92   aParticleChange.ProposeTrackStatus(fStopAndK << 102      G4cout << "\n** Photon absorbed! **" << G4endl;
 93                                                << 103         }
 94   if(verboseLevel > 1)                         << 104         return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
 95   {                                            << 
 96     G4cout << "\n** OpAbsorption: Photon absor << 
 97   }                                            << 
 98   return G4VDiscreteProcess::PostStepDoIt(aTra << 
 99 }                                                 105 }
100                                                   106 
101 //....oooOO0OOooo........oooOO0OOooo........oo << 
102 G4double G4OpAbsorption::GetMeanFreePath(const << 
103                                          G4For << 
104 {                                              << 
105   const G4DynamicParticle* aParticle = aTrack. << 
106   G4MaterialPropertiesTable* MPT =             << 
107     aTrack.GetMaterial()->GetMaterialPropertie << 
108   G4double attLength = DBL_MAX;                << 
109                                                << 
110   if(MPT)                                      << 
111   {                                            << 
112     G4MaterialPropertyVector* attVector = MPT- << 
113     if(attVector)                              << 
114     {                                          << 
115       attLength =                              << 
116         attVector->Value(aParticle->GetTotalMo << 
117     }                                          << 
118   }                                            << 
119                                                   107 
120   return attLength;                            << 108 // GetMeanFreePath
121 }                                              << 109 // ---------------
                                                   >> 110 //
                                                   >> 111 G4double G4OpAbsorption::GetMeanFreePath(const G4Track& aTrack,
                                                   >> 112                  G4double ,
                                                   >> 113                  G4ForceCondition* )
                                                   >> 114 {
                                                   >> 115   const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
                                                   >> 116         const G4Material* aMaterial = aTrack.GetMaterial();
                                                   >> 117 
                                                   >> 118   G4double thePhotonMomentum = aParticle->GetTotalMomentum();
                                                   >> 119 
                                                   >> 120   G4MaterialPropertiesTable* aMaterialPropertyTable;
                                                   >> 121   G4MaterialPropertyVector* AttenuationLengthVector;
                                                   >> 122   
                                                   >> 123         G4double AttenuationLength = DBL_MAX;
                                                   >> 124 
                                                   >> 125   aMaterialPropertyTable = aMaterial->GetMaterialPropertiesTable();
                                                   >> 126 
                                                   >> 127   if ( aMaterialPropertyTable ) {
                                                   >> 128      AttenuationLengthVector = aMaterialPropertyTable->
                                                   >> 129                                                 GetProperty("ABSLENGTH");
                                                   >> 130            if ( AttenuationLengthVector ){
                                                   >> 131              AttenuationLength = AttenuationLengthVector->
                                                   >> 132                                          GetProperty (thePhotonMomentum);
                                                   >> 133            }
                                                   >> 134            else {
                                                   >> 135 //             G4cout << "No Absorption length specified" << G4endl;
                                                   >> 136            }
                                                   >> 137         } 
                                                   >> 138         else {
                                                   >> 139 //           G4cout << "No Absorption length specified" << G4endl;
                                                   >> 140         }
122                                                   141 
123 //....oooOO0OOooo........oooOO0OOooo........oo << 142         return AttenuationLength;
124 void G4OpAbsorption::SetVerboseLevel(G4int ver << 
125 {                                              << 
126   verboseLevel = verbose;                      << 
127   G4OpticalParameters::Instance()->SetAbsorpti << 
128 }                                                 143 }
129                                                   144