diff --git a/PWGCF/Femto3D/Core/femto3dPairTask.h b/PWGCF/Femto3D/Core/femto3dPairTask.h index 5627215ea55..db5949f4ae0 100755 --- a/PWGCF/Femto3D/Core/femto3dPairTask.h +++ b/PWGCF/Femto3D/Core/femto3dPairTask.h @@ -222,10 +222,12 @@ class FemtoPair } float GetPhiStarDiff(const float& radius = 1.2) const { - if (_first != NULL && _second != NULL) - return _first->phiStar(_magfield1, radius) - _second->phiStar(_magfield2, radius); - else + if (_first != NULL && _second != NULL) { + float dphi = _first->phiStar(_magfield1, radius) - _second->phiStar(_magfield2, radius); + return std::fabs(dphi) > o2::constants::math::PI ? (1.0 - 2.0 * o2::constants::math::PI / std::fabs(dphi)) * dphi : dphi; + } else { return 1000; + } } float GetAvgPhiStarDiff() const; @@ -327,8 +329,7 @@ float FemtoPair::GetAvgPhiStarDiff() const float res = 0.0; for (const auto& radius : TPCradii) { - const float dphi = GetPhiStarDiff(radius); - res += std::fabs(dphi) > o2::constants::math::PI ? (1.0 - 2.0 * o2::constants::math::PI / std::fabs(dphi)) * dphi : dphi; + res += GetPhiStarDiff(radius); } return res / TPCradii.size(); diff --git a/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx b/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx index bc91f8a25c2..83aa740795c 100644 --- a/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx +++ b/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx @@ -90,9 +90,10 @@ struct FemtoCorrelations { Configurable _particlePDGtoReject{"particlePDGtoRejectFromSecond", 0, "applied only if the particles are non-identical and only to the second particle in the pair!!!"}; Configurable> _rejectWithinNsigmaTOF{"rejectWithinNsigmaTOF", std::vector{-0.0f, 0.0f}, "TOF rejection Nsigma range for the particle specified with PDG to be rejected"}; + Configurable _dPhiMode{"dPhiMode", 0, "Flag to choose how to calc. dphi*: 0 - at a fixed TPC radius; 1 - average over different TPC radii;"}; + Configurable _radiusTPC{"radiusTPC", 1.2, "TPC radius to calculate phi_star for"}; Configurable _deta{"deta", 0.01, "minimum allowed defference in eta between two tracks in a pair"}; Configurable _dphi{"dphi", 0.01, "minimum allowed defference in phi_star between two tracks in a pair"}; - // Configurable _radiusTPC{"radiusTPC", 1.2, "TPC radius to calculate phi_star for"}; Configurable _avgSepTPC{"avgSepTPC", 10, "average sep. (cm) in TPC"}; Configurable _vertexNbinsToMix{"vertexNbinsToMix", 10, "Number of vertexZ bins for the mixing"}; @@ -310,15 +311,15 @@ struct FemtoCorrelations { LOGF(fatal, "kTbin value obtained for a pair exceeds the configured number of kT bins (3D)"); if (_fillDetaDphi % 2 == 0) - DoubleTrack_SE_histos_BC[multBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); + DoubleTrack_SE_histos_BC[multBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); - if (_deta > 0 && _dphi > 0 && Pair->IsClosePair(_deta, _dphi)) + if (_deta > 0 && _dphi > 0 && (_dPhiMode.value == 0 ? Pair->IsClosePair(_deta, _dphi, _radiusTPC) : Pair->IsClosePair(_deta, _dphi))) continue; if (_avgSepTPC > 0 && Pair->IsClosePair(_avgSepTPC)) continue; if (_fillDetaDphi > 0) - DoubleTrack_SE_histos_AC[multBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); + DoubleTrack_SE_histos_AC[multBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); kThistos[multBin][kTbin]->Fill(pair_kT); mThistos[multBin][kTbin]->Fill(Pair->GetMt()); // test @@ -359,21 +360,21 @@ struct FemtoCorrelations { if (_fillDetaDphi % 2 == 0) { if (!SE_or_ME) - DoubleTrack_SE_histos_BC[multBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); + DoubleTrack_SE_histos_BC[multBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); else - DoubleTrack_ME_histos_BC[multBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); + DoubleTrack_ME_histos_BC[multBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); } - if (_deta > 0 && _dphi > 0 && Pair->IsClosePair(_deta, _dphi)) + if (_deta > 0 && _dphi > 0 && (_dPhiMode.value == 0 ? Pair->IsClosePair(_deta, _dphi, _radiusTPC) : Pair->IsClosePair(_deta, _dphi))) continue; if (_avgSepTPC > 0 && Pair->IsClosePair(_avgSepTPC)) continue; if (_fillDetaDphi > 0) { if (!SE_or_ME) - DoubleTrack_SE_histos_AC[multBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); + DoubleTrack_SE_histos_AC[multBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); else - DoubleTrack_ME_histos_AC[multBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); + DoubleTrack_ME_histos_AC[multBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); } if (!SE_or_ME) { diff --git a/PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx b/PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx index be66280928e..b776d34e629 100644 --- a/PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx +++ b/PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx @@ -86,7 +86,8 @@ struct FemtoCorrelationsMC { Configurable _particlePDGtoReject{"particlePDGtoRejectFromSecond", 0, "applied only if the particles are non-identical and only to the second particle in the pair!!!"}; Configurable> _rejectWithinNsigmaTOF{"rejectWithinNsigmaTOF", std::vector{-0.0f, 0.0f}, "TOF rejection Nsigma range for the particle specified with PDG to be rejected"}; - // Configurable _radiusTPC{"radiusTPC", 1.2, "TPC radius to calculate phi_star for"}; + Configurable _dPhiMode{"dPhiMode", 0, "Flag to choose how to calc. dphi*: 0 - at a fixed TPC radius; 1 - average over different TPC radii;"}; + Configurable _radiusTPC{"radiusTPC", 1.2, "TPC radius to calculate phi_star for"}; Configurable _vertexNbinsToMix{"vertexNbinsToMix", 10, "Number of vertexZ bins for the mixing"}; Configurable> _centBins{"multBins", std::vector{0.0f, 100.0f}, "multiplicity percentile/centrality binning (min:0, max:100)"}; @@ -257,7 +258,7 @@ struct FemtoCorrelationsMC { LOGF(fatal, "kTbin value obtained for a pair exceeds the configured number of kT bins"); kThistos[centBin][kTbin]->Fill(pair_kT); - DoubleTrack_SE_histos[centBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); + DoubleTrack_SE_histos[centBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); AvgSep_SE_histos[centBin][kTbin]->Fill(Pair->GetAvgSep()); Pair->ResetPair(); } @@ -281,7 +282,7 @@ struct FemtoCorrelationsMC { LOGF(fatal, "kTbin value obtained for a pair exceeds the configured number of kT bins"); kThistos[centBin][kTbin]->Fill(pair_kT); - DoubleTrack_SE_histos[centBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); + DoubleTrack_SE_histos[centBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); AvgSep_SE_histos[centBin][kTbin]->Fill(Pair->GetAvgSep()); Pair->ResetPair(); } @@ -304,7 +305,7 @@ struct FemtoCorrelationsMC { if (kTbin > Resolution_histos[centBin].size() || kTbin > DoubleTrack_ME_histos[centBin].size()) LOGF(fatal, "kTbin value obtained for a pair exceeds the configured number of kT bins"); - DoubleTrack_ME_histos[centBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); + DoubleTrack_ME_histos[centBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff()); AvgSep_ME_histos[centBin][kTbin]->Fill(Pair->GetAvgSep()); if (abs(ii->pdgCode()) != _particlePDG_1.value || abs(iii->pdgCode()) != _particlePDG_2.value)