Skip to content

Commit

Permalink
PWGCF: FemtoUniverse -- Fixing Delta Eta Delta Phi* cut for h-Phi cor…
Browse files Browse the repository at this point in the history
…relations (AliceO2Group#4233)

* Fixing Delta Eta Delta Phi* cut for h-Phi correlations

* Fixing error

* Fixing errors (2)
  • Loading branch information
zchochul authored Jan 2, 2024
1 parent f91accd commit 4a6ced5
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 11 deletions.
48 changes: 44 additions & 4 deletions PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <memory>
#include <string>
#include <vector>
#include "TMath.h"
#include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h"
#include "Framework/HistogramRegistry.h"

Expand All @@ -42,10 +43,12 @@ class FemtoUniverseDetaDphiStar
/// Destructor
virtual ~FemtoUniverseDetaDphiStar() = default;
/// Initialization of the histograms and setting required values
void init(HistogramRegistry* registry, HistogramRegistry* registryQA, float ldeltaPhiMax, float ldeltaEtaMax, bool lplotForEveryRadii)
void init(HistogramRegistry* registry, HistogramRegistry* registryQA, float ldeltaPhiMax, float ldeltaEtaMax, float ldeltaphistarcut, float ldeltaetacut, bool lplotForEveryRadii)
{
deltaPhiMax = ldeltaPhiMax;
deltaEtaMax = ldeltaEtaMax;
CutDeltaPhStar = ldeltaphistarcut;
CutDeltaEta = ldeltaetacut;
plotForEveryRadii = lplotForEveryRadii;
mHistogramRegistry = registry;
mHistogramRegistryQA = registryQA;
Expand Down Expand Up @@ -177,10 +180,11 @@ class FemtoUniverseDetaDphiStar
auto indexOfDaughter = part2.index() - 2 + i;
auto daughter = particles.begin() + indexOfDaughter;
auto deta = part1.eta() - daughter.eta();
auto dphiAvg = AveragePhiStar(part1, *daughter, i);
auto dphiAvg = CalculateDphiStar(part1, *daughter);
dphiAvg = TVector2::Phi_mpi_pi(dphiAvg);
histdetadpi[i][0]->Fill(deta, dphiAvg);
if (pow(dphiAvg, 2) / pow(deltaPhiMax, 2) + pow(deta, 2) / pow(deltaEtaMax, 2) < 1.) {
pass = true;
if ((fabs(dphiAvg) < CutDeltaPhStar) && (fabs(deta) < CutDeltaEta)) {
pass = true; // pair is close
} else {
histdetadpi[i][1]->Fill(deta, dphiAvg);
}
Expand Down Expand Up @@ -217,6 +221,8 @@ class FemtoUniverseDetaDphiStar

float deltaPhiMax;
float deltaEtaMax;
float CutDeltaPhStar;
float CutDeltaEta;
float magfield;
bool plotForEveryRadii = false;

Expand Down Expand Up @@ -268,6 +274,40 @@ class FemtoUniverseDetaDphiStar
}
return dPhiAvg / num;
}

// Get particle charge from mask
template <typename T1>
float GetCharge(const T1& part)
{
float charge = 0;
if ((part.cut() & kSignMinusMask) == kValue0 && (part.cut() & kSignPlusMask) == kValue0) {
charge = 0;
} else if ((part.cut() & kSignPlusMask) == kSignPlusMask) {
charge = 1;
} else if ((part.cut() & kSignMinusMask) == kSignMinusMask) {
charge = -1;
} else {
LOG(fatal) << "FemtoUniverseDetaDphiStar: Charge bits are set wrong!";
}
return charge;
}

// Calculate phi* as in https://github.com/alisw/AliPhysics/blob/master/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutRadialDistance.cxx
template <typename T1, typename T2>
double CalculateDphiStar(const T1& part1, const T2& part2)
{
float charge1 = GetCharge(part1);
float charge2 = GetCharge(part2);
float rad = 0.8;

double deltaphiconstFD = 0.3 * 0.1 * 0.01 / 2;
// double deltaphiconstAF = 0.15;
double afsi0b = deltaphiconstFD * magfield * charge1 * rad / part1.pt();
double afsi1b = deltaphiconstFD * magfield * charge2 * rad / part2.pt();

double dphis = part2.phi() - part1.phi() + TMath::ASin(afsi1b) - TMath::ASin(afsi0b);
return dphis;
}
};

} /* namespace femtoUniverse */
Expand Down
4 changes: 3 additions & 1 deletion PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ struct femtoUniversePairTaskTrackD0 {
Configurable<bool> ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"};
Configurable<float> ConfCPRdeltaPhiMax{"ConfCPRdeltaPhiMax", 0.01, "Max. Delta Phi for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaEtaMax{"ConfCPRdeltaEtaMax", 0.01, "Max. Delta Eta for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaPhiCut{"ConfCPRdeltaPhiCut", 0.0, "Delta Phi cut for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaEtaCut{"ConfCPRdeltaEtaCut", 0.0, "Delta Eta cut for Close Pair Rejection"};

FemtoUniverseFemtoContainer<femtoUniverseFemtoContainer::EventType::same, femtoUniverseFemtoContainer::Observable::kstar> sameEventFemtoCont;
FemtoUniverseFemtoContainer<femtoUniverseFemtoContainer::EventType::mixed, femtoUniverseFemtoContainer::Observable::kstar> mixedEventFemtoCont;
Expand Down Expand Up @@ -310,7 +312,7 @@ struct femtoUniversePairTaskTrackD0 {

pairCleaner.init(&qaRegistry);
if (ConfIsCPR.value) {
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRPlotPerRadii.value);
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRdeltaPhiCut.value, ConfCPRdeltaEtaCut.value, ConfCPRPlotPerRadii.value);
}

vPIDTrack = ConfTrack.ConfPIDTrack.value;
Expand Down
4 changes: 3 additions & 1 deletion PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ struct femtoUniversePairTaskTrackPhi {
Configurable<bool> ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"};
Configurable<float> ConfCPRdeltaPhiMax{"ConfCPRdeltaPhiMax", 0.01, "Max. Delta Phi for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaEtaMax{"ConfCPRdeltaEtaMax", 0.01, "Max. Delta Eta for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaPhiCut{"ConfCPRdeltaPhiCut", 0.01, "Delta Phi cut for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaEtaCut{"ConfCPRdeltaEtaCut", 0.004, "Delta Eta cut for Close Pair Rejection"};

FemtoUniverseFemtoContainer<femtoUniverseFemtoContainer::EventType::same, femtoUniverseFemtoContainer::Observable::kstar> sameEventFemtoCont;
FemtoUniverseFemtoContainer<femtoUniverseFemtoContainer::EventType::mixed, femtoUniverseFemtoContainer::Observable::kstar> mixedEventFemtoCont;
Expand Down Expand Up @@ -288,7 +290,7 @@ struct femtoUniversePairTaskTrackPhi {

pairCleaner.init(&qaRegistry);
if (ConfIsCPR.value) {
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRPlotPerRadii.value);
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRdeltaPhiCut.value, ConfCPRdeltaEtaCut.value, ConfCPRPlotPerRadii.value);
}

vPIDPhiCandidate = ConfPhi.ConfPIDPhi.value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ struct femtoUniversePairTaskTrackTrack {
Configurable<bool> ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"};
Configurable<float> ConfCPRdeltaPhiMax{"ConfCPRdeltaPhiMax", 0.01, "Max. Delta Phi for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaEtaMax{"ConfCPRdeltaEtaMax", 0.01, "Max. Delta Eta for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaPhiCut{"ConfCPRdeltaPhiCut", 0.0, "Delta Phi cut for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaEtaCut{"ConfCPRdeltaEtaCut", 0.0, "Delta Eta cut for Close Pair Rejection"};
Configurable<int> ConfPhiBins{"ConfPhiBins", 29, "Number of phi bins in deta dphi"};
Configurable<int> ConfEtaBins{"ConfEtaBins", 29, "Number of eta bins in deta dphi"};

Expand Down Expand Up @@ -161,7 +163,7 @@ struct femtoUniversePairTaskTrackTrack {

pairCleaner.init(&qaRegistry);
if (ConfIsCPR.value) {
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRPlotPerRadii.value);
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRdeltaPhiCut.value, ConfCPRdeltaEtaCut.value, ConfCPRPlotPerRadii.value);
}

vPIDPartOne = ConfPIDPartOne.value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ struct femtoUniversePairTaskTrackTrackExtended {
Configurable<bool> ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"};
Configurable<float> ConfCPRdeltaPhiMax{"ConfCPRdeltaPhiMax", 0.01, "Max. Delta Phi for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaEtaMax{"ConfCPRdeltaEtaMax", 0.01, "Max. Delta Eta for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaPhiCut{"ConfCPRdeltaPhiCut", 0.0, "Delta Phi cut for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaEtaCut{"ConfCPRdeltaEtaCut", 0.0, "Delta Eta cut for Close Pair Rejection"};
Configurable<int> ConfPhiBins{"ConfPhiBins", 29, "Number of phi bins in deta dphi"};
Configurable<int> ConfEtaBins{"ConfEtaBins", 29, "Number of eta bins in deta dphi"};

Expand Down Expand Up @@ -312,7 +314,7 @@ struct femtoUniversePairTaskTrackTrackExtended {
mixedEventCont.setPDGCodes(trackonefilter.ConfPDGCodePartOne, tracktwofilter.ConfPDGCodePartTwo);
pairCleaner.init(&qaRegistry);
if (ConfIsCPR.value) {
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRPlotPerRadii.value);
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRdeltaPhiCut.value, ConfCPRdeltaEtaCut.value, ConfCPRPlotPerRadii.value);
}

vPIDPartOne = trackonefilter.ConfPIDPartOne.value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ struct femtoUniversePairTaskTrackTrackMC {
Configurable<bool> ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"};
Configurable<float> ConfCPRdeltaPhiMax{"ConfCPRdeltaPhiMax", 0.01, "Max. Delta Phi for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaEtaMax{"ConfCPRdeltaEtaMax", 0.01, "Max. Delta Eta for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaPhiCut{"ConfCPRdeltaPhiCut", 0.0, "Delta Phi cut for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaEtaCut{"ConfCPRdeltaEtaCut", 0.0, "Delta Eta cut for Close Pair Rejection"};
Configurable<int> ConfPhiBins{"ConfPhiBins", 29, "Number of phi bins in deta dphi"};
Configurable<int> ConfEtaBins{"ConfEtaBins", 29, "Number of eta bins in deta dphi"};

Expand Down Expand Up @@ -384,7 +386,7 @@ struct femtoUniversePairTaskTrackTrackMC {

pairCleaner.init(&qaRegistry);
if (ConfIsCPR.value) {
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRPlotPerRadii.value);
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRdeltaPhiCut.value, ConfCPRdeltaEtaCut.value, ConfCPRPlotPerRadii.value);
}

vPIDPartOne = trackonefilter.ConfPIDPartOne.value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended {
Configurable<bool> ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"};
Configurable<float> ConfCPRdeltaPhiMax{"ConfCPRdeltaPhiMax", 0.01, "Max. Delta Phi for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaEtaMax{"ConfCPRdeltaEtaMax", 0.01, "Max. Delta Eta for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaPhiCut{"ConfCPRdeltaPhiCut", 0.0, "Delta Phi cut for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaEtaCut{"ConfCPRdeltaEtaCut", 0.0, "Delta Eta cut for Close Pair Rejection"};

Configurable<bool> cfgProcessPM{"cfgProcessPM", false, "Process particles of the opposite charge"};
Configurable<bool> cfgProcessPP{"cfgProcessPP", true, "Process particles of the same, positice charge"};
Expand Down Expand Up @@ -389,7 +391,7 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended {

pairCleaner.init(&qaRegistry);
if (ConfIsCPR.value) {
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRPlotPerRadii.value);
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRdeltaPhiCut.value, ConfCPRdeltaEtaCut.value, ConfCPRPlotPerRadii.value);
}

vPIDPartOne = trackonefilter.ConfPIDPartOne.value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ struct femtoUniversePairTaskTrackV0Extended {
Configurable<bool> ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"};
Configurable<float> ConfCPRdeltaPhiMax{"ConfCPRdeltaPhiMax", 0.01, "Max. Delta Phi for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaEtaMax{"ConfCPRdeltaEtaMax", 0.01, "Max. Delta Eta for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaPhiCut{"ConfCPRdeltaPhiCut", 0.0, "Delta Phi cut for Close Pair Rejection"};
Configurable<float> ConfCPRdeltaEtaCut{"ConfCPRdeltaEtaCut", 0.0, "Delta Eta cut for Close Pair Rejection"};
Configurable<int> ConfPhiBins{"ConfPhiBins", 29, "Number of phi bins in deta dphi"};
Configurable<int> ConfEtaBins{"ConfEtaBins", 29, "Number of eta bins in deta dphi"};
ConfigurableAxis ConfmTBins3D{"ConfmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <<ConfUse3D>> to true in order to use)"};
Expand Down Expand Up @@ -146,7 +148,7 @@ struct femtoUniversePairTaskTrackV0Extended {

pairCleaner.init(&qaRegistry);
if (ConfIsCPR.value) {
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRPlotPerRadii.value);
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRdeltaPhiCut.value, ConfCPRdeltaEtaCut.value, ConfCPRPlotPerRadii.value);
}
}
/// This function processes the same event and takes care of all the histogramming
Expand Down

0 comments on commit 4a6ced5

Please sign in to comment.