Skip to content

Commit d4d8b72

Browse files
committed
* add improvements to the precision in computing the kinematics of
pair production from a heavy nucleus. [rtj] Note: this update requires a coordinated update to the Dirac++ library, to introduce the TLorentzBoost::SetGamma methods.
1 parent 07fd7bf commit d4d8b72

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/GlueXBeamConversionProcess.cc

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,10 +1156,14 @@ void GlueXBeamConversionProcess::GenerateBetheHeitlerProcess(const G4Step &step)
11561156
TFourVectorReal q3(Erecoil, 0, 0, 0);
11571157
LDouble_t q3dotq0(0);
11581158
LDouble_t qRkin(qR * kin);
1159-
LDouble_t costhetaR = (sqr(Mpair) / 2 - sqr(mRecoil) / 2
1160-
- q0.InvariantSqr() / 2
1161-
+ Erecoil * (kin + Etarget)
1162-
- kin * (Etarget - q0[3])
1159+
LDouble_t mTarget(Etarget);
1160+
if (q0.Length() > 0) {
1161+
mTarget = q0.Invariant();
1162+
}
1163+
LDouble_t costhetaR = (sqr(Mpair) / 2 - sqr(mRecoil - mTarget) / 2
1164+
+ kin * (Erecoil - Etarget + q0[3])
1165+
+ Etarget * (Erecoil - mRecoil)
1166+
+ mRecoil * (Etarget - mTarget)
11631167
- q3dotq0
11641168
) / qRkin;
11651169
for (int i=0; i < 99; ++i) {
@@ -1171,7 +1175,7 @@ void GlueXBeamConversionProcess::GenerateBetheHeitlerProcess(const G4Step &step)
11711175
q3[2] = qR * sinthetaR * sin(phiR),
11721176
q3[3] = qR * costhetaR;
11731177
LDouble_t delta = q3.Dot(q0) - q3dotq0;
1174-
if (fabs(delta) < qRkin * 1e-12)
1178+
if (fabs(delta) < qRkin * 1e-15)
11751179
break;
11761180
costhetaR -= delta / qRkin;
11771181
q3dotq0 += delta;
@@ -1182,6 +1186,7 @@ void GlueXBeamConversionProcess::GenerateBetheHeitlerProcess(const G4Step &step)
11821186
(q3[2] - q0[2]) / E12,
11831187
(q3[3] - q0[3] - kin) / E12);
11841188
TLorentzBoost toLab(beta);
1189+
toLab.SetGamma(E12 / Mpair);
11851190
LDouble_t sinthetastar = sqrt(1 - sqr(costhetastar));
11861191
TThreeVectorReal k12(k12star * sinthetastar * cos(phi12),
11871192
k12star * sinthetastar * sin(phi12),
@@ -1206,6 +1211,8 @@ void GlueXBeamConversionProcess::GenerateBetheHeitlerProcess(const G4Step &step)
12061211
TFourVectorReal pFi(pOut.Mom() + eOut.Mom() + nOut.Mom());
12071212
TFourVectorReal::SetResolution(1e-10);
12081213
if (pIn != pFi) {
1214+
std::streamsize defprec = std::cout.precision();
1215+
std::cout << std::setprecision(12);
12091216
std::cout << "Warning in GenerateBetheHeitlerConversion - "
12101217
<< "momentum conservation violated." << std::endl
12111218
<< " pIn = ";
@@ -1224,6 +1231,7 @@ void GlueXBeamConversionProcess::GenerateBetheHeitlerProcess(const G4Step &step)
12241231
nOut.Mom().Print();
12251232
std::cout << " pIn - pFi = ";
12261233
(pIn-pFi).Print();
1234+
std::cout << std::setprecision(defprec);
12271235
}
12281236

12291237
// Compute the polarized differential cross section (barnes/GeV^4)

0 commit comments

Comments
 (0)