Skip to content
Open
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: 16 additions & 9 deletions PWGLF/Utils/strangenessBuilderHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,14 +390,14 @@
negativeTrackParam.getPxPyPzGlo(v0.negativeMomentum);
positiveTrackParam.getXYZGlo(v0.positivePosition);
negativeTrackParam.getXYZGlo(v0.negativePosition);
for (int i = 0; i < 3; i++) {

Check failure on line 393 in PWGLF/Utils/strangenessBuilderHelper.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.
// avoids misuse if mixed with KF particle use
v0.momentum[i] = v0.positiveMomentum[i] + v0.negativeMomentum[i];
}

// get decay vertex coordinates
const auto& vtx = fitter.getPCACandidate();
for (int i = 0; i < 3; i++) {

Check failure on line 400 in PWGLF/Utils/strangenessBuilderHelper.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.
v0.position[i] = vtx[i];
}

Expand Down Expand Up @@ -470,7 +470,7 @@
positiveTrackParam.getCovXYZPxPyPzGlo(covTpositive);
negativeTrackParam.getCovXYZPxPyPzGlo(covTnegative);
constexpr int MomInd[6] = {9, 13, 14, 18, 19, 20}; // cov matrix elements for momentum component
for (int i = 0; i < 6; i++) {

Check failure on line 473 in PWGLF/Utils/strangenessBuilderHelper.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.
v0.momentumCovariance[i] = covTpositive[MomInd[i]] + covTnegative[MomInd[i]];
}
}
Expand Down Expand Up @@ -568,7 +568,7 @@
return false;
}

if (kfConstrainedMassValue > -1e-4) {

Check failure on line 571 in PWGLF/Utils/strangenessBuilderHelper.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.
// photon constraint: this one's got no mass
KFV0.SetNonlinearMassConstraint(kfConstrainedMassValue);
}
Expand Down Expand Up @@ -597,7 +597,7 @@
}

// check radius
for (int i = 0; i < 3; i++) {

Check failure on line 600 in PWGLF/Utils/strangenessBuilderHelper.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.
v0.position[i] = xyz_decay[i];
}
if (std::hypot(v0.position[0], v0.position[1]) < v0selections.v0radius) {
Expand Down Expand Up @@ -773,7 +773,7 @@
// Set up covariance matrices (should in fact be optional)
std::array<float, 21> covV = {0.};
constexpr int MomInd[6] = {9, 13, 14, 18, 19, 20}; // cov matrix elements for momentum component
for (int i = 0; i < 6; i++) {

Check failure on line 776 in PWGLF/Utils/strangenessBuilderHelper.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.
covV[MomInd[i]] = v0input.momentumCovariance[i];
covV[i] = v0input.positionCovariance[i];
}
Expand Down Expand Up @@ -811,7 +811,7 @@
lBachelorTrack.getPxPyPzGlo(cascade.bachelorMomentum);
// get decay vertex coordinates
const auto& vtx = fitter.getPCACandidate();
for (int i = 0; i < 3; i++) {

Check failure on line 814 in PWGLF/Utils/strangenessBuilderHelper.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.
cascade.cascadePosition[i] = vtx[i];
}
if (std::hypot(cascade.cascadePosition[0], cascade.cascadePosition[1]) < cascadeselections.cascradius) {
Expand Down Expand Up @@ -901,10 +901,10 @@
lV0Track.getCovXYZPxPyPzGlo(covTv0);
lBachelorTrack.getCovXYZPxPyPzGlo(covTbachelor);
constexpr int MomInd[6] = {9, 13, 14, 18, 19, 20}; // cov matrix elements for momentum component
for (int i = 0; i < 21; i++) {

Check failure on line 904 in PWGLF/Utils/strangenessBuilderHelper.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.
cascade.covariance[i] = 0.0f;
}
for (int i = 0; i < 6; i++) {

Check failure on line 907 in PWGLF/Utils/strangenessBuilderHelper.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.
cascade.covariance[i] = positionCovariance[i];
cascade.covariance[MomInd[i]] = covTv0[MomInd[i]] + covTbachelor[MomInd[i]];
}
Expand Down Expand Up @@ -1059,6 +1059,11 @@
return false;
}

// Calculate V0 mass before mass constraint
float MLambda, SigmaLambda;
KFV0.GetMass(MLambda, SigmaLambda);
cascade.kfMLambda = MLambda;

if (kfUseV0MassConstraint) {
KFV0.SetNonlinearMassConstraint(o2::constants::physics::MassLambda);
}
Expand Down Expand Up @@ -1117,9 +1122,20 @@
cascade = {};
return false;
}

// Calculate masses a priori before potentially applying mass constraint
// --> this is the invariant mass of the decay products, not the mass-constrained value
float MXi, SigmaXi, MOmega, SigmaOmega;
KFXi.GetMass(MXi, SigmaXi);
KFOmega.GetMass(MOmega, SigmaOmega);
cascade.massXi = MXi;
cascade.massOmega = MOmega;

if (kfUseCascadeMassConstraint) {
// set mass constraint if requested
// WARNING: this is only adequate for decay chains, i.e. XiC -> Xi or OmegaC -> Omega
// WARNING: be aware of the fact that if enabled, the stored particle momentum and covariance matrix will be mass-constrained
// while the stored mass will be the invariant mass of the decay products (i.e. not mass-constrained)
KFXi.SetNonlinearMassConstraint(o2::constants::physics::MassXiMinus);
KFOmega.SetNonlinearMassConstraint(o2::constants::physics::MassOmegaMinus);
}
Expand Down Expand Up @@ -1215,18 +1231,9 @@
}
cascade.pointingAngle = TMath::ACos(cosPA);

// Calculate masses a priori
float MLambda, SigmaLambda, MXi, SigmaXi, MOmega, SigmaOmega;
KFV0.GetMass(MLambda, SigmaLambda);
KFXi.GetMass(MXi, SigmaXi);
KFOmega.GetMass(MOmega, SigmaOmega);
cascade.kfMLambda = MLambda;
cascade.massXi = MXi;
cascade.massOmega = MOmega;

// KF Cascade covariance matrix
std::array<float, 21> covCascKF;
for (int i = 0; i < 21; i++) { // get covariance matrix elements (lower triangle)

Check failure on line 1236 in PWGLF/Utils/strangenessBuilderHelper.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.
covCascKF[i] = KFXi.GetCovariance(i);
cascade.covariance[i] = covCascKF[i];
}
Expand Down
Loading