Skip to content
Merged
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
25 changes: 25 additions & 0 deletions Common/Core/fwdtrackUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,31 @@
return o2::track::TrackParCovFwd(track.z() + zshift, tpars, tcovs, chi2);
}

inline o2::track::TrackParCovFwd getTrackParCovFwdShiftManual(
const double x, const double y, const double phi, const double tgl, const double signed1Pt,
const double cXX,
const double cXY, const double cYY,
const double cPhiX, const double cPhiY, const double cPhiPhi,
const double cTglX, const double cTglY, const double cTglPhi, const double cTglTgl,
const double c1PtX, const double c1PtY, const double c1PtPhi, const double c1PtTgl, const double c1Pt21Pt2,
const float z, const float zshift, const float chi2)
{
SMatrix5 tpars(x, y, phi, tgl, signed1Pt);

SMatrix55 tcovs;
std::vector<double> v1{
cXX,
cXY, cYY,
cPhiX, cPhiY, cPhiPhi,
cTglX, cTglY, cTglPhi, cTglTgl,
c1PtX, c1PtY, c1PtPhi, c1PtTgl, c1Pt21Pt2};
tcovs = SMatrix55(v1.begin(), v1.end());
v1.clear();
v1.shrink_to_fit();

return o2::track::TrackParCovFwd(z + zshift, tpars, tcovs, chi2);
}

template <typename TFwdTrack, typename TFwdTrackCov>
o2::track::TrackParCovFwd getTrackParCovFwd(TFwdTrack const& track, TFwdTrackCov const& cov)
{
Expand Down Expand Up @@ -156,7 +181,7 @@
o2::dataformats::GlobalFwdTrack propmuon;
o2::globaltracking::MatchGlobalFwd mMatching;

if (trackType > 2) { // MCH-MID or MCH standalone

Check failure on line 184 in Common/Core/fwdtrackUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
o2::dataformats::GlobalFwdTrack track;
track.setParameters(fwdtrack.getParameters());
track.setZ(fwdtrack.getZ());
Expand All @@ -177,7 +202,7 @@
propmuon.setParameters(proptrack.getParameters());
propmuon.setZ(proptrack.getZ());
propmuon.setCovariances(proptrack.getCovariances());
} else if (trackType < 2) { // MFT-MCH-MID

Check failure on line 205 in Common/Core/fwdtrackUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
// const double centerMFT[3] = {0, 0, -61.4};
// o2::field::MagneticField* field = static_cast<o2::field::MagneticField*>(TGeoGlobalMagField::Instance()->GetField());
// auto Bz = field->getBz(centerMFT); // Get field at centre of MFT in kG.
Expand Down Expand Up @@ -256,7 +281,7 @@

o2::track::TrackParCovFwd trk = getTrackParCovFwdShift(fwdtrack, zShift, fwdtrack);

if (std::abs(bz) < 1e-12) {

Check failure on line 284 in Common/Core/fwdtrackUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
trk.propagateToZlinear(collision.posZ());
} else {
trk.propagateToZhelix(collision.posZ(), bz);
Expand All @@ -267,7 +292,7 @@
float phi = trk.getPhi();
float tgl = trk.getTanl();

if (!std::isfinite(x) || !std::isfinite(y) || !std::isfinite(phi) || !std::isfinite(tgl) || std::abs(tgl) < 1e-8) {

Check failure on line 295 in Common/Core/fwdtrackUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return -1.f;
}

Expand Down Expand Up @@ -300,7 +325,7 @@

float chi2 = (sYY * dx * dx - 2.0 * sXY * dx * dy + sXX * dy * dy) / det;

if (!std::isfinite(chi2) || chi2 < -1e-8) {

Check failure on line 328 in Common/Core/fwdtrackUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return -1.f;
}

Expand Down
Loading