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 // G4ParticleWithCuts << 27 // 23 // 28 // Dummy class for G4ParticleDefinition << 24 // $Id: G4ParticleWithCuts.hh,v 1.7.2.2 2001/06/28 20:19:09 gunter Exp $ >> 25 // GEANT4 tag $Name: $ >> 26 // >> 27 // >> 28 // ------------------------------------------------------------ >> 29 // GEANT 4 class header file >> 30 // >> 31 // History: first implementation, based on object model of >> 32 // Hisaya Kurashige, 21 Oct 1996 >> 33 // Calculation of Range Table is based on >> 34 // implementeation for Muon by L.Urban, 10 May 1996 >> 35 // ---------------------------------------------------------------- >> 36 // modified by Hisaya Kurashige, 04 Jan 1997 >> 37 // added verboseLevel by Hisaya Kurashige 13 Nov 1997 >> 38 // added ReCalcCuts() and ResetCuts H.Kurashige 15 Nov.1996 >> 39 // BuildPhysicsTable() becomes dummy H.Kurashige 06 June 1998 >> 40 // added GetEnergyThreshold H.Kurashige 08 June 1998 >> 41 // change Lowest/HighestEnergy as static H.Kurashige 18 June 1998 >> 42 // added RestoreCuts H.Kurashige 09 Mar. 2001 >> 43 // ---------------------------------------------------------------- >> 44 // Class Description >> 45 // "theCutInMaxInteractionLength", for charged particles, is >> 46 // coincident with a cut in stopping range; for neutral >> 47 // particles it corresponds to the distance allowed by >> 48 // the total cross section. >> 49 // "theKineticEnergyCuts" is the vector of cuts in kinetic >> 50 // energy (a value per material); it is allocated/computed >> 51 // in the specific SetCuts method. >> 52 // void SetCuts(G4double aCut): >> 53 // Sets the cuts values relative to this particle type in stopping >> 54 // range (or absorption length) and converts those cuts into energy cuts >> 55 // for all the materials defined in the Material table. >> 56 // [in protected method of CalcEnergyCuts(G4double aCut) ; >> 57 // It also triggers the recomputation of the physics tables of the >> 58 // void ReCalcCuts(): >> 59 // Re calculate energy cut values with the previous cut value in range >> 60 // void ResetCuts(): >> 61 // Reset alll cut values in energy, though theCutInMaxInteractionLength >> 62 // remains unchanged >> 63 // G4double GetCuts(): >> 64 // Returns value of the cut in interaction length for all the >> 65 // processes of this particle type. >> 66 // const G4double* GetCutsInEnergy(); >> 67 // Returns vector of energy cuts (ordered per material) >> 68 // corresponding to the current stopping range or absorption length >> 69 // 29 70 30 // Author: H.Kurashige, 9 March 2001 << 31 // ------------------------------------------- << 32 #ifndef G4ParticleWithCuts_h 71 #ifndef G4ParticleWithCuts_h 33 #define G4ParticleWithCuts_h 1 72 #define G4ParticleWithCuts_h 1 34 73 >> 74 #include "globals.hh" >> 75 #include "G4ios.hh" 35 #include "G4ParticleDefinition.hh" 76 #include "G4ParticleDefinition.hh" 36 77 37 using G4ParticleWithCuts = G4ParticleDefinitio << 78 #include "G4PhysicsTable.hh" >> 79 #include "G4Element.hh" >> 80 #include "G4Material.hh" >> 81 class G4PhysicsLogVector; >> 82 >> 83 >> 84 class G4ParticleWithCuts : public G4ParticleDefinition >> 85 { >> 86 public: >> 87 G4ParticleWithCuts(const G4String& aName, >> 88 G4double mass, >> 89 G4double width, >> 90 G4double charge, >> 91 G4int iSpin, >> 92 G4int iParity, >> 93 G4int iConjugation, >> 94 G4int iIsospin, >> 95 G4int iIsospinZ, >> 96 G4int gParity, >> 97 const G4String& pType, >> 98 G4int lepton, >> 99 G4int baryon, >> 100 G4int encoding, >> 101 G4bool stable, >> 102 G4double lifetime, >> 103 G4DecayTable *decaytable, >> 104 G4bool resonance = false); >> 105 virtual ~G4ParticleWithCuts(); >> 106 >> 107 //--------------for SetCuts------------------------------------------- >> 108 protected: >> 109 G4double theCutInMaxInteractionLength; >> 110 G4double* theKineticEnergyCuts; >> 111 >> 112 public: // With Description >> 113 // virtual methods derived from G4ParticleDefinition >> 114 virtual void ResetCuts(); >> 115 // Reset alll cut values in energy >> 116 // but theCutInMaxInteractionLength remain unchanged >> 117 virtual void ReCalcCuts(); >> 118 // Set cut values in energy derived from theCutInMaxInteractionLength >> 119 virtual void SetCuts(G4double aCut); >> 120 // Set cut values in energy derived from the cut range of aCut >> 121 >> 122 virtual G4double GetLengthCuts() const; >> 123 virtual G4double* GetEnergyCuts() const; >> 124 >> 125 virtual G4double GetEnergyThreshold(const G4Material* aMaterial) const; >> 126 static void SetEnergyRange(G4double, G4double); >> 127 >> 128 public: // With Description >> 129 // This method concerning cut values is supposed to be used by >> 130 // G4VUserPhysicsList to restore cutvalues witout calculation >> 131 >> 132 virtual void RestoreCuts(G4double cutInLength, >> 133 const G4double* cutInEnergy ); >> 134 >> 135 protected: >> 136 virtual void CalcEnergyCuts(G4double aCut); >> 137 >> 138 // BuildPhysicsTable is defined as a dummy routine >> 139 void BuildPhysicsTable() {}; >> 140 >> 141 //-------------- Loss Table ------------------------------------------ >> 142 // theLossTable is a collection of loss vectors for all elements. >> 143 // Each loss vector has energy loss values (cross section values >> 144 // for neutral particles) which are calculated by >> 145 // ComputeLoss(G4double AtomicNumber,G4double KineticEnergy). >> 146 >> 147 protected: >> 148 typedef G4PhysicsTable G4LossTable; >> 149 G4LossTable* theLossTable; >> 150 G4int NumberOfElements; >> 151 >> 152 typedef G4PhysicsLogVector G4LossVector; >> 153 static G4double LowestEnergy, HighestEnergy; >> 154 G4int TotBin; >> 155 >> 156 protected: >> 157 virtual void BuildLossTable(); >> 158 virtual G4double ComputeLoss(G4double AtomicNumber, >> 159 G4double KineticEnergy >> 160 ) const; >> 161 //-------------- Range Table ------------------------------------------ >> 162 protected: >> 163 typedef G4PhysicsLogVector G4RangeVector; >> 164 virtual void BuildRangeVector(const G4Material* aMaterial, >> 165 const G4LossTable* aLossTable, >> 166 G4double maxEnergy, >> 167 G4double aMass, >> 168 G4RangeVector* rangeVector); >> 169 >> 170 protected: >> 171 G4double ConvertCutToKineticEnergy( >> 172 G4RangeVector* theRangeVector >> 173 ) const; >> 174 >> 175 static G4double RangeLinSimpson( >> 176 const G4ElementVector* elementVector, >> 177 const G4double* atomicNumDensityVector, >> 178 const G4LossTable* aLossTable, >> 179 G4double aMass, >> 180 G4double taulow, G4double tauhigh, >> 181 G4int nbin, G4int NumEl >> 182 ); >> 183 static G4double RangeLogSimpson( >> 184 const G4ElementVector* elementVector, >> 185 const G4double* atomicNumDensityVector, >> 186 const G4LossTable* aLossTable, >> 187 G4double aMass, >> 188 G4double ltaulow, G4double ltauhigh, >> 189 G4int nbin, G4int NumEl >> 190 ); >> 191 }; 38 192 >> 193 inline G4double G4ParticleWithCuts::GetLengthCuts() const >> 194 { >> 195 return theCutInMaxInteractionLength; >> 196 } >> 197 >> 198 inline G4double* G4ParticleWithCuts::GetEnergyCuts() const >> 199 { >> 200 return theKineticEnergyCuts; >> 201 } >> 202 >> 203 inline void G4ParticleWithCuts::ResetCuts() >> 204 { >> 205 if(theKineticEnergyCuts) delete [] theKineticEnergyCuts; >> 206 theKineticEnergyCuts = 0; >> 207 } >> 208 >> 209 inline void G4ParticleWithCuts::ReCalcCuts() >> 210 { >> 211 if (theCutInMaxInteractionLength>0.0) { >> 212 CalcEnergyCuts(theCutInMaxInteractionLength); >> 213 } else { >> 214 if (GetVerboseLevel()>0) { >> 215 G4cout << "G4ParticleWithCuts::ReCalcCuts() :"; >> 216 G4cout << "theCutInMaxInteractionLength is not defined " << G4endl; >> 217 } >> 218 } >> 219 } >> 220 >> 221 inline void G4ParticleWithCuts::SetCuts(G4double aCut) >> 222 { >> 223 CalcEnergyCuts(aCut); >> 224 } >> 225 >> 226 inline >> 227 void G4ParticleWithCuts::SetEnergyRange(G4double lowedge, G4double highedge) >> 228 { >> 229 LowestEnergy = lowedge; >> 230 HighestEnergy = highedge; >> 231 } >> 232 >> 233 #include "G4Material.hh" >> 234 >> 235 inline >> 236 G4double G4ParticleWithCuts::GetEnergyThreshold(const G4Material* aMaterial) const >> 237 { >> 238 return theKineticEnergyCuts[aMaterial->GetIndex()]; >> 239 } 39 #endif 240 #endif >> 241 >> 242 >> 243 >> 244 >> 245 >> 246 >> 247 >> 248 >> 249 40 250