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
29 changes: 16 additions & 13 deletions PWGLF/Tasks/Nuspex/spectraKinkPiKa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -517,28 +517,28 @@
return ptd;
}

double maxKinkAngle(double pMother, double M, double mDaughter)
double maxKinkAngle(double pMother, double M, double beta)
{
double pStar = (M * M - mDaughter * mDaughter) / (2 * M); // rest-frame momentum
double denom = std::sqrt(pMother * pMother + mDaughter * mDaughter);
double sinTheta = pStar / denom;
if (sinTheta > 1.0)
sinTheta = 1.0;
return std::asin(sinTheta) * o2::constants::math::Rad2Deg;
double num = M * beta; // rest-frame momentum
double denom = std::sqrt(pMother * pMother * (1 - beta * beta) - (M * M * beta * beta));
double tanTheta = num / denom;
return std::atan(tanTheta) * o2::constants::math::Rad2Deg;
}

double f1(double p) // K → μ ν
{
double betak = 0.9127037;
return maxKinkAngle(p,
o2::constants::physics::MassKaonCharged,
o2::constants::physics::MassMuon);
betak);
}

inline double f2(double p) // π → μ ν
{
double betapi = 0.2731374;
return maxKinkAngle(p,
o2::constants::physics::MassPionCharged,
o2::constants::physics::MassMuon);
betapi);
}

void processData(CollisionsFull::iterator const& collision, aod::KinkCands const& KinkCands, TracksFull const&)
Expand Down Expand Up @@ -668,7 +668,7 @@
double maxDecAngKmu = f1(pMoth);
double maxDecAngPimu = f2(pMoth);

if (maxkinkanglecut && (kinkangle > maxDecAngKmu * 0.98) && (pMoth > 1.2))

Check failure on line 671 in PWGLF/Tasks/Nuspex/spectraKinkPiKa.cxx

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.
continue;
if (maxkinkanglecut && kinkangle <= maxDecAngPimu * 1.2)
continue;
Expand Down Expand Up @@ -744,7 +744,7 @@
rEventSelection.fill(HIST("hVertexZRec"), collision.posZ());
rEventSelection.fill(HIST("hMultiplicity"), multiplicity);

auto kinkCandPerColl = KinkCands.sliceBy(mPerCol, collision.globalIndex());
auto kinkCandPerColl = KinkCands.sliceBy(mPerCol, collision.index());
for (const auto& kinkCand : kinkCandPerColl) {
auto dauTrack = kinkCand.trackDaug_as<TracksFull>();
auto mothTrack = kinkCand.trackMoth_as<TracksFull>();
Expand All @@ -754,9 +754,9 @@
if (mothTrack.collisionId() != dauTrack.collisionId()) {
continue; // skip mismatched collision tracks
}
if (mothTrack.collisionId() != collision.globalIndex()) {
continue; // not from this event
}
// if (mothTrack.collisionId() != collision.globalIndex()) {
// continue; // not from this event
// }
if (dauTrack.sign() != mothTrack.sign()) {
LOG(info) << "Skipping kink candidate with opposite sign daughter and mother: " << kinkCand.globalIndex();
continue; // Skip if the daughter has the opposite sign as the mother
Expand Down Expand Up @@ -847,12 +847,15 @@
double maxDecAngKmu = f1(pMoth);
double maxDecAngPimu = f2(pMoth);

if (maxkinkanglecut && (kinkangle > maxDecAngKmu * 0.98) && (pMoth > 1.2))

Check failure on line 850 in PWGLF/Tasks/Nuspex/spectraKinkPiKa.cxx

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.
continue;
if (maxkinkanglecut && kinkangle <= maxDecAngPimu * 1.2)
continue;

rpiKkink.fill(HIST("h1_tracks"), 12.0);
if (std::abs(v0.Rapidity()) > rapCut) {
continue;
}
if (additionalhist) {
rpiKkink.fill(HIST("h2_moth_pt_vs_eta_rec"), v0.Pt(), v0.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_dau_pt_vs_eta_rec"), v1.Pt(), v1.Eta(), multiplicity);
Expand Down
Loading