Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class PID
GPUd() operator ID() const { return getID(); }

GPUd() float getMass() const { return getMass(mID); }
GPUd() float getMass2() const { return getMass2(mID); }
GPUd() float getMass2Z() const { return getMass2Z(mID); }
GPUd() int getCharge() const { return getCharge(mID); }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class TrackParametrization
GPUd() math_utils::Point3D<value_t> getXYZGloAt(value_t xk, value_t b, bool& ok) const;

// parameters manipulation
GPUd() bool correctForELoss(value_t xrho, value_t mass, bool anglecorr = false, value_t dedx = kCalcdEdxAuto);
GPUd() bool correctForELoss(value_t xrho, bool anglecorr = false, value_t dedx = kCalcdEdxAuto);
GPUd() bool rotateParam(value_t alpha);
GPUd() bool propagateParamTo(value_t xk, value_t b);
GPUd() bool propagateParamTo(value_t xk, const dim3_t& b);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class TrackParametrizationWithError : public TrackParametrization<value_T>
template <typename T>
GPUd() bool update(const BaseCluster<T>& p);

GPUd() bool correctForMaterial(value_t x2x0, value_t xrho, value_t mass, bool anglecorr = false, value_t dedx = kCalcdEdxAuto);
GPUd() bool correctForMaterial(value_t x2x0, value_t xrho, bool anglecorr = false, value_t dedx = kCalcdEdxAuto);

GPUd() void resetCovariance(value_t s2 = 0);
GPUd() void checkCovariance();
Expand Down
15 changes: 5 additions & 10 deletions DataFormats/Reconstruction/src/TrackParametrization.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -682,14 +682,13 @@ GPUd() bool TrackParametrization<value_T>::getXatLabR(value_t r, value_t& x, val

//______________________________________________
template <typename value_T>
GPUd() bool TrackParametrization<value_T>::correctForELoss(value_t xrho, value_t mass, bool anglecorr, value_t dedx)
GPUd() bool TrackParametrization<value_T>::correctForELoss(value_t xrho, bool anglecorr, value_t dedx)
{
//------------------------------------------------------------------
// This function corrects the track parameters for the energy loss in crossed material.
// "xrho" - is the product length*density (g/cm^2).
// It should be passed as negative when propagating tracks
// from the intreaction point to the outside of the central barrel.
// "mass" - the mass of this particle (GeV/c^2).
// "dedx" - mean enery loss (GeV/(g/cm^2), if <=kCalcdEdxAuto : calculate on the fly
// "anglecorr" - switch for the angular correction
//------------------------------------------------------------------
Expand All @@ -703,19 +702,15 @@ GPUd() bool TrackParametrization<value_T>::correctForELoss(value_t xrho, value_t
value_t angle = gpu::CAMath::Sqrt(cst2I / (csp2));
xrho *= angle;
}

value_t p = getP();
if (mass < 0) {
p += p; // q=2 particle
}
value_t p2 = p * p, mass2 = mass * mass;
value_t e2 = p2 + mass2;
value_t p2 = p * p;
value_t e2 = p2 + getPID().getMass2();
value_t beta2 = p2 / e2;

// Calculating the energy loss corrections************************
if ((xrho != 0.f) && (beta2 < 1.f)) {
if (dedx < kCalcdEdxAuto + constants::math::Almost1) { // request to calculate dedx on the fly
dedx = BetheBlochSolid(p / gpu::CAMath::Abs(mass));
dedx = BetheBlochSolid(p / getPID().getMass());
if (mAbsCharge != 1) {
dedx *= mAbsCharge * mAbsCharge;
}
Expand All @@ -727,7 +722,7 @@ GPUd() bool TrackParametrization<value_T>::correctForELoss(value_t xrho, value_t
return false; // 30% energy loss is too much!
}
value_t eupd = e + dE;
value_t pupd2 = eupd * eupd - mass2;
value_t pupd2 = eupd * eupd - getPID().getMass2();
if (pupd2 < kMinP * kMinP) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -908,15 +908,14 @@ GPUd() bool TrackParametrizationWithError<value_T>::update(const dim2_t& p, cons

//______________________________________________
template <typename value_T>
GPUd() bool TrackParametrizationWithError<value_T>::correctForMaterial(value_t x2x0, value_t xrho, value_t mass, bool anglecorr, value_t dedx)
GPUd() bool TrackParametrizationWithError<value_T>::correctForMaterial(value_t x2x0, value_t xrho, bool anglecorr, value_t dedx)
{
//------------------------------------------------------------------
// This function corrects the track parameters for the crossed material.
// "x2x0" - X/X0, the thickness in units of the radiation length.
// "xrho" - is the product length*density (g/cm^2).
// It should be passed as negative when propagating tracks
// from the intreaction point to the outside of the central barrel.
// "mass" - the mass of this particle (GeV/c^2).
// "dedx" - mean enery loss (GeV/(g/cm^2), if <=kCalcdEdxAuto : calculate on the fly
// "anglecorr" - switch for the angular correction
//------------------------------------------------------------------
Expand All @@ -937,10 +936,9 @@ GPUd() bool TrackParametrizationWithError<value_T>::correctForMaterial(value_t x
x2x0 *= angle;
xrho *= angle;
}

value_t p = this->getP();
value_t p2 = p * p, mass2 = mass * mass;
value_t e2 = p2 + mass2;
value_t p2 = p * p;
value_t e2 = p2 + this->getPID().getMass2();
value_t beta2 = p2 / e2;

// Calculating the multiple scattering corrections******************
Expand Down Expand Up @@ -970,7 +968,7 @@ GPUd() bool TrackParametrizationWithError<value_T>::correctForMaterial(value_t x
value_t cP4 = 1.f;
if ((xrho != 0.f) && (beta2 < 1.f)) {
if (dedx < kCalcdEdxAuto + constants::math::Almost1) { // request to calculate dedx on the fly
dedx = BetheBlochSolid(p / gpu::CAMath::Abs(mass));
dedx = BetheBlochSolid(p / this->getPID().getMass());
if (this->getAbsCharge() != 1) {
dedx *= this->getAbsCharge() * this->getAbsCharge();
}
Expand All @@ -982,7 +980,7 @@ GPUd() bool TrackParametrizationWithError<value_T>::correctForMaterial(value_t x
return false; // 30% energy loss is too much!
}
value_t eupd = e + dE;
value_t pupd2 = eupd * eupd - mass2;
value_t pupd2 = eupd * eupd - this->getPID().getMass2();
if (pupd2 < kMinP * kMinP) {
return false;
}
Expand Down
16 changes: 8 additions & 8 deletions Detectors/Base/include/DetectorsBase/Propagator.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,39 +59,39 @@ class Propagator
static constexpr float MAX_SIN_PHI = 0.85f;
static constexpr float MAX_STEP = 2.0f;

bool PropagateToXBxByBz(o2::track::TrackParCov& track, float x, float mass = o2::constants::physics::MassPionCharged,
bool PropagateToXBxByBz(o2::track::TrackParCov& track, float x,
float maxSnp = MAX_SIN_PHI, float maxStep = MAX_STEP, MatCorrType matCorr = MatCorrType::USEMatCorrTGeo,
o2::track::TrackLTIntegral* tofInfo = nullptr, int signCorr = 0) const;

bool PropagateToXBxByBz(o2::track::TrackPar& track, float x, float mass = o2::constants::physics::MassPionCharged,
bool PropagateToXBxByBz(o2::track::TrackPar& track, float x,
float maxSnp = MAX_SIN_PHI, float maxStep = MAX_STEP, MatCorrType matCorr = MatCorrType::USEMatCorrTGeo,
o2::track::TrackLTIntegral* tofInfo = nullptr, int signCorr = 0) const;

bool propagateToX(o2::track::TrackParCov& track, float x, float bZ, float mass = o2::constants::physics::MassPionCharged,
bool propagateToX(o2::track::TrackParCov& track, float x, float bZ,
float maxSnp = MAX_SIN_PHI, float maxStep = MAX_STEP, MatCorrType matCorr = MatCorrType::USEMatCorrTGeo,
o2::track::TrackLTIntegral* tofInfo = nullptr, int signCorr = 0) const;

bool propagateToX(o2::track::TrackPar& track, float x, float bZ, float mass = o2::constants::physics::MassPionCharged,
bool propagateToX(o2::track::TrackPar& track, float x, float bZ,
float maxSnp = MAX_SIN_PHI, float maxStep = MAX_STEP, MatCorrType matCorr = MatCorrType::USEMatCorrTGeo,
o2::track::TrackLTIntegral* tofInfo = nullptr, int signCorr = 0) const;

bool propagateToDCA(const o2::dataformats::VertexBase& vtx, o2::track::TrackParCov& track, float bZ,
float mass = o2::constants::physics::MassPionCharged, float maxStep = MAX_STEP, MatCorrType matCorr = MatCorrType::USEMatCorrTGeo,
float maxStep = MAX_STEP, MatCorrType matCorr = MatCorrType::USEMatCorrTGeo,
o2::dataformats::DCA* dcaInfo = nullptr, o2::track::TrackLTIntegral* tofInfo = nullptr,
int signCorr = 0, float maxD = 999.f) const;

bool propagateToDCABxByBz(const o2::dataformats::VertexBase& vtx, o2::track::TrackParCov& track,
float mass = o2::constants::physics::MassPionCharged, float maxStep = MAX_STEP, MatCorrType matCorr = MatCorrType::USEMatCorrTGeo,
float maxStep = MAX_STEP, MatCorrType matCorr = MatCorrType::USEMatCorrTGeo,
o2::dataformats::DCA* dcaInfo = nullptr, o2::track::TrackLTIntegral* tofInfo = nullptr,
int signCorr = 0, float maxD = 999.f) const;

bool propagateToDCA(const o2::math_utils::Point3D<float>& vtx, o2::track::TrackPar& track, float bZ,
float mass = o2::constants::physics::MassPionCharged, float maxStep = MAX_STEP, MatCorrType matCorr = MatCorrType::USEMatCorrTGeo,
float maxStep = MAX_STEP, MatCorrType matCorr = MatCorrType::USEMatCorrTGeo,
std::array<float, 2>* dca = nullptr, o2::track::TrackLTIntegral* tofInfo = nullptr,
int signCorr = 0, float maxD = 999.f) const;

bool propagateToDCABxByBz(const o2::math_utils::Point3D<float>& vtx, o2::track::TrackPar& track,
float mass = o2::constants::physics::MassPionCharged, float maxStep = MAX_STEP, MatCorrType matCorr = MatCorrType::USEMatCorrTGeo,
float maxStep = MAX_STEP, MatCorrType matCorr = MatCorrType::USEMatCorrTGeo,
std::array<float, 2>* dca = nullptr, o2::track::TrackLTIntegral* tofInfo = nullptr,
int signCorr = 0, float maxD = 999.f) const;

Expand Down
Loading