Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // 26 // >> 27 // $Id: G4OpRayleigh.hh,v 1.9 2006/06/29 21:08:40 gunter Exp $ >> 28 // GEANT4 tag $Name: geant4-09-01-patch-03 $ 27 // 29 // 28 // << 30 // 29 ////////////////////////////////////////////// 31 //////////////////////////////////////////////////////////////////////// 30 // Optical Photon Rayleigh Scattering Class De 32 // Optical Photon Rayleigh Scattering Class Definition 31 ////////////////////////////////////////////// 33 //////////////////////////////////////////////////////////////////////// 32 // 34 // 33 // File: G4OpRayleigh.hh 35 // File: G4OpRayleigh.hh 34 // Description: Discrete Process -- Rayleigh s << 36 // Description: Discrete Process -- Rayleigh scattering of optical photons 35 // Version: 1.0 37 // Version: 1.0 36 // Created: 1996-05-31 38 // Created: 1996-05-31 37 // Author: Juliet Armstrong 39 // Author: Juliet Armstrong 38 // Updated: 2014-08-20 allow for more mate << 40 // Updated: 2005-07-28 add G4ProcessType to constructor 39 // 2005-07-28 add G4ProcessType t << 40 // 1999-10-29 add method and clas 41 // 1999-10-29 add method and class descriptors 41 // 1997-04-09 by Peter Gumplinger 42 // 1997-04-09 by Peter Gumplinger 42 // > new physics/tracking scheme 43 // > new physics/tracking scheme >> 44 // mail: gum@triumf.ca 43 // 45 // 44 ////////////////////////////////////////////// 46 //////////////////////////////////////////////////////////////////////// 45 47 46 #ifndef G4OpRayleigh_h 48 #ifndef G4OpRayleigh_h 47 #define G4OpRayleigh_h 1 49 #define G4OpRayleigh_h 1 48 50 >> 51 ///////////// >> 52 // Includes >> 53 ///////////// >> 54 >> 55 #include "globals.hh" >> 56 #include "templates.hh" >> 57 #include "Randomize.hh" >> 58 #include "G4ThreeVector.hh" >> 59 #include "G4ParticleMomentum.hh" >> 60 #include "G4Step.hh" 49 #include "G4VDiscreteProcess.hh" 61 #include "G4VDiscreteProcess.hh" >> 62 #include "G4DynamicParticle.hh" >> 63 #include "G4Material.hh" 50 #include "G4OpticalPhoton.hh" 64 #include "G4OpticalPhoton.hh" 51 #include "G4PhysicsTable.hh" 65 #include "G4PhysicsTable.hh" >> 66 #include "G4PhysicsOrderedFreeVector.hh" >> 67 >> 68 // Class Description: >> 69 // Discrete Process -- Rayleigh scattering of optical photons. >> 70 // Class inherits publicly from G4VDiscreteProcess. >> 71 // Class Description - End: >> 72 >> 73 ///////////////////// >> 74 // Class Definition >> 75 ///////////////////// 52 76 53 class G4OpRayleigh : public G4VDiscreteProcess << 77 class G4OpRayleigh : public G4VDiscreteProcess 54 { 78 { 55 public: << 56 explicit G4OpRayleigh(const G4String& proces << 57 G4ProcessType type << 58 virtual ~G4OpRayleigh(); << 59 79 60 virtual G4bool IsApplicable( << 80 private: 61 const G4ParticleDefinition& aParticleType) << 81 62 // Returns true -> 'is applicable' only for << 82 ////////////// >> 83 // Operators >> 84 ////////////// >> 85 >> 86 // G4OpRayleigh& operator=(const G4OpRayleigh &right); >> 87 >> 88 public: // Without description >> 89 >> 90 //////////////////////////////// >> 91 // Constructors and Destructor >> 92 //////////////////////////////// >> 93 >> 94 G4OpRayleigh(const G4String& processName = "OpRayleigh", >> 95 G4ProcessType type = fOptical); >> 96 >> 97 // G4OpRayleigh(const G4OpRayleigh &right); >> 98 >> 99 ~G4OpRayleigh(); >> 100 >> 101 //////////// >> 102 // Methods >> 103 //////////// 63 104 64 virtual void BuildPhysicsTable( << 105 public: // With description 65 const G4ParticleDefinition& aParticleType) << 66 // Build thePhysicsTable at a right time << 67 106 68 virtual G4double GetMeanFreePath(const G4Tra << 107 G4bool IsApplicable(const G4ParticleDefinition& aParticleType); 69 G4ForceCond << 108 // Returns true -> 'is applicable' only for an optical photon. 70 // Returns the mean free path for Rayleigh s << 71 109 72 virtual G4VParticleChange* PostStepDoIt(cons << 110 G4double GetMeanFreePath(const G4Track& aTrack, 73 cons << 111 G4double , 74 // This is the method implementing Rayleigh << 112 G4ForceCondition* ); >> 113 // Returns the mean free path for Rayleigh scattering in water. >> 114 // --- Not yet implemented for other materials! --- 75 115 76 virtual G4PhysicsTable* GetPhysicsTable() co << 116 G4VParticleChange* PostStepDoIt(const G4Track& aTrack, 77 // Returns the address of the physics table. << 117 const G4Step& aStep); >> 118 // This is the method implementing Rayleigh scattering. 78 119 79 virtual void DumpPhysicsTable() const; << 120 G4PhysicsTable* GetPhysicsTable() const; 80 // Prints the physics table. << 121 // Returns the address of the physics table. 81 122 82 virtual void PreparePhysicsTable(const G4Par << 123 void DumpPhysicsTable() const; 83 virtual void Initialise(); << 124 // Prints the physics table. 84 125 85 void SetVerboseLevel(G4int); << 126 private: 86 127 87 protected: << 128 void BuildThePhysicsTable(); 88 G4PhysicsTable* thePhysicsTable; << 89 129 90 private: << 130 ///////////////////// 91 G4OpRayleigh(const G4OpRayleigh& right) = de << 131 // Helper Functions 92 G4OpRayleigh& operator=(const G4OpRayleigh& << 132 ///////////////////// 93 133 94 /// Calculates the mean free paths for a mat << 134 G4PhysicsOrderedFreeVector* RayleighAttenuationLengthGenerator( 95 /// photon energy << 135 G4MaterialPropertiesTable *aMPT); 96 G4PhysicsFreeVector* CalculateRayleighMeanFr << 136 97 const G4Material* material) const; << 137 /////////////////////// >> 138 // Class Data Members >> 139 /////////////////////// >> 140 >> 141 protected: >> 142 >> 143 G4PhysicsTable* thePhysicsTable; >> 144 // A Physics Table can be either a cross-sections table or >> 145 // an energy table (or can be used for other specific >> 146 // purposes). >> 147 >> 148 private: >> 149 >> 150 G4bool DefaultWater; 98 151 99 size_t idx_rslength = 0; << 100 }; 152 }; 101 153 102 //////////////////// 154 //////////////////// 103 // Inline methods 155 // Inline methods 104 //////////////////// 156 //////////////////// 105 157 106 inline G4bool G4OpRayleigh::IsApplicable( << 158 inline 107 const G4ParticleDefinition& aParticleType) << 159 G4bool G4OpRayleigh::IsApplicable(const G4ParticleDefinition& aParticleType) 108 { 160 { 109 return (&aParticleType == G4OpticalPhoton::O << 161 return ( &aParticleType == G4OpticalPhoton::OpticalPhoton() ); 110 } 162 } 111 163 112 inline void G4OpRayleigh::DumpPhysicsTable() c << 164 inline >> 165 void G4OpRayleigh::DumpPhysicsTable() const >> 166 113 { 167 { 114 for(size_t i = 0; i < thePhysicsTable->entri << 168 G4int PhysicsTableSize = thePhysicsTable->entries(); 115 { << 169 G4PhysicsOrderedFreeVector *v; 116 ((G4PhysicsFreeVector*) (*thePhysicsTable) << 170 117 } << 171 for (G4int i = 0 ; i < PhysicsTableSize ; i++ ) >> 172 { >> 173 v = (G4PhysicsOrderedFreeVector*)(*thePhysicsTable)[i]; >> 174 v->DumpValues(); >> 175 } 118 } 176 } 119 177 120 inline G4PhysicsTable* G4OpRayleigh::GetPhysic 178 inline G4PhysicsTable* G4OpRayleigh::GetPhysicsTable() const 121 { 179 { 122 return thePhysicsTable; 180 return thePhysicsTable; 123 } 181 } >> 182 124 183 125 #endif /* G4OpRayleigh_h */ 184 #endif /* G4OpRayleigh_h */ 126 185