Skip to content

Commit c2dd585

Browse files
f3schdavidrohr
authored andcommitted
Change division to use float for massInv
1 parent ae042e7 commit c2dd585

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

DataFormats/Reconstruction/src/TrackParametrizationWithError.cxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,12 +1427,12 @@ GPUd() bool TrackParametrizationWithError<value_T>::correctForMaterial(value_t x
14271427
}
14281428
auto m = this->getPID().getMass();
14291429
int charge2 = this->getAbsCharge() * this->getAbsCharge();
1430-
value_t p = this->getP(), p0 = p, p02 = p * p, e2 = p02 + this->getPID().getMass2(), massInv = 1. / m, bg = p * massInv, dETot = 0.;
1430+
value_t p = this->getP(), p0 = p, p02 = p * p, e2 = p02 + this->getPID().getMass2(), massInv = 1.f / m, bg = p * massInv, dETot = 0.f;
14311431
value_t e = gpu::CAMath::Sqrt(e2), e0 = e;
14321432
if (m > 0 && xrho != 0.f) {
14331433
value_t ekin = e - m, dedx = this->getdEdxBBOpt(bg);
14341434
#ifdef _BB_NONCONST_CORR_
1435-
value_t dedxDer = 0., dedx1 = dedx;
1435+
value_t dedxDer = 0.f, dedx1 = dedx;
14361436
#endif
14371437
if (charge2 != 1) {
14381438
dedx *= charge2;
@@ -1454,11 +1454,11 @@ GPUd() bool TrackParametrizationWithError<value_T>::correctForMaterial(value_t x
14541454
}
14551455
while (na--) {
14561456
#ifdef _BB_NONCONST_CORR_
1457-
if (dedxDer != 0.) { // correction for non-constantness of dedx vs beta*gamma (in linear approximation): for a single step dE -> dE * [(exp(dedxDer) - 1)/dedxDer]
1457+
if (dedxDer != 0.f) { // correction for non-constantness of dedx vs beta*gamma (in linear approximation): for a single step dE -> dE * [(exp(dedxDer) - 1)/dedxDer]
14581458
if (xrho < 0) {
14591459
dedxDer = -dedxDer; // E.loss ( -> positive derivative)
14601460
}
1461-
auto corrC = (gpu::CAMath::Exp(dedxDer) - 1.) / dedxDer;
1461+
auto corrC = (gpu::CAMath::Exp(dedxDer) - 1.f) / dedxDer;
14621462
dE *= corrC;
14631463
}
14641464
#endif
@@ -1562,12 +1562,12 @@ GPUd() bool TrackParametrizationWithError<value_T>::correctForMaterial(TrackPara
15621562
auto pid = linRef.getPID();
15631563
auto m = pid.getMass();
15641564
int charge2 = linRef.getAbsCharge() * linRef.getAbsCharge();
1565-
value_t p = linRef.getP(), p0 = p, p02 = p * p, e2 = p02 + pid.getMass2(), massInv = 1. / m, bg = p * massInv, dETot = 0.;
1565+
value_t p = linRef.getP(), p0 = p, p02 = p * p, e2 = p02 + pid.getMass2(), massInv = 1.f / m, bg = p * massInv, dETot = 0.f;
15661566
value_t e = gpu::CAMath::Sqrt(e2), e0 = e;
15671567
if (m > 0 && xrho != 0.f) {
15681568
value_t ekin = e - m, dedx = this->getdEdxBBOpt(bg);
15691569
#ifdef _BB_NONCONST_CORR_
1570-
value_t dedxDer = 0., dedx1 = dedx;
1570+
value_t dedxDer = 0.f, dedx1 = dedx;
15711571
#endif
15721572
if (charge2 != 1) {
15731573
dedx *= charge2;
@@ -1589,11 +1589,11 @@ GPUd() bool TrackParametrizationWithError<value_T>::correctForMaterial(TrackPara
15891589
}
15901590
while (na--) {
15911591
#ifdef _BB_NONCONST_CORR_
1592-
if (dedxDer != 0.) { // correction for non-constantness of dedx vs beta*gamma (in linear approximation): for a single step dE -> dE * [(exp(dedxDer) - 1)/dedxDer]
1592+
if (dedxDer != 0.f) { // correction for non-constantness of dedx vs beta*gamma (in linear approximation): for a single step dE -> dE * [(exp(dedxDer) - 1)/dedxDer]
15931593
if (xrho < 0) {
15941594
dedxDer = -dedxDer; // E.loss ( -> positive derivative)
15951595
}
1596-
auto corrC = (gpu::CAMath::Exp(dedxDer) - 1.) / dedxDer;
1596+
auto corrC = (gpu::CAMath::Exp(dedxDer) - 1.f) / dedxDer;
15971597
dE *= corrC;
15981598
}
15991599
#endif

0 commit comments

Comments
 (0)