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 // 7 // >> 8 // $Id: G4Cerenkov.hh,v 1.3.4.1 1999/12/07 20:51:23 gunter Exp $ >> 9 // GEANT4 tag $Name: geant4-01-00 $ >> 10 // >> 11 // 26 ////////////////////////////////////////////// 12 //////////////////////////////////////////////////////////////////////// 27 // Cerenkov Radiation Class Definition << 13 // Cerenkov Radiation Class Definition 28 ////////////////////////////////////////////// 14 //////////////////////////////////////////////////////////////////////// 29 // 15 // 30 // File: G4Cerenkov.hh << 16 // File: G4Cerenkov.hh 31 // Description: Discrete Process - Generation << 17 // Description: Continuous Process -- Generation of Cerenkov Photons 32 // Version: 2.0 18 // Version: 2.0 33 // Created: 1996-02-21 19 // Created: 1996-02-21 34 // Author: Juliet Armstrong 20 // Author: Juliet Armstrong 35 // Updated: 2007-09-30 change inheritance << 21 // Updated: 1999-10-29 add method and class descriptors 36 // 2005-07-28 add G4ProcessType t << 37 // 1999-10-29 add method and clas << 38 // 1997-04-09 by Peter Gumplinger 22 // 1997-04-09 by Peter Gumplinger 39 // > G4MaterialPropertiesTable; n 23 // > G4MaterialPropertiesTable; new physics/tracking scheme >> 24 // mail: gum@triumf.ca 40 // 25 // 41 ////////////////////////////////////////////// 26 //////////////////////////////////////////////////////////////////////// 42 27 43 #ifndef G4Cerenkov_h 28 #ifndef G4Cerenkov_h 44 #define G4Cerenkov_h 1 29 #define G4Cerenkov_h 1 45 30 >> 31 ///////////// >> 32 // Includes >> 33 ///////////// >> 34 46 #include "globals.hh" 35 #include "globals.hh" >> 36 #include "templates.hh" >> 37 #include "Randomize.hh" >> 38 #include "G4ThreeVector.hh" >> 39 #include "G4ParticleMomentum.hh" >> 40 #include "G4Step.hh" >> 41 #include "G4VContinuousProcess.hh" >> 42 #include "G4OpticalPhoton.hh" 47 #include "G4DynamicParticle.hh" 43 #include "G4DynamicParticle.hh" 48 #include "G4ForceCondition.hh" << 44 #include "G4Material.hh" 49 #include "G4GPILSelection.hh" << 45 #include "G4PhysicsTable.hh" 50 #include "G4MaterialPropertyVector.hh" << 46 #include "G4MaterialPropertiesTable.hh" 51 #include "G4VProcess.hh" << 47 #include "G4PhysicsOrderedFreeVector.hh" 52 << 48 53 class G4Material; << 49 // Class Description: 54 class G4ParticleDefinition; << 50 // Continuous Process -- Generation of Cerenkov Photons. 55 class G4PhysicsTable; << 51 // Class inherits publicly from G4VContinuousProcess. 56 class G4Step; << 52 // Class Description - End: 57 class G4Track; << 53 58 class G4VParticleChange; << 54 ///////////////////// >> 55 // Class Definition >> 56 ///////////////////// 59 57 60 class G4Cerenkov : public G4VProcess << 58 class G4Cerenkov : public G4VContinuousProcess 61 { 59 { 62 public: << 63 explicit G4Cerenkov(const G4String& processN << 64 G4ProcessType type << 65 ~G4Cerenkov(); << 66 << 67 explicit G4Cerenkov(const G4Cerenkov& right) << 68 << 69 G4Cerenkov& operator=(const G4Cerenkov& righ << 70 << 71 G4bool IsApplicable(const G4ParticleDefiniti << 72 // Returns true -> 'is applicable', for all << 73 // except short-lived particles. << 74 << 75 void BuildPhysicsTable(const G4ParticleDefin << 76 // Build table at a right time << 77 << 78 void PreparePhysicsTable(const G4ParticleDef << 79 void Initialise(); << 80 << 81 G4double GetMeanFreePath(const G4Track& aTra << 82 // Returns the discrete step limit and sets << 83 // condition for the DoIt to be invoked at e << 84 << 85 G4double PostStepGetPhysicalInteractionLengt << 86 << 87 // Returns the discrete step limit and sets << 88 // condition for the DoIt to be invoked at e << 89 << 90 G4VParticleChange* PostStepDoIt(const G4Trac << 91 const G4Step << 92 // This is the method implementing the Ceren << 93 << 94 // no operation in AtRestDoIt and AlongSt << 95 virtual G4double AlongStepGetPhysicalInterac << 96 const G4Track&, G4double, G4double, G4doub << 97 { << 98 return -1.0; << 99 }; << 100 << 101 virtual G4double AtRestGetPhysicalInteractio << 102 const G4Track&, G4ForceCondition*) overrid << 103 { << 104 return -1.0; << 105 }; << 106 << 107 // no operation in AtRestDoIt and AlongSt << 108 virtual G4VParticleChange* AtRestDoIt(const << 109 { << 110 return nullptr; << 111 }; << 112 << 113 virtual G4VParticleChange* AlongStepDoIt(con << 114 con << 115 { << 116 return nullptr; << 117 }; << 118 << 119 void SetTrackSecondariesFirst(const G4bool s << 120 // If set, the primary particle tracking is << 121 // produced Cerenkov photons are tracked nex << 122 // been tracked, the tracking of the primary << 123 << 124 G4bool GetTrackSecondariesFirst() const; << 125 // Returns the boolean flag for tracking sec << 126 << 127 void SetMaxBetaChangePerStep(const G4double << 128 // Set the maximum allowed change in beta = << 129 << 130 G4double GetMaxBetaChangePerStep() const; << 131 // Returns the maximum allowed change in bet << 132 << 133 void SetMaxNumPhotonsPerStep(const G4int Num << 134 // Set the maximum number of Cerenkov photon << 135 // a tracking step. This is an average ONLY; << 136 // around this average. If invoked, the maxi << 137 // of the size set. If not called, the step << 138 // photons generated. << 139 << 140 G4int GetMaxNumPhotonsPerStep() const; << 141 // Returns the maximum number of Cerenkov ph << 142 // generated during a tracking step. << 143 << 144 void SetStackPhotons(const G4bool); << 145 // Call by the user to set the flag for stac << 146 << 147 G4bool GetStackPhotons() const; << 148 // Return the boolean for whether or not the << 149 << 150 G4int GetNumPhotons() const; << 151 // Returns the current number of scint. phot << 152 << 153 G4PhysicsTable* GetPhysicsTable() const; << 154 // Returns the address of the physics table. << 155 << 156 void DumpPhysicsTable() const; << 157 // Prints the physics table. << 158 << 159 G4double GetAverageNumberOfPhotons(const G4d << 160 const G4M << 161 G4Materia << 162 << 163 void DumpInfo() const override {ProcessDescr << 164 void ProcessDescription(std::ostream& out) c << 165 << 166 void SetVerboseLevel(G4int); << 167 // sets verbosity << 168 << 169 protected: << 170 G4PhysicsTable* thePhysicsTable; << 171 << 172 private: << 173 G4double fMaxBetaChange; << 174 << 175 G4int fMaxPhotons; << 176 G4int fNumPhotons; << 177 60 178 G4bool fStackingFlag; << 61 private: 179 G4bool fTrackSecondariesFirst; << 62 >> 63 ////////////// >> 64 // Operators >> 65 ////////////// >> 66 >> 67 // G4Cerenkov& operator=(const G4Cerenkov &right); >> 68 >> 69 public: // Without description >> 70 >> 71 //////////////////////////////// >> 72 // Constructors and Destructor >> 73 //////////////////////////////// >> 74 >> 75 G4Cerenkov(const G4String& processName = "Cerenkov"); >> 76 >> 77 // G4Cerenkov(const G4Cerenkov &right); >> 78 >> 79 ~G4Cerenkov(); >> 80 >> 81 //////////// >> 82 // Methods >> 83 //////////// >> 84 >> 85 public: // With description >> 86 >> 87 G4bool IsApplicable(const G4ParticleDefinition& aParticleType); >> 88 // Returns true -> 'is applicable', for all charged particles. >> 89 >> 90 G4double GetContinuousStepLimit(const G4Track& aTrack, >> 91 G4double , >> 92 G4double , >> 93 G4double& ); >> 94 // Returns the continuous step limit defined by the Cerenkov >> 95 // process. >> 96 >> 97 G4VParticleChange* AlongStepDoIt(const G4Track& aTrack, >> 98 const G4Step& aStep); >> 99 // This is the method implementing the Cerenkov process. >> 100 >> 101 void SetTrackSecondariesFirst(const G4bool state); >> 102 // If set, the primary particle tracking is interrupted and any >> 103 // produced Cerenkov photons are tracked next. When all have >> 104 // been tracked, the tracking of the primary resumes. >> 105 >> 106 void SetMaxNumPhotonsPerStep(const G4int NumPhotons); >> 107 // Set the maximum number of Cerenkov photons allowed to be >> 108 // generated during a tracking step. This is an average ONLY; >> 109 // the actual number will vary around this average. If invoked, >> 110 // the maximum photon stack will roughly be of the size set. >> 111 // If not called, the step is not limited by the number of >> 112 // photons generated. 180 113 181 G4int secID = -1; // creator modelID << 114 G4PhysicsTable* GetPhysicsTable() const; >> 115 // Returns the address of the physics table. 182 116 >> 117 void DumpPhysicsTable() const; >> 118 // Prints the physics table. >> 119 >> 120 private: >> 121 >> 122 void BuildThePhysicsTable(); >> 123 >> 124 ///////////////////// >> 125 // Helper Functions >> 126 ///////////////////// >> 127 >> 128 G4double GetAverageNumberOfPhotons(const G4DynamicParticle *aParticle, >> 129 const G4Material *aMaterial, >> 130 const G4MaterialPropertyVector* Rindex) const; >> 131 >> 132 /////////////////////// >> 133 // Class Data Members >> 134 /////////////////////// >> 135 >> 136 protected: >> 137 >> 138 G4PhysicsTable* thePhysicsTable; >> 139 // A Physics Table can be either a cross-sections table or >> 140 // an energy table (or can be used for other specific >> 141 // purposes). >> 142 >> 143 private: >> 144 >> 145 G4bool fTrackSecondariesFirst; >> 146 G4int fMaxPhotons; 183 }; 147 }; 184 148 185 inline G4bool G4Cerenkov::GetTrackSecondariesF << 149 //////////////////// >> 150 // Inline methods >> 151 //////////////////// >> 152 >> 153 inline >> 154 G4bool G4Cerenkov::IsApplicable(const G4ParticleDefinition& aParticleType) 186 { 155 { 187 return fTrackSecondariesFirst; << 156 return (aParticleType.GetPDGCharge() != 0); 188 } 157 } 189 158 190 inline G4double G4Cerenkov::GetMaxBetaChangePe << 159 inline 191 { << 160 void G4Cerenkov::SetTrackSecondariesFirst(const G4bool state) 192 return fMaxBetaChange; << 161 { >> 162 fTrackSecondariesFirst = state; 193 } 163 } 194 164 195 inline G4int G4Cerenkov::GetMaxNumPhotonsPerSt << 165 inline >> 166 void G4Cerenkov::SetMaxNumPhotonsPerStep(const G4int NumPhotons) >> 167 { >> 168 fMaxPhotons = NumPhotons; >> 169 } 196 170 197 inline G4bool G4Cerenkov::GetStackPhotons() co << 171 inline >> 172 void G4Cerenkov::DumpPhysicsTable() const >> 173 { >> 174 G4int PhysicsTableSize = thePhysicsTable->entries(); >> 175 G4PhysicsOrderedFreeVector *v; 198 176 199 inline G4int G4Cerenkov::GetNumPhotons() const << 177 for (G4int i = 0 ; i < PhysicsTableSize ; i++ ) >> 178 { >> 179 v = (G4PhysicsOrderedFreeVector*)(*thePhysicsTable)[i]; >> 180 v->DumpValues(); >> 181 } >> 182 } 200 183 201 inline G4PhysicsTable* G4Cerenkov::GetPhysicsT 184 inline G4PhysicsTable* G4Cerenkov::GetPhysicsTable() const 202 { 185 { 203 return thePhysicsTable; 186 return thePhysicsTable; 204 } 187 } 205 188 206 #endif /* G4Cerenkov_h */ 189 #endif /* G4Cerenkov_h */ 207 190