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