From d4c1d5d5b6c37dc1951ccc3f12723341ba13cf3f Mon Sep 17 00:00:00 2001 From: Gleb Romanenko Date: Fri, 14 Jun 2024 11:13:15 +0200 Subject: [PATCH 1/2] adding new 2trck cut --- PWGCF/Femto3D/Core/femto3dPairTask.h | 27 ++++++++++++++++++++++- PWGCF/Femto3D/Tasks/femto3dPairTask.cxx | 9 ++++++-- PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx | 13 +++++++++++ 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/PWGCF/Femto3D/Core/femto3dPairTask.h b/PWGCF/Femto3D/Core/femto3dPairTask.h index 43a84047509..7a51bede4c5 100755 --- a/PWGCF/Femto3D/Core/femto3dPairTask.h +++ b/PWGCF/Femto3D/Core/femto3dPairTask.h @@ -16,6 +16,8 @@ #ifndef PWGCF_FEMTO3D_CORE_FEMTO3DPAIRTASK_H_ #define PWGCF_FEMTO3D_CORE_FEMTO3DPAIRTASK_H_ +#define THETA(eta) 2.0 * atan(exp(-eta)) + // #include "Framework/ASoA.h" // #include "Framework/DataTypes.h" // #include "Framework/AnalysisDataModel.h" @@ -191,7 +193,11 @@ class FemtoPair TrackType* GetSecondParticle() const { return _second; } bool IsIdentical() { return _isidentical; } - bool IsClosePair(const float& deta = 0.01, const float& dphi = 0.01, const float& radius = 1.2) const; + bool IsClosePair(const float& deta, const float& dphi, const float& radius) const; + bool IsClosePair(const float& avgSep) const { return static_cast(GetAvgSep() < avgSep); } + + float GetAvgSep() const; + float GetEtaDiff() const { if (_first != NULL && _second != NULL) @@ -217,6 +223,7 @@ class FemtoPair float _magfield1 = 0.0, _magfield2 = 0.0; int _PDG1 = 0, _PDG2 = 0; bool _isidentical = true; + float TPCradii[9] = {0.85, 1.05, 1.25, 1.45, 1.65, 1.85, 2.05, 2.25, 2.45}; }; template @@ -253,6 +260,24 @@ bool FemtoPair::IsClosePair(const float& deta, const float& dphi, con return false; } +template +float FemtoPair::GetAvgSep() const +{ + if (_first == NULL || _second == NULL) + return -100.f; + if (_magfield1 * _magfield2 == 0) + return -100.f; + + float dtheta = THETA(_first->eta()) - THETA(_second->eta()); + float res = 0.0; + + for (const auto& radius : TPCradii) { + res += sqrt(pow(2.0 * radius * sin(0.5 * GetPhiStarDiff(radius)), 2) + pow(2.0 * radius * sin(0.5 * dtheta), 2)); + } + + return 100.0 * res / 9; +} + template float FemtoPair::GetKstar() const { diff --git a/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx b/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx index 8b9b21ff560..c9bab458453 100644 --- a/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx +++ b/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx @@ -85,6 +85,7 @@ struct FemtoCorrelations { 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"}; Configurable> _centBins{"multBins", std::vector{0.0f, 100.0f}, "multiplicity percentile/centrality binning (min:0, max:100)"}; @@ -281,7 +282,9 @@ struct FemtoCorrelations { if (_fillDetaDphi % 2 == 0) DoubleTrack_SE_histos_BC[multBin][kTbin]->Fill(Pair->GetPhiStarDiff(_radiusTPC), Pair->GetEtaDiff()); - if (Pair->IsClosePair(_deta, _dphi, _radiusTPC)) + if (_deta > 0 && _dphi > 0 && Pair->IsClosePair(_deta, _dphi, _radiusTPC)) + continue; + if (_avgSepTPC > 0 && Pair->IsClosePair(_avgSepTPC)) continue; if (_fillDetaDphi > 0) @@ -331,7 +334,9 @@ struct FemtoCorrelations { DoubleTrack_ME_histos_BC[multBin][kTbin]->Fill(Pair->GetPhiStarDiff(_radiusTPC), Pair->GetEtaDiff()); } - if (Pair->IsClosePair(_deta, _dphi, _radiusTPC)) + if (_deta > 0 && _dphi > 0 && Pair->IsClosePair(_deta, _dphi, _radiusTPC)) + continue; + if (_avgSepTPC > 0 && Pair->IsClosePair(_avgSepTPC)) continue; if (_fillDetaDphi > 0) { diff --git a/PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx b/PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx index 6b995c5a956..f7cdb8d0a23 100644 --- a/PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx +++ b/PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx @@ -128,6 +128,8 @@ struct FemtoCorrelationsMC { std::vector>> Resolution_histos; std::vector>> DoubleTrack_SE_histos; std::vector>> DoubleTrack_ME_histos; + std::vector>> AvgSep_SE_histos; + std::vector>> AvgSep_ME_histos; void init(o2::framework::InitContext&) { @@ -199,22 +201,30 @@ struct FemtoCorrelationsMC { std::vector> Resolution_histos_perMult; std::vector> DoubleTrack_SE_histos_perMult; std::vector> DoubleTrack_ME_histos_perMult; + std::vector> AvgSep_SE_histos_perMult; + std::vector> AvgSep_ME_histos_perMult; for (unsigned int j = 0; j < _kTbins.value.size() - 1; j++) { auto kT_tmp = registry.add(Form("Cent%i/kT_cent%i_kT%i", i, i, j), Form("kT_cent%i_kT%i", i, j), kTH1F, {{500, 0., 5., "kT"}}); auto Res_tmp = registry.add(Form("Cent%i/ResolutionMatrix_cent%i_kT%i", i, i, j), Form("ResolutionMatrix_rec(gen)_cent%i_kT%i", i, j), kTH2F, {{CFkStarBinning, "k*_gen (GeV/c)"}, {CFkStarBinning, "k*_rec (GeV/c)"}}); auto DblTrk_SE_tmp = registry.add(Form("Cent%i/DoubleTrackEffects_SE_cent%i_kT%i", i, i, j), Form("DoubleTrackEffects_deta(dphi*)_SE_cent%i_kT%i", i, j), kTH2F, {{101, -0.2, 0.2, "dphi*"}, {101, -0.2, 0.2, "deta"}}); auto DblTrk_ME_tmp = registry.add(Form("Cent%i/DoubleTrackEffects_ME_cent%i_kT%i", i, i, j), Form("DoubleTrackEffects_deta(dphi*)_ME_cent%i_kT%i", i, j), kTH2F, {{101, -0.2, 0.2, "dphi*"}, {101, -0.2, 0.2, "deta"}}); + auto AvgSep_SE_tmp = registry.add(Form("Cent%i/AvgSep_SE_cent%i_kT%i", i, i, j), Form("AvgSep_SE_cent%i_kT%i", i, j), kTH1F, {{100, 0.0, 100.0, "avg. sep. (cm)"}}); + auto AvgSep_ME_tmp = registry.add(Form("Cent%i/AvgSep_ME_cent%i_kT%i", i, i, j), Form("AvgSep_ME_cent%i_kT%i", i, j), kTH1F, {{100, 0.0, 100.0, "avg. sep. (cm)"}}); kThistos_perMult.push_back(std::move(kT_tmp)); Resolution_histos_perMult.push_back(std::move(Res_tmp)); DoubleTrack_SE_histos_perMult.push_back(std::move(DblTrk_SE_tmp)); DoubleTrack_ME_histos_perMult.push_back(std::move(DblTrk_ME_tmp)); + AvgSep_SE_histos_perMult.push_back(std::move(AvgSep_SE_tmp)); + AvgSep_ME_histos_perMult.push_back(std::move(AvgSep_ME_tmp)); } kThistos.push_back(std::move(kThistos_perMult)); Resolution_histos.push_back(std::move(Resolution_histos_perMult)); DoubleTrack_SE_histos.push_back(std::move(DoubleTrack_SE_histos_perMult)); DoubleTrack_ME_histos.push_back(std::move(DoubleTrack_ME_histos_perMult)); + AvgSep_SE_histos.push_back(std::move(AvgSep_SE_histos_perMult)); + AvgSep_ME_histos.push_back(std::move(AvgSep_ME_histos_perMult)); } } @@ -236,6 +246,7 @@ struct FemtoCorrelationsMC { kThistos[centBin][kTbin]->Fill(pair_kT); DoubleTrack_SE_histos[centBin][kTbin]->Fill(Pair->GetPhiStarDiff(_radiusTPC), Pair->GetEtaDiff()); + AvgSep_SE_histos[centBin][kTbin]->Fill(Pair->GetAvgSep()); Pair->ResetPair(); } } @@ -259,6 +270,7 @@ struct FemtoCorrelationsMC { kThistos[centBin][kTbin]->Fill(pair_kT); DoubleTrack_SE_histos[centBin][kTbin]->Fill(Pair->GetPhiStarDiff(_radiusTPC), Pair->GetEtaDiff()); + AvgSep_SE_histos[centBin][kTbin]->Fill(Pair->GetAvgSep()); Pair->ResetPair(); } } @@ -289,6 +301,7 @@ struct FemtoCorrelationsMC { Resolution_histos[centBin][kTbin]->Fill(o2::aod::singletrackselector::GetKstarFrom4vectors(first4momentumGen, second4momentumGen, IsIdentical), Pair->GetKstar()); DoubleTrack_ME_histos[centBin][kTbin]->Fill(Pair->GetPhiStarDiff(_radiusTPC), Pair->GetEtaDiff()); + AvgSep_ME_histos[centBin][kTbin]->Fill(Pair->GetAvgSep()); Pair->ResetPair(); } } From 4aedd8a9d7940d2f3c2b618e235069315f420e90 Mon Sep 17 00:00:00 2001 From: Gleb Romanenko Date: Fri, 14 Jun 2024 12:11:36 +0200 Subject: [PATCH 2/2] applying requisted change --- PWGCF/Femto3D/Core/femto3dPairTask.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/Femto3D/Core/femto3dPairTask.h b/PWGCF/Femto3D/Core/femto3dPairTask.h index 7a51bede4c5..8480cbcbadd 100755 --- a/PWGCF/Femto3D/Core/femto3dPairTask.h +++ b/PWGCF/Femto3D/Core/femto3dPairTask.h @@ -223,7 +223,7 @@ class FemtoPair float _magfield1 = 0.0, _magfield2 = 0.0; int _PDG1 = 0, _PDG2 = 0; bool _isidentical = true; - float TPCradii[9] = {0.85, 1.05, 1.25, 1.45, 1.65, 1.85, 2.05, 2.25, 2.45}; + std::array TPCradii = {0.85, 1.05, 1.25, 1.45, 1.65, 1.85, 2.05, 2.25, 2.45}; }; template @@ -275,7 +275,7 @@ float FemtoPair::GetAvgSep() const res += sqrt(pow(2.0 * radius * sin(0.5 * GetPhiStarDiff(radius)), 2) + pow(2.0 * radius * sin(0.5 * dtheta), 2)); } - return 100.0 * res / 9; + return 100.0 * res / TPCradii.size(); } template