Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion PWGCF/Femto3D/Core/femto3dPairTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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<bool>(GetAvgSep() < avgSep); }

float GetAvgSep() const;

float GetEtaDiff() const
{
if (_first != NULL && _second != NULL)
Expand All @@ -217,6 +223,7 @@ class FemtoPair
float _magfield1 = 0.0, _magfield2 = 0.0;
int _PDG1 = 0, _PDG2 = 0;
bool _isidentical = true;
std::array<float, 9> TPCradii = {0.85, 1.05, 1.25, 1.45, 1.65, 1.85, 2.05, 2.25, 2.45};
};

template <typename TrackType>
Expand Down Expand Up @@ -253,6 +260,24 @@ bool FemtoPair<TrackType>::IsClosePair(const float& deta, const float& dphi, con
return false;
}

template <typename TrackType>
float FemtoPair<TrackType>::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 / TPCradii.size();
}

template <typename TrackType>
float FemtoPair<TrackType>::GetKstar() const
{
Expand Down
9 changes: 7 additions & 2 deletions PWGCF/Femto3D/Tasks/femto3dPairTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ struct FemtoCorrelations {
Configurable<float> _deta{"deta", 0.01, "minimum allowed defference in eta between two tracks in a pair"};
Configurable<float> _dphi{"dphi", 0.01, "minimum allowed defference in phi_star between two tracks in a pair"};
Configurable<float> _radiusTPC{"radiusTPC", 1.2, "TPC radius to calculate phi_star for"};
Configurable<float> _avgSepTPC{"avgSepTPC", 10, "average sep. (cm) in TPC"};

Configurable<int> _vertexNbinsToMix{"vertexNbinsToMix", 10, "Number of vertexZ bins for the mixing"};
Configurable<std::vector<float>> _centBins{"multBins", std::vector<float>{0.0f, 100.0f}, "multiplicity percentile/centrality binning (min:0, max:100)"};
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down
13 changes: 13 additions & 0 deletions PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ struct FemtoCorrelationsMC {
std::vector<std::vector<std::shared_ptr<TH2>>> Resolution_histos;
std::vector<std::vector<std::shared_ptr<TH2>>> DoubleTrack_SE_histos;
std::vector<std::vector<std::shared_ptr<TH2>>> DoubleTrack_ME_histos;
std::vector<std::vector<std::shared_ptr<TH1>>> AvgSep_SE_histos;
std::vector<std::vector<std::shared_ptr<TH1>>> AvgSep_ME_histos;

void init(o2::framework::InitContext&)
{
Expand Down Expand Up @@ -199,22 +201,30 @@ struct FemtoCorrelationsMC {
std::vector<std::shared_ptr<TH2>> Resolution_histos_perMult;
std::vector<std::shared_ptr<TH2>> DoubleTrack_SE_histos_perMult;
std::vector<std::shared_ptr<TH2>> DoubleTrack_ME_histos_perMult;
std::vector<std::shared_ptr<TH1>> AvgSep_SE_histos_perMult;
std::vector<std::shared_ptr<TH1>> AvgSep_ME_histos_perMult;

for (unsigned int j = 0; j < _kTbins.value.size() - 1; j++) {
auto kT_tmp = registry.add<TH1>(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<TH2>(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<TH2>(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<TH2>(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<TH1>(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<TH1>(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));
}
}

Expand All @@ -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();
}
}
Expand All @@ -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();
}
}
Expand Down Expand Up @@ -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();
}
}
Expand Down