diff --git a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx index 1692d71a6d7..574fea93669 100644 --- a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx +++ b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx @@ -42,6 +42,7 @@ #include "Common/Core/EventPlaneHelper.h" #include "Common/DataModel/Qvectors.h" #include "Common/Tools/TrackTuner.h" +#include "Common/Core/RecoDecay.h" #include "DataFormatsParameters/GRPMagField.h" #include "DataFormatsParameters/GRPObject.h" @@ -321,18 +322,6 @@ struct nucleiSpectra { HistogramRegistry spectra{"spectra", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - double getPhiInRange(double phi) - { - double result = phi; - while (result < 0) { - result = result + 2. * TMath::Pi() / 2; - } - while (result > 2. * TMath::Pi() / 2) { - result = result - 2. * TMath::Pi() / 2; - } - return result; - } - double computeAbsoDecL(aod::McParticles::iterator particle) { if (!particle.has_daughters()) @@ -469,7 +458,7 @@ struct nucleiSpectra { if (doprocessMatching) { for (int iC{0}; iC < 2; ++iC) { nuclei::hMatchingStudy[iC] = spectra.add(fmt::format("hMatchingStudy{}", nuclei::matter[iC]).data(), ";#it{p}_{T};#phi;#eta;n#sigma_{ITS};n#sigma{TPC};n#sigma_{TOF};Centrality", HistType::kTHnSparseF, {{20, 1., 9.}, {10, 0., o2::constants::math::TwoPI}, {10, -1., 1.}, {50, -5., 5.}, {50, -5., 5.}, {50, 0., 1.}, {8, 0., 80.}}); - nuclei::hMatchingStudyHadrons[iC] = spectra.add(fmt::format("hMatchingStudyHadrons{}", nuclei::matter[iC]).data(), ";#it{p}_{T};#phi;#eta;Centrality;Track type", HistType::kTHnSparseF, {{23, 0.4, 5.}, {20, 0., o2::constants::math::TwoPI}, {10, -1., 1.}, {8, 0., 80.}, {2, -0.5, 1.5}}); + nuclei::hMatchingStudyHadrons[iC] = spectra.add(fmt::format("hMatchingStudyHadrons{}", nuclei::matter[iC]).data(), ";#it{p}_{T};#phi;#eta;Centrality;Track type", HistType::kTHnF, {{23, 0.4, 5.}, {20, 0., o2::constants::math::TwoPI}, {10, -1., 1.}, {8, 0., 80.}, {2, -0.5, 1.5}}); } } @@ -648,13 +637,13 @@ struct nucleiSpectra { if (cfgFlowHist->get(iS) && doprocessDataFlow) { if constexpr (std::is_same::value) { - auto deltaPhiInRange = getPhiInRange(fvector.phi() - collision.psiFT0C()); + auto deltaPhiInRange = RecoDecay::constrainAngle(fvector.phi() - collision.psiFT0C(), 0.f, 2); auto v2 = std::cos(2.0 * deltaPhiInRange); nuclei::hFlowHists[iC][iS]->Fill(collision.centFT0C(), fvector.pt(), nSigma[0][iS], tofMasses[iS], v2, track.itsNCls(), track.tpcNClsFound()); } } else if (cfgFlowHist->get(iS) && doprocessDataFlowAlternative) { if constexpr (std::is_same::value) { - auto deltaPhiInRange = getPhiInRange(fvector.phi() - computeEventPlane(collision.qvecFT0CIm(), collision.qvecFT0CRe())); + auto deltaPhiInRange = RecoDecay::constrainAngle(fvector.phi() - computeEventPlane(collision.qvecFT0CIm(), collision.qvecFT0CRe()), 0.f, 2); auto v2 = std::cos(2.0 * deltaPhiInRange); nuclei::hFlowHists[iC][iS]->Fill(collision.centFT0C(), fvector.pt(), nSigma[0][iS], tofMasses[iS], v2, track.itsNCls(), track.tpcNClsFound()); } @@ -908,13 +897,12 @@ struct nucleiSpectra { if (!eventSelection(collision) || !collision.triggereventep()) { return; } - const float centrality = getCentrality(collision); + const float centrality = collision.centFT0C(); o2::aod::ITSResponse itsResponse; for (const auto& track : tracks) { if (std::abs(track.eta()) > cfgCutEta || track.itsNCls() < 7 || - track.itsChi2NCl() > 36.f || - itsResponse.nSigmaITS(track) < -1.) { + track.itsChi2NCl() > 36.f) { continue; } double expBethe{tpc::BetheBlochAleph(static_cast(track.tpcInnerParam() * 2. / o2::constants::physics::MassHelium3), cfgBetheBlochParams->get(4, 0u), cfgBetheBlochParams->get(4, 1u), cfgBetheBlochParams->get(4, 2u), cfgBetheBlochParams->get(4, 3u), cfgBetheBlochParams->get(4, 4u))}; @@ -922,9 +910,11 @@ struct nucleiSpectra { double nSigmaTPC{(track.tpcSignal() - expBethe) / expSigma}; int iC = track.signed1Pt() > 0; const float pt = track.pt(); - const float phi = getPhiInRange(track.phi() - collision.psiFT0C()); - nuclei::hMatchingStudy[iC]->Fill(pt * 2, phi, track.eta(), itsResponse.nSigmaITS(track), nSigmaTPC, o2::pid::tof::Beta::GetBeta(track), centrality); + const float phi = 2.f * RecoDecay::constrainAngle(track.phi() - collision.psiFT0C(), 0.f, 2); nuclei::hMatchingStudyHadrons[iC]->Fill(pt, phi, track.eta(), centrality, track.hasTPC()); + if (itsResponse.nSigmaITS(track) > -1.) { + nuclei::hMatchingStudy[iC]->Fill(pt * 2, phi, track.eta(), itsResponse.nSigmaITS(track), nSigmaTPC, o2::pid::tof::Beta::GetBeta(track), centrality); + } } }