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
92 changes: 63 additions & 29 deletions PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -48,6 +48,9 @@
static std::vector<std::string> lambdaPtBins;
std::vector<std::shared_ptr<TH1>> antilambdaPt;
static std::vector<std::string> antilambdaPtBins;
std::vector<std::shared_ptr<TH1>> kaonSplit;
std::vector<std::shared_ptr<TH1>> lambdaSplit;
std::vector<std::shared_ptr<TH1>> antilambdaSplit;
} // namespace pthistos
using namespace o2;
using namespace o2::framework;
Expand All @@ -60,6 +63,9 @@
HistogramRegistry rKaonshMassPlotsPerPtBin{"KaonshMassPlotsPerPtBin", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
HistogramRegistry rLambdaMassPlotsPerPtBin{"LambdaMassPlotsPerPtBin", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
HistogramRegistry rAntilambdaMassPlotsPerPtBin{"AntilambdaMassPlotsPerPtBin", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
HistogramRegistry rKaonshSplitMassPlotsPerPtBin{"KaonshSplitMassPlotsPerPtBin", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
HistogramRegistry rLambdaSplitMassPlotsPerPtBin{"LambdaSplitMassPlotsPerPtBin", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
HistogramRegistry rAntilambdaSplitMassPlotsPerPtBin{"AntilambdaSplitMassPlotsPerPtBin", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
HistogramRegistry rFeeddownMatrices{"FeeddownMatrices", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
HistogramRegistry rMCCorrections{"MCCorrections", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};

Expand Down Expand Up @@ -169,9 +175,12 @@

void init(InitContext const&)
{
pthistos::kaonPt.resize(nmaxHistograms); // number of Kaon Pt histograms to expect
pthistos::lambdaPt.resize(nmaxHistograms); // number of Lambda histograms to expect
pthistos::antilambdaPt.resize(nmaxHistograms); // number of Antilambda histograms to expect
pthistos::kaonPt.resize(nmaxHistograms); // number of Kaon Pt histograms to expect
pthistos::lambdaPt.resize(nmaxHistograms); // number of Lambda histograms to expect
pthistos::antilambdaPt.resize(nmaxHistograms); // number of Antilambda histograms to expect
pthistos::kaonSplit.resize(nmaxHistograms); // number of Kaon Split Pt histograms to expect
pthistos::lambdaSplit.resize(nmaxHistograms); // number of Lambda Split Pt histograms to expect
pthistos::antilambdaSplit.resize(nmaxHistograms); // number of Antilambda Split Pt histograms to expect
// tokenise strings into individual values
pthistos::kaonPtBins = o2::utils::Str::tokenize(kzeroSettingPtBinsString, ',');
pthistos::lambdaPtBins = o2::utils::Str::tokenize(lambdaSettingPtBinsString, ',');
Expand Down Expand Up @@ -202,7 +211,7 @@
std::vector<std::string> kaonhistvalue(nmaxHistograms + 1);
std::vector<std::string> lambdahistvalue(nmaxHistograms + 1);
std::vector<std::string> antilambdahistvalue(nmaxHistograms + 1);
// K0short Histogram Pt Bin Edges
// K0short Histogram Pt Bin Edges (and Split)
for (int i = 0; i < nmaxHistograms + 1; i++) { // Histos won't accept "." character so converting it to "_"
std::string kaonptbin = pthistos::kaonPtBins[i]; // getting the value of the bin edge
size_t pos = kaonptbin.find("."); // finding the "." character
Expand Down Expand Up @@ -249,6 +258,7 @@
rPtAnalysis.add("hK0shDCANegDaughter", "hK0shDCANegDaughter", {HistType::kTH1F, {{nBins, 0.0f, 2.2f}}});
for (int i = 0; i < nmaxHistograms; i++) {
pthistos::kaonPt[i] = rKaonshMassPlotsPerPtBin.add<TH1>(fmt::format("hPt_from_{0}_to_{1}", kaonhistvalue[i], kaonhistvalue[i + 1]).c_str(), fmt::format("hPt_from_{0}_to_{1}", kaonhistvalue[i], kaonhistvalue[i + 1]).c_str(), {HistType::kTH1D, {{k0ShortMassAxis}}});
pthistos::kaonSplit[i] = rKaonshSplitMassPlotsPerPtBin.add<TH1>(fmt::format("hPt_from_{0}_to_{1}", kaonhistvalue[i], kaonhistvalue[i + 1]).c_str(), fmt::format("hPt_from_{0}_to_{1}", kaonhistvalue[i], kaonhistvalue[i + 1]).c_str(), {HistType::kTH1D, {{k0ShortMassAxis}}});
}
rFeeddownMatrices.add("hK0shFeeddownMatrix", "hK0shFeeddownMatrix", {HistType::kTH2F, {{k0ShortPtAxis}, {k0ShortPtAxis}}});
rFeeddownMatrices.add("hK0shPhiFeeddownMatrix", "hK0shPhiFeeddownMatrix", {HistType::kTH2F, {{k0ShortPtAxis}, {k0ShortPtAxis}}});
Expand All @@ -268,6 +278,7 @@
rPtAnalysis.add("hLambdaDCANegDaughter", "hLambdaDCANegDaughter", {HistType::kTH1F, {{nBins, 0.0f, 2.2f}}});
for (int i = 0; i < nmaxHistograms; i++) {
pthistos::lambdaPt[i] = rLambdaMassPlotsPerPtBin.add<TH1>(fmt::format("hPt_from_{0}_to_{1}", lambdahistvalue[i], lambdahistvalue[i + 1]).c_str(), fmt::format("hPt_from_{0}_to_{1}", lambdahistvalue[i], lambdahistvalue[i + 1]).c_str(), {HistType::kTH1D, {{lambdaMassAxis}}});
pthistos::lambdaSplit[i] = rLambdaSplitMassPlotsPerPtBin.add<TH1>(fmt::format("hPt_from_{0}_to_{1}", lambdahistvalue[i], lambdahistvalue[i + 1]).c_str(), fmt::format("hPt_from_{0}_to_{1}", lambdahistvalue[i], lambdahistvalue[i + 1]).c_str(), {HistType::kTH1D, {{lambdaMassAxis}}});
}
// lambdafeeddown matrices
rFeeddownMatrices.add("hLambdaFeeddownMatrix", "hLambdaFeeddownMatrix", {HistType::kTH2F, {{lambdaPtAxis}, {lambdaPtAxis}}});
Expand All @@ -290,6 +301,7 @@
rPtAnalysis.add("hAntilambdaDCANegDaughter", "hAntilambdaDCANegDaughter", {HistType::kTH1F, {{nBins, 0.0f, 2.2f}}});
for (int i = 0; i < nmaxHistograms; i++) {
pthistos::antilambdaPt[i] = rAntilambdaMassPlotsPerPtBin.add<TH1>(fmt::format("hPt_from_{0}_to_{1}", antilambdahistvalue[i], antilambdahistvalue[i + 1]).c_str(), fmt::format("hPt_from_{0}_to_{1}", antilambdahistvalue[i], antilambdahistvalue[i + 1]).c_str(), {HistType::kTH1D, {{antiLambdaMassAxis}}});
pthistos::antilambdaSplit[i] = rAntilambdaSplitMassPlotsPerPtBin.add<TH1>(fmt::format("hPt_from_{0}_to_{1}", antilambdahistvalue[i], antilambdahistvalue[i + 1]).c_str(), fmt::format("hPt_from_{0}_to_{1}", antilambdahistvalue[i], antilambdahistvalue[i + 1]).c_str(), {HistType::kTH1D, {{antiLambdaMassAxis}}});
}
// antilambdafeeddown matrices
rFeeddownMatrices.add("hAntiLambdaFeeddownMatrix", "hAntiLambdaFeeddownMatrix", {HistType::kTH2F, {{antilambdaPtAxis}, {antilambdaPtAxis}}});
Expand All @@ -299,12 +311,7 @@
}

// Particle Level Corrections
rMCCorrections.add("hK0ShSplitDenominatorPtSpectrum", "hK0ShSplitDenominatorPtSpectrum", {HistType::kTH1D, {k0ShortPtAxis}});
rMCCorrections.add("hLambdaSplitDenominatorPtSpectrum", "hLambdaSplitDenominatorPtSpectrum", {HistType::kTH1D, {lambdaPtAxis}});
rMCCorrections.add("hAntilambdaSplitDenominatorPtSpectrum", "hAntilambdaSplitDenominatorPtSpectrum", {HistType::kTH1F, {{antilambdaPtAxis}}});
rMCCorrections.add("hK0ShSplitNumenatorPtSpectrum", "hK0ShSplitNumenatorPtSpectrum", {HistType::kTH1D, {k0ShortPtAxis}});
rMCCorrections.add("hLambdaSplitNumenatorPtSpectrum", "hLambdaSplitNumenatorPtSpectrum", {HistType::kTH1D, {lambdaPtAxis}});
rMCCorrections.add("hAntilambdaSplitNumenatorPtSpectrum", "hAntilambdaSplitNumenatorPtSpectrum", {HistType::kTH1F, {{antilambdaPtAxis}}});
rMCCorrections.add("hK0ShNoMCParticle", "hK0ShNoMCParticle", {HistType::kTH1D, {k0ShortPtAxis}});
rMCCorrections.add("hK0ShBeforeEventSelectionPtSpectrum", "hK0ShBeforeEventSelectionPtSpectrum", {HistType::kTH1D, {k0ShortPtAxis}});
rMCCorrections.add("hLambdaBeforeEventSelectionPtSpectrum", "hLambdaBeforeEventSelectionPtSpectrum", {HistType::kTH1D, {lambdaPtAxis}});
rMCCorrections.add("hAntilambdaBeforeEventSelectionPtSpectrum", "hAntilambdaBeforeEventSelectionPtSpectrum", {HistType::kTH1F, {{antilambdaPtAxis}}});
Expand Down Expand Up @@ -771,6 +778,7 @@
pthistos::kaonPtBins = o2::utils::Str::tokenize(kzeroSettingPtBinsString, ',');
pthistos::lambdaPtBins = o2::utils::Str::tokenize(lambdaSettingPtBinsString, ',');
pthistos::antilambdaPtBins = o2::utils::Str::tokenize(antilambdaSettingPtBinsString, ',');
pthistos::kaonPtBins = o2::utils::Str::tokenize(kzeroSettingPtBinsString, ',');

// initialize and convert tokenized strings into vector of doubles for Pt Bin Edges
std::vector<double> kaonptedgevalues(nmaxHistograms + 1);
Expand All @@ -789,16 +797,22 @@

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)
if (v0.has_mcParticle()) {
auto v0mcParticle = v0.mcParticle();

if (!acceptV0(v0)) { // V0 Selections
continue;
}
// kzero analysis
if (kzeroAnalysis == true) {
if (dotruthk0sh && (v0mcParticle.pdgCode() == kK0Short)) { // kzero matched
if (acceptK0sh(v0)) { // K0sh Selection
if (!acceptV0(v0)) { // V0 Selections
continue;
}
// kzero analysis
if (kzeroAnalysis == true) {
if (acceptK0sh(v0)) { // K0sh Selection
// K0sh Signal Split Numerator Start
for (int i = 0; i < nmaxHistograms; 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()); // filling the k0s namespace histograms for K0sh Splitting Numerator
}
}
// K0sh Signla Split Numerator End
if (v0.has_mcParticle()) {
auto v0mcParticle = v0.mcParticle();
if (dotruthk0sh && (v0mcParticle.pdgCode() == kK0Short)) { // kzero matched
if (v0mcParticle.isPhysicalPrimary()) {
for (int i = 0; i < nmaxHistograms; i++) {
if (kaonptedgevalues[i] <= v0.pt() && v0.pt() < kaonptedgevalues[i + 1]) { // finding v0s with pt within the range of our bin edges
Expand All @@ -819,10 +833,20 @@
}
}
}
// lambda analysis
if (lambdaAnalysis == true) {
if (dotruthLambda && (v0mcParticle.pdgCode() == kLambda0)) { // lambda matched
if (acceptLambda(v0)) { // Lambda Selections
}
// lambda analysis
if (lambdaAnalysis == true) {
if (acceptLambda(v0)) { // Lambda Selections
// Lambda Signal Split Numerator Start
for (int i = 0; i < nmaxHistograms; i++) {
if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) {
pthistos::lambdaSplit[i]->Fill(v0.mLambda());
}
}
// Lambda Signal Split Numerator End
if (v0.has_mcParticle()) {
auto v0mcParticle = v0.mcParticle();
if (dotruthLambda && (v0mcParticle.pdgCode() == kLambda0)) { // lambda matched
if (v0mcParticle.isPhysicalPrimary()) {
for (int i = 0; i < nmaxHistograms; i++) {
if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) {
Expand All @@ -849,10 +873,20 @@
}
}
}
// antilambda analysis
if (antiLambdaAnalysis == true) {
if (dotruthAntilambda && (v0mcParticle.pdgCode() == kLambda0Bar)) { // antilambda matched
if (acceptAntilambda(v0)) { // Antilambda Selections
}
// antilambda analysis
if (antiLambdaAnalysis == true) {
if (acceptAntilambda(v0)) { // Antilambda Selections
// Antilambda Signal Split Numerator End
for (int i = 0; i < nmaxHistograms; i++) {
if (antilambdaPtedgevalues[i] <= v0.pt() && v0.pt() < antilambdaPtedgevalues[i + 1]) {
pthistos::antilambdaSplit[i]->Fill(v0.mAntiLambda());
}
}
// Antilambda Signal Split Numerator End
if (v0.has_mcParticle()) {
auto v0mcParticle = v0.mcParticle();
if (dotruthAntilambda && (v0mcParticle.pdgCode() == kLambda0Bar)) { // antilambda matched
if (v0mcParticle.isPhysicalPrimary()) {
for (int i = 0; i < nmaxHistograms; i++) {
if (antilambdaPtedgevalues[i] <= v0.pt() && v0.pt() < antilambdaPtedgevalues[i + 1]) {
Expand Down Expand Up @@ -904,7 +938,7 @@
if (!acceptEvent(collision)) { // Event Selection
return;
}
rPtAnalysis.fill(HIST("hNRecEvents_Data"), 1.0); // Number of Reconstructed Events
rPtAnalysis.fill(HIST("hNRecEvents_Data"), 0.5); // Number of Reconstructed 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
Loading