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