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 // >> 27 // $Id: G4Cerenkov.hh 98002 2016-06-30 13:03:36Z gcosmo $ >> 28 // >> 29 // 26 ////////////////////////////////////////////// 30 //////////////////////////////////////////////////////////////////////// 27 // Cerenkov Radiation Class Definition 31 // Cerenkov Radiation Class Definition 28 ////////////////////////////////////////////// 32 //////////////////////////////////////////////////////////////////////// 29 // 33 // 30 // File: G4Cerenkov.hh 34 // File: G4Cerenkov.hh 31 // Description: Discrete Process - Generation 35 // Description: Discrete Process - Generation of Cerenkov Photons 32 // Version: 2.0 36 // Version: 2.0 33 // Created: 1996-02-21 37 // Created: 1996-02-21 34 // Author: Juliet Armstrong 38 // Author: Juliet Armstrong 35 // Updated: 2007-09-30 change inheritance 39 // Updated: 2007-09-30 change inheritance to G4VDiscreteProcess 36 // 2005-07-28 add G4ProcessType t 40 // 2005-07-28 add G4ProcessType to constructor 37 // 1999-10-29 add method and clas 41 // 1999-10-29 add method and class descriptors 38 // 1997-04-09 by Peter Gumplinger 42 // 1997-04-09 by Peter Gumplinger 39 // > G4MaterialPropertiesTable; n 43 // > G4MaterialPropertiesTable; new physics/tracking scheme >> 44 // mail: gum@triumf.ca 40 // 45 // 41 ////////////////////////////////////////////// 46 //////////////////////////////////////////////////////////////////////// 42 47 43 #ifndef G4Cerenkov_h 48 #ifndef G4Cerenkov_h 44 #define G4Cerenkov_h 1 49 #define G4Cerenkov_h 1 45 50 >> 51 ///////////// >> 52 // Includes >> 53 ///////////// >> 54 >> 55 #include <CLHEP/Units/SystemOfUnits.h> >> 56 46 #include "globals.hh" 57 #include "globals.hh" >> 58 #include "templates.hh" >> 59 #include "Randomize.hh" >> 60 #include "G4ThreeVector.hh" >> 61 #include "G4ParticleMomentum.hh" >> 62 #include "G4Step.hh" >> 63 #include "G4VProcess.hh" >> 64 #include "G4OpticalPhoton.hh" 47 #include "G4DynamicParticle.hh" 65 #include "G4DynamicParticle.hh" 48 #include "G4ForceCondition.hh" << 66 #include "G4Material.hh" 49 #include "G4GPILSelection.hh" << 67 #include "G4PhysicsTable.hh" 50 #include "G4MaterialPropertyVector.hh" 68 #include "G4MaterialPropertyVector.hh" 51 #include "G4VProcess.hh" << 69 #include "G4MaterialPropertiesTable.hh" >> 70 #include "G4PhysicsOrderedFreeVector.hh" 52 71 53 class G4Material; << 72 // Class Description: 54 class G4ParticleDefinition; << 73 // Discrete Process -- Generation of Cerenkov Photons. 55 class G4PhysicsTable; << 74 // Class inherits publicly from G4VDiscreteProcess. 56 class G4Step; << 75 // Class Description - End: 57 class G4Track; << 76 58 class G4VParticleChange; << 77 ///////////////////// >> 78 // Class Definition >> 79 ///////////////////// 59 80 60 class G4Cerenkov : public G4VProcess 81 class G4Cerenkov : public G4VProcess 61 { 82 { 62 public: << 83 63 explicit G4Cerenkov(const G4String& processN << 84 public: 64 G4ProcessType type << 85 >> 86 //////////////////////////////// >> 87 // Constructors and Destructor >> 88 //////////////////////////////// >> 89 >> 90 explicit G4Cerenkov(const G4String& processName = "Cerenkov", >> 91 G4ProcessType type = fElectromagnetic); 65 ~G4Cerenkov(); 92 ~G4Cerenkov(); 66 93 67 explicit G4Cerenkov(const G4Cerenkov& right) << 94 explicit G4Cerenkov(const G4Cerenkov &right); >> 95 >> 96 private: 68 97 69 G4Cerenkov& operator=(const G4Cerenkov& righ << 98 ////////////// >> 99 // Operators >> 100 ////////////// >> 101 >> 102 G4Cerenkov& operator=(const G4Cerenkov &right) = delete; >> 103 >> 104 public: >> 105 >> 106 //////////// >> 107 // Methods >> 108 //////////// 70 109 71 G4bool IsApplicable(const G4ParticleDefiniti 110 G4bool IsApplicable(const G4ParticleDefinition& aParticleType) override; 72 // Returns true -> 'is applicable', for all 111 // Returns true -> 'is applicable', for all charged particles 73 // except short-lived particles. 112 // except short-lived particles. 74 113 75 void BuildPhysicsTable(const G4ParticleDefin 114 void BuildPhysicsTable(const G4ParticleDefinition& aParticleType) override; 76 // Build table at a right time 115 // Build table at a right time 77 116 78 void PreparePhysicsTable(const G4ParticleDef << 117 G4double GetMeanFreePath(const G4Track& aTrack, 79 void Initialise(); << 118 G4double, G4ForceCondition* ); 80 << 81 G4double GetMeanFreePath(const G4Track& aTra << 82 // Returns the discrete step limit and sets 119 // Returns the discrete step limit and sets the 'StronglyForced' 83 // condition for the DoIt to be invoked at e 120 // condition for the DoIt to be invoked at every step. 84 121 85 G4double PostStepGetPhysicalInteractionLengt << 122 G4double PostStepGetPhysicalInteractionLength(const G4Track& aTrack, 86 << 123 G4double , >> 124 G4ForceCondition* ) override; 87 // Returns the discrete step limit and sets 125 // Returns the discrete step limit and sets the 'StronglyForced' 88 // condition for the DoIt to be invoked at e 126 // condition for the DoIt to be invoked at every step. 89 127 90 G4VParticleChange* PostStepDoIt(const G4Trac << 128 G4VParticleChange* PostStepDoIt(const G4Track& aTrack, 91 const G4Step << 129 const G4Step& aStep) override; 92 // This is the method implementing the Ceren 130 // This is the method implementing the Cerenkov process. 93 131 94 // no operation in AtRestDoIt and AlongSt 132 // no operation in AtRestDoIt and AlongStepDoIt 95 virtual G4double AlongStepGetPhysicalInterac << 133 virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track&, 96 const G4Track&, G4double, G4double, G4doub << 134 G4double , 97 { << 135 G4double , 98 return -1.0; << 136 G4double& , 99 }; << 137 G4GPILSelection* 100 << 138 ) override { return -1.0; }; 101 virtual G4double AtRestGetPhysicalInteractio << 139 102 const G4Track&, G4ForceCondition*) overrid << 140 virtual G4double AtRestGetPhysicalInteractionLength(const G4Track& , 103 { << 141 G4ForceCondition* 104 return -1.0; << 142 ) override { return -1.0; }; 105 }; << 106 143 107 // no operation in AtRestDoIt and AlongSt 144 // no operation in AtRestDoIt and AlongStepDoIt 108 virtual G4VParticleChange* AtRestDoIt(const << 145 virtual G4VParticleChange* AtRestDoIt(const G4Track& , const G4Step& ) 109 { << 146 override {return nullptr;}; 110 return nullptr; << 147 111 }; << 148 virtual G4VParticleChange* AlongStepDoIt(const G4Track& , const G4Step&) 112 << 149 override {return nullptr;}; 113 virtual G4VParticleChange* AlongStepDoIt(con << 114 con << 115 { << 116 return nullptr; << 117 }; << 118 150 119 void SetTrackSecondariesFirst(const G4bool s 151 void SetTrackSecondariesFirst(const G4bool state); 120 // If set, the primary particle tracking is << 152 // If set, the primary particle tracking is interrupted and any 121 // produced Cerenkov photons are tracked nex << 153 // produced Cerenkov photons are tracked next. When all have 122 // been tracked, the tracking of the primary 154 // been tracked, the tracking of the primary resumes. 123 155 124 G4bool GetTrackSecondariesFirst() const; 156 G4bool GetTrackSecondariesFirst() const; 125 // Returns the boolean flag for tracking sec 157 // Returns the boolean flag for tracking secondaries first. 126 158 127 void SetMaxBetaChangePerStep(const G4double 159 void SetMaxBetaChangePerStep(const G4double d); 128 // Set the maximum allowed change in beta = << 160 // Set the maximum allowed change in beta = v/c in % (perCent) >> 161 // per step. 129 162 130 G4double GetMaxBetaChangePerStep() const; 163 G4double GetMaxBetaChangePerStep() const; 131 // Returns the maximum allowed change in bet 164 // Returns the maximum allowed change in beta = v/c in % (perCent) 132 165 133 void SetMaxNumPhotonsPerStep(const G4int Num 166 void SetMaxNumPhotonsPerStep(const G4int NumPhotons); 134 // Set the maximum number of Cerenkov photon << 167 // Set the maximum number of Cerenkov photons allowed to be 135 // a tracking step. This is an average ONLY; << 168 // generated during a tracking step. This is an average ONLY; 136 // around this average. If invoked, the maxi << 169 // the actual number will vary around this average. If invoked, 137 // of the size set. If not called, the step << 170 // the maximum photon stack will roughly be of the size set. >> 171 // If not called, the step is not limited by the number of 138 // photons generated. 172 // photons generated. 139 173 140 G4int GetMaxNumPhotonsPerStep() const; 174 G4int GetMaxNumPhotonsPerStep() const; 141 // Returns the maximum number of Cerenkov ph 175 // Returns the maximum number of Cerenkov photons allowed to be 142 // generated during a tracking step. 176 // generated during a tracking step. 143 177 144 void SetStackPhotons(const G4bool); << 178 void SetStackPhotons(const G4bool ); 145 // Call by the user to set the flag for stac 179 // Call by the user to set the flag for stacking the scint. photons 146 180 147 G4bool GetStackPhotons() const; 181 G4bool GetStackPhotons() const; 148 // Return the boolean for whether or not the 182 // Return the boolean for whether or not the scint. photons are stacked 149 183 150 G4int GetNumPhotons() const; 184 G4int GetNumPhotons() const; 151 // Returns the current number of scint. phot 185 // Returns the current number of scint. photons (after PostStepDoIt) 152 186 153 G4PhysicsTable* GetPhysicsTable() const; 187 G4PhysicsTable* GetPhysicsTable() const; 154 // Returns the address of the physics table. 188 // Returns the address of the physics table. 155 189 156 void DumpPhysicsTable() const; 190 void DumpPhysicsTable() const; 157 // Prints the physics table. 191 // Prints the physics table. 158 192 159 G4double GetAverageNumberOfPhotons(const G4d << 193 private: 160 const G4M << 194 >> 195 void BuildThePhysicsTable(); >> 196 >> 197 ///////////////////// >> 198 // Helper Functions >> 199 ///////////////////// >> 200 >> 201 G4double GetAverageNumberOfPhotons(const G4double charge, >> 202 const G4double beta, >> 203 const G4Material *aMaterial, 161 G4Materia 204 G4MaterialPropertyVector* Rindex) const; 162 205 163 void DumpInfo() const override {ProcessDescr << 206 /////////////////////// 164 void ProcessDescription(std::ostream& out) c << 207 // Class Data Members >> 208 /////////////////////// 165 209 166 void SetVerboseLevel(G4int); << 210 protected: 167 // sets verbosity << 168 211 169 protected: << 170 G4PhysicsTable* thePhysicsTable; 212 G4PhysicsTable* thePhysicsTable; >> 213 // A Physics Table can be either a cross-sections table or >> 214 // an energy table (or can be used for other specific >> 215 // purposes). 171 216 172 private: << 217 private: 173 G4double fMaxBetaChange; << 174 << 175 G4int fMaxPhotons; << 176 G4int fNumPhotons; << 177 218 178 G4bool fStackingFlag; << 179 G4bool fTrackSecondariesFirst; 219 G4bool fTrackSecondariesFirst; >> 220 G4double fMaxBetaChange; >> 221 G4int fMaxPhotons; 180 222 181 G4int secID = -1; // creator modelID << 223 G4bool fStackingFlag; 182 224 >> 225 G4int fNumPhotons; 183 }; 226 }; 184 227 185 inline G4bool G4Cerenkov::GetTrackSecondariesF << 228 //////////////////// >> 229 // Inline methods >> 230 //////////////////// >> 231 >> 232 inline >> 233 G4bool G4Cerenkov::GetTrackSecondariesFirst() const 186 { 234 { 187 return fTrackSecondariesFirst; 235 return fTrackSecondariesFirst; 188 } 236 } 189 237 190 inline G4double G4Cerenkov::GetMaxBetaChangePe << 238 inline >> 239 G4double G4Cerenkov::GetMaxBetaChangePerStep() const 191 { 240 { 192 return fMaxBetaChange; 241 return fMaxBetaChange; 193 } 242 } 194 243 195 inline G4int G4Cerenkov::GetMaxNumPhotonsPerSt << 244 inline >> 245 G4int G4Cerenkov::GetMaxNumPhotonsPerStep() const >> 246 { >> 247 return fMaxPhotons; >> 248 } 196 249 197 inline G4bool G4Cerenkov::GetStackPhotons() co << 250 inline >> 251 void G4Cerenkov::SetStackPhotons(const G4bool stackingFlag) >> 252 { >> 253 fStackingFlag = stackingFlag; >> 254 } 198 255 199 inline G4int G4Cerenkov::GetNumPhotons() const << 256 inline >> 257 G4bool G4Cerenkov::GetStackPhotons() const >> 258 { >> 259 return fStackingFlag; >> 260 } >> 261 >> 262 inline >> 263 G4int G4Cerenkov::GetNumPhotons() const >> 264 { >> 265 return fNumPhotons; >> 266 } >> 267 >> 268 inline >> 269 void G4Cerenkov::DumpPhysicsTable() const >> 270 { >> 271 G4int PhysicsTableSize = thePhysicsTable->entries(); >> 272 G4PhysicsOrderedFreeVector *v; >> 273 >> 274 for (G4int i = 0 ; i < PhysicsTableSize ; i++ ) { >> 275 v = (G4PhysicsOrderedFreeVector*)(*thePhysicsTable)[i]; >> 276 v->DumpValues(); >> 277 } >> 278 } 200 279 201 inline G4PhysicsTable* G4Cerenkov::GetPhysicsT << 280 inline >> 281 G4PhysicsTable* G4Cerenkov::GetPhysicsTable() const 202 { 282 { 203 return thePhysicsTable; 283 return thePhysicsTable; 204 } 284 } 205 285 206 #endif /* G4Cerenkov_h */ 286 #endif /* G4Cerenkov_h */ 207 287