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
8 changes: 6 additions & 2 deletions PWGLF/DataModel/LFSigmaTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
DECLARE_SOA_COLUMN(X, x, float);
DECLARE_SOA_COLUMN(Y, y, float);
DECLARE_SOA_COLUMN(Z, z, float);
DECLARE_SOA_COLUMN(DCADaughters, dcadaughters, float);

Check failure on line 41 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.

DECLARE_SOA_COLUMN(PhotonPx, photonPx, float);
DECLARE_SOA_COLUMN(PhotonPy, photonPy, float);
Expand All @@ -49,7 +49,7 @@
DECLARE_SOA_COLUMN(LambdaPy, lambdaPy, float);
DECLARE_SOA_COLUMN(LambdaPz, lambdaPz, float);
DECLARE_SOA_COLUMN(LambdaMass, lambdaMass, float);
DECLARE_SOA_COLUMN(AntiLambdaMass, antilambdaMass, float);

Check failure on line 52 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.

//______________________________________________________
// DYNAMIC COLUMNS
Expand Down Expand Up @@ -100,7 +100,7 @@
DECLARE_SOA_DYNAMIC_COLUMN(Radius, radius, //! Sigma0 decay radius (2D, centered at zero)
[](float x, float y) -> float { return RecoDecay::sqrtSumOfSquares(x, y); });

DECLARE_SOA_DYNAMIC_COLUMN(OPAngle, opAngle,

Check failure on line 103 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
[](float photonPx, float photonPy, float photonPz, float lambdaPx, float lambdaPy, float lambdaPz) {
TVector3 v1(photonPx, photonPy, photonPz);
TVector3 v2(lambdaPx, lambdaPy, lambdaPz);
Expand All @@ -113,7 +113,7 @@
return RecoDecay::sqrtSumOfSquares(photonPx, photonPy);
});

DECLARE_SOA_DYNAMIC_COLUMN(PhotonP, photonp, //! Total momentum in GeV/c

Check failure on line 116 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
[](float photonPx, float photonPy, float photonPz) -> float {
return RecoDecay::sqrtSumOfSquares(photonPx, photonPy, photonPz);
});
Expand All @@ -137,7 +137,7 @@
return RecoDecay::sqrtSumOfSquares(lambdaPx, lambdaPy);
});

DECLARE_SOA_DYNAMIC_COLUMN(LambdaP, lambdap, //! Total momentum in GeV/c

Check failure on line 140 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
[](float lambdaPx, float lambdaPy, float lambdaPz) -> float {
return RecoDecay::sqrtSumOfSquares(lambdaPx, lambdaPy, lambdaPz);
});
Expand Down Expand Up @@ -196,21 +196,21 @@
namespace kstarCore
{
DECLARE_SOA_COLUMN(PhotonV0ID, photonV0ID, int);
DECLARE_SOA_COLUMN(KShortV0ID, kshortV0ID, int);

Check failure on line 199 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.

DECLARE_SOA_COLUMN(X, x, float);
DECLARE_SOA_COLUMN(Y, y, float);
DECLARE_SOA_COLUMN(Z, z, float);
DECLARE_SOA_COLUMN(DCADaughters, dcadaughters, float);

Check failure on line 204 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.

DECLARE_SOA_COLUMN(PhotonPx, photonPx, float);
DECLARE_SOA_COLUMN(PhotonPy, photonPy, float);
DECLARE_SOA_COLUMN(PhotonPz, photonPz, float);
DECLARE_SOA_COLUMN(PhotonMass, photonMass, float);

DECLARE_SOA_COLUMN(KShortPx, kshortPx, float);

Check failure on line 211 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(KShortPy, kshortPy, float);

Check failure on line 212 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(KShortPz, kshortPz, float);

Check failure on line 213 in PWGLF/DataModel/LFSigmaTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(KShortMass, kshortMass, float);

// Dynamic Columns
Expand Down Expand Up @@ -790,6 +790,8 @@
DECLARE_SOA_COLUMN(IsPhotonPrimary, isPhotonPrimary, bool);
DECLARE_SOA_COLUMN(PhotonPDGCode, photonPDGCode, int);
DECLARE_SOA_COLUMN(PhotonPDGCodeMother, photonPDGCodeMother, int);
DECLARE_SOA_COLUMN(PhotonPDGCodeGrandMother, photonPDGCodeGrandMother, int);
DECLARE_SOA_COLUMN(PhotonGlobalIndexGrandMother, photonGlobalIndexGrandMother, int);
DECLARE_SOA_COLUMN(PhotonIsCorrectlyAssoc, photonIsCorrectlyAssoc, bool);

DECLARE_SOA_COLUMN(KShortMCPx, kshortmcpx, float);
Expand All @@ -798,6 +800,8 @@
DECLARE_SOA_COLUMN(IsKShortPrimary, isKShortPrimary, bool);
DECLARE_SOA_COLUMN(KShortPDGCode, kshortPDGCode, int);
DECLARE_SOA_COLUMN(KShortPDGCodeMother, kshortPDGCodeMother, int);
DECLARE_SOA_COLUMN(KShortPDGCodeGrandMother, kshortPDGCodeGrandMother, int);
DECLARE_SOA_COLUMN(KShortGlobalIndexGrandMother, kshortGlobalIndexGrandMother, int);
DECLARE_SOA_COLUMN(KShortIsCorrectlyAssoc, kshortIsCorrectlyAssoc, bool);

DECLARE_SOA_DYNAMIC_COLUMN(IsKStar, isKStar, //! IsSigma0
Expand Down Expand Up @@ -903,10 +907,10 @@
kstarMCCore::MCradius, kstarMCCore::PDGCode, kstarMCCore::PDGCodeMother, kstarMCCore::MCprocess, kstarMCCore::IsProducedByGenerator,

kstarMCCore::PhotonMCPx, kstarMCCore::PhotonMCPy, kstarMCCore::PhotonMCPz,
kstarMCCore::IsPhotonPrimary, kstarMCCore::PhotonPDGCode, kstarMCCore::PhotonPDGCodeMother, kstarMCCore::PhotonIsCorrectlyAssoc,
kstarMCCore::IsPhotonPrimary, kstarMCCore::PhotonPDGCode, kstarMCCore::PhotonPDGCodeMother, kstarMCCore::PhotonPDGCodeGrandMother, kstarMCCore::PhotonGlobalIndexGrandMother, kstarMCCore::PhotonIsCorrectlyAssoc,

kstarMCCore::KShortMCPx, kstarMCCore::KShortMCPy, kstarMCCore::KShortMCPz,
kstarMCCore::IsKShortPrimary, kstarMCCore::KShortPDGCode, kstarMCCore::KShortPDGCodeMother, kstarMCCore::KShortIsCorrectlyAssoc,
kstarMCCore::IsKShortPrimary, kstarMCCore::KShortPDGCode, kstarMCCore::KShortPDGCodeMother, kstarMCCore::KShortPDGCodeGrandMother, kstarMCCore::KShortGlobalIndexGrandMother, kstarMCCore::KShortIsCorrectlyAssoc,

// Dynamic columns
kstarMCCore::IsKStar<kstarMCCore::PDGCode>,
Expand Down
66 changes: 53 additions & 13 deletions PWGLF/TableProducer/Strangeness/sigma0builder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,10 @@ struct sigma0builder {
int V02PDGCode = 0;
int V01PDGCodeMother = 0;
int V02PDGCodeMother = 0;
int V01PDGCodeGrandMother = 0;
int V02PDGCodeGrandMother = 0;
int V01GlobalIndexGrandMother = 0;
int V02GlobalIndexGrandMother = 0;
int V0PairPDGCode = 0;
int V0PairPDGCodeMother = 0;
int V0PairMCProcess = -1;
Expand Down Expand Up @@ -956,6 +960,46 @@ struct sigma0builder {
auto const& MCMother_v01 = MCMothersList_v01.front(); // First mother
auto const& MCMother_v02 = MCMothersList_v02.front(); // First mother

// Add the grandmothers
auto const& GrandMothersList_v01 = MCMother_v01.template mothers_as<aod::McParticles>();
if (!GrandMothersList_v01.empty()) {
MCinfo.V01PDGCodeGrandMother = GrandMothersList_v01.front().pdgCode();
MCinfo.V01GlobalIndexGrandMother = GrandMothersList_v01.front().globalIndex();
}

auto const& GrandMothersList_v02 = MCMother_v02.template mothers_as<aod::McParticles>();
if (!GrandMothersList_v02.empty()) {
MCinfo.V02PDGCodeGrandMother = GrandMothersList_v02.front().pdgCode();
MCinfo.V02GlobalIndexGrandMother = GrandMothersList_v02.front().globalIndex();
}

// check grandmothers and fill histograms
int kShortMotherCode = 0;
int photonMotherCode = 0;
if ((std::abs(MCParticle_v01.pdgCode()) == PDG_t::kGamma) && (std::abs(MCParticle_v02.pdgCode()) == PDG_t::kK0Short) && (!fIsKStar)) {

kShortMotherCode = MCMother_v02.pdgCode();

// If the KShort mother is a (anti)Kaon, use the grandmother instead
if (std::abs(kShortMotherCode) == PDG_t::kK0) {
auto const& kShortGrandMothers = MCMother_v02.template mothers_as<aod::McParticles>();
if (!kShortGrandMothers.empty()) {
kShortMotherCode = kShortGrandMothers.front().pdgCode();
}
}

photonMotherCode = MCMother_v01.pdgCode();
// If the photon mother is a pi0, climb to grandmother
if (std::abs(photonMotherCode) == PDG_t::kPi0) {
auto const& photonGrandMothers = MCMother_v01.template mothers_as<aod::McParticles>();
if (!photonGrandMothers.empty()) {
photonMotherCode = photonGrandMothers.front().pdgCode();
}
}

histos.fill(HIST("MCQA/h2dTrueDaughtersMatrix"), kShortMotherCode, photonMotherCode);
}

if (MCMother_v01.globalIndex() == MCMother_v02.globalIndex()) { // Is it the same mother?

MCinfo.fV0PairProducedByGenerator = MCMother_v01.producedByGenerator();
Expand Down Expand Up @@ -1330,13 +1374,11 @@ struct sigma0builder {
if (eventSelections.maxIR >= 0 && interactionRate > eventSelections.maxIR) {
return false;
}
if (fillHists)
if (fillHists) {
histos.fill(HIST("hEventSelection"), 19 /* Above max IR */);

// Fill centrality histogram after event selection
if (fillHists)
// Fill centrality histogram after event selection
histos.fill(HIST("hEventCentrality"), centrality);

}
return true;
}

Expand Down Expand Up @@ -2561,9 +2603,9 @@ struct sigma0builder {

kstarmccores(kstarMCInfo.V0PairMCRadius, kstarMCInfo.V0PairPDGCode, kstarMCInfo.V0PairPDGCodeMother, kstarMCInfo.V0PairMCProcess, kstarMCInfo.fV0PairProducedByGenerator,
kstarMCInfo.V01MCpx, kstarMCInfo.V01MCpy, kstarMCInfo.V01MCpz,
kstarMCInfo.fIsV01Primary, kstarMCInfo.V01PDGCode, kstarMCInfo.V01PDGCodeMother, kstarMCInfo.fIsV01CorrectlyAssign,
kstarMCInfo.fIsV01Primary, kstarMCInfo.V01PDGCode, kstarMCInfo.V01PDGCodeMother, kstarMCInfo.V01PDGCodeGrandMother, kstarMCInfo.V01GlobalIndexGrandMother, kstarMCInfo.fIsV01CorrectlyAssign,
kstarMCInfo.V02MCpx, kstarMCInfo.V02MCpy, kstarMCInfo.V02MCpz,
kstarMCInfo.fIsV02Primary, kstarMCInfo.V02PDGCode, kstarMCInfo.V02PDGCodeMother, kstarMCInfo.fIsV02CorrectlyAssign);
kstarMCInfo.fIsV02Primary, kstarMCInfo.V02PDGCode, kstarMCInfo.V02PDGCodeMother, kstarMCInfo.V02PDGCodeGrandMother, kstarMCInfo.V02GlobalIndexGrandMother, kstarMCInfo.fIsV02CorrectlyAssign);
}

// KStar -> stracollisions link
Expand Down Expand Up @@ -2765,9 +2807,9 @@ struct sigma0builder {
}
}

//_______________________________________________
// KStar loop
if constexpr (!soa::is_table<TEMCal>) { // Don't use EMCal clusters here
//_______________________________________________
// KStar loop
if (fillKStarTables) {
auto gamma1 = fullV0s.rawIteratorAt(bestGammasArray[i]);
for (size_t j = 0; j < bestKShortsArray.size(); ++j) {
Expand All @@ -2778,11 +2820,9 @@ struct sigma0builder {
continue;
}
}
}

//_______________________________________________
// pi0 loop
if constexpr (!soa::is_table<TEMCal>) { // Don't use EMCal clusters here
//_______________________________________________
// pi0 loop
if (fillPi0Tables) {
auto gamma1 = fullV0s.rawIteratorAt(bestGammasArray[i]);
for (size_t j = i + 1; j < bestGammasArray.size(); ++j) {
Expand Down
70 changes: 48 additions & 22 deletions PWGLF/Tasks/Resonances/k892hadronphoton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,9 @@ struct k892hadronphoton {
histos.add(histodir + "/MC/KStar/hDCAPairDauVsPt", "hDCAPairDauVsPt", kTH2D, {axisDCAdau, axisPt});

// 1/pT Resolution:
if (fillResoQAhistos && histodir == "BeforeSel") {

if (fillResoQAhistos) {
histos.add(histodir + "/MC/Reso/h2dKShortPtResolution", "h2dKShortPtResolution", kTH2D, {axisInvPt, axisDeltaPt});
histos.add(histodir + "/MC/Reso/h3dKShortPtResoVsTPCCR", "h3dKShortPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows});
histos.add(histodir + "/MC/Reso/h3dKShortPtResoVsTPCCR", "h3dKShortPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows});
histos.add(histodir + "/MC/Reso/h2dGammaPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisDeltaPt});
histos.add(histodir + "/MC/Reso/h2dKStarPtResolution", "h2dKStarPtResolution", kTH2D, {axisInvPt, axisDeltaPt});
histos.add(histodir + "/MC/Reso/h2dKStarRadiusResolution", "h2dKStarRadiusResolution", kTH2D, {axisPt, axisDeltaPt});
}
Expand All @@ -396,10 +394,16 @@ struct k892hadronphoton {
if (fillBkgQAhistos) {
histos.add(histodir + "/MC/BkgStudy/h2dPtVsMassKStar_All", "h2dPtVsMassKStar_All", kTH2D, {axisPt, axisKStarMass});
histos.add(histodir + "/MC/BkgStudy/h2dPtVsMassKStar_TrueDaughters", "h2dPtVsMassKStar_TrueDaughters", kTH2D, {axisPt, axisKStarMass});
histos.add(histodir + "/MC/BkgStudy/h2dTrueDaughtersMatrix", "h2dTrueDaughtersMatrix", kTHnSparseD, {{10001, -5000.5f, +5000.5f}, {10001, -5000.5f, +5000.5f}});
histos.add(histodir + "/MC/BkgStudy/h2dPtVsMassKStar_PhotonOmega", "h2dPtVsMassKStar_PhotonOmega", kTH2D, {axisPt, axisKStarMass});
histos.add(histodir + "/MC/BkgStudy/h2dPtVsMassKStar_PhotonRho", "h2dPtVsMassKStar_PhotonRho", kTH2D, {axisPt, axisKStarMass});
histos.add(histodir + "/MC/BkgStudy/h2dPtVsMassKStar_PhotonEta", "h2dPtVsMassKStar_PhotonEta", kTH2D, {axisPt, axisKStarMass});
histos.add(histodir + "/MC/BkgStudy/h2dPtVsMassKStar_KShortKCharged", "h2dPtVsMassKStar_KShortKCharged", kTH2D, {axisPt, axisKStarMass});
histos.add(histodir + "/MC/BkgStudy/h2dPtVsMassKStar_KStarPionKaon", "h2dPtVsMassKStar_KStarPionKaon", kTH2D, {axisPt, axisKStarMass});
histos.add(histodir + "/MC/BkgStudy/h2dPtVsMassKStar_TrueGammaFakeKShort", "h2dPtVsMassKStar_TrueGammaFakeKShort", kTH2D, {axisPt, axisKStarMass});
histos.add(histodir + "/MC/BkgStudy/h2dPtVsMassKStar_FakeGammaTrueKShort", "h2dPtVsMassKStar_FakeGammaTrueKShort", kTH2D, {axisPt, axisKStarMass});
histos.add(histodir + "/MC/BkgStudy/h2dPtVsMassKStar_FakeDaughters", "h2dPtVsMassKStar_FakeDaughters", kTH2D, {axisPt, axisKStarMass});
histos.add(histodir + "/MC/BkgStudy/h2dTrueDaughtersMatrix", "h2dTrueDaughtersMatrix", kTHnSparseD, {{10001, -5000.5f, +5000.5f}, {10001, -5000.5f, +5000.5f}});
histos.add(histodir + "/MC/BkgStudy/h2dTrueDaughtersMatrixGrandMother", "h2dTrueDaughtersMatrixGrandMother", kTHnSparseD, {{10001, -5000.5f, +5000.5f}, {10001, -5000.5f, +5000.5f}});
}
}
}
Expand Down Expand Up @@ -575,12 +579,12 @@ struct k892hadronphoton {
if (eventSelections.maxIR >= 0 && interactionRate > eventSelections.maxIR) {
return false;
}
if (fillHists)
histos.fill(HIST("hEventSelection"), 19 /* Above max IR */);

// Fill centrality histogram after event selection
if (fillHists)
if (fillHists) {
histos.fill(HIST("hEventSelection"), 19 /* Above max IR */);
// Fill centrality histogram after event selection
histos.fill(HIST("hEventCentrality"), centrality);
}

return true;
}
Expand Down Expand Up @@ -761,36 +765,36 @@ struct k892hadronphoton {
return trkCode;
}

template <typename TKStarObject>
template <int mode, typename TKStarObject>
void getResolution(TKStarObject const& kstar)
{
// Check whether it is before or after selections
static constexpr std::string_view MainDir[] = {"BeforeSel", "AfterSel"};

//_______________________________________
// Gamma MC association
if (std::abs(kstar.photonPDGCode()) == PDG_t::kGamma) {
if (kstar.photonmcpt() > 0) {
histos.fill(HIST("BeforeSel/MC/Reso/h3dGammaPtResoVsTPCCR"), 1.f / kstar.kshortmcpt(), 1.f / kstar.kshortPt() - 1.f / kstar.kshortmcpt(), -1 * kstar.photonNegTPCCrossedRows()); // 1/pT resolution
histos.fill(HIST("BeforeSel/MC/Reso/h3dGammaPtResoVsTPCCR"), 1.f / kstar.kshortmcpt(), 1.f / kstar.kshortPt() - 1.f / kstar.kshortmcpt(), kstar.photonPosTPCCrossedRows()); // 1/pT resolution
histos.fill(HIST("BeforeSel/MC/Reso/h2dGammaPtResolution"), 1.f / kstar.photonmcpt(), 1.f / kstar.photonPt() - 1.f / kstar.photonmcpt()); // pT resolution
// histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaPtResolution"), 1.f / kstar.photonmcpt(), kstar.photonPt() - kstar.photonmcpt());
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaPtResolution"), 1.f / kstar.photonmcpt(), (kstar.photonPt() - kstar.photonmcpt()) / kstar.photonmcpt());
}
}

//_______________________________________
// KShort MC association
if (std::abs(kstar.kshortPDGCode()) == PDG_t::kK0Short) {
if (kstar.kshortmcpt() > 0) {
histos.fill(HIST("BeforeSel/MC/Reso/h2dKShortPtResolution"), 1.f / kstar.kshortmcpt(), 1.f / kstar.kshortPt() - 1.f / kstar.kshortmcpt()); // 1/pT resolution
histos.fill(HIST("BeforeSel/MC/Reso/h3dKShortPtResoVsTPCCR"), 1.f / kstar.kshortmcpt(), 1.f / kstar.kshortPt() - 1.f / kstar.kshortmcpt(), -1 * kstar.kshortNegTPCCrossedRows()); // 1/pT resolution
histos.fill(HIST("BeforeSel/MC/Reso/h3dKShortPtResoVsTPCCR"), 1.f / kstar.kshortmcpt(), 1.f / kstar.kshortPt() - 1.f / kstar.kshortmcpt(), kstar.kshortPosTPCCrossedRows()); // 1/pT resolution
// histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dKShortPtResolution"), 1.f / kstar.kshortmcpt(), kstar.kshortPt() - kstar.kshortmcpt());
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dKShortPtResolution"), 1.f / kstar.kshortmcpt(), (kstar.kshortPt() - kstar.kshortmcpt()) / kstar.kshortmcpt());
}
}

//_______________________________________
// KStar MC association
if (kstar.isKStar()) {
histos.fill(HIST("BeforeSel/MC/Reso/h2dKStarRadiusResolution"), kstar.mcpt(), kstar.radius() - kstar.mcradius()); // pT resolution
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dKStarRadiusResolution"), kstar.mcpt(), kstar.radius() - kstar.mcradius()); // pT resolution
if (kstar.mcpt() > 0)
histos.fill(HIST("BeforeSel/MC/Reso/h2dKStarPtResolution"), 1.f / kstar.mcpt(), 1.f / kstar.pt() - 1.f / kstar.mcpt()); // pT resolution
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dKStarPtResolution"), 1.f / kstar.mcpt(), (1.f / kstar.pt() - 1.f / kstar.mcpt()) / (1.f / kstar.mcpt())); // pT resolution
}
}

Expand All @@ -804,18 +808,40 @@ struct k892hadronphoton {
bool fIsKStar = kstar.isKStar();
int photonPDGCode = kstar.photonPDGCode();
int photonPDGCodeMother = kstar.photonPDGCodeMother();
int photonPDGCodeGrandMother = kstar.photonPDGCodeGrandMother();
int photonGlobalIndexGrandMother = kstar.photonGlobalIndexGrandMother();
int kshortPDGCode = kstar.kshortPDGCode();
int kshortPDGCodeMother = kstar.kshortPDGCodeMother();
int kshortPDGCodeGrandMother = kstar.kshortPDGCodeGrandMother();
int kshortGlobalIndexGrandMother = kstar.kshortGlobalIndexGrandMother();
float kstarpT = kstar.pt();
float kstarMass = kstar.kstarMass();

histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassKStar_All"), kstarpT, kstarMass);

//_______________________________________
// Real Gamma x Real KShort - but not from the same kstar!
if ((!fIsKStar)) { //(std::abs(photonPDGCode) == PDG_t::kGamma) && (std::abs(KShortPDGCode) == PDG_t::kK0Short) &&
// Real Gamma x Real KShort - but not direct decays from the same kstar!
if ((!fIsKStar) && (std::abs(photonPDGCode) == PDG_t::kGamma) && (std::abs(kshortPDGCode) == PDG_t::kK0Short)) {
histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassKStar_TrueDaughters"), kstarpT, kstarMass);
histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dTrueDaughtersMatrix"), kshortPDGCodeMother, photonPDGCodeMother);
histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dTrueDaughtersMatrixGrandMother"), kshortPDGCodeGrandMother, photonPDGCodeGrandMother);

// coming from the same kstar (coupled), but via a different decay channel (K* -> K0 pi0 -> K0s gamma)
if (std::abs(kshortPDGCodeGrandMother) == o2::constants::physics::Pdg::kK0Star892 && std::abs(photonPDGCodeGrandMother) == o2::constants::physics::Pdg::kK0Star892 && (photonGlobalIndexGrandMother == kshortGlobalIndexGrandMother)) // K*(892)0
histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassKStar_KStarPionKaon"), kstarpT, kstarMass);

// Break down of different photon / kshort sources
if (std::abs(photonPDGCodeGrandMother) == o2::constants::physics::Pdg::kOmega) // omega(782)
histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassKStar_PhotonOmega"), kstarpT, kstarMass);

if (std::abs(photonPDGCodeGrandMother) == PDG_t::kRho770Plus) // rho+-(770)
histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassKStar_PhotonRho"), kstarpT, kstarMass);

if (std::abs(photonPDGCodeMother) == o2::constants::physics::Pdg::kEta) // eta
histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassKStar_PhotonEta"), kstarpT, kstarMass);

if (std::abs(kshortPDGCodeGrandMother) == o2::constants::physics::Pdg::kKPlusStar892) // K*(892)+-
histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassKStar_KShortKCharged"), kstarpT, kstarMass);
}

//_______________________________________
Expand Down Expand Up @@ -978,8 +1004,8 @@ struct k892hadronphoton {

//_______________________________________
// pT resolution histos
if ((mode == 0) && fillResoQAhistos)
getResolution(kstar);
if (fillResoQAhistos)
getResolution<mode>(kstar);
}
}
}
Expand Down
13 changes: 6 additions & 7 deletions PWGLF/Tasks/Resonances/k892hadronphotonBkg.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ struct k892hadronphotonBkg {
Configurable<float> kstarMaxRap{"kstarMaxRap", 0.5f, "Max |y(K*)|"};
Configurable<int> nBkgRot{"nBkgRot", 3, "Rotations per pair (rotational bkg)"};
Configurable<int> rotationalCut{"rotationalCut", 10, "theta band: [pi - pi/cut, pi + pi/cut]"};
Configurable<float> rotationalFactor{"rotationalFactor", 1.f, "Factor to scale the angle of rotation (rotationalFactor * PI)"};
} kstarBkgConfig;

ConfigurableAxis axisVertexMixBkg{"axisVertexMixBkg", {VARIABLE_WIDTH, -10.f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "z-vertex bins for mixing"};
Expand Down Expand Up @@ -385,13 +386,11 @@ struct k892hadronphotonBkg {
if (eventSelections.maxIR >= 0 && interactionRate > eventSelections.maxIR) {
return false;
}
if (fillHists)
if (fillHists) {
histos.fill(HIST("hEventSelection"), 19 /* Above max IR */);

// Fill centrality histogram after event selection
if (fillHists)
// Fill centrality histogram after event selection
histos.fill(HIST("hEventCentrality"), centrality);

}
return true;
}

Expand Down Expand Up @@ -595,8 +594,8 @@ struct k892hadronphotonBkg {
0.0);

for (int irot = 0; irot < kstarBkgConfig.nBkgRot; ++irot) {
float theta = rotRng.Uniform(o2::constants::math::PI - o2::constants::math::PI / kstarBkgConfig.rotationalCut,
o2::constants::math::PI + o2::constants::math::PI / kstarBkgConfig.rotationalCut);
float theta = rotRng.Uniform(kstarBkgConfig.rotationalFactor * o2::constants::math::PI - o2::constants::math::PI / kstarBkgConfig.rotationalCut,
kstarBkgConfig.rotationalFactor * o2::constants::math::PI + o2::constants::math::PI / kstarBkgConfig.rotationalCut);

ROOT::Math::PtEtaPhiMVector kRot(kshort.pt(), kshort.eta(), kshort.phi() + theta, o2::constants::physics::MassK0Short);

Expand Down
Loading