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
12 changes: 8 additions & 4 deletions PWGLF/DataModel/LFSigmaTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,16 @@ namespace sigma0Gen
{
DECLARE_SOA_COLUMN(IsSigma0, isSigma0, bool); // true: sigma0, false: antisigma0
DECLARE_SOA_COLUMN(ProducedByGenerator, producedByGenerator, bool);
DECLARE_SOA_COLUMN(Sigma0MCPt, sigma0MCPt, float); // MC pT
DECLARE_SOA_COLUMN(MCPt, mcpt, float); // MC pT
DECLARE_SOA_COLUMN(MCY, mcy, float); // MC Y

} // namespace sigma0Gen

DECLARE_SOA_TABLE(Sigma0Gens, "AOD", "SIGMA0GENS",
sigma0Gen::IsSigma0,
sigma0Gen::ProducedByGenerator,
sigma0Gen::Sigma0MCPt);
sigma0Gen::MCPt,
sigma0Gen::MCY);

DECLARE_SOA_TABLE(SigmaCollRef, "AOD", "SIGMACOLLREF", //! optional table to refer back to a collision
o2::soa::Index<>, v0data::StraCollisionId);
Expand Down Expand Up @@ -859,12 +861,14 @@ DECLARE_SOA_TABLE(Pi0CollRef, "AOD", "PI0COLLREF", //! optional table to refer b
namespace pi0Gen
{
DECLARE_SOA_COLUMN(ProducedByGenerator, producedByGenerator, bool);
DECLARE_SOA_COLUMN(Pi0MCPt, pi0MCPt, float); // MC pT
DECLARE_SOA_COLUMN(MCPt, mcpt, float); // MC pT
DECLARE_SOA_COLUMN(MCY, mcy, float); // MC Y
} // namespace pi0Gen

DECLARE_SOA_TABLE(Pi0Gens, "AOD", "PI0GENS",
pi0Gen::ProducedByGenerator,
pi0Gen::Pi0MCPt);
pi0Gen::MCPt,
pi0Gen::MCY);

DECLARE_SOA_TABLE(Pi0GenCollRef, "AOD", "PI0GENCOLLREF", //! optional table to refer back to a collision
o2::soa::Index<>, v0data::StraMCCollisionId);
Expand Down
5 changes: 3 additions & 2 deletions PWGLF/TableProducer/Strangeness/sigma0builder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include <cmath>
#include <cstdlib>
#include <string>
#include <vector>

using namespace o2;
using namespace o2::framework;
Expand Down Expand Up @@ -1259,13 +1260,13 @@ struct sigma0builder {
// Fill tables
// Pi0
if (fillPi0Tables && MCGenInfo.IsPi0) {
pi0Gens(MCGenInfo.IsProducedByGenerator, MCGenInfo.MCPt); // optional table to store generated pi0 candidates. Be careful, this is a large table!
pi0Gens(MCGenInfo.IsProducedByGenerator, MCGenInfo.MCPt, mcParticle.y()); // optional table to store generated pi0 candidates. Be careful, this is a large table!
pi0GenCollRefs(MCGenInfo.MCCollId); // link to stramccollision table
}

// Sigma0/ASigma0
if (fillSigma0Tables && (MCGenInfo.IsSigma0 || MCGenInfo.IsAntiSigma0)) {
sigma0Gens(MCGenInfo.IsSigma0, MCGenInfo.IsProducedByGenerator, MCGenInfo.MCPt);
sigma0Gens(MCGenInfo.IsSigma0, MCGenInfo.IsProducedByGenerator, MCGenInfo.MCPt, mcParticle.y());
sigma0GenCollRefs(MCGenInfo.MCCollId); // link to stramccollision table
}
}
Expand Down
68 changes: 40 additions & 28 deletions PWGLF/Tasks/Strangeness/sigmaanalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@
#include <cmath>
#include <cstdlib>
#include <string>
#include <unordered_map>
#include <vector>

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;

using std::array;
using MCSigma0s = soa::Join<aod::Sigma0Cores, aod::Sigma0PhotonExtras, aod::Sigma0LambdaExtras, aod::Sigma0MCCores, aod::SigmaCollRef, aod::SigmaMCLabels>;
using MCSigma0s = soa::Join<aod::Sigma0Cores, aod::Sigma0PhotonExtras, aod::Sigma0LambdaExtras, aod::Sigma0MCCores, aod::SigmaCollRef>;
using Sigma0s = soa::Join<aod::Sigma0Cores, aod::Sigma0PhotonExtras, aod::Sigma0LambdaExtras, aod::SigmaCollRef>;

static const std::vector<std::string> PhotonSels = {"NoSel", "V0Type", "DCADauToPV",
Expand Down Expand Up @@ -124,7 +126,12 @@ struct sigmaanalysis {
} eventSelections;

// Generated Sigma0s
Configurable<bool> mc_keepOnlyFromGenerator{"mc_keepOnlyFromGenerator", true, "if true, consider only particles from generator to calculate efficiency."};
struct : ConfigurableGroup {
std::string prefix = "genSelections"; // JSON group name
Configurable<bool> mc_keepOnlyFromGenerator{"mc_keepOnlyFromGenerator", true, "if true, consider only particles from generator to calculate efficiency."};
Configurable<float> mc_rapidityMin{"mc_rapidityMin", -0.5, "Min generated particle rapidity"};
Configurable<float> mc_rapidityMax{"mc_rapidityMax", 0.5, "Max generated particle rapidity"};
} genSelections;

// QA
Configurable<bool> fdoSigma0QA{"doSigma0QA", false, "if true, perform Sigma0 QA analysis. Only works with MC."};
Expand Down Expand Up @@ -544,8 +551,8 @@ struct sigmaanalysis {
histos.add("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt", "h2dGenAntiSigma0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt});
histos.add("Gen/h2dGenSigma0VsMultMC", "h2dGenSigma0VsMultMC", kTH2D, {axisNch, axisPt});
histos.add("Gen/h2dGenAntiSigma0VsMultMC", "h2dGenAntiSigma0VsMultMC", kTH2D, {axisNch, axisPt});

} else { // Pi0 specific
}
if (doprocessPi0GeneratedRun3) { // Pi0 specific
histos.add("Gen/h2dGenPi0VsMultMC_RecoedEvt", "h2dGenPi0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt});
histos.add("Gen/h2dGenPi0", "h2dGenPi0", kTH2D, {axisCentrality, axisPt});
histos.add("Gen/h2dGenPi0VsMultMC", "h2dGenPi0VsMultMC", kTH2D, {axisNch, axisPt});
Expand Down Expand Up @@ -813,8 +820,12 @@ struct sigmaanalysis {
continue;
}

// Rapidity selection
if ((genParticle.mcy() < genSelections.mc_rapidityMin) || (genParticle.mcy() > genSelections.mc_rapidityMax))
continue;

// Selection on the source (generator/transport)
if (!genParticle.producedByGenerator() && mc_keepOnlyFromGenerator)
if (!genParticle.producedByGenerator() && genSelections.mc_keepOnlyFromGenerator)
continue;

// Select corresponding mc collision && Basic event selection
Expand All @@ -834,33 +845,35 @@ struct sigmaanalysis {

//______________________________________________________________________________
// Generated Sigma0 processing
if constexpr (requires { genParticle.sigma0MCPt(); }) {
if constexpr (requires { genParticle.isSigma0(); }) {
if (doprocessGeneratedRun3) {

float ptmc = genParticle.sigma0MCPt();
float ptmc = genParticle.mcpt();

if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) {
auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]);
centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C();
if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) {
auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]);
centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C();

if (genParticle.isSigma0())
histos.fill(HIST("Gen/h2dGenSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
if (genParticle.isSigma0())
histos.fill(HIST("Gen/h2dGenSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);

else
histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
}
else
histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc);
}

if (genParticle.isSigma0()) {
histos.fill(HIST("Gen/h2dGenSigma0"), centrality, ptmc);
histos.fill(HIST("Gen/h2dGenSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
} else {
histos.fill(HIST("Gen/h2dGenAntiSigma0"), centrality, ptmc);
histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
if (genParticle.isSigma0()) {
histos.fill(HIST("Gen/h2dGenSigma0"), centrality, ptmc);
histos.fill(HIST("Gen/h2dGenSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
} else {
histos.fill(HIST("Gen/h2dGenAntiSigma0"), centrality, ptmc);
histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc);
}
}
}
//______________________________________________________________________________
// Generated Pi0 processing
if constexpr (requires { genParticle.pi0MCPt(); }) {
float ptmc = genParticle.pi0MCPt();
if (doprocessPi0GeneratedRun3) {
float ptmc = genParticle.mcpt();

if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) {
auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]);
Expand Down Expand Up @@ -1210,15 +1223,15 @@ struct sigmaanalysis {
"TPCTOFPID", "DCADauToPV", "Mass"};

if (PDGRequired == 22) {
if constexpr (selection_index >= 0 && selection_index < (int)std::size(PhotonSelsLocal)) {
if constexpr (selection_index >= 0 && selection_index < static_cast<int>(std::size(PhotonSelsLocal))) {
histos.fill(HIST("Selection/Photon/hCandidateSel"), selection_index);
histos.fill(HIST("Selection/Photon/h2d") + HIST(PhotonSelsLocal[selection_index]), sigma.photonPt(), sigma.photonMass());
histos.fill(HIST("Selection/Sigma0/h2dPhoton") + HIST(PhotonSelsLocal[selection_index]), sigma.pt(), sigma.sigma0Mass());
}
}

if (PDGRequired == 3122) {
if constexpr (selection_index >= 0 && selection_index < (int)std::size(LambdaSelsLocal)) {
if constexpr (selection_index >= 0 && selection_index < static_cast<int>(std::size(LambdaSelsLocal))) {
histos.fill(HIST("Selection/Lambda/hCandidateSel"), selection_index);
histos.fill(HIST("Selection/Lambda/h2d") + HIST(LambdaSelsLocal[selection_index]), sigma.lambdaPt(), sigma.lambdaMass());
histos.fill(HIST("Selection/Sigma0/h2dLambda") + HIST(LambdaSelsLocal[selection_index]), sigma.pt(), sigma.sigma0Mass());
Expand Down Expand Up @@ -1252,9 +1265,8 @@ struct sigmaanalysis {
auto sigma0mc = fullSigma0s.rawIteratorAt(sigma0Index[mcid]);
histos.fill(HIST("Sigma0QA/hDuplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed

if (sigma0mc.isSigma0()) {
}
histos.fill(HIST("Sigma0QA/hSigma0Duplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed
if (sigma0mc.isSigma0())
histos.fill(HIST("Sigma0QA/hSigma0Duplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed

if (sigma0mc.isAntiSigma0())
histos.fill(HIST("Sigma0QA/hASigma0Duplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed
Expand Down