Skip to content

Commit 78c33b5

Browse files
committed
- change double to LDouble_t to agree with the standard double type
in Dirac++ - fixes to the atomic form factor description of the pair converter target, nothing that should substantially affect the simulation. [rtj]
1 parent 5febe64 commit 78c33b5

File tree

2 files changed

+40
-39
lines changed

2 files changed

+40
-39
lines changed

src/PairConversionGeneration.cc

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,25 @@ PairConversionGeneration::PairConversionGeneration()
6262
PairConversionGeneration::~PairConversionGeneration()
6363
{}
6464

65-
double PairConversionGeneration::FFatomic(double qRecoil)
65+
LDouble_t PairConversionGeneration::FFatomic(LDouble_t qRecoil)
6666
{
6767
// return the atomic form factor of the pair converter
6868
// normalized to unity at zero momentum transfer qRecoil (GeV/c).
69+
// Lengths are in Angstroms in this function.
6970

7071
#if H_DIPOLE_FORM_FACTOR
7172

72-
double a0Bohr = 0.529177 / 1.97327e-6;
73-
double ff = 1 / pow(1 + pow(a0Bohr * qRecoil, 2) / 4, 2);
73+
LDouble_t a0Bohr = 0.529177 / 1.97327e-6;
74+
LDouble_t ff = 1 / pow(1 + pow(a0Bohr * qRecoil, 2), 2);
7475

7576
#else
7677

7778
// parameterization for 4Be given by online database at
7879
// http://lampx.tugraz.at/~hadley/ss1/crystaldiffraction
7980
// /atomicformfactors/formfactors.php
8081

82+
int Z=4;
83+
8184
LDouble_t acoeff[] = {1.5919, 1.1278, 0.5391, 0.7029};
8285
LDouble_t bcoeff[] = {43.6427, 1.8623, 103.483, 0.5420};
8386
LDouble_t ccoeff[] = {0.0385};
@@ -87,16 +90,16 @@ double PairConversionGeneration::FFatomic(double qRecoil)
8790
for (int i=0; i < 4; ++i) {
8891
ff += acoeff[i] * exp(-bcoeff[i] * pow(q_invA / (4 * M_PI), 2));
8992
}
90-
ff /= 4;
93+
ff /= Z;
9194

9295
#endif
9396

9497
return ff;
9598
}
9699

97-
double PairConversionGeneration::DiffXS_pair(const TPhoton &gIn,
98-
const TLepton &pOut,
99-
const TLepton &eOut)
100+
LDouble_t PairConversionGeneration::DiffXS_pair(const TPhoton &gIn,
101+
const TLepton &pOut,
102+
const TLepton &eOut)
100103
{
101104
// Calculates the e+e- pair production cross section for a
102105
// gamma ray off an atom at a particular recoil momentum vector q.
@@ -120,27 +123,26 @@ double PairConversionGeneration::DiffXS_pair(const TPhoton &gIn,
120123
e2.AllPol();
121124

122125
// Multiply the basic cross section by the converter atomic form factor
123-
double result = TCrossSection::PairProduction(g0, e2, p1);
126+
LDouble_t result = TCrossSection::PairProduction(g0, e2, p1);
124127
TFourVectorReal qR(gIn.Mom() - eOut.Mom() - pOut.Mom());
125-
double Q2 = fabs(qR.InvariantSqr());
126-
result *= sqr(fConverterZ * (1 - FFatomic(sqrt(Q2))));
128+
result *= sqr(fConverterZ * (1 - FFatomic(qR.Length())));
127129
return result * 1e-6;
128130

129131
// The unpolarized Bethe-Heitler cross section is given here for comparison
130-
double kin = gIn.Mom()[0];
131-
double Epos = pOut.Mom()[0];
132-
double Eele = eOut.Mom()[0];
133-
double delta = 136 * mElectron / pow(fConverterZ, 0.33333) *
134-
kin / (Eele * Epos);
135-
double aCoul = sqr(alphaQED * fConverterZ);
136-
double fCoul = aCoul * (1 / (1 + aCoul) + 0.20206 - 0.0369 * aCoul +
137-
0.0083 * pow(aCoul, 2) - 0.002 * pow(aCoul, 3));
138-
double xsi = log(1440 / pow(fConverterZ, 0.66667)) /
139-
(log(183 / pow(fConverterZ, 0.33333) - fCoul));
140-
double FofZ = (8./3.) * log(fConverterZ) + ((kin < 0.05)? 0 : 8 * fCoul);
141-
double Phi1 = 20.867 - 3.242 * delta + 0.625 * sqr(delta);
142-
double Phi2 = 20.209 - 1.930 * delta - 0.086 * sqr(delta);
143-
double Phi0 = 21.12 - 4.184 * log(delta + 0.952);
132+
LDouble_t kin = gIn.Mom()[0];
133+
LDouble_t Epos = pOut.Mom()[0];
134+
LDouble_t Eele = eOut.Mom()[0];
135+
LDouble_t delta = 136 * mElectron / pow(fConverterZ, 0.33333) *
136+
kin / (Eele * Epos);
137+
LDouble_t aCoul = sqr(alphaQED * fConverterZ);
138+
LDouble_t fCoul = aCoul * (1 / (1 + aCoul) + 0.20206 - 0.0369 * aCoul +
139+
0.0083 * pow(aCoul, 2) - 0.002 * pow(aCoul, 3));
140+
LDouble_t xsi = log(1440 / pow(fConverterZ, 0.66667)) /
141+
(log(183 / pow(fConverterZ, 0.33333) - fCoul));
142+
LDouble_t FofZ = (8./3.) * log(fConverterZ) + ((kin < 0.05)? 0 : 8 * fCoul);
143+
LDouble_t Phi1 = 20.867 - 3.242 * delta + 0.625 * sqr(delta);
144+
LDouble_t Phi2 = 20.209 - 1.930 * delta - 0.086 * sqr(delta);
145+
LDouble_t Phi0 = 21.12 - 4.184 * log(delta + 0.952);
144146
if (delta > 1) {
145147
Phi1 = Phi2 = Phi0;
146148
}
@@ -153,19 +155,20 @@ double PairConversionGeneration::DiffXS_pair(const TPhoton &gIn,
153155
return result * 1e-6;
154156
}
155157

156-
double PairConversionGeneration::DiffXS_triplet(const TPhoton &gIn,
157-
const TLepton &pOut,
158-
const TLepton &eOut2,
159-
const TLepton &eOut3)
158+
LDouble_t PairConversionGeneration::DiffXS_triplet(const TPhoton &gIn,
159+
const TLepton &pOut,
160+
const TLepton &eOut2,
161+
const TLepton &eOut3)
160162
{
161163
// Calculates the e+e- pair production rate on a free electron target,
162164
// including incident photon polarization effects, for a given set of
163165
// kinematics. The kinematics are specified by the initial photon
164166
// energy kin, the mass of the e+e- pair M, the recoil momentum vector
165167
// qR, the azimuthal angle of the plane containing the e+e- pair phi+,
166168
// and the energy of the pair positron E+. The returned value is the
167-
// differential cross section measured in barns/GeV^4, differential
168-
// in (d^3 qR dphi+ dE+) = (M / 2 kin) (dM dqR^2 dphiR dphi+ dE+).
169+
// differential cross section measured in barns/GeV^4 per atom, with
170+
// fConverterZ electrons per atom, differential in
171+
// (d^3 qR dphi+ dE+) = (M / 2 kin) (dM dqR^2 dphiR dphi+ dE+).
169172

170173
TPhoton g0(gIn);
171174
TLepton e0(zeroVector, mElectron);
@@ -185,10 +188,8 @@ double PairConversionGeneration::DiffXS_triplet(const TPhoton &gIn,
185188
e3.AllPol();
186189

187190
// Correct the basic cross section by the converter atomic form factor
188-
double result = TCrossSection::TripletProduction(g0, e0, p1, e2, e3);
189-
TFourVectorReal qR(e3.Mom() - e0.Mom());
190-
double Q2 = fabs(qR.InvariantSqr());
191-
result *= fConverterZ * (1 - sqr(FFatomic(sqrt(Q2))));
191+
LDouble_t result = TCrossSection::TripletProduction(g0, e0, p1, e2, e3);
192+
result *= fConverterZ * (1 - sqr(FFatomic(e3.Mom().Length())));
192193
return result * 1e-6;
193194
}
194195

src/PairConversionGeneration.hh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ class PairConversionGeneration {
4242
PairConversionGeneration();
4343
~PairConversionGeneration();
4444

45-
double FFatomic(double qRecoil);
46-
double DiffXS_pair(const TPhoton &gIn,
47-
const TLepton &pOut, const TLepton &eOut);
48-
double DiffXS_triplet(const TPhoton &gIn, const TLepton &pOut,
49-
const TLepton &eOut2, const TLepton &eOut3);
45+
LDouble_t FFatomic(LDouble_t qRecoil);
46+
LDouble_t DiffXS_pair(const TPhoton &gIn,
47+
const TLepton &pOut, const TLepton &eOut);
48+
LDouble_t DiffXS_triplet(const TPhoton &gIn, const TLepton &pOut,
49+
const TLepton &eOut2, const TLepton &eOut3);
5050

5151
const TThreeVectorReal &GetPolarization();
5252
unsigned int GetConverterZ();

0 commit comments

Comments
 (0)