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
103 changes: 54 additions & 49 deletions PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ struct V0PtInvMassPlots {
rPtAnalysis.fill(HIST("hNEvents"), 5.5, collision.centFT0M());
rPtAnalysis.get<TH2>(HIST("hNEvents"))->GetXaxis()->SetBinLabel(6, "cutZVertex");
if (doisInelGt0 && !(collision.multNTracksPVeta1() > 0)) {
// if (doisInelGt0 && !(collision.multMCNParticlesEta10() > 0)) { //CHANGE TO THIS
return false;
}
rPtAnalysis.fill(HIST("hNEvents"), 6.5, collision.centFT0M());
Expand Down Expand Up @@ -694,17 +695,18 @@ struct V0PtInvMassPlots {
using DaughterTracksDerived = soa::Join<aod::DauTrackExtras, aod::DauTrackTPCPIDs>;
o2::framework::Service<o2::framework::O2DatabasePDG> pdgDB;

void genMCProcess(
soa::Join<aod::McCollisions, aod::McCentFT0Ms>::iterator const& mcCollision,
soa::SmallGroups<soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels, aod::PVMults, aod::McCentFT0Ms>> const& collisions,
aod::McParticles const& mcParticles)
// This is the process for Generated Particles
void genMCProcess(soa::Join<aod::McCollisions, aod::McCentFT0Ms, aod::MultMCExtras>::iterator const& mcCollision,
soa::SmallGroups<soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels, aod::PVMults, aod::McCentFT0Ms>> const& collisions,
aod::McParticles const& mcParticles)
{
// Event Efficiency, Event Split and V0 Signal Loss Corrections
rMCCorrections.fill(HIST("hNEvents_Corrections"), 0.5, mcCollision.centFT0M()); // All Events
if (std::abs(mcCollision.posZ()) > cutZVertex) {
return;
}
if (!pwglf::isINELgtNmc(mcParticles, 0, pdgDB)) {
if (!(mcCollision.multMCNParticlesEta10() > 0)) { // TRY TO CHANGE TO THIS
// if (!pwglf::isINELgtNmc(mcParticles, 0, pdgDB)) {
return;
}
rMCCorrections.fill(HIST("hNEvents_Corrections"), 1.5, mcCollision.centFT0M()); // Event Efficiency Denominator
Expand Down Expand Up @@ -787,7 +789,8 @@ struct V0PtInvMassPlots {
// End of Signal Loss Numenator Loop
}
// This is the Process for the MC reconstructed Data
void recMCProcess(soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels, aod::PVMults, aod::McCentFT0Ms>::iterator const& collision,
void recMCProcess(soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels, aod::PVMults, aod::MultsExtraMC, aod::CentFT0Ms>::iterator const& collision,
soa::Join<aod::McCollisions, aod::McCentFT0Ms> const& /*mcCollisions*/,
soa::Join<aod::V0Datas, aod::McV0Labels> const& V0s,
DaughterTracks const&, // no need to define a variable for tracks, if we don't access them directly
aod::McParticles const& /*mcParticles*/)
Expand All @@ -808,6 +811,9 @@ struct V0PtInvMassPlots {
std::vector<double> lambdaptedgevalues(nLambdaHistograms + 1);
std::vector<double> antilambdaptedgevalues(nAntilambdaHistograms + 1);

// For centrality estimation
const auto& mcCollision = collision.mcCollision_as<soa::Join<aod::McCollisions, aod::McCentFT0Ms>>();

for (int i = 0; i < nKaonHistograms + 1; i++) {
kaonptedgevalues[i] = std::stod(pthistos::kaonPtBins[i]);
}
Expand All @@ -820,21 +826,21 @@ struct V0PtInvMassPlots {
if (!acceptEvent(collision)) { // Event Selection
return;
}
rPtAnalysis.fill(HIST("hNRecEvents"), 0.5, collision.centFT0M()); // Event Split Numenator
rPtAnalysis.fill(HIST("hNRecEvents"), 0.5, mcCollision.centFT0M()); // Event Split Numenator
for (const auto& v0 : V0s) {
// Checking that the V0 is a true K0s/Lambdas/Antilambdas and then filling the parameter histograms and the invariant mass plots for different cuts (which are taken from namespace)
const auto& posDaughterTrack = v0.template posTrack_as<DaughterTracks>();
const auto& negDaughterTrack = v0.template negTrack_as<DaughterTracks>();
if (!acceptV0(v0, posDaughterTrack, negDaughterTrack, collision)) { // V0 Selections
if (!acceptV0(v0, posDaughterTrack, negDaughterTrack, mcCollision)) { // V0 Selections
continue;
}
// kzero analysis
if (kzeroAnalysis == true) {
if (acceptK0sh(v0, posDaughterTrack, negDaughterTrack, collision)) { // K0sh Selection
if (acceptK0sh(v0, posDaughterTrack, negDaughterTrack, mcCollision)) { // K0sh Selection
// K0sh Signal Split Numerator Start
for (int i = 0; i < nKaonHistograms; i++) {
if (kaonptedgevalues[i] <= v0.pt() && v0.pt() < kaonptedgevalues[i + 1]) { // finding v0s with pt within the range of our bin edges for K0sh Splitting Numerator
pthistos::kaonSplit[i]->Fill(v0.mK0Short(), collision.centFT0M()); // filling the k0s namespace histograms for K0sh Splitting Numerator
pthistos::kaonSplit[i]->Fill(v0.mK0Short(), mcCollision.centFT0M()); // filling the k0s namespace histograms for K0sh Splitting Numerator
}
}
// K0sh Signla Split Numerator End
Expand All @@ -844,17 +850,17 @@ struct V0PtInvMassPlots {
if (v0mcParticle.isPhysicalPrimary()) {
for (int i = 0; i < nKaonHistograms; i++) {
if (kaonptedgevalues[i] <= v0.pt() && v0.pt() < kaonptedgevalues[i + 1]) { // finding v0s with pt within the range of our bin edges
pthistos::kaonPt[i]->Fill(v0.mK0Short(), collision.centFT0M()); // filling the k0s namespace histograms
pthistos::kaonPt[i]->Fill(v0.mK0Short(), mcCollision.centFT0M()); // filling the k0s namespace histograms
}
}
}
if (!v0mcParticle.isPhysicalPrimary()) {
auto v0mothers = v0mcParticle.mothers_as<aod::McParticles>(); // Get mothers
if (!v0mothers.empty()) {
auto& v0mcParticleMother = v0mothers.front(); // First mother
rFeeddownMatrices.fill(HIST("hK0shFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
rFeeddownMatrices.fill(HIST("hK0shFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), mcCollision.centFT0M());
if (v0mcParticleMother.pdgCode() == kPhi) { // Phi Mother Matched
rFeeddownMatrices.fill(HIST("hK0shPhiFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
rFeeddownMatrices.fill(HIST("hK0shPhiFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), mcCollision.centFT0M());
}
}
}
Expand All @@ -864,11 +870,11 @@ struct V0PtInvMassPlots {
}
// lambda analysis
if (lambdaAnalysis == true) {
if (acceptLambda(v0, posDaughterTrack, negDaughterTrack, collision)) { // Lambda Selections
if (acceptLambda(v0, posDaughterTrack, negDaughterTrack, mcCollision)) { // Lambda Selections
// Lambda Signal Split Numerator Start
for (int i = 0; i < nLambdaHistograms; i++) {
if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) {
pthistos::lambdaSplit[i]->Fill(v0.mLambda(), collision.centFT0M());
pthistos::lambdaSplit[i]->Fill(v0.mLambda(), mcCollision.centFT0M());
}
}
// Lambda Signal Split Numerator End
Expand All @@ -878,23 +884,23 @@ struct V0PtInvMassPlots {
if (v0mcParticle.isPhysicalPrimary()) {
for (int i = 0; i < nLambdaHistograms; i++) {
if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) {
pthistos::lambdaPt[i]->Fill(v0.mLambda(), collision.centFT0M());
pthistos::lambdaPt[i]->Fill(v0.mLambda(), mcCollision.centFT0M());
}
}
}
if (!v0mcParticle.isPhysicalPrimary()) {
auto v0mothers = v0mcParticle.mothers_as<aod::McParticles>(); // Get mothers
if (!v0mothers.empty()) {
auto& v0mcParticleMother = v0mothers.front(); // First mother
rFeeddownMatrices.fill(HIST("hLambdaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
rFeeddownMatrices.fill(HIST("hLambdaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), mcCollision.centFT0M());
if (v0mcParticleMother.pdgCode() == kXiMinus) { // Xi Minus Mother Matched
rFeeddownMatrices.fill(HIST("hLambdaXiMinusFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
rFeeddownMatrices.fill(HIST("hLambdaXiMinusFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), mcCollision.centFT0M());
}
if (v0mcParticleMother.pdgCode() == kXi0) { // Xi Zero Mother Matched
rFeeddownMatrices.fill(HIST("hLambdaXiZeroFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
rFeeddownMatrices.fill(HIST("hLambdaXiZeroFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), mcCollision.centFT0M());
}
if (v0mcParticleMother.pdgCode() == kOmegaMinus) { // Omega Mother Matched
rFeeddownMatrices.fill(HIST("hLambdaOmegaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
rFeeddownMatrices.fill(HIST("hLambdaOmegaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), mcCollision.centFT0M());
}
}
}
Expand All @@ -904,11 +910,11 @@ struct V0PtInvMassPlots {
}
// antilambda analysis
if (antiLambdaAnalysis == true) {
if (acceptAntilambda(v0, posDaughterTrack, negDaughterTrack, collision)) { // Antilambda Selections
if (acceptAntilambda(v0, posDaughterTrack, negDaughterTrack, mcCollision)) { // Antilambda Selections
// Antilambda Signal Split Numerator End
for (int i = 0; i < nAntilambdaHistograms; i++) {
if (antilambdaptedgevalues[i] <= v0.pt() && v0.pt() < antilambdaptedgevalues[i + 1]) {
pthistos::antilambdaSplit[i]->Fill(v0.mAntiLambda(), collision.centFT0M());
pthistos::antilambdaSplit[i]->Fill(v0.mAntiLambda(), mcCollision.centFT0M());
}
}
// Antilambda Signal Split Numerator End
Expand All @@ -918,23 +924,23 @@ struct V0PtInvMassPlots {
if (v0mcParticle.isPhysicalPrimary()) {
for (int i = 0; i < nAntilambdaHistograms; i++) {
if (antilambdaptedgevalues[i] <= v0.pt() && v0.pt() < antilambdaptedgevalues[i + 1]) {
pthistos::antilambdaPt[i]->Fill(v0.mAntiLambda(), collision.centFT0M());
pthistos::antilambdaPt[i]->Fill(v0.mAntiLambda(), mcCollision.centFT0M());
}
}
}
if (!v0mcParticle.isPhysicalPrimary()) {
auto v0mothers = v0mcParticle.mothers_as<aod::McParticles>(); // Get mothers
if (!v0mothers.empty()) {
auto& v0mcParticleMother = v0mothers.front(); // First mother
rFeeddownMatrices.fill(HIST("hAntiLambdaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
rFeeddownMatrices.fill(HIST("hAntiLambdaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), mcCollision.centFT0M());
if (v0mcParticleMother.pdgCode() == kXiPlusBar) { // Xi Plus Mother Matched
rFeeddownMatrices.fill(HIST("hAntiLambdaXiPlusFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
rFeeddownMatrices.fill(HIST("hAntiLambdaXiPlusFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), mcCollision.centFT0M());
}
if (v0mcParticleMother.pdgCode() == -kXi0) { // Anti-Xi Zero Mother Matched
rFeeddownMatrices.fill(HIST("hAntiLambdaAntiXiZeroFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
rFeeddownMatrices.fill(HIST("hAntiLambdaAntiXiZeroFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), mcCollision.centFT0M());
}
if (v0mcParticleMother.pdgCode() == kOmegaPlusBar) { // Anti-Omega (minus) Mother Matched
rFeeddownMatrices.fill(HIST("hAntiLambdaAntiOmegaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
rFeeddownMatrices.fill(HIST("hAntiLambdaAntiOmegaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), mcCollision.centFT0M());
}
}
}
Expand All @@ -945,7 +951,7 @@ struct V0PtInvMassPlots {
}
}
// This is the process for Real Data
void dataProcess(soa::Join<aod::Collisions, aod::EvSels, aod::PVMults, aod::CentFT0Ms /*,aod::CentNGlobals*/>::iterator const& collision,
void dataProcess(soa::Join<aod::Collisions, aod::EvSels, aod::PVMults, aod::CentFT0Ms, aod::MultsExtra /*,aod::CentNGlobals*/>::iterator const& collision,
aod::V0Datas const& V0s,
DaughterTracks const&)
{
Expand Down Expand Up @@ -975,9 +981,9 @@ struct V0PtInvMassPlots {
antilambdaptedgevalues[i] = std::stod(pthistos::antilambdaPtBins[i]);
}

if (!acceptEvent(collision)) { // Event Selection
return;
}
// if (!acceptEvent(collision)) { // Event Selection
// return;
// }
rPtAnalysis.fill(HIST("hNRecEvents"), 0.5, collision.centFT0M()); // Number of recorded events
for (const auto& v0 : V0s) {
// Checking that the V0 is a true K0s/Lambdas/Antilambdas and then filling the parameter histograms and the invariant mass plots for different cuts (which are taken from namespace)
Expand Down Expand Up @@ -1049,9 +1055,9 @@ struct V0PtInvMassPlots {
antilambdaptedgevalues[i] = std::stod(pthistos::antilambdaPtBins[i]);
}

if (!acceptEvent(collision)) { // Event Selection
return;
}
// if (!acceptEvent(collision)) { // Event Selection
// return;
// }
rPtAnalysis.fill(HIST("hNRecEvents"), 0.5, collision.centFT0M()); // Number of recorded events
for (const auto& v0 : V0s) {
// Checking that the V0 is a true K0s/Lambdas/Antilambdas and then filling the parameter histograms and the invariant mass plots for different cuts (which are taken from namespace)
Expand Down Expand Up @@ -1092,10 +1098,9 @@ struct V0PtInvMassPlots {
}
}
}
// This is the Process for the MC reconstructed Data
void recMCProcessDerived(soa::Join<aod::StraCollisions, aod::StraEvSels, aod::StraCollLabels, aod::StraCents>::iterator const& collision,
// <aod::McCollisions> const& /*mcCollisions*/,
soa::Join<aod::V0CollRefs, aod::V0Cores, aod::V0Extras, aod::V0CoreMCLabels, aod::V0MCMothers> const& V0s,
// To add McCentFT0Ms
soa::Join<aod::V0CollRefs, aod::V0MCCores, aod::V0Cores, aod::V0Extras, aod::V0CoreMCLabels, aod::V0MCMothers> const& V0s,
DaughterTracksDerived const&)
{
// tokenise strings into individual values
Expand Down Expand Up @@ -1123,9 +1128,9 @@ struct V0PtInvMassPlots {
for (int i = 0; i < nAntilambdaHistograms + 1; i++) {
antilambdaptedgevalues[i] = std::stod(pthistos::antilambdaPtBins[i]);
}
if (!acceptEvent(collision)) { // Event Selection
return;
}
// if (!acceptEvent(collision)) { // Event Selection
// return;
// }
rPtAnalysis.fill(HIST("hNRecEvents"), 0.5, collision.centFT0M()); // Event Split Numenator
for (const auto& v0 : V0s) {
// Checking that the V0 is a true K0s/Lambdas/Antilambdas and then filling the parameter histograms and the invariant mass plots for different cuts (which are taken from namespace)
Expand All @@ -1139,18 +1144,18 @@ struct V0PtInvMassPlots {
if (acceptK0sh(v0, posDaughterTrack, negDaughterTrack, collision)) { // K0sh Selection
// K0sh Signal Split Numerator Start
for (int i = 0; i < nKaonHistograms; i++) {
if (kaonptedgevalues[i] <= v0.pt() && v0.pt() < kaonptedgevalues[i + 1]) { // finding v0s with pt within the range of our bin edges for K0sh Splitting Numerator
pthistos::kaonSplit[i]->Fill(v0.mK0Short(), collision.centFT0M()); // filling the k0s namespace histograms for K0sh Splitting Numerator
if (kaonptedgevalues[i] <= v0.ptMC() && v0.ptMC() < kaonptedgevalues[i + 1]) { // finding v0s with pt within the range of our bin edges for K0sh Splitting Numerator
pthistos::kaonSplit[i]->Fill(v0.mK0Short(), collision.centFT0M()); // filling the k0s namespace histograms for K0sh Splitting Numerator
}
}
// K0sh Signla Split Numerator End
// K0sh SignaL Split Numerator End
if (v0.has_v0MCCore()) {
auto v0mcParticle = v0.v0MCCore_as<aod::V0MCCores>();
if (dotruthk0sh && (v0mcParticle.pdgCode() == kK0Short)) { // kzero matched
if (v0mcParticle.isPhysicalPrimary()) {
for (int i = 0; i < nKaonHistograms; i++) {
if (kaonptedgevalues[i] <= v0.pt() && v0.pt() < kaonptedgevalues[i + 1]) { // finding v0s with pt within the range of our bin edges
pthistos::kaonPt[i]->Fill(v0.mK0Short(), collision.centFT0M()); // filling the k0s namespace histograms
if (kaonptedgevalues[i] <= v0.ptMC() && v0.ptMC() < kaonptedgevalues[i + 1]) { // finding v0s with pt within the range of our bin edges
pthistos::kaonPt[i]->Fill(v0.mK0Short(), collision.centFT0M()); // filling the k0s namespace histograms
}
}
}
Expand All @@ -1170,7 +1175,7 @@ struct V0PtInvMassPlots {
if (acceptLambda(v0, posDaughterTrack, negDaughterTrack, collision)) { // Lambda Selections
// Lambda Signal Split Numerator Start
for (int i = 0; i < nLambdaHistograms; i++) {
if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) {
if (lambdaptedgevalues[i] <= v0.ptMC() && v0.ptMC() < lambdaptedgevalues[i + 1]) {
pthistos::lambdaSplit[i]->Fill(v0.mLambda(), collision.centFT0M());
}
}
Expand All @@ -1180,7 +1185,7 @@ struct V0PtInvMassPlots {
if (dotruthLambda && (v0mcParticle.pdgCode() == kLambda0)) { // lambda matched
if (v0mcParticle.isPhysicalPrimary()) {
for (int i = 0; i < nLambdaHistograms; i++) {
if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) {
if (lambdaptedgevalues[i] <= v0.ptMC() && v0.ptMC() < lambdaptedgevalues[i + 1]) {
pthistos::lambdaPt[i]->Fill(v0.mLambda(), collision.centFT0M());
}
}
Expand All @@ -1207,7 +1212,7 @@ struct V0PtInvMassPlots {
if (acceptAntilambda(v0, posDaughterTrack, negDaughterTrack, collision)) { // Antilambda Selections
// Antilambda Signal Split Numerator End
for (int i = 0; i < nAntilambdaHistograms; i++) {
if (antilambdaptedgevalues[i] <= v0.pt() && v0.pt() < antilambdaptedgevalues[i + 1]) {
if (antilambdaptedgevalues[i] <= v0.ptMC() && v0.ptMC() < antilambdaptedgevalues[i + 1]) {
pthistos::antilambdaSplit[i]->Fill(v0.mAntiLambda(), collision.centFT0M());
}
}
Expand All @@ -1217,7 +1222,7 @@ struct V0PtInvMassPlots {
if (dotruthAntilambda && (v0mcParticle.pdgCode() == kLambda0Bar)) { // antilambda matched
if (v0mcParticle.isPhysicalPrimary()) {
for (int i = 0; i < nAntilambdaHistograms; i++) {
if (antilambdaptedgevalues[i] <= v0.pt() && v0.pt() < antilambdaptedgevalues[i + 1]) {
if (antilambdaptedgevalues[i] <= v0.ptMC() && v0.ptMC() < antilambdaptedgevalues[i + 1]) {
pthistos::antilambdaPt[i]->Fill(v0.mAntiLambda(), collision.centFT0M());
}
}
Expand Down
Loading