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