| [819] | 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: G4UrbanMscModel.hh,v 1.31 2007/10/29 08:42:43 vnivanch Exp $
|
|---|
| 27 | // GEANT4 tag $Name: geant4-09-01-patch-02 $
|
|---|
| 28 | //
|
|---|
| 29 | // -------------------------------------------------------------------
|
|---|
| 30 | //
|
|---|
| 31 | //
|
|---|
| 32 | // GEANT4 Class header file
|
|---|
| 33 | //
|
|---|
| 34 | //
|
|---|
| 35 | // File name: G4UrbanMscModel
|
|---|
| 36 | //
|
|---|
| 37 | // Author: Laszlo Urban
|
|---|
| 38 | //
|
|---|
| 39 | // Creation date: 01.03.2001
|
|---|
| 40 | //
|
|---|
| 41 | // Modifications:
|
|---|
| 42 | //
|
|---|
| 43 | // 27-03-03 Move model part from G4MultipleScattering (V.Ivanchenko)
|
|---|
| 44 | // 27-03-03 Rename (V.Ivanchenko)
|
|---|
| 45 | //
|
|---|
| 46 | // 05-08-03 angle distribution has been modified (L.Urban)
|
|---|
| 47 | // 26-11-03 new data member currentRange (L.Urban)
|
|---|
| 48 | // 01-03-04 changes in data members + signature changed in SampleCosineTheta
|
|---|
| 49 | // 11-03-04 changes in data members (L.Urban)
|
|---|
| 50 | // 23-04-04 changes in data members and in signature of SampleCosineTheta
|
|---|
| 51 | // (L.Urban)
|
|---|
| 52 | // 17-08-04 name of data member facxsi changed to factail (L.Urban)
|
|---|
| 53 | // 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
|
|---|
| 54 | // 15-04-05 optimize internal interface - add SampleSecondaries method (V.Ivanchenko)
|
|---|
| 55 | // 11-08-05 computation of lateral correlation added (L.Urban)
|
|---|
| 56 | // 02-10-05 nuclear size correction computation removed, the correction
|
|---|
| 57 | // included in the (theoretical) tabulated values (L.Urban)
|
|---|
| 58 | // 16-02-06 data members b and xsi have been removed (L.Urban)
|
|---|
| 59 | // 17-02-06 Save table of transport cross sections not mfp (V.Ivanchenko)
|
|---|
| 60 | // 07-03-06 Create G4UrbanMscModel and move there step limit calculation (V.Ivanchenko)
|
|---|
| 61 | // 10-05-06 SetMscStepLimitation at initialisation (V.Ivantchenko)
|
|---|
| 62 | // 11-05-06 name of data member safety changed to presafety, some new data
|
|---|
| 63 | // members added (frscaling1,frscaling2,tlimitminfix,nstepmax)
|
|---|
| 64 | // (L.Urban)
|
|---|
| 65 | // 13-10-06 data member factail removed, data member tkinlimit changed
|
|---|
| 66 | // to lambdalimit,
|
|---|
| 67 | // new data members tgeom,tnow,skin,skindepth,Zeff,geomlimit
|
|---|
| 68 | // G4double GeomLimit(const G4Track& track) changed to
|
|---|
| 69 | // void GeomLimit(const G4Track& track) (L.Urban)
|
|---|
| 70 | // 20-10-06 parameter theta0 now computed in the (public)
|
|---|
| 71 | // function ComputeTheta0,
|
|---|
| 72 | // single scattering modified allowing not small
|
|---|
| 73 | // angles as well (L.Urban)
|
|---|
| 74 | // 31-01-07 code cleaning (L.Urban)
|
|---|
| 75 | // 06-02-07 Move SetMscStepLimitation method into the source (VI)
|
|---|
| 76 | // 15-02-07 new data member : smallstep (L.Urban)
|
|---|
| 77 | // 10-04-07 remove navigator, smallstep, tnow (V.Ivanchenko)
|
|---|
| 78 | //
|
|---|
| 79 | //
|
|---|
| 80 | // Class Description:
|
|---|
| 81 | //
|
|---|
| 82 | // Implementation of the model of multiple scattering based on
|
|---|
| 83 | // H.W.Lewis Phys Rev 78 (1950) 526 and L.Urban model
|
|---|
| 84 |
|
|---|
| 85 | // -------------------------------------------------------------------
|
|---|
| 86 | //
|
|---|
| 87 |
|
|---|
| 88 | #ifndef G4UrbanMscModel_h
|
|---|
| 89 | #define G4UrbanMscModel_h 1
|
|---|
| 90 |
|
|---|
| 91 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 92 |
|
|---|
| 93 | #include "G4VEmModel.hh"
|
|---|
| 94 | #include "G4PhysicsTable.hh"
|
|---|
| 95 | #include "G4MscStepLimitType.hh"
|
|---|
| 96 |
|
|---|
| 97 | class G4ParticleChangeForMSC;
|
|---|
| 98 | class G4SafetyHelper;
|
|---|
| 99 | class G4LossTableManager;
|
|---|
| 100 |
|
|---|
| 101 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 102 |
|
|---|
| 103 | class G4UrbanMscModel : public G4VEmModel
|
|---|
| 104 | {
|
|---|
| 105 |
|
|---|
| 106 | public:
|
|---|
| 107 |
|
|---|
| 108 | G4UrbanMscModel(G4double facrange, G4double dtrl, G4double lambdalimit,
|
|---|
| 109 | G4double facgeom,G4double skin,
|
|---|
| 110 | G4bool samplez, G4MscStepLimitType stepAlg,
|
|---|
| 111 | const G4String& nam = "UrbanMscUni");
|
|---|
| 112 |
|
|---|
| 113 | virtual ~G4UrbanMscModel();
|
|---|
| 114 |
|
|---|
| 115 | virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
|
|---|
| 116 |
|
|---|
| 117 | G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition* particle,
|
|---|
| 118 | G4double KineticEnergy,
|
|---|
| 119 | G4double AtomicNumber,
|
|---|
| 120 | G4double AtomicWeight=0.,
|
|---|
| 121 | G4double cut =0.,
|
|---|
| 122 | G4double emax=DBL_MAX);
|
|---|
| 123 |
|
|---|
| 124 | void SampleSecondaries(std::vector<G4DynamicParticle*>*,
|
|---|
| 125 | const G4MaterialCutsCouple*,
|
|---|
| 126 | const G4DynamicParticle*,
|
|---|
| 127 | G4double,
|
|---|
| 128 | G4double);
|
|---|
| 129 |
|
|---|
| 130 | void SampleScattering(const G4DynamicParticle*,
|
|---|
| 131 | G4double safety);
|
|---|
| 132 |
|
|---|
| 133 | G4double ComputeTruePathLengthLimit(const G4Track& track,
|
|---|
| 134 | G4PhysicsTable* theLambdaTable,
|
|---|
| 135 | G4double currentMinimalStep);
|
|---|
| 136 |
|
|---|
| 137 | G4double ComputeGeomPathLength(G4double truePathLength);
|
|---|
| 138 |
|
|---|
| 139 | G4double ComputeTrueStepLength(G4double geomStepLength);
|
|---|
| 140 |
|
|---|
| 141 | G4double ComputeTheta0(G4double truePathLength,
|
|---|
| 142 | G4double KineticEnergy);
|
|---|
| 143 |
|
|---|
| 144 | void SetStepLimitType(G4MscStepLimitType);
|
|---|
| 145 |
|
|---|
| 146 | void SetLateralDisplasmentFlag(G4bool val);
|
|---|
| 147 |
|
|---|
| 148 | void SetRangeFactor(G4double);
|
|---|
| 149 |
|
|---|
| 150 | void SetGeomFactor(G4double);
|
|---|
| 151 |
|
|---|
| 152 | void SetSkin(G4double);
|
|---|
| 153 |
|
|---|
| 154 | private:
|
|---|
| 155 |
|
|---|
| 156 | G4double SampleCosineTheta(G4double trueStepLength, G4double KineticEnergy);
|
|---|
| 157 |
|
|---|
| 158 | G4double SampleDisplacement();
|
|---|
| 159 |
|
|---|
| 160 | G4double LatCorrelation();
|
|---|
| 161 |
|
|---|
| 162 | G4double GetLambda(G4double kinEnergy);
|
|---|
| 163 |
|
|---|
| 164 | void GeomLimit(const G4Track& track);
|
|---|
| 165 |
|
|---|
| 166 | void SetParticle(const G4ParticleDefinition* p);
|
|---|
| 167 |
|
|---|
| 168 | // hide assignment operator
|
|---|
| 169 | G4UrbanMscModel & operator=(const G4UrbanMscModel &right);
|
|---|
| 170 | G4UrbanMscModel(const G4UrbanMscModel&);
|
|---|
| 171 |
|
|---|
| 172 | const G4ParticleDefinition* particle;
|
|---|
| 173 | G4ParticleChangeForMSC* fParticleChange;
|
|---|
| 174 |
|
|---|
| 175 | G4SafetyHelper* safetyHelper;
|
|---|
| 176 | G4PhysicsTable* theLambdaTable;
|
|---|
| 177 | const G4MaterialCutsCouple* couple;
|
|---|
| 178 | G4LossTableManager* theManager;
|
|---|
| 179 |
|
|---|
| 180 |
|
|---|
| 181 | G4double mass;
|
|---|
| 182 | G4double charge;
|
|---|
| 183 |
|
|---|
| 184 | G4double masslimite,masslimitmu;
|
|---|
| 185 |
|
|---|
| 186 | G4double taubig;
|
|---|
| 187 | G4double tausmall;
|
|---|
| 188 | G4double taulim;
|
|---|
| 189 | G4double currentTau;
|
|---|
| 190 | G4double dtrl;
|
|---|
| 191 |
|
|---|
| 192 | G4double lambdalimit;
|
|---|
| 193 | G4double facrange;
|
|---|
| 194 | G4double frscaling1,frscaling2;
|
|---|
| 195 | G4double tlimit;
|
|---|
| 196 | G4double tlimitmin;
|
|---|
| 197 | G4double tlimitminfix;
|
|---|
| 198 |
|
|---|
| 199 | G4double nstepmax;
|
|---|
| 200 | G4double geombig;
|
|---|
| 201 | G4double geommin;
|
|---|
| 202 | G4double geomlimit;
|
|---|
| 203 | G4double facgeom;
|
|---|
| 204 | G4double skin;
|
|---|
| 205 | G4double skindepth;
|
|---|
| 206 | G4double smallstep;
|
|---|
| 207 |
|
|---|
| 208 | G4double presafety;
|
|---|
| 209 | G4double facsafety;
|
|---|
| 210 |
|
|---|
| 211 | G4double lambda0;
|
|---|
| 212 | G4double lambdaeff;
|
|---|
| 213 | G4double tPathLength;
|
|---|
| 214 | G4double zPathLength;
|
|---|
| 215 | G4double par1,par2,par3 ;
|
|---|
| 216 |
|
|---|
| 217 | G4double stepmin ;
|
|---|
| 218 |
|
|---|
| 219 | G4double currentKinEnergy;
|
|---|
| 220 | G4double currentRange;
|
|---|
| 221 | G4double currentRadLength;
|
|---|
| 222 |
|
|---|
| 223 | G4double Zeff;
|
|---|
| 224 |
|
|---|
| 225 | G4int currentMaterialIndex;
|
|---|
| 226 |
|
|---|
| 227 | G4MscStepLimitType steppingAlgorithm;
|
|---|
| 228 |
|
|---|
| 229 | G4bool samplez;
|
|---|
| 230 | G4bool latDisplasment;
|
|---|
| 231 | G4bool isInitialized;
|
|---|
| 232 |
|
|---|
| 233 | G4bool inside;
|
|---|
| 234 | G4bool insideskin;
|
|---|
| 235 |
|
|---|
| 236 | };
|
|---|
| 237 |
|
|---|
| 238 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 239 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 240 |
|
|---|
| 241 | inline
|
|---|
| 242 | void G4UrbanMscModel::SetLateralDisplasmentFlag(G4bool val)
|
|---|
| 243 | {
|
|---|
| 244 | latDisplasment = val;
|
|---|
| 245 | }
|
|---|
| 246 |
|
|---|
| 247 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 248 |
|
|---|
| 249 | inline
|
|---|
| 250 | void G4UrbanMscModel::SetSkin(G4double val)
|
|---|
| 251 | {
|
|---|
| 252 | skin = val;
|
|---|
| 253 | stepmin = tlimitminfix;
|
|---|
| 254 | skindepth = skin*stepmin;
|
|---|
| 255 | }
|
|---|
| 256 |
|
|---|
| 257 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 258 |
|
|---|
| 259 | inline
|
|---|
| 260 | void G4UrbanMscModel::SetRangeFactor(G4double val)
|
|---|
| 261 | {
|
|---|
| 262 | facrange = val;
|
|---|
| 263 | }
|
|---|
| 264 |
|
|---|
| 265 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 266 |
|
|---|
| 267 | inline
|
|---|
| 268 | void G4UrbanMscModel::SetGeomFactor(G4double val)
|
|---|
| 269 | {
|
|---|
| 270 | facgeom = val;
|
|---|
| 271 | }
|
|---|
| 272 |
|
|---|
| 273 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 274 |
|
|---|
| 275 | inline
|
|---|
| 276 | void G4UrbanMscModel::SetStepLimitType(G4MscStepLimitType val)
|
|---|
| 277 | {
|
|---|
| 278 | steppingAlgorithm = val;
|
|---|
| 279 | }
|
|---|
| 280 |
|
|---|
| 281 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 282 |
|
|---|
| 283 | inline
|
|---|
| 284 | G4double G4UrbanMscModel::GetLambda(G4double e)
|
|---|
| 285 | {
|
|---|
| 286 | G4double x;
|
|---|
| 287 | if(theLambdaTable) {
|
|---|
| 288 | G4bool b;
|
|---|
| 289 | x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b);
|
|---|
| 290 | } else {
|
|---|
| 291 | x = CrossSection(couple,particle,e);
|
|---|
| 292 | }
|
|---|
| 293 | if(x > DBL_MIN) x = 1./x;
|
|---|
| 294 | else x = DBL_MAX;
|
|---|
| 295 | return x;
|
|---|
| 296 | }
|
|---|
| 297 |
|
|---|
| 298 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 299 |
|
|---|
| 300 | inline
|
|---|
| 301 | void G4UrbanMscModel::SetParticle(const G4ParticleDefinition* p)
|
|---|
| 302 | {
|
|---|
| 303 | if (p != particle) {
|
|---|
| 304 | particle = p;
|
|---|
| 305 | mass = p->GetPDGMass();
|
|---|
| 306 | charge = p->GetPDGCharge()/eplus;
|
|---|
| 307 | }
|
|---|
| 308 | }
|
|---|
| 309 |
|
|---|
| 310 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|---|
| 311 |
|
|---|
| 312 | #endif
|
|---|
| 313 |
|
|---|