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
11 changes: 6 additions & 5 deletions PWGCF/Femto3D/Core/femto3dPairTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <vector>
#include <memory>
#include "TLorentzVector.h"

Check failure on line 29 in PWGCF/Femto3D/Core/femto3dPairTask.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include "TVector3.h"
#include "TDatabasePDG.h"

Expand Down Expand Up @@ -119,14 +119,14 @@

//====================================================================================

float GetKstarFrom4vectors(TLorentzVector& first4momentum, TLorentzVector& second4momentum, bool isIdentical)

Check failure on line 122 in PWGCF/Femto3D/Core/femto3dPairTask.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
{
if (isIdentical) {
TLorentzVector fourmomentadiff = first4momentum - second4momentum;

Check failure on line 125 in PWGCF/Femto3D/Core/femto3dPairTask.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
return 0.5 * std::fabs(fourmomentadiff.Mag());
} else {
TLorentzVector fourmomentasum = first4momentum + second4momentum;

Check failure on line 128 in PWGCF/Femto3D/Core/femto3dPairTask.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
TLorentzVector fourmomentadif = first4momentum - second4momentum;

Check failure on line 129 in PWGCF/Femto3D/Core/femto3dPairTask.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.

fourmomentadif.Boost((-1) * fourmomentasum.BoostVector());

Expand All @@ -136,10 +136,10 @@

//====================================================================================

TVector3 GetQLCMSFrom4vectors(TLorentzVector& first4momentum, TLorentzVector& second4momentum)

Check failure on line 139 in PWGCF/Femto3D/Core/femto3dPairTask.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
{
TLorentzVector fourmomentasum = first4momentum + second4momentum;

Check failure on line 141 in PWGCF/Femto3D/Core/femto3dPairTask.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
TLorentzVector fourmomentadif = first4momentum - second4momentum;

Check failure on line 142 in PWGCF/Femto3D/Core/femto3dPairTask.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.

fourmomentadif.Boost(0.0, 0.0, (-1) * fourmomentasum.BoostVector().Z()); // boost to LCMS
fourmomentadif.RotateZ((-1) * fourmomentasum.Phi()); // rotate so the X axis is along pair's kT
Expand Down Expand Up @@ -222,10 +222,12 @@
}
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;

Expand Down Expand Up @@ -327,8 +329,7 @@
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();
Expand All @@ -344,9 +345,9 @@
if (_PDG1 * _PDG2 == 0)
return -1000;

TLorentzVector first4momentum;

Check failure on line 348 in PWGCF/Femto3D/Core/femto3dPairTask.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
first4momentum.SetPtEtaPhiM(_first->pt(), _first->eta(), _first->phi(), particle_mass(_PDG1));
TLorentzVector second4momentum;

Check failure on line 350 in PWGCF/Femto3D/Core/femto3dPairTask.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
second4momentum.SetPtEtaPhiM(_second->pt(), _second->eta(), _second->phi(), particle_mass(_PDG2));

return GetKstarFrom4vectors(first4momentum, second4momentum, _isidentical);
Expand Down
19 changes: 10 additions & 9 deletions PWGCF/Femto3D/Tasks/femto3dPairTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ struct FemtoCorrelations {
Configurable<int> _particlePDGtoReject{"particlePDGtoRejectFromSecond", 0, "applied only if the particles are non-identical and only to the second particle in the pair!!!"};
Configurable<std::vector<float>> _rejectWithinNsigmaTOF{"rejectWithinNsigmaTOF", std::vector<float>{-0.0f, 0.0f}, "TOF rejection Nsigma range for the particle specified with PDG to be rejected"};

Configurable<int> _dPhiMode{"dPhiMode", 0, "Flag to choose how to calc. dphi*: 0 - at a fixed TPC radius; 1 - average over different TPC radii;"};
Configurable<float> _radiusTPC{"radiusTPC", 1.2, "TPC radius to calculate phi_star for"};
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"};
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
9 changes: 5 additions & 4 deletions PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ struct FemtoCorrelationsMC {
Configurable<int> _particlePDGtoReject{"particlePDGtoRejectFromSecond", 0, "applied only if the particles are non-identical and only to the second particle in the pair!!!"};
Configurable<std::vector<float>> _rejectWithinNsigmaTOF{"rejectWithinNsigmaTOF", std::vector<float>{-0.0f, 0.0f}, "TOF rejection Nsigma range for the particle specified with PDG to be rejected"};

// Configurable<float> _radiusTPC{"radiusTPC", 1.2, "TPC radius to calculate phi_star for"};
Configurable<int> _dPhiMode{"dPhiMode", 0, "Flag to choose how to calc. dphi*: 0 - at a fixed TPC radius; 1 - average over different TPC radii;"};
Configurable<float> _radiusTPC{"radiusTPC", 1.2, "TPC radius to calculate phi_star for"};

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