Geant4 Cross Reference |
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.4 2001/07/11 10:08:22 gunter Exp $ >> 25 // GEANT4 tag $Name: geant4-05-02-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: 2000-09-18 by Peter Gumplinger 38 // 2000-09-18 by Peter Gumplinger << 37 // > comment out warning - "No Absorption length specified" 39 // > comment out warning - "No Ab << 40 // 1997-04-09 by Peter Gumplinger 38 // 1997-04-09 by Peter Gumplinger 41 // > new physics/tracking scheme 39 // > new physics/tracking scheme 42 // 1998-08-25 by Stefano Magni 40 // 1998-08-25 by Stefano Magni 43 // > Change process to use G4Mate 41 // > Change process to use G4MaterialPropertiesTables 44 // 1998-09-03 by Peter Gumplinger 42 // 1998-09-03 by Peter Gumplinger 45 // > Protect G4MaterialPropertyVe 43 // > Protect G4MaterialPropertyVector* AttenuationLengthVector >> 44 // mail: gum@triumf.ca >> 45 // magni@mi.infn.it 46 // 46 // 47 ////////////////////////////////////////////// 47 //////////////////////////////////////////////////////////////////////// 48 48 49 #include "G4ios.hh" 49 #include "G4ios.hh" 50 #include "G4OpProcessSubType.hh" << 51 #include "G4OpticalParameters.hh" << 52 << 53 #include "G4OpAbsorption.hh" 50 #include "G4OpAbsorption.hh" 54 51 55 //....oooOO0OOooo........oooOO0OOooo........oo << 52 ///////////////////////// 56 G4OpAbsorption::G4OpAbsorption(const G4String& << 53 // Class Implementation 57 : G4VDiscreteProcess(processName, type) << 54 ///////////////////////// 58 { << 55 59 Initialise(); << 56 ////////////// 60 if(verboseLevel > 0) << 57 // Operators 61 { << 58 ////////////// 62 G4cout << GetProcessName() << " is created << 59 63 } << 60 // G4OpAbsorption::operator=(const G4OpAbsorption &right) 64 SetProcessSubType(fOpAbsorption); << 61 // { >> 62 // } >> 63 >> 64 ///////////////// >> 65 // Constructors >> 66 ///////////////// >> 67 >> 68 G4OpAbsorption::G4OpAbsorption(const G4String& processName) >> 69 : G4VDiscreteProcess(processName) >> 70 { >> 71 if (verboseLevel>0) { >> 72 G4cout << GetProcessName() << " is created " << G4endl; >> 73 } 65 } 74 } 66 75 67 //....oooOO0OOooo........oooOO0OOooo........oo << 76 // G4OpAbsorption::G4OpAbsorption(const G4OpAbsorpton &right) 68 G4OpAbsorption::~G4OpAbsorption() = default; << 77 // { 69 << 78 // } 70 //....oooOO0OOooo........oooOO0OOooo........oo << 79 71 void G4OpAbsorption::PreparePhysicsTable(const << 80 //////////////// 72 { << 81 // Destructors 73 Initialise(); << 82 //////////////// 74 } << 83 75 << 84 G4OpAbsorption::~G4OpAbsorption(){} 76 //....oooOO0OOooo........oooOO0OOooo........oo << 85 77 void G4OpAbsorption::Initialise() << 86 //////////// 78 { << 87 // Methods 79 SetVerboseLevel(G4OpticalParameters::Instanc << 88 //////////// 80 } << 81 89 82 //....oooOO0OOooo........oooOO0OOooo........oo << 90 // PostStepDoIt 83 G4VParticleChange* G4OpAbsorption::PostStepDoI << 91 // ------------- 84 << 92 // >> 93 G4VParticleChange* >> 94 G4OpAbsorption::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep) 85 { 95 { 86 aParticleChange.Initialize(aTrack); << 96 aParticleChange.Initialize(aTrack); 87 97 88 const G4DynamicParticle* aParticle = aTrack. << 98 aParticleChange.SetStatusChange(fStopAndKill); 89 G4double thePhotonMomentum = aPartic << 90 99 91 aParticleChange.ProposeLocalEnergyDeposit(th << 100 if (verboseLevel>0) { 92 aParticleChange.ProposeTrackStatus(fStopAndK << 101 G4cout << "\n** Photon absorbed! **" << G4endl; 93 << 102 } 94 if(verboseLevel > 1) << 103 return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep); 95 { << 96 G4cout << "\n** OpAbsorption: Photon absor << 97 } << 98 return G4VDiscreteProcess::PostStepDoIt(aTra << 99 } 104 } 100 105 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 106 120 return attLength; << 107 // GetMeanFreePath 121 } << 108 // --------------- >> 109 // >> 110 G4double G4OpAbsorption::GetMeanFreePath(const G4Track& aTrack, >> 111 G4double , >> 112 G4ForceCondition* ) >> 113 { >> 114 const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle(); >> 115 const G4Material* aMaterial = aTrack.GetMaterial(); >> 116 >> 117 G4double thePhotonMomentum = aParticle->GetTotalMomentum(); >> 118 >> 119 G4MaterialPropertiesTable* aMaterialPropertyTable; >> 120 G4MaterialPropertyVector* AttenuationLengthVector; >> 121 >> 122 G4double AttenuationLength = DBL_MAX; >> 123 >> 124 aMaterialPropertyTable = aMaterial->GetMaterialPropertiesTable(); >> 125 >> 126 if ( aMaterialPropertyTable ) { >> 127 AttenuationLengthVector = aMaterialPropertyTable-> >> 128 GetProperty("ABSLENGTH"); >> 129 if ( AttenuationLengthVector ){ >> 130 AttenuationLength = AttenuationLengthVector-> >> 131 GetProperty (thePhotonMomentum); >> 132 } >> 133 else { >> 134 // G4cout << "No Absorption length specified" << G4endl; >> 135 } >> 136 } >> 137 else { >> 138 // G4cout << "No Absorption length specified" << G4endl; >> 139 } 122 140 123 //....oooOO0OOooo........oooOO0OOooo........oo << 141 return AttenuationLength; 124 void G4OpAbsorption::SetVerboseLevel(G4int ver << 125 { << 126 verboseLevel = verbose; << 127 G4OpticalParameters::Instance()->SetAbsorpti << 128 } 142 } 129 143