G4OpAbsorption.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00030 // Optical Photon Absorption Class Implementation
00032 //
00033 // File:        G4OpAbsorption.cc
00034 // Description: Discrete Process -- Absorption of Optical Photons  
00035 // Version:     1.0
00036 // Created:     1996-05-21
00037 // Author:      Juliet Armstrong
00038 // Updated:     2005-07-28 - add G4ProcessType to constructor
00039 //              2000-09-18 by Peter Gumplinger
00040 //              > comment out warning - "No Absorption length specified" 
00041 //              1997-04-09 by Peter Gumplinger
00042 //              > new physics/tracking scheme
00043 //              1998-08-25 by Stefano Magni
00044 //              > Change process to use G4MaterialPropertiesTables
00045 //              1998-09-03 by Peter Gumplinger
00046 //              > Protect G4MaterialPropertyVector* AttenuationLengthVector
00047 // mail:        gum@triumf.ca
00048 //              magni@mi.infn.it
00049 //
00051 
00052 #include "G4ios.hh"
00053 #include "G4OpProcessSubType.hh"
00054 
00055 #include "G4OpAbsorption.hh"
00056 
00058 // Class Implementation
00060 
00062         // Operators
00064 
00065 // G4OpAbsorption::operator=(const G4OpAbsorption &right)
00066 // {
00067 // }
00068 
00070         // Constructors
00072 
00073 G4OpAbsorption::G4OpAbsorption(const G4String& processName, G4ProcessType type)
00074               : G4VDiscreteProcess(processName, type)
00075 {
00076         if (verboseLevel>0) {
00077            G4cout << GetProcessName() << " is created " << G4endl;
00078         }
00079 
00080         SetProcessSubType(fOpAbsorption);
00081 }
00082 
00083 // G4OpAbsorption::G4OpAbsorption(const G4OpAbsorpton &right)
00084 // {
00085 // }
00086 
00088         // Destructors
00090 
00091 G4OpAbsorption::~G4OpAbsorption(){}
00092 
00094         // Methods
00096 
00097 // PostStepDoIt
00098 // -------------
00099 //
00100 G4VParticleChange*
00101 G4OpAbsorption::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
00102 {
00103         aParticleChange.Initialize(aTrack);
00104 
00105         aParticleChange.ProposeTrackStatus(fStopAndKill);
00106 
00107         if (verboseLevel>0) {
00108            G4cout << "\n** Photon absorbed! **" << G4endl;
00109         }
00110         return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
00111 }
00112 
00113 
00114 // GetMeanFreePath
00115 // ---------------
00116 //
00117 G4double G4OpAbsorption::GetMeanFreePath(const G4Track& aTrack,
00118                                          G4double ,
00119                                          G4ForceCondition* )
00120 {
00121         const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
00122         const G4Material* aMaterial = aTrack.GetMaterial();
00123 
00124         G4double thePhotonMomentum = aParticle->GetTotalMomentum();
00125 
00126         G4MaterialPropertiesTable* aMaterialPropertyTable;
00127         G4MaterialPropertyVector* AttenuationLengthVector;
00128         
00129         G4double AttenuationLength = DBL_MAX;
00130 
00131         aMaterialPropertyTable = aMaterial->GetMaterialPropertiesTable();
00132 
00133         if ( aMaterialPropertyTable ) {
00134            AttenuationLengthVector = aMaterialPropertyTable->
00135                                                 GetProperty("ABSLENGTH");
00136            if ( AttenuationLengthVector ){
00137              AttenuationLength = AttenuationLengthVector->
00138                                          Value(thePhotonMomentum);
00139            }
00140            else {
00141 //             G4cout << "No Absorption length specified" << G4endl;
00142            }
00143         } 
00144         else {
00145 //           G4cout << "No Absorption length specified" << G4endl;
00146         }
00147 
00148         return AttenuationLength;
00149 }

Generated on Mon May 27 17:49:09 2013 for Geant4 by  doxygen 1.4.7