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
166 changes: 40 additions & 126 deletions PWGLF/Tasks/Resonances/doublephimeson.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <Math/Vector3D.h>
#include <TMath.h>
#include <fairlogger/Logger.h>
#include <iostream>

Check warning on line 23 in PWGLF/Tasks/Resonances/doublephimeson.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <iterator>
#include <string>
#include <vector>
Expand All @@ -41,14 +41,13 @@

struct doublephimeson {
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
Configurable<bool> fillDeltaMass{"fillDeltaMass", 1, "Fill Delta Mass"};
Configurable<bool> fillRotation{"fillRotation", 1, "Fill rotation"};
Configurable<int> strategyPID1{"strategyPID1", 0, "PID strategy 1"};
Configurable<int> strategyPID2{"strategyPID2", 0, "PID strategy 2"};
Configurable<float> minPhiMass{"minPhiMass", 1.01, "Minimum phi mass"};
Configurable<float> maxPhiMass{"maxPhiMass", 1.03, "Maximum phi mass"};
Configurable<bool> additionalEvsel{"additionalEvsel", false, "Additional event selection"};
Configurable<float> cutNsigmaTPC{"cutNsigmaTPC", 2.5, "nsigma cut TPC"};
Configurable<float> cutMinNsigmaTPC{"cutMinNsigmaTPC", -2.5, "nsigma cut TPC"};
Configurable<float> cutNsigmaTPC{"cutNsigmaTPC", 3.0, "nsigma cut TPC"};
Configurable<float> cutNsigmaTOF{"cutNsigmaTOF", 3.0, "nsigma cut TOF"};
// Event Mixing
Configurable<int> nEvtMixing{"nEvtMixing", 10, "Number of events to mix"};
Expand All @@ -62,30 +61,26 @@
ConfigurableAxis configThnAxisPt{"configThnAxisPt", {40, 0.0, 20.}, "#it{p}_{T} (GeV/#it{c})"};
ConfigurableAxis configThnAxisKstar{"configThnAxisKstar", {200, 0.0, 2.0}, "#it{k}^{*} (GeV/#it{c})"};
ConfigurableAxis configThnAxisDeltaR{"configThnAxisDeltaR", {200, 0.0, 2.0}, "#it{k}^{*} (GeV/#it{c})"};
ConfigurableAxis configThnAxisCosTheta{"configThnAxisCosTheta", {5, 0.0, 1.0}, "cos #theta{*}"};
// ConfigurableAxis configThnAxisPhiMult{"configThnAxisPhiMult", {10, 0.5, 10.5}, "#Phi Multiplicity"};
ConfigurableAxis configThnAxisCosTheta{"configThnAxisCosTheta", {100, -1.0, 1.0}, "cos #theta{*}"};
ConfigurableAxis configThnAxisNumPhi{"configThnAxisNumPhi", {101, -0.5, 100.5}, "cos #theta{*}"};

// Initialize the ananlysis task
void init(o2::framework::InitContext&)
{
// register histograms
histos.add("hnsigmaTPCKaonPlus", "hnsigmaTPCKaonPlus", kTH2F, {{1000, -3.0, 3.0f}, {100, 0.0f, 10.0f}});
histos.add("hnsigmaTPCKaonMinus", "hnsigmaTPCKaonMinus", kTH2F, {{1000, -3.0, 3.0f}, {100, 0.0f, 10.0f}});
histos.add("hPhid1Mass", "hPhid1Mass", kTH2F, {{40, 1.0, 1.04f}, {100, 0.0f, 10.0f}});
histos.add("hPhid2Mass", "hPhid2Mass", kTH2F, {{40, 1.0, 1.04f}, {100, 0.0f, 10.0f}});
histos.add("hPhiMass", "hPhiMass", kTH2F, {{40, 1.0, 1.04f}, {100, 0.0f, 10.0f}});

const AxisSpec thnAxisInvMass{configThnAxisInvMass, "#it{M} (GeV/#it{c}^{2})"};
const AxisSpec thnAxisInvMassPhi{configThnAxisInvMassPhi, "#it{M} (GeV/#it{c}^{2})"};
const AxisSpec thnAxisDaughterPt{configThnAxisDaugherPt, "#it{p}_{T} (GeV/#it{c})"};
const AxisSpec thnAxisPt{configThnAxisPt, "#it{p}_{T} (GeV/#it{c})"};
const AxisSpec thnAxisKstar{configThnAxisKstar, "#it{k}^{*} (GeV/#it{c})"};
const AxisSpec thnAxisDeltaR{configThnAxisDeltaR, "#Delta R)"};
const AxisSpec thnAxisCosTheta{configThnAxisCosTheta, "cos #theta{*}"};
// const AxisSpec thnAxisPhiMult{configThnAxisPhiMult, "#Phi Multiplicity)"};
histos.add("SEMass", "SEMass", HistType::kTHnSparseF, {thnAxisInvMassPhi, thnAxisInvMassPhi, thnAxisDaughterPt, thnAxisDaughterPt});
histos.add("SEMassUnlike", "SEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisKstar, thnAxisCosTheta, thnAxisDeltaR});
histos.add("SEMassRot", "SEMassRot", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisKstar, thnAxisCosTheta, thnAxisDeltaR});
histos.add("MEMassUnlike", "MEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisKstar, thnAxisCosTheta, thnAxisDeltaR});
const AxisSpec thnAxisCosTheta{configThnAxisCosTheta, "cos #theta"};
const AxisSpec thnAxisNumPhi{configThnAxisNumPhi, "Number of phi meson"};

histos.add("SEMassUnlike", "SEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisDeltaR, thnAxisCosTheta, thnAxisInvMassPhi, thnAxisInvMassPhi, thnAxisNumPhi});
histos.add("MEMassUnlike", "MEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisDeltaR, thnAxisCosTheta, thnAxisInvMassPhi, thnAxisInvMassPhi, thnAxisNumPhi});
}

// get kstar
Expand Down Expand Up @@ -125,118 +120,75 @@
const ROOT::Math::Boost boostPRF = ROOT::Math::Boost(-betax, -betay, -betaz);
daughterCMS = boostPRF(daughter);
threeVecDauCM = daughterCMS.Vect();
float cosThetaStar = TMath::Abs(threeVecDauCM.Dot(threeVecMother) / std::sqrt(threeVecMother.Mag2()) / std::sqrt(threeVecDauCM.Mag2()));

Check warning on line 123 in PWGLF/Tasks/Resonances/doublephimeson.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 cosThetaStar;
}

bool selectionPID(float nsigmaTPC, float nsigmaTOF, int TOFHit, int PIDStrategy, float ptcand)
{
if (PIDStrategy == 0) {
if (TOFHit != 1) {
if (TMath::Abs(nsigmaTPC) < cutNsigmaTPC) {
return true;
}
}
if (TOFHit == 1) {
if (TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
return true;
}
}
}
if (PIDStrategy == 1) {
if (ptcand < 0.5) {
if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) {
return true;
}
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
return true;
}
}
if (ptcand >= 0.5) {
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
return true;
}
}
}
if (PIDStrategy == 2) {
if (ptcand < 0.5) {
if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) {
return true;
}
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
return true;
}
}
if (ptcand >= 0.5 && ptcand < 1.2) {
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
return true;
}
if (TOFHit != 1 && nsigmaTPC > -1.5 && nsigmaTPC < cutNsigmaTPC) {
return true;
}
}
if (ptcand >= 1.2) {
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
return true;
if (TOFHit != 1) {
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
return true;
}
}
if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) {
return true;
if (TOFHit == 1) {
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {

Check warning on line 142 in PWGLF/Tasks/Resonances/doublephimeson.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 (PIDStrategy == 3) {

if (PIDStrategy == 1) {
if (ptcand < 0.5) {
if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) {
return true;
}
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC) {
return true;
}
}
if (ptcand >= 0.5 && ptcand < 1.2) {
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
return true;
}
}
if (ptcand >= 1.2) {
if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {
return true;
}
if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) {
return true;
if (ptcand >= 0.5) {
if (TOFHit == 1) {
if (nsigmaTPC > cutMinNsigmaTPC && nsigmaTPC < cutNsigmaTPC && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) {

Check warning on line 157 in PWGLF/Tasks/Resonances/doublephimeson.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;
}

TLorentzVector exotic, Phid1, Phid2;
TLorentzVector exoticRot, Phid1Rot;
// TLorentzVector exoticRot, Phid1Rot;

void process(aod::RedPhiEvents::iterator const& collision, aod::PhiTracks const& phitracks)
{
if (additionalEvsel && (collision.numPos() < 2 || collision.numNeg() < 2)) {
return;
}
auto phimult = phitracks.size();
for (auto phitrackd1 : phitracks) {
if (phitrackd1.phiMass() < minPhiMass || phitrackd1.phiMass() > maxPhiMass) {
continue;
}

auto kaonplusd1pt = TMath::Sqrt(phitrackd1.phid1Px() * phitrackd1.phid1Px() + phitrackd1.phid1Py() * phitrackd1.phid1Py());

Check warning on line 179 in PWGLF/Tasks/Resonances/doublephimeson.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
auto kaonminusd1pt = TMath::Sqrt(phitrackd1.phid2Px() * phitrackd1.phid2Px() + phitrackd1.phid2Py() * phitrackd1.phid2Py());

Check warning on line 180 in PWGLF/Tasks/Resonances/doublephimeson.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 (!selectionPID(phitrackd1.phid1TPC(), phitrackd1.phid1TOF(), phitrackd1.phid1TOFHit(), strategyPID1, kaonplusd1pt)) {
continue;
}
if (!selectionPID(phitrackd1.phid2TPC(), phitrackd1.phid2TOF(), phitrackd1.phid2TOFHit(), strategyPID1, kaonminusd1pt)) {
continue;
}
// LOGF(info, "pass TOF hit: (%d, %d)", phitrackd1.phid1TOFHit(), phitrackd1.phid2TOFHit());
auto phid1id = phitrackd1.index();
Phid1.SetXYZM(phitrackd1.phiPx(), phitrackd1.phiPy(), phitrackd1.phiPz(), phitrackd1.phiMass());
histos.fill(HIST("hnsigmaTPCKaonPlus"), phitrackd1.phid1TPC(), kaonplusd1pt);
histos.fill(HIST("hnsigmaTPCKaonMinus"), phitrackd1.phid2TPC(), kaonminusd1pt);
Phid1.SetXYZM(phitrackd1.phiPx(), phitrackd1.phiPy(), phitrackd1.phiPz(), phitrackd1.phiMass());
histos.fill(HIST("hPhid1Mass"), Phid1.M(), Phid1.Pt());
auto phid1id = phitrackd1.index();
histos.fill(HIST("hPhiMass"), Phid1.M(), Phid1.Pt());
for (auto phitrackd2 : phitracks) {
auto phid2id = phitrackd2.index();
if (phid2id <= phid1id) {
Expand All @@ -245,9 +197,8 @@
if (phitrackd2.phiMass() < minPhiMass || phitrackd2.phiMass() > maxPhiMass) {
continue;
}
auto kaonplusd2pt = TMath::Sqrt(phitrackd2.phid1Px() * phitrackd2.phid1Px() + phitrackd2.phid1Py() * phitrackd2.phid1Py());

Check warning on line 200 in PWGLF/Tasks/Resonances/doublephimeson.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
auto kaonminusd2pt = TMath::Sqrt(phitrackd2.phid2Px() * phitrackd2.phid2Px() + phitrackd2.phid2Py() * phitrackd2.phid2Py());

Check warning on line 201 in PWGLF/Tasks/Resonances/doublephimeson.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 (!selectionPID(phitrackd2.phid1TPC(), phitrackd2.phid1TOF(), phitrackd2.phid1TOFHit(), strategyPID2, kaonplusd2pt)) {
continue;
}
Expand All @@ -262,37 +213,11 @@
}
Phid2.SetXYZM(phitrackd2.phiPx(), phitrackd2.phiPy(), phitrackd2.phiPz(), phitrackd2.phiMass());
exotic = Phid1 + Phid2;
auto cosThetaStar = getCosTheta(exotic, Phid1);
auto kstar = getkstar(Phid1, Phid2);
// auto cosThetaStar = getCosTheta(exotic, Phid1);
// auto kstar = getkstar(Phid1, Phid2);
auto deltaR = TMath::Sqrt(TMath::Power(Phid1.Phi() - Phid2.Phi(), 2.0) + TMath::Power(Phid1.Eta() - Phid2.Eta(), 2.0));

Check warning on line 218 in PWGLF/Tasks/Resonances/doublephimeson.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 (!fillDeltaMass) {
histos.fill(HIST("SEMassUnlike"), exotic.M(), exotic.Pt(), kstar, cosThetaStar, deltaR);
}
if (fillDeltaMass) {
histos.fill(HIST("SEMassUnlike"), exotic.M() - Phid1.M(), exotic.Pt(), kstar, cosThetaStar, deltaR);
}
histos.fill(HIST("SEMass"), Phid1.M(), Phid2.M(), Phid1.Pt(), Phid2.Pt());
if (fillRotation) {
for (int nrotbkg = 0; nrotbkg < 5; nrotbkg++) {
auto anglestart = 5.0 * TMath::Pi() / 6.0;
auto angleend = 7.0 * TMath::Pi() / 6.0;
auto anglestep = (angleend - anglestart) / (1.0 * (9.0 - 1.0));
auto rotangle = anglestart + nrotbkg * anglestep;
auto rotd1px = Phid1.Px() * std::cos(rotangle) - Phid1.Py() * std::sin(rotangle);
auto rotd1py = Phid1.Px() * std::sin(rotangle) + Phid1.Py() * std::cos(rotangle);
Phid1Rot.SetXYZM(rotd1px, rotd1py, Phid1.Pz(), Phid1.M());
exoticRot = Phid1Rot + Phid2;
auto cosThetaStar_rot = getCosTheta(exoticRot, Phid1Rot);
auto kstar_rot = getkstar(Phid1Rot, Phid2);
auto deltaR_rot = TMath::Sqrt(TMath::Power(Phid1Rot.Phi() - Phid2.Phi(), 2.0) + TMath::Power(Phid1Rot.Eta() - Phid2.Eta(), 2.0));
if (!fillDeltaMass) {
histos.fill(HIST("SEMassRot"), exoticRot.M(), exoticRot.Pt(), kstar_rot, cosThetaStar_rot, deltaR_rot);
}
if (fillDeltaMass) {
histos.fill(HIST("SEMassRot"), exoticRot.M() - Phid1Rot.M(), exoticRot.Pt(), kstar_rot, cosThetaStar_rot, deltaR_rot);
}
}
}
auto costheta = (Phid1.Px() * Phid2.Px() + Phid1.Py() * Phid2.Py() + Phid1.Pz() * Phid2.Pz()) / (Phid1.P() * Phid2.P());
histos.fill(HIST("SEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, costheta, Phid1.M(), Phid2.M(), phimult);
}
}
}
Expand All @@ -309,12 +234,7 @@
if (collision1.index() == collision2.index()) {
continue;
}
if (additionalEvsel && (collision1.numPos() < 2 || collision1.numNeg() < 2)) {
continue;
}
if (additionalEvsel && (collision2.numPos() < 2 || collision2.numNeg() < 2)) {
continue;
}
auto phimult = tracks1.size();
for (auto& [phitrackd1, phitrackd2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) {
if (phitrackd1.phiMass() < minPhiMass || phitrackd1.phiMass() > maxPhiMass) {
continue;
Expand All @@ -322,7 +242,7 @@
if (phitrackd2.phiMass() < minPhiMass || phitrackd2.phiMass() > maxPhiMass) {
continue;
}
auto kaonplusd1pt = TMath::Sqrt(phitrackd1.phid1Px() * phitrackd1.phid1Px() + phitrackd1.phid1Py() * phitrackd1.phid1Py());

Check warning on line 245 in PWGLF/Tasks/Resonances/doublephimeson.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
auto kaonminusd1pt = TMath::Sqrt(phitrackd1.phid2Px() * phitrackd1.phid2Px() + phitrackd1.phid2Py() * phitrackd1.phid2Py());
auto kaonplusd2pt = TMath::Sqrt(phitrackd2.phid1Px() * phitrackd2.phid1Px() + phitrackd2.phid1Py() * phitrackd2.phid1Py());
auto kaonminusd2pt = TMath::Sqrt(phitrackd2.phid2Px() * phitrackd2.phid2Px() + phitrackd2.phid2Py() * phitrackd2.phid2Py());
Expand All @@ -341,15 +261,9 @@
}
Phid2.SetXYZM(phitrackd2.phiPx(), phitrackd2.phiPy(), phitrackd2.phiPz(), phitrackd2.phiMass());
exotic = Phid1 + Phid2;
auto cosThetaStar = getCosTheta(exotic, Phid1);
auto kstar = getkstar(Phid1, Phid2);
auto deltaR = TMath::Sqrt(TMath::Power(Phid1.Phi() - Phid2.Phi(), 2.0) + TMath::Power(Phid1.Eta() - Phid2.Eta(), 2.0));
if (!fillDeltaMass) {
histos.fill(HIST("MEMassUnlike"), exotic.M(), exotic.Pt(), kstar, cosThetaStar, deltaR);
}
if (fillDeltaMass) {
histos.fill(HIST("MEMassUnlike"), exotic.M() - Phid1.M(), exotic.Pt(), kstar, cosThetaStar, deltaR);
}
auto costheta = (Phid1.Px() * Phid2.Px() + Phid1.Py() * Phid2.Py() + Phid1.Pz() * Phid2.Pz()) / (Phid1.P() * Phid2.P());
histos.fill(HIST("MEMassUnlike"), exotic.M(), exotic.Pt(), deltaR, costheta, Phid1.M(), Phid2.M(), phimult);
}
}
}
Expand Down
Loading