[819] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
| 27 | // $Id: G4Cerenkov.hh,v 1.9 2007/09/30 22:17:04 gum Exp $ |
---|
| 28 | // GEANT4 tag $Name: $ |
---|
| 29 | // |
---|
| 30 | // |
---|
| 31 | //////////////////////////////////////////////////////////////////////// |
---|
| 32 | // Cerenkov Radiation Class Definition |
---|
| 33 | //////////////////////////////////////////////////////////////////////// |
---|
| 34 | // |
---|
| 35 | // File: G4Cerenkov.hh |
---|
| 36 | // Description: Discrete Process - Generation of Cerenkov Photons |
---|
| 37 | // Version: 2.0 |
---|
| 38 | // Created: 1996-02-21 |
---|
| 39 | // Author: Juliet Armstrong |
---|
| 40 | // Updated: 2007-09-30 change inheritance to G4VDiscreteProcess |
---|
| 41 | // 2005-07-28 add G4ProcessType to constructor |
---|
| 42 | // 1999-10-29 add method and class descriptors |
---|
| 43 | // 1997-04-09 by Peter Gumplinger |
---|
| 44 | // > G4MaterialPropertiesTable; new physics/tracking scheme |
---|
| 45 | // mail: gum@triumf.ca |
---|
| 46 | // |
---|
| 47 | //////////////////////////////////////////////////////////////////////// |
---|
| 48 | |
---|
| 49 | #ifndef G4Cerenkov_h |
---|
| 50 | #define G4Cerenkov_h 1 |
---|
| 51 | |
---|
| 52 | ///////////// |
---|
| 53 | // Includes |
---|
| 54 | ///////////// |
---|
| 55 | |
---|
| 56 | #include "globals.hh" |
---|
| 57 | #include "templates.hh" |
---|
| 58 | #include "Randomize.hh" |
---|
| 59 | #include "G4ThreeVector.hh" |
---|
| 60 | #include "G4ParticleMomentum.hh" |
---|
| 61 | #include "G4Step.hh" |
---|
| 62 | #include "G4VDiscreteProcess.hh" |
---|
| 63 | #include "G4OpticalPhoton.hh" |
---|
| 64 | #include "G4DynamicParticle.hh" |
---|
| 65 | #include "G4Material.hh" |
---|
| 66 | #include "G4PhysicsTable.hh" |
---|
| 67 | #include "G4MaterialPropertiesTable.hh" |
---|
| 68 | #include "G4PhysicsOrderedFreeVector.hh" |
---|
| 69 | |
---|
| 70 | // Class Description: |
---|
| 71 | // Discrete Process -- Generation of Cerenkov Photons. |
---|
| 72 | // Class inherits publicly from G4VDiscreteProcess. |
---|
| 73 | // Class Description - End: |
---|
| 74 | |
---|
| 75 | ///////////////////// |
---|
| 76 | // Class Definition |
---|
| 77 | ///////////////////// |
---|
| 78 | |
---|
| 79 | class G4Cerenkov : public G4VDiscreteProcess |
---|
| 80 | { |
---|
| 81 | |
---|
| 82 | private: |
---|
| 83 | |
---|
| 84 | ////////////// |
---|
| 85 | // Operators |
---|
| 86 | ////////////// |
---|
| 87 | |
---|
| 88 | // G4Cerenkov& operator=(const G4Cerenkov &right); |
---|
| 89 | |
---|
| 90 | public: // Without description |
---|
| 91 | |
---|
| 92 | //////////////////////////////// |
---|
| 93 | // Constructors and Destructor |
---|
| 94 | //////////////////////////////// |
---|
| 95 | |
---|
| 96 | G4Cerenkov(const G4String& processName = "Cerenkov", |
---|
| 97 | G4ProcessType type = fElectromagnetic); |
---|
| 98 | |
---|
| 99 | // G4Cerenkov(const G4Cerenkov &right); |
---|
| 100 | |
---|
| 101 | ~G4Cerenkov(); |
---|
| 102 | |
---|
| 103 | //////////// |
---|
| 104 | // Methods |
---|
| 105 | //////////// |
---|
| 106 | |
---|
| 107 | public: // With description |
---|
| 108 | |
---|
| 109 | G4bool IsApplicable(const G4ParticleDefinition& aParticleType); |
---|
| 110 | // Returns true -> 'is applicable', for all charged particles. |
---|
| 111 | |
---|
| 112 | G4double GetMeanFreePath(const G4Track& aTrack, |
---|
| 113 | G4double , |
---|
| 114 | G4ForceCondition* ); |
---|
| 115 | // Returns the discrete step limit and sets the 'StronglyForced' |
---|
| 116 | // condition for the DoIt to be invoked at every step. |
---|
| 117 | |
---|
| 118 | G4VParticleChange* PostStepDoIt(const G4Track& aTrack, |
---|
| 119 | const G4Step& aStep); |
---|
| 120 | // This is the method implementing the Cerenkov process. |
---|
| 121 | |
---|
| 122 | void SetTrackSecondariesFirst(const G4bool state); |
---|
| 123 | // If set, the primary particle tracking is interrupted and any |
---|
| 124 | // produced Cerenkov photons are tracked next. When all have |
---|
| 125 | // been tracked, the tracking of the primary resumes. |
---|
| 126 | |
---|
| 127 | void SetMaxNumPhotonsPerStep(const G4int NumPhotons); |
---|
| 128 | // Set the maximum number of Cerenkov photons allowed to be |
---|
| 129 | // generated during a tracking step. This is an average ONLY; |
---|
| 130 | // the actual number will vary around this average. If invoked, |
---|
| 131 | // the maximum photon stack will roughly be of the size set. |
---|
| 132 | // If not called, the step is not limited by the number of |
---|
| 133 | // photons generated. |
---|
| 134 | |
---|
| 135 | G4PhysicsTable* GetPhysicsTable() const; |
---|
| 136 | // Returns the address of the physics table. |
---|
| 137 | |
---|
| 138 | void DumpPhysicsTable() const; |
---|
| 139 | // Prints the physics table. |
---|
| 140 | |
---|
| 141 | private: |
---|
| 142 | |
---|
| 143 | void BuildThePhysicsTable(); |
---|
| 144 | |
---|
| 145 | ///////////////////// |
---|
| 146 | // Helper Functions |
---|
| 147 | ///////////////////// |
---|
| 148 | |
---|
| 149 | G4double GetAverageNumberOfPhotons(const G4double charge, |
---|
| 150 | const G4double beta, |
---|
| 151 | const G4Material *aMaterial, |
---|
| 152 | const G4MaterialPropertyVector* Rindex) const; |
---|
| 153 | |
---|
| 154 | /////////////////////// |
---|
| 155 | // Class Data Members |
---|
| 156 | /////////////////////// |
---|
| 157 | |
---|
| 158 | protected: |
---|
| 159 | |
---|
| 160 | G4PhysicsTable* thePhysicsTable; |
---|
| 161 | // A Physics Table can be either a cross-sections table or |
---|
| 162 | // an energy table (or can be used for other specific |
---|
| 163 | // purposes). |
---|
| 164 | |
---|
| 165 | private: |
---|
| 166 | |
---|
| 167 | G4bool fTrackSecondariesFirst; |
---|
| 168 | G4int fMaxPhotons; |
---|
| 169 | }; |
---|
| 170 | |
---|
| 171 | //////////////////// |
---|
| 172 | // Inline methods |
---|
| 173 | //////////////////// |
---|
| 174 | |
---|
| 175 | inline |
---|
| 176 | G4bool G4Cerenkov::IsApplicable(const G4ParticleDefinition& aParticleType) |
---|
| 177 | { |
---|
| 178 | if (aParticleType.GetParticleName() != "chargedgeantino" ) { |
---|
| 179 | return (aParticleType.GetPDGCharge() != 0); |
---|
| 180 | } else { |
---|
| 181 | return false; |
---|
| 182 | } |
---|
| 183 | } |
---|
| 184 | |
---|
| 185 | inline |
---|
| 186 | void G4Cerenkov::SetTrackSecondariesFirst(const G4bool state) |
---|
| 187 | { |
---|
| 188 | fTrackSecondariesFirst = state; |
---|
| 189 | } |
---|
| 190 | |
---|
| 191 | inline |
---|
| 192 | void G4Cerenkov::SetMaxNumPhotonsPerStep(const G4int NumPhotons) |
---|
| 193 | { |
---|
| 194 | fMaxPhotons = NumPhotons; |
---|
| 195 | } |
---|
| 196 | |
---|
| 197 | inline |
---|
| 198 | void G4Cerenkov::DumpPhysicsTable() const |
---|
| 199 | { |
---|
| 200 | G4int PhysicsTableSize = thePhysicsTable->entries(); |
---|
| 201 | G4PhysicsOrderedFreeVector *v; |
---|
| 202 | |
---|
| 203 | for (G4int i = 0 ; i < PhysicsTableSize ; i++ ) |
---|
| 204 | { |
---|
| 205 | v = (G4PhysicsOrderedFreeVector*)(*thePhysicsTable)[i]; |
---|
| 206 | v->DumpValues(); |
---|
| 207 | } |
---|
| 208 | } |
---|
| 209 | |
---|
| 210 | inline G4PhysicsTable* G4Cerenkov::GetPhysicsTable() const |
---|
| 211 | { |
---|
| 212 | return thePhysicsTable; |
---|
| 213 | } |
---|
| 214 | |
---|
| 215 | #endif /* G4Cerenkov_h */ |
---|