ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4LDMBremModel.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4LDMBremModel.cc
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 //
27 // -------------------------------------------------------------------
28 //
29 // 21.03.17 V. Grichine based on G4hBremsstrahlungModel
30 //
31 // Class Description:
32 //
33 // Implementation of energy loss for LDMPhoton emission by hadrons
34 //
35 
36 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
37 
38 #include "G4LDMBremModel.hh"
39 #include "G4PhysicalConstants.hh"
40 #include "G4SystemOfUnits.hh"
41 #include "G4Log.hh"
42 #include "G4LDMPhoton.hh"
44 #include "TestParameters.hh"
45 
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47 
48 using namespace std;
49 
51  const G4String& nam)
52  : G4MuBremsstrahlungModel(p, nam)
53 {
58 }
59 
60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
61 
63 {}
64 
65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
66 
68  const G4ParticleDefinition*,
70 {
71  return 0.0;
72 }
73 
74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
75 
77  G4double tkin,
78  G4double Z,
79  G4double gammaEnergy)
80 // differential cross section
81 {
82  G4double dxsection = 0.;
83 
84  if( gammaEnergy > tkin || tkin < minThreshold) return dxsection;
85  /*
86  G4cout << "G4LDMBremModel m= " << mass
87  << " " << particle->GetParticleName()
88  << " Egamma(GeV)= " << gammaEnergy/GeV
89  << " Ekin(GeV)= " << tkin/GeV << G4endl;
90  */
91  G4double E = tkin + mass ;
92  G4double v = gammaEnergy/E ;
93  G4double delta = 0.5*mass*mass*v/(E-gammaEnergy) ;
94  G4double rab0=delta*sqrte ;
95 
96  G4int iz = std::max(1,std::min(G4lrint(Z),99));
97 
98  G4double z13 = 1.0/nist->GetZ13(iz);
99  G4double dn = mass*nist->GetA27(iz)/(70.*MeV);
100 
101  G4double b = btf;
102  if(1 == iz) b = bh;
103 
104  // nucleus contribution logarithm
105  G4double rab1=b*z13;
106  G4double fn=G4Log(rab1/(dn*(electron_mass_c2+rab0*rab1))*
107  (mass+delta*(dn*sqrte-2.))) ;
108  if(fn <0.) fn = 0. ;
109 
110  G4double x = 1.0 - v;
111 
112  if(particle->GetPDGSpin() != 0) { x += 0.75*v*v; }
113 
114  dxsection = coeff*x*Z*Z*fn/gammaEnergy;
115  return dxsection;
116 }
117 
118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119 
121  const G4ParticleDefinition*,
122  G4double kineticEnergy,
124  G4double cutEnergy,
125  G4double maxEnergy)
126 {
127  G4double cross = 0.0;
128 
129  if (kineticEnergy <= lowestKinEnergy) return cross;
130 
131  G4double tmax = std::min(maxEnergy, kineticEnergy);
132  G4double cut = std::min(cutEnergy, kineticEnergy);
133 
134  cut = std::max(cut, minThreshold);
135  if (cut >= tmax) return cross;
136 
137  cross = ComputeMicroscopicCrossSection (kineticEnergy, Z, cut);
138 
139  if(tmax < kineticEnergy)
140  {
141  cross -= ComputeMicroscopicCrossSection(kineticEnergy, Z, tmax);
142  }
143  cross *= fEpsilon*fEpsilon;
144 
145  return cross;
146 }
147 
148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
149 
151  std::vector<G4DynamicParticle*>* vdp,
152  const G4MaterialCutsCouple* couple,
153  const G4DynamicParticle* dp,
154  G4double minEnergy,
155  G4double maxEnergy)
156 {
157  G4double kineticEnergy = dp->GetKineticEnergy();
158  // check against insufficient energy
159  G4double tmax = std::min(kineticEnergy, maxEnergy);
160  G4double tmin = std::min(kineticEnergy, minEnergy);
161  tmin = std::max(tmin, minThreshold);
162  if(tmin >= tmax) return;
163 
164  // ===== sampling of energy transfer ======
165 
166  G4ParticleMomentum partDirection = dp->GetMomentumDirection();
167 
168  // select randomly one element constituing the material
169  const G4Element* anElement = SelectRandomAtom(couple,particle,kineticEnergy);
170  G4double Z = anElement->GetZ();
171 
172  G4double totalEnergy = kineticEnergy + mass;
173  G4double totalMomentum = sqrt(kineticEnergy*(kineticEnergy + 2.0*mass));
174 
175  G4double func1 = tmin*
176  ComputeDMicroscopicCrossSection(kineticEnergy,Z,tmin);
177 
178  G4double lnepksi, epksi;
179  G4double func2;
180 
181  G4double xmin = G4Log(tmin/MeV);
182  G4double xmax = G4Log(tmax/tmin);
183 
184  do
185  {
186  lnepksi = xmin + G4UniformRand()*xmax;
187  epksi = MeV*G4Exp(lnepksi);
188  func2 = epksi*ComputeDMicroscopicCrossSection(kineticEnergy,Z,epksi);
189 
190  // Loop checking, 03-Aug-2015, Vladimir Ivanchenko
191  } while(func2 < func1*G4UniformRand());
192 
193  G4double gEnergy = std::max(epksi, fLDMPhotonMass);
194  G4double gMomentum =
195  std::sqrt((epksi - fLDMPhotonMass)*(epksi + fLDMPhotonMass));
196 
197  // ===== sample angle =====
198 
199  G4double gam = totalEnergy/mass;
200  G4double rmax = gam*std::min(1.0, totalEnergy/gEnergy - 1.0);
201  G4double rmax2= rmax*rmax;
202  G4double x = G4UniformRand()*rmax2/(1.0 + rmax2);
203 
204  G4double theta = std::sqrt(x/(1.0 - x))/gam;
205  G4double sint = std::sin(theta);
207  G4double dirx = sint*cos(phi), diry = sint*sin(phi), dirz = cos(theta) ;
208 
209  G4ThreeVector gDirection(dirx, diry, dirz);
210  gDirection.rotateUz(partDirection);
211 
212  partDirection *= totalMomentum;
213  partDirection -= gMomentum*gDirection;
214  partDirection = partDirection.unit();
215 
216  // primary change
217 
218  kineticEnergy -= gEnergy;
219 
222 
223  // save secondary
224  G4DynamicParticle* aLDMPhoton =
225  new G4DynamicParticle(theLDMPhoton,gDirection,gEnergy);
226  vdp->push_back(aLDMPhoton);
227 }
228 
229 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......