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