| 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * License and Disclaimer *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of *
|
|---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and *
|
|---|
| 7 | // * conditions of the Geant4 Software License, included in the file *
|
|---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These *
|
|---|
| 9 | // * include a list of copyright holders. *
|
|---|
| 10 | // * *
|
|---|
| 11 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 12 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 13 | // * work make any representation or warranty, express or implied, *
|
|---|
| 14 | // * regarding this software system or assume any liability for its *
|
|---|
| 15 | // * use. Please see the license in the file LICENSE and URL above *
|
|---|
| 16 | // * for the full disclaimer and the limitation of liability. *
|
|---|
| 17 | // * *
|
|---|
| 18 | // * This code implementation is the result of the scientific and *
|
|---|
| 19 | // * technical work of the GEANT4 collaboration. *
|
|---|
| 20 | // * By using, copying, modifying or distributing the software (or *
|
|---|
| 21 | // * any work based on the software) you agree to acknowledge its *
|
|---|
| 22 | // * use in resulting scientific publications, and indicate your *
|
|---|
| 23 | // * acceptance of all terms of the Geant4 Software license. *
|
|---|
| 24 | // ********************************************************************
|
|---|
| 25 | //
|
|---|
| 26 | // $Id: G4UrbanMscModel2.hh,v 1.17 2009/05/15 09:26:42 urban Exp $
|
|---|
| 27 | // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
|
|---|
| 28 | //
|
|---|
| 29 | // -------------------------------------------------------------------
|
|---|
| 30 | //
|
|---|
| 31 | //
|
|---|
| 32 | // GEANT4 Class header file
|
|---|
| 33 | //
|
|---|
| 34 | //
|
|---|
| 35 | // File name: G4UrbanMscModel2
|
|---|
| 36 | //
|
|---|
| 37 | // Author: Laszlo Urban
|
|---|
| 38 | //
|
|---|
| 39 | // Creation date: 06.03.2008
|
|---|
| 40 | //
|
|---|
| 41 | // Modifications:
|
|---|
| 42 | // 23.04.2009 L.Urban updated parameterization in UpdateCache method
|
|---|
| 43 | //
|
|---|
| 44 | //
|
|---|
| 45 | // Class Description:
|
|---|
| 46 | //
|
|---|
| 47 | // Implementation of the model of multiple scattering based on
|
|---|
| 48 | // H.W.Lewis Phys Rev 78 (1950) 526 and L.Urban model
|
|---|
| 49 |
|
|---|
| 50 | // -------------------------------------------------------------------
|
|---|
| 51 | //
|
|---|
| 52 |
|
|---|
| 53 | #ifndef G4UrbanMscModel2_h
|
|---|
| 54 | #define G4UrbanMscModel2_h 1
|
|---|
| 55 |
|
|---|
| 56 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 57 |
|
|---|
| 58 | #include "G4VMscModel.hh"
|
|---|
| 59 | #include "G4PhysicsTable.hh"
|
|---|
| 60 | #include "G4MscStepLimitType.hh"
|
|---|
| 61 |
|
|---|
| 62 | class G4ParticleChangeForMSC;
|
|---|
| 63 | class G4SafetyHelper;
|
|---|
| 64 | class G4LossTableManager;
|
|---|
| 65 |
|
|---|
| 66 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 67 |
|
|---|
| 68 | class G4UrbanMscModel2 : public G4VMscModel
|
|---|
| 69 | {
|
|---|
| 70 |
|
|---|
| 71 | public:
|
|---|
| 72 |
|
|---|
| 73 | G4UrbanMscModel2(const G4String& nam = "UrbanMscUni2");
|
|---|
| 74 |
|
|---|
| 75 | virtual ~G4UrbanMscModel2();
|
|---|
| 76 |
|
|---|
| 77 | void Initialise(const G4ParticleDefinition*, const G4DataVector&);
|
|---|
| 78 |
|
|---|
| 79 | G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition* particle,
|
|---|
| 80 | G4double KineticEnergy,
|
|---|
| 81 | G4double AtomicNumber,
|
|---|
| 82 | G4double AtomicWeight=0.,
|
|---|
| 83 | G4double cut =0.,
|
|---|
| 84 | G4double emax=DBL_MAX);
|
|---|
| 85 |
|
|---|
| 86 | void SampleScattering(const G4DynamicParticle*,
|
|---|
| 87 | G4double safety);
|
|---|
| 88 |
|
|---|
| 89 | G4double ComputeTruePathLengthLimit(const G4Track& track,
|
|---|
| 90 | G4PhysicsTable* theLambdaTable,
|
|---|
| 91 | G4double currentMinimalStep);
|
|---|
| 92 |
|
|---|
| 93 | G4double ComputeGeomPathLength(G4double truePathLength);
|
|---|
| 94 |
|
|---|
| 95 | G4double ComputeTrueStepLength(G4double geomStepLength);
|
|---|
| 96 |
|
|---|
| 97 | G4double ComputeTheta0(G4double truePathLength,
|
|---|
| 98 | G4double KineticEnergy);
|
|---|
| 99 |
|
|---|
| 100 | private:
|
|---|
| 101 |
|
|---|
| 102 | G4double SimpleScattering(G4double xmeanth, G4double x2meanth);
|
|---|
| 103 |
|
|---|
| 104 | G4double SampleCosineTheta(G4double trueStepLength, G4double KineticEnergy);
|
|---|
| 105 |
|
|---|
| 106 | G4double SampleDisplacement();
|
|---|
| 107 |
|
|---|
| 108 | G4double LatCorrelation();
|
|---|
| 109 |
|
|---|
| 110 | inline G4double GetLambda(G4double kinEnergy);
|
|---|
| 111 |
|
|---|
| 112 | inline void SetParticle(const G4ParticleDefinition*);
|
|---|
| 113 |
|
|---|
| 114 | inline void UpdateCache();
|
|---|
| 115 |
|
|---|
| 116 | // hide assignment operator
|
|---|
| 117 | G4UrbanMscModel2 & operator=(const G4UrbanMscModel2 &right);
|
|---|
| 118 | G4UrbanMscModel2(const G4UrbanMscModel2&);
|
|---|
| 119 |
|
|---|
| 120 | const G4ParticleDefinition* particle;
|
|---|
| 121 | G4ParticleChangeForMSC* fParticleChange;
|
|---|
| 122 |
|
|---|
| 123 | G4PhysicsTable* theLambdaTable;
|
|---|
| 124 | const G4MaterialCutsCouple* couple;
|
|---|
| 125 | G4LossTableManager* theManager;
|
|---|
| 126 |
|
|---|
| 127 | G4double mass;
|
|---|
| 128 | G4double charge,ChargeSquare;
|
|---|
| 129 | G4double masslimite,lambdalimit,fr;
|
|---|
| 130 |
|
|---|
| 131 | G4double taubig;
|
|---|
| 132 | G4double tausmall;
|
|---|
| 133 | G4double taulim;
|
|---|
| 134 | G4double currentTau;
|
|---|
| 135 | G4double tlimit;
|
|---|
| 136 | G4double tlimitmin;
|
|---|
| 137 | G4double tlimitminfix;
|
|---|
| 138 | G4double tgeom;
|
|---|
| 139 |
|
|---|
| 140 | G4double geombig;
|
|---|
| 141 | G4double geommin;
|
|---|
| 142 | G4double geomlimit;
|
|---|
| 143 | G4double skindepth;
|
|---|
| 144 | G4double smallstep;
|
|---|
| 145 |
|
|---|
| 146 | G4double presafety;
|
|---|
| 147 |
|
|---|
| 148 | G4double lambda0;
|
|---|
| 149 | G4double lambdaeff;
|
|---|
| 150 | G4double tPathLength;
|
|---|
| 151 | G4double zPathLength;
|
|---|
| 152 | G4double par1,par2,par3;
|
|---|
| 153 |
|
|---|
| 154 | G4double stepmin;
|
|---|
| 155 |
|
|---|
| 156 | G4double currentKinEnergy;
|
|---|
| 157 | G4double currentRange;
|
|---|
| 158 | G4double rangeinit;
|
|---|
| 159 | G4double currentRadLength;
|
|---|
| 160 |
|
|---|
| 161 | G4double theta0max,rellossmax;
|
|---|
| 162 | G4double third;
|
|---|
| 163 |
|
|---|
| 164 | G4int currentMaterialIndex;
|
|---|
| 165 |
|
|---|
| 166 | G4double y;
|
|---|
| 167 | G4double Zold;
|
|---|
| 168 | G4double Zeff,Z2,Z23,lnZ;
|
|---|
| 169 | G4double coeffth1,coeffth2;
|
|---|
| 170 | G4double coeffc1,coeffc2;
|
|---|
| 171 | G4double scr1ini,scr2ini,scr1,scr2;
|
|---|
| 172 |
|
|---|
| 173 | G4bool isInitialized;
|
|---|
| 174 | G4bool inside;
|
|---|
| 175 | G4bool insideskin;
|
|---|
| 176 | };
|
|---|
| 177 |
|
|---|
| 178 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 179 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 180 |
|
|---|
| 181 | inline
|
|---|
| 182 | G4double G4UrbanMscModel2::GetLambda(G4double e)
|
|---|
| 183 | {
|
|---|
| 184 | G4double x;
|
|---|
| 185 | if(theLambdaTable) {
|
|---|
| 186 | G4bool b;
|
|---|
| 187 | x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b);
|
|---|
| 188 | } else {
|
|---|
| 189 | x = CrossSection(couple,particle,e);
|
|---|
| 190 | }
|
|---|
| 191 | if(x > DBL_MIN) x = 1./x;
|
|---|
| 192 | else x = DBL_MAX;
|
|---|
| 193 | return x;
|
|---|
| 194 | }
|
|---|
| 195 |
|
|---|
| 196 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 197 |
|
|---|
| 198 | inline
|
|---|
| 199 | void G4UrbanMscModel2::SetParticle(const G4ParticleDefinition* p)
|
|---|
| 200 | {
|
|---|
| 201 | if (p != particle) {
|
|---|
| 202 | particle = p;
|
|---|
| 203 | mass = p->GetPDGMass();
|
|---|
| 204 | charge = p->GetPDGCharge()/eplus;
|
|---|
| 205 | ChargeSquare = charge*charge;
|
|---|
| 206 | }
|
|---|
| 207 | }
|
|---|
| 208 |
|
|---|
| 209 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 210 |
|
|---|
| 211 | inline
|
|---|
| 212 | void G4UrbanMscModel2::UpdateCache()
|
|---|
| 213 | {
|
|---|
| 214 | lnZ = std::log(Zeff);
|
|---|
| 215 | //new correction in theta0 formula
|
|---|
| 216 | coeffth1 = (1.-8.7780e-2/Zeff)*(0.87+0.03*lnZ);
|
|---|
| 217 | coeffth2 = (4.0780e-2+1.7315e-4*Zeff)*(0.87+0.03*lnZ);
|
|---|
| 218 | // tail parameters
|
|---|
| 219 | G4double lnZ1 = std::log(Zeff+1.);
|
|---|
| 220 | coeffc1 = 2.943-0.197*lnZ1;
|
|---|
| 221 | coeffc2 = 0.0987-0.0143*lnZ1;
|
|---|
| 222 | // for single scattering
|
|---|
| 223 | Z2 = Zeff*Zeff;
|
|---|
| 224 | Z23 = std::exp(2.*lnZ/3.);
|
|---|
| 225 | scr1 = scr1ini*Z23;
|
|---|
| 226 | scr2 = scr2ini*Z2*ChargeSquare;
|
|---|
| 227 |
|
|---|
| 228 | Zold = Zeff;
|
|---|
| 229 | }
|
|---|
| 230 |
|
|---|
| 231 | #endif
|
|---|
| 232 |
|
|---|