From c12519548300612339f5fa5d16567f7b60770a35 Mon Sep 17 00:00:00 2001 From: Sara Haidlova Date: Thu, 18 Apr 2024 22:08:33 +0200 Subject: [PATCH] PWGUD: buxfix for errors from hyperloop --- PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx b/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx index f95fbf4d286..bc2fa042f29 100644 --- a/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx +++ b/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx @@ -513,13 +513,13 @@ struct upcJpsiCentralBarrel { float massPr = o2::constants::physics::MassProton; if (countGT == 2) { - TLorentzVector mom, daughter[2]; - auto trkDaughter1 = tracks.iteratorAt(trkIdx[0]); - auto trkDaughter2 = tracks.iteratorAt(trkIdx[1]); - if ((trkDaughter1.sign() * trkDaughter2.sign()) > 0) { - return; - } if (countGTel == 2) { + TLorentzVector mom, daughter[2]; + auto trkDaughter1 = tracks.iteratorAt(trkIdx[0]); + auto trkDaughter2 = tracks.iteratorAt(trkIdx[1]); + if ((trkDaughter1.sign() * trkDaughter2.sign()) > 0) { + return; + } if (!(RecoDecay::sumOfSquares(trkDaughter1.tpcNSigmaMu(), trkDaughter2.tpcNSigmaMu()) < RecoDecay::sumOfSquares(trkDaughter1.tpcNSigmaEl(), trkDaughter2.tpcNSigmaEl()))) { return; } @@ -659,6 +659,9 @@ struct upcJpsiCentralBarrel { TLorentzVector mom, daughter[2]; auto trkDaughter1 = tracks.iteratorAt(trkIdx[0]); auto trkDaughter2 = tracks.iteratorAt(trkIdx[1]); + if ((trkDaughter1.sign() * trkDaughter2.sign()) > 0) { + return; + } if (!(RecoDecay::sumOfSquares(trkDaughter1.tpcNSigmaEl(), trkDaughter2.tpcNSigmaEl() < RecoDecay::sumOfSquares(trkDaughter1.tpcNSigmaMu(), trkDaughter2.tpcNSigmaMu())))) { return; } @@ -674,7 +677,7 @@ struct upcJpsiCentralBarrel { std::array mother = {trkDaughter1.px() + trkDaughter2.px(), trkDaughter1.py() + trkDaughter2.py(), trkDaughter1.pz() + trkDaughter2.pz()}; auto arrMom = std::array{daughter1, daughter2}; - float massJpsi = RecoDecay::m(arrMom, std::array{massEl, massEl}); + float massJpsi = RecoDecay::m(arrMom, std::array{massMu, massMu}); float rapJpsi = RecoDecay::y(mother, massJpsi); TGmu.get(HIST("TGmu/hTrackPt"))->Fill(trkDaughter1.pt()); @@ -777,6 +780,9 @@ struct upcJpsiCentralBarrel { TLorentzVector mom, daughter[2]; auto trkDaughter1 = tracks.iteratorAt(trkIdx[0]); auto trkDaughter2 = tracks.iteratorAt(trkIdx[1]); + if ((trkDaughter1.sign() * trkDaughter2.sign()) > 0) { + return; + } auto ene1 = RecoDecay::e(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz(), massPr); auto ene2 = RecoDecay::e(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz(), massPr); @@ -790,7 +796,7 @@ struct upcJpsiCentralBarrel { std::array mother = {trkDaughter1.px() + trkDaughter2.px(), trkDaughter1.py() + trkDaughter2.py(), trkDaughter1.pz() + trkDaughter2.pz()}; auto arrMom = std::array{daughter1, daughter2}; - float massJpsi = RecoDecay::m(arrMom, std::array{massEl, massEl}); + float massJpsi = RecoDecay::m(arrMom, std::array{massPr, massPr}); float rapJpsi = RecoDecay::y(mother, massJpsi); TGp.get(HIST("TGp/hTrackPt"))->Fill(trkDaughter1.pt());