diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h index bc4c6f1ea4e..8793dc4bea6 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h @@ -169,6 +169,7 @@ class FemtoUniverseDetaDphiStar } auto deta = part1.eta() - part2.eta(); auto dphiAvg = averagePhiStar(part1, part2, 0); + auto dphi = averagePhiStarFrac(part1, part2); if (ChosenEventType == femto_universe_container::EventType::same) { histdetadpisame[0][0]->Fill(deta, dphiAvg); } else if (ChosenEventType == femto_universe_container::EventType::mixed) { @@ -177,7 +178,8 @@ class FemtoUniverseDetaDphiStar LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; } - if (std::pow(dphiAvg, 2) / std::pow(cutDeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(cutDeltaEtaMax, 2) < 1.) { + // if (std::pow(dphiAvg, 2) / std::pow(cutDeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(cutDeltaEtaMax, 2) < 1.) { + if (dphi > 0.02) { return true; } else { if (ChosenEventType == femto_universe_container::EventType::same) { @@ -554,6 +556,36 @@ class FemtoUniverseDetaDphiStar return dPhiAvg / static_cast(entries); } + /// Calculate average phi + template + float averagePhiStarFrac(const T1& part1, const T2& part2) + { + std::vector tmpVec1; + std::vector tmpVec2; + phiAtRadiiTPC(part1, tmpVec1); + phiAtRadiiTPC(part2, tmpVec2); + int num = tmpVec1.size(); + float dphi = 0; + int entries = 0; + double distance = 0; + int badpoints = 0; + + for (int i = 0; i < num; i++) { + if (tmpVec1.at(i) != 999 && tmpVec2.at(i) != 999) { + dphi = tmpVec1.at(i) - tmpVec2.at(i); + entries++; + } else { + dphi = 0; + } + dphi = TVector2::Phi_mpi_pi(dphi); + distance = 2 * TMath::Sin(TMath::Abs(dphi) * 0.5) * TmpRadiiTPC[i]; + if (distance < 10.0) { + badpoints++; + } + } + return badpoints / entries; + } + // Get particle charge from mask template float getCharge(const T1& part)