Skip to content
Merged
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
122 changes: 93 additions & 29 deletions PWGLF/Tasks/Resonances/phispectrapbpbqa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
Configurable<bool> ispTdepPID{"ispTdepPID", false, "pT dependent PID"};
Configurable<float> cfgCutTOFBeta{"cfgCutTOFBeta", 0.5, "cut TOF beta"};
Configurable<float> nsigmaCutTPC{"nsigmacutTPC", 2.0, "Value of the TPC Nsigma cut"};
Configurable<float> nsigmaCutCombined{"nsigmaCutCombined", 2.0, "Value of the Combined TPC-TOF Nsigma cut"};
Configurable<bool> applyTOF{"applyTOF", true, "Apply TOF"};
ConfigurableAxis axisOccupancy{"axisOccupancy", {VARIABLE_WIDTH, -1.0, 200.0, 500.0, 1000.0, 2000.0f, 4000.0, 10000.0f, 100000.0f}, "occupancy axis"};
struct : ConfigurableGroup {
ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {90, 0.98, 1.07}, "#it{M} (GeV/#it{c}^{2})"};
Expand Down Expand Up @@ -157,6 +157,8 @@

histos.add("hPhiMommentum", "hPhiMommentum", kTH3F, {{36, 0, 6.283}, {200, -10.0, 10.0}, axisOccupancy});

histos.add("hNsigmaTPCBeforeCut", "NsigmaKaon TPC Before Cut", kTH3F, {{200, -10.0f, 10.0f}, {100, 0.0, 10.0}, axisOccupancy});
histos.add("hNsigmaTOFBeforeCut", "NsigmaKaon TOF Before Cut", kTH3F, {{200, -10.0f, 10.0f}, {100, 0.0, 10.0}, axisOccupancy});
histos.add("hNsigmaTPCAfterCut", "NsigmaKaon TPC After Cut", kTH3F, {{200, -10.0f, 10.0f}, {100, 0.0, 10.0}, axisOccupancy});
histos.add("hNsigmaTOFAfterCut", "NsigmaKaon TOF After Cut", kTH3F, {{200, -10.0f, 10.0f}, {100, 0.0, 10.0}, axisOccupancy});

Expand Down Expand Up @@ -211,25 +213,66 @@
template <typename T>
bool selectionPIDpTdependent(const T& candidate, double nsigmaTPC, double nsigmaTOF)
{
if (candidate.p() < 0.7 && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {

Check failure on line 216 in PWGLF/Tasks/Resonances/phispectrapbpbqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return true;
}
if (candidate.p() >= 0.7 && candidate.hasTOF() && candidate.beta() > cfgCutTOFBeta && TMath::Sqrt(nsigmaTPC * nsigmaTPC + nsigmaTOF * nsigmaTOF) < nsigmaCutCombined) {
return true;
if (candidate.p() > 0.7 && candidate.hasTOF() && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {

Check failure on line 219 in PWGLF/Tasks/Resonances/phispectrapbpbqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
if (candidate.p() > 0.7 && candidate.p() < 1.6 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -5.0 && nsigmaTOF < 10.0) {
return true;
}
if (candidate.p() >= 1.6 && candidate.p() < 2.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 10.0) {
return true;
}
if (candidate.p() >= 2.0 && candidate.p() < 2.5 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 6.0) {
return true;
}
if (candidate.p() >= 2.5 && candidate.p() < 4.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -2.5 && nsigmaTOF < 4.0) {
return true;
}
if (candidate.p() >= 4.0 && candidate.p() < 5.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 3.0) {
return true;
}
if (candidate.p() >= 5.0 && candidate.p() < 6.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 2.5) {
return true;
}
if (candidate.p() >= 6.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 3.0) {
return true;
}
}
return false;
}

template <typename T>
bool selectionPID(const T& candidate, double nsigmaTPC, double nsigmaTOF)
{
if (candidate.p() < 0.7 && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {
return true;
}
if (candidate.p() >= 0.7 && candidate.hasTOF() && candidate.beta() > cfgCutTOFBeta && TMath::Sqrt(nsigmaTPC * nsigmaTPC + nsigmaTOF * nsigmaTOF) < nsigmaCutCombined) {
return true;
}
if (candidate.p() >= 0.7 && !candidate.hasTOF() && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {
if (applyTOF) {
if (!candidate.hasTOF() && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {

Check failure on line 249 in PWGLF/Tasks/Resonances/phispectrapbpbqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return true;
}
if (candidate.p() > 0.5 && candidate.hasTOF() && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {

Check failure on line 252 in PWGLF/Tasks/Resonances/phispectrapbpbqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
if (candidate.p() > 0.5 && candidate.p() < 1.6 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -5.0 && nsigmaTOF < 10.0) {
return true;
}
if (candidate.p() >= 1.6 && candidate.p() < 2.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 10.0) {
return true;
}
if (candidate.p() >= 2.0 && candidate.p() < 2.5 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 6.0) {
return true;
}
if (candidate.p() >= 2.5 && candidate.p() < 4.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -2.5 && nsigmaTOF < 4.0) {
return true;
}
if (candidate.p() >= 4.0 && candidate.p() < 5.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 3.0) {
return true;
}
if (candidate.p() >= 5.0 && candidate.p() < 6.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 2.5) {
return true;
}
if (candidate.p() >= 6.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 3.0) {
return true;
}
}
} else if (TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {

Check failure on line 275 in PWGLF/Tasks/Resonances/phispectrapbpbqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return true;
}
return false;
Expand All @@ -246,7 +289,7 @@
pz2 = candidate2.pz();
p1 = candidate1.p();
p2 = candidate2.p();
angle = TMath::ACos((pt1 * pt2 + pz1 * pz2) / (p1 * p2));

Check failure on line 292 in PWGLF/Tasks/Resonances/phispectrapbpbqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
if (isDeepAngle && angle < cfgDeepAngle) {
return false;
}
Expand Down Expand Up @@ -324,6 +367,8 @@
if (track1.hasTOF()) {
histos.fill(HIST("hNsigmaTOF"), nSigmaTOF, track1.p(), occupancy, centrality);
}
histos.fill(HIST("hNsigmaTPCBeforeCut"), nSigmaTPC, track1.p(), occupancy);
histos.fill(HIST("hNsigmaTOFBeforeCut"), nSigmaTOF, track1.p(), occupancy);
if (applyPID) {
if (ispTdepPID && !selectionPIDpTdependent(track1, nSigmaTPC, nSigmaTOF)) {
continue;
Expand Down Expand Up @@ -374,6 +419,8 @@
if (track2.hasTOF()) {
histos.fill(HIST("hNsigmaTOF"), nSigmaTOF2, track2.p(), occupancy, centrality);
}
histos.fill(HIST("hNsigmaTPCBeforeCut"), nSigmaTPC2, track2.p(), occupancy);
histos.fill(HIST("hNsigmaTOFBeforeCut"), nSigmaTOF2, track2.p(), occupancy);
}
if (applyPID) {
if (ispTdepPID && !selectionPIDpTdependent(track2, nSigmaTPC2, nSigmaTOF2)) {
Expand Down Expand Up @@ -414,7 +461,7 @@
KaonMinus = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massKa);
PhiMesonMother = KaonPlus + KaonMinus;

if (TMath::Abs(PhiMesonMother.Rapidity()) < 0.5) {

Check failure on line 464 in PWGLF/Tasks/Resonances/phispectrapbpbqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
histos.fill(HIST("hphiSE"), PhiMesonMother.M(), PhiMesonMother.Pt(), centrality, occupancy, passsector);
}
}
Expand Down Expand Up @@ -499,7 +546,7 @@
KaonPlus = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
KaonMinus = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massKa);
PhiMesonMother = KaonPlus + KaonMinus;
if (TMath::Abs(PhiMesonMother.Rapidity()) < 0.5) {

Check failure on line 549 in PWGLF/Tasks/Resonances/phispectrapbpbqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
histos.fill(HIST("hphiME"), PhiMesonMother.M(), PhiMesonMother.Pt(), centrality, occupancy, passsector);
}
}
Expand Down Expand Up @@ -527,7 +574,7 @@
histos.fill(HIST("hMC"), 4);
continue;
}
if (TMath::Abs(RecCollision.posZ()) > cfgCutVertex) {

Check failure on line 577 in PWGLF/Tasks/Resonances/phispectrapbpbqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
histos.fill(HIST("hMC"), 6);
continue;
}
Expand All @@ -549,6 +596,7 @@
auto oldindex = -999;
auto Rectrackspart = RecTracks.sliceBy(perCollision, RecCollision.globalIndex());
// loop over reconstructed particle
int ntrack1 = 0;
for (auto track1 : Rectrackspart) {
if (!selectionTrack(track1)) {
continue;
Expand All @@ -557,6 +605,32 @@
continue;
}
auto track1ID = track1.index();
// PID track 1
double nSigmaTPC = track1.tpcNSigmaKa();
double nSigmaTOF = track1.tofNSigmaKa();
if (!track1.hasTOF()) {
nSigmaTOF = -9999.99;
}
if (cfgUpdatePID) {
nSigmaTPC = (nSigmaTPC - hTPCCallib->GetBinContent(hTPCCallib->FindBin(track1.p(), centrality, occupancy))) / hTPCCallib->GetBinError(hTPCCallib->FindBin(track1.p(), centrality, occupancy));
if (track1.hasTOF()) {
nSigmaTOF = (nSigmaTOF - hTOFCallib->GetBinContent(hTOFCallib->FindBin(track1.p(), centrality, occupancy))) / hTOFCallib->GetBinError(hTOFCallib->FindBin(track1.p(), centrality, occupancy));
}
}
histos.fill(HIST("hNsigmaTPCBeforeCut"), nSigmaTPC, track1.p(), occupancy);
histos.fill(HIST("hNsigmaTOFBeforeCut"), nSigmaTOF, track1.p(), occupancy);

if (applyPID) {
if (ispTdepPID && !selectionPIDpTdependent(track1, nSigmaTPC, nSigmaTOF)) {
continue;
}
if (!ispTdepPID && !selectionPID(track1, nSigmaTPC, nSigmaTOF)) {
continue;
}
histos.fill(HIST("hNsigmaTPCAfterCut"), nSigmaTPC, track1.p(), occupancy);
histos.fill(HIST("hNsigmaTOFAfterCut"), nSigmaTOF, track1.p(), occupancy);
}
ntrack1 = ntrack1 + 1;
for (auto track2 : Rectrackspart) {
auto track2ID = track2.index();
if (track2ID <= track1ID) {
Expand All @@ -574,18 +648,7 @@
if (track1.sign() * track2.sign() > 0) {
continue;
}
// PID track 1
double nSigmaTPC = track1.tpcNSigmaKa();
double nSigmaTOF = track1.tofNSigmaKa();
if (!track1.hasTOF()) {
nSigmaTOF = -9999.99;
}
if (cfgUpdatePID) {
nSigmaTPC = (nSigmaTPC - hTPCCallib->GetBinContent(hTPCCallib->FindBin(track1.p(), centrality, occupancy))) / hTPCCallib->GetBinError(hTPCCallib->FindBin(track1.p(), centrality, occupancy));
if (track1.hasTOF()) {
nSigmaTOF = (nSigmaTOF - hTOFCallib->GetBinContent(hTOFCallib->FindBin(track1.p(), centrality, occupancy))) / hTOFCallib->GetBinError(hTOFCallib->FindBin(track1.p(), centrality, occupancy));
}
}

// PID track 2
double nSigmaTPC2 = track2.tpcNSigmaKa();
double nSigmaTOF2 = track2.tofNSigmaKa();
Expand All @@ -598,25 +661,26 @@
nSigmaTOF2 = (nSigmaTOF2 - hTOFCallib->GetBinContent(hTOFCallib->FindBin(track2.p(), centrality, occupancy))) / hTOFCallib->GetBinError(hTOFCallib->FindBin(track2.p(), centrality, occupancy));
}
}
if (ntrack1 == 1) {
histos.fill(HIST("hNsigmaTPCBeforeCut"), nSigmaTPC2, track2.p(), occupancy);
histos.fill(HIST("hNsigmaTOFBeforeCut"), nSigmaTOF2, track2.p(), occupancy);
}
if (applyPID) {
if (ispTdepPID && !selectionPIDpTdependent(track1, nSigmaTPC, nSigmaTOF)) {
continue;
}
if (!ispTdepPID && !selectionPID(track1, nSigmaTPC, nSigmaTOF)) {
continue;
}

if (ispTdepPID && !selectionPIDpTdependent(track2, nSigmaTPC2, nSigmaTOF2)) {
continue;
}
if (!ispTdepPID && !selectionPID(track2, nSigmaTPC2, nSigmaTOF2)) {
continue;
}
}
if (ntrack1 == 1) {
histos.fill(HIST("hNsigmaTPCAfterCut"), nSigmaTPC2, track2.p(), occupancy);
histos.fill(HIST("hNsigmaTOFAfterCut"), nSigmaTOF2, track2.p(), occupancy);
}

const auto mctrack1 = track1.mcParticle();
const auto mctrack2 = track2.mcParticle();
int track1PDG = TMath::Abs(mctrack1.pdgCode());

Check failure on line 683 in PWGLF/Tasks/Resonances/phispectrapbpbqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
int track2PDG = TMath::Abs(mctrack2.pdgCode());
if (!mctrack1.isPhysicalPrimary()) {
continue;
Expand Down
Loading