source: trunk/source/processes/electromagnetic/muons/include/G4MuPairProductionModel.hh @ 1316

Last change on this file since 1316 was 1228, checked in by garnier, 14 years ago

update geant4.9.3 tag

File size: 7.2 KB
Line 
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: G4MuPairProductionModel.hh,v 1.28 2009/02/20 14:48:16 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-03 $
28//
29// -------------------------------------------------------------------
30//
31// GEANT4 Class header file
32//
33//
34// File name:     G4MuPairProductionModel
35//
36// Author:        Vladimir Ivanchenko on base of Laszlo Urban code
37//
38// Creation date: 18.05.2002
39//
40// Modifications:
41//
42// 23-12-02 Change interface in order to move to cut per region (V.Ivanchenko)
43// 27-01-03 Make models region aware (V.Ivanchenko)
44// 13-02-03 Add name (V.Ivanchenko)
45// 10-02-04 Update parameterisation using R.Kokoulin model (V.Ivanchenko)
46// 10-02-04 Add lowestKinEnergy (V.Ivanchenko)
47// 13-02-06 Add ComputeCrossSectionPerAtom (mma)
48// 12-05-06 Add parameter to SelectRandomAtom (A.Bogdanov)
49// 11-10-07 Add ignoreCut flag (V.Ivanchenko)
50// 28-02-08 Reorganized protected methods and members (V.Ivanchenko)
51
52//
53// Class Description:
54//
55// Implementation of e+e- pair production by muons
56//
57
58// -------------------------------------------------------------------
59//
60
61#ifndef G4MuPairProductionModel_h
62#define G4MuPairProductionModel_h 1
63
64#include "G4VEmModel.hh"
65#include "G4NistManager.hh"
66#include <vector>
67
68class G4Element;
69class G4ParticleChangeForLoss;
70class G4ParticleChangeForGamma;
71
72class G4MuPairProductionModel : public G4VEmModel
73{
74public:
75
76  G4MuPairProductionModel(const G4ParticleDefinition* p = 0,
77                          const G4String& nam = "muPairProd");
78
79  virtual ~G4MuPairProductionModel();
80
81  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
82
83                       
84  virtual G4double ComputeCrossSectionPerAtom(
85                                 const G4ParticleDefinition*,
86                                 G4double kineticEnergy,
87                                 G4double Z, G4double A,
88                                 G4double cutEnergy,
89                                 G4double maxEnergy);
90                                 
91  virtual G4double ComputeDEDXPerVolume(const G4Material*,
92                                const G4ParticleDefinition*,
93                                G4double kineticEnergy,
94                                G4double cutEnergy);
95
96  virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, 
97                                 const G4MaterialCutsCouple*,
98                                 const G4DynamicParticle*,
99                                 G4double tmin,
100                                 G4double maxEnergy);
101
102  virtual G4double MinEnergyCut(const G4ParticleDefinition*,
103                               const G4MaterialCutsCouple*);
104
105  inline void SetLowestKineticEnergy(G4double e);
106
107  inline void SetParticle(const G4ParticleDefinition*);
108
109protected:
110
111  G4double ComputMuPairLoss(G4double Z, G4double tkin, G4double cut,
112                            G4double tmax);
113
114  G4double ComputeMicroscopicCrossSection(G4double tkin,
115                                          G4double Z,
116                                          G4double cut);
117
118  virtual G4double ComputeDMicroscopicCrossSection(G4double tkin,
119                                                   G4double Z,
120                                                   G4double pairEnergy);
121
122  virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
123                                      G4double kineticEnergy);
124
125  inline void SetCurrentElement(G4double Z);
126
127private:
128
129  const G4Element* SelectRandomAtom(G4double kinEnergy, 
130                                    G4double dt, 
131                                    G4int it,
132                                    const G4MaterialCutsCouple* couple, 
133                                    G4double tmin);
134
135  void MakeSamplingTables();
136
137  inline G4double InterpolatedIntegralCrossSection(
138                     G4double dt, G4double dz, G4int iz,
139                     G4int it, G4int iy, G4double z);
140
141  // hide assignment operator
142  G4MuPairProductionModel & operator=(const  G4MuPairProductionModel &right);
143  G4MuPairProductionModel(const  G4MuPairProductionModel&);
144
145protected:
146
147  const G4ParticleDefinition* particle;
148  G4NistManager*              nist;
149
150  G4double factorForCross;
151  G4double sqrte;
152  G4double particleMass;
153  G4double currentZ;
154  G4double z13;
155  G4double z23;
156  G4double lnZ;
157
158  static G4double xgi[8],wgi[8];
159
160private:
161
162  G4ParticleDefinition*       theElectron;
163  G4ParticleDefinition*       thePositron;
164  G4ParticleChangeForLoss*    fParticleChange;
165
166  G4double minPairEnergy;
167  G4double lowestKinEnergy;
168
169  // tables for sampling
170  G4int nzdat;
171  G4int ntdat;
172  G4int nbiny;
173  size_t nmaxElements;
174  static G4double zdat[5],adat[5],tdat[8];
175  G4double ya[1001],proba[5][8][1001];
176
177  G4double ymin;
178  G4double ymax;
179  G4double dy;
180
181  G4bool  samplingTablesAreFilled;
182  std::vector<G4double>   partialSum;
183};
184
185//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
186
187inline void G4MuPairProductionModel::SetLowestKineticEnergy(G4double e) 
188{
189  lowestKinEnergy = e;
190}
191
192//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
193
194inline
195void G4MuPairProductionModel::SetParticle(const G4ParticleDefinition* p)
196{
197  if(!particle) {
198    particle = p;
199    particleMass = particle->GetPDGMass();
200  }
201}
202
203//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
204
205inline void G4MuPairProductionModel::SetCurrentElement(G4double Z)
206{
207  if(Z != currentZ) {
208    currentZ = Z;
209    G4int iz = G4int(Z);
210    z13 = nist->GetZ13(iz);
211    z23 = z13*z13;
212    lnZ = nist->GetLOGZ(iz);
213  }
214}
215
216//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
217
218inline G4double G4MuPairProductionModel::InterpolatedIntegralCrossSection(
219                G4double dt, G4double dz,
220                G4int iz, G4int it, G4int iy, G4double z)
221{
222  G4double fac =  1./(zdat[iz]  *(zdat[iz]  +1.));
223  G4double fac1 = 1./(zdat[iz-1]*(zdat[iz-1]+1.));
224  G4double f0 = fac1*proba[iz-1][it-1][iy] + 
225                (fac*proba[iz][it-1][iy]-fac1*proba[iz-1][it-1][iy])*dz;
226  G4double f1 = fac1*proba[iz-1][it  ][iy] + 
227                (fac*proba[iz][it  ][iy]-fac1*proba[iz-1][it  ][iy])*dz;
228  return (f0 + (f1-f0)*dt)*z*(z+1.);
229}
230
231//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
232
233#endif
Note: See TracBrowser for help on using the repository browser.