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: G4OpRayleigh.hh,v 1.8 2005/07/28 22:27:16 gum Exp $ >> 25 // GEANT4 tag $Name: geant4-08-00-patch-01 $ 27 // 26 // 28 // << 27 // 29 ////////////////////////////////////////////// 28 //////////////////////////////////////////////////////////////////////// 30 // Optical Photon Rayleigh Scattering Class De 29 // Optical Photon Rayleigh Scattering Class Definition 31 ////////////////////////////////////////////// 30 //////////////////////////////////////////////////////////////////////// 32 // 31 // 33 // File: G4OpRayleigh.hh 32 // File: G4OpRayleigh.hh 34 // Description: Discrete Process -- Rayleigh s << 33 // Description: Discrete Process -- Rayleigh scattering of optical photons 35 // Version: 1.0 34 // Version: 1.0 36 // Created: 1996-05-31 35 // Created: 1996-05-31 37 // Author: Juliet Armstrong 36 // Author: Juliet Armstrong 38 // Updated: 2014-08-20 allow for more mate << 37 // Updated: 2005-07-28 add G4ProcessType to constructor 39 // 2005-07-28 add G4ProcessType t << 40 // 1999-10-29 add method and clas 38 // 1999-10-29 add method and class descriptors 41 // 1997-04-09 by Peter Gumplinger 39 // 1997-04-09 by Peter Gumplinger 42 // > new physics/tracking scheme 40 // > new physics/tracking scheme >> 41 // mail: gum@triumf.ca 43 // 42 // 44 ////////////////////////////////////////////// 43 //////////////////////////////////////////////////////////////////////// 45 44 46 #ifndef G4OpRayleigh_h 45 #ifndef G4OpRayleigh_h 47 #define G4OpRayleigh_h 1 46 #define G4OpRayleigh_h 1 48 47 >> 48 ///////////// >> 49 // Includes >> 50 ///////////// >> 51 >> 52 #include "globals.hh" >> 53 #include "templates.hh" >> 54 #include "Randomize.hh" >> 55 #include "G4ThreeVector.hh" >> 56 #include "G4ParticleMomentum.hh" >> 57 #include "G4Step.hh" 49 #include "G4VDiscreteProcess.hh" 58 #include "G4VDiscreteProcess.hh" >> 59 #include "G4DynamicParticle.hh" >> 60 #include "G4Material.hh" 50 #include "G4OpticalPhoton.hh" 61 #include "G4OpticalPhoton.hh" 51 #include "G4PhysicsTable.hh" 62 #include "G4PhysicsTable.hh" >> 63 #include "G4PhysicsOrderedFreeVector.hh" >> 64 >> 65 // Class Description: >> 66 // Discrete Process -- Rayleigh scattering of optical photons. >> 67 // Class inherits publicly from G4VDiscreteProcess. >> 68 // Class Description - End: >> 69 >> 70 ///////////////////// >> 71 // Class Definition >> 72 ///////////////////// 52 73 53 class G4OpRayleigh : public G4VDiscreteProcess << 74 class G4OpRayleigh : public G4VDiscreteProcess 54 { 75 { 55 public: << 56 explicit G4OpRayleigh(const G4String& proces << 57 G4ProcessType type << 58 virtual ~G4OpRayleigh(); << 59 76 60 virtual G4bool IsApplicable( << 77 private: 61 const G4ParticleDefinition& aParticleType) << 78 62 // Returns true -> 'is applicable' only for << 79 ////////////// >> 80 // Operators >> 81 ////////////// >> 82 >> 83 // G4OpRayleigh& operator=(const G4OpRayleigh &right); >> 84 >> 85 public: // Without description >> 86 >> 87 //////////////////////////////// >> 88 // Constructors and Destructor >> 89 //////////////////////////////// >> 90 >> 91 G4OpRayleigh(const G4String& processName = "OpRayleigh", >> 92 G4ProcessType type = fOptical); >> 93 >> 94 // G4OpRayleigh(const G4OpRayleigh &right); >> 95 >> 96 ~G4OpRayleigh(); >> 97 >> 98 //////////// >> 99 // Methods >> 100 //////////// 63 101 64 virtual void BuildPhysicsTable( << 102 public: // With description 65 const G4ParticleDefinition& aParticleType) << 66 // Build thePhysicsTable at a right time << 67 103 68 virtual G4double GetMeanFreePath(const G4Tra << 104 G4bool IsApplicable(const G4ParticleDefinition& aParticleType); 69 G4ForceCond << 105 // Returns true -> 'is applicable' only for an optical photon. 70 // Returns the mean free path for Rayleigh s << 71 106 72 virtual G4VParticleChange* PostStepDoIt(cons << 107 G4double GetMeanFreePath(const G4Track& aTrack, 73 cons << 108 G4double , 74 // This is the method implementing Rayleigh << 109 G4ForceCondition* ); >> 110 // Returns the mean free path for Rayleigh scattering in water. >> 111 // --- Not yet implemented for other materials! --- 75 112 76 virtual G4PhysicsTable* GetPhysicsTable() co << 113 G4VParticleChange* PostStepDoIt(const G4Track& aTrack, 77 // Returns the address of the physics table. << 114 const G4Step& aStep); >> 115 // This is the method implementing Rayleigh scattering. 78 116 79 virtual void DumpPhysicsTable() const; << 117 G4PhysicsTable* GetPhysicsTable() const; 80 // Prints the physics table. << 118 // Returns the address of the physics table. 81 119 82 virtual void PreparePhysicsTable(const G4Par << 120 void DumpPhysicsTable() const; 83 virtual void Initialise(); << 121 // Prints the physics table. 84 122 85 void SetVerboseLevel(G4int); << 123 private: 86 124 87 protected: << 125 void BuildThePhysicsTable(); 88 G4PhysicsTable* thePhysicsTable; << 89 126 90 private: << 127 ///////////////////// 91 G4OpRayleigh(const G4OpRayleigh& right) = de << 128 // Helper Functions 92 G4OpRayleigh& operator=(const G4OpRayleigh& << 129 ///////////////////// 93 130 94 /// Calculates the mean free paths for a mat << 131 G4PhysicsOrderedFreeVector* RayleighAttenuationLengthGenerator( 95 /// photon energy << 132 G4MaterialPropertiesTable *aMPT); 96 G4PhysicsFreeVector* CalculateRayleighMeanFr << 133 97 const G4Material* material) const; << 134 /////////////////////// >> 135 // Class Data Members >> 136 /////////////////////// >> 137 >> 138 protected: >> 139 >> 140 G4PhysicsTable* thePhysicsTable; >> 141 // A Physics Table can be either a cross-sections table or >> 142 // an energy table (or can be used for other specific >> 143 // purposes). >> 144 >> 145 private: >> 146 >> 147 G4bool DefaultWater; 98 148 99 size_t idx_rslength = 0; << 100 }; 149 }; 101 150 102 //////////////////// 151 //////////////////// 103 // Inline methods 152 // Inline methods 104 //////////////////// 153 //////////////////// 105 154 106 inline G4bool G4OpRayleigh::IsApplicable( << 155 inline 107 const G4ParticleDefinition& aParticleType) << 156 G4bool G4OpRayleigh::IsApplicable(const G4ParticleDefinition& aParticleType) 108 { 157 { 109 return (&aParticleType == G4OpticalPhoton::O << 158 return ( &aParticleType == G4OpticalPhoton::OpticalPhoton() ); 110 } 159 } 111 160 112 inline void G4OpRayleigh::DumpPhysicsTable() c << 161 inline >> 162 void G4OpRayleigh::DumpPhysicsTable() const >> 163 113 { 164 { 114 for(size_t i = 0; i < thePhysicsTable->entri << 165 G4int PhysicsTableSize = thePhysicsTable->entries(); 115 { << 166 G4PhysicsOrderedFreeVector *v; 116 ((G4PhysicsFreeVector*) (*thePhysicsTable) << 167 117 } << 168 for (G4int i = 0 ; i < PhysicsTableSize ; i++ ) >> 169 { >> 170 v = (G4PhysicsOrderedFreeVector*)(*thePhysicsTable)[i]; >> 171 v->DumpValues(); >> 172 } 118 } 173 } 119 174 120 inline G4PhysicsTable* G4OpRayleigh::GetPhysic 175 inline G4PhysicsTable* G4OpRayleigh::GetPhysicsTable() const 121 { 176 { 122 return thePhysicsTable; 177 return thePhysicsTable; 123 } 178 } >> 179 124 180 125 #endif /* G4OpRayleigh_h */ 181 #endif /* G4OpRayleigh_h */ 126 182