Skip to content

Commit 0e51526

Browse files
author
nkaratze
committed
Added centrality to events
1 parent 408d74a commit 0e51526

File tree

1 file changed

+100
-110
lines changed

1 file changed

+100
-110
lines changed

PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx

Lines changed: 100 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ struct V0PtInvMassPlots {
246246

247247
// General Plots
248248
rPtAnalysis.add("hNEvents", "hNEvents", {HistType::kTH1D, {{7, 0.f, 7.f}}});
249-
rPtAnalysis.add("hNRecEvents_Data", "hNRecEvents_Data", {HistType::kTH1D, {{1, 0.f, 1.f}}});
250249
rPtAnalysis.add("hNV0s", "hNV0s", {HistType::kTH1D, {{10, 0.f, 10.f}}});
251250
rPtAnalysis.add("hNK0sh", "hNK0sh", {HistType::kTH1D, {{11, 0.f, 11.f}}});
252251
rPtAnalysis.add("hNLambda", "hNLambda", {HistType::kTH1D, {{11, 0.f, 11.f}}});
@@ -330,8 +329,8 @@ struct V0PtInvMassPlots {
330329
rMCCorrections.add("hAntilambdaAfterEventSelectionPtSpectrum", "hAntilambdaAfterEventSelectionPtSpectrum", {HistType::kTH2D, {antilambdaPtAxis, centAxis}});
331330

332331
// Event and V0s Corrections
333-
rMCCorrections.add("hNEvents_Corrections", "hNEvents_Corrections", {HistType::kTH1D, {{10, 0.f, 10.f}}});
334-
rMCCorrections.add("hNRecEvents_MC", "hNRecEvents_MC", {HistType::kTH1D, {{1, 0.f, 1.f}}});
332+
rMCCorrections.add("hNEvents_Corrections", "hNEvents_Corrections", {HistType::kTH2D, {{10, 0.f, 10.f}, centAxis}});
333+
rMCCorrections.add("hNRecEvents", "hNRecEvents", {HistType::kTH2D, {{1, 0.f, 1.f}, centAxis}});
335334

336335
// Generated Level Pt Spectrums (with rapidity cut)
337336
rMCCorrections.add("GenParticleRapidity", "GenParticleRapidity", {HistType::kTH1F, {{nBins, -10.0f, 10.0f}}});
@@ -684,13 +683,14 @@ struct V0PtInvMassPlots {
684683
aod::McParticles const& mcParticles)
685684
{
686685
// Event Efficiency, Event Split and V0 Signal Loss Corrections
687-
rMCCorrections.fill(HIST("hNEvents_Corrections"), 0.5); // Event Efficiency Denominator
686+
rMCCorrections.fill(HIST("hNEvents_Corrections"), 0.5, mcCollision.centFT0M()); // All Events
688687
if (std::abs(mcCollision.posZ()) > cutZVertex) {
689688
return;
690689
}
691690
if (!pwglf::isINELgtNmc(mcParticles, 0, pdgDB)) {
692691
return;
693692
}
693+
rMCCorrections.fill(HIST("hNEvents_Corrections"), 1.5, mcCollision.centFT0M()); // Event Efficiency Denominator
694694
// Particles (of interest) Generated Pt Spectrum and Signal Loss Denominator Loop
695695
for (const auto& mcParticle : mcParticles) {
696696
if (std::abs(mcParticle.y()) < rapidityCut) {
@@ -741,11 +741,11 @@ struct V0PtInvMassPlots {
741741
}
742742
// Signal Loss Numenator Loop
743743
for (const auto& collision : collisions) {
744-
rMCCorrections.fill(HIST("hNEvents_Corrections"), 1.5); // Number of Events Reconsctructed
745-
if (!acceptEvent(collision)) { // Event Selection
744+
rMCCorrections.fill(HIST("hNEvents_Corrections"), 2.5, mcCollision.centFT0M()); // Number of Events Reconsctructed
745+
if (!acceptEvent(collision)) { // Event Selection
746746
return;
747747
}
748-
rMCCorrections.fill(HIST("hNEvents_Corrections"), 2.5); // Event Split Denomimator and Event Efficiency Numenator
748+
rMCCorrections.fill(HIST("hNEvents_Corrections"), 3.5, mcCollision.centFT0M()); // Event Split Denomimator and Event Efficiency Numenator
749749
for (const auto& mcParticle : mcParticles) {
750750
if (!mcParticle.isPhysicalPrimary()) {
751751
continue;
@@ -804,128 +804,119 @@ struct V0PtInvMassPlots {
804804
if (!acceptEvent(collision)) { // Event Selection
805805
return;
806806
}
807-
rMCCorrections.fill(HIST("hNRecEvents_MC"), 0.5); // Event Split Numenator
808-
809-
// if (collision.has_mcCollision())
810-
{
811-
812-
// const auto& mcCollision = collision.mcCollision_as<soa::Join<aod::McCollisions, aod::McCentFT0Ms>>();
813-
814-
// std::cout<<"Measured: "<<collision.centFT0M()<<" Generated: "<<mcCollision.centFT0M()<<std::endl;
815-
816-
for (const auto& v0 : V0s) {
817-
// 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)
818-
if (!acceptV0(v0)) { // V0 Selections
819-
continue;
820-
}
821-
// kzero analysis
822-
if (kzeroAnalysis == true) {
823-
if (acceptK0sh(v0)) { // K0sh Selection
824-
// K0sh Signal Split Numerator Start
825-
for (int i = 0; i < nKaonHistograms; i++) {
826-
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
827-
pthistos::kaonSplit[i]->Fill(v0.mK0Short(), collision.centFT0M()); // filling the k0s namespace histograms for K0sh Splitting Numerator
828-
}
807+
rMCCorrections.fill(HIST("hNRecEvents"), 0.5, collision.centFT0M()); // Event Split Numenator
808+
for (const auto& v0 : V0s) {
809+
// 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)
810+
if (!acceptV0(v0)) { // V0 Selections
811+
continue;
812+
}
813+
// kzero analysis
814+
if (kzeroAnalysis == true) {
815+
if (acceptK0sh(v0)) { // K0sh Selection
816+
// K0sh Signal Split Numerator Start
817+
for (int i = 0; i < nKaonHistograms; i++) {
818+
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
819+
pthistos::kaonSplit[i]->Fill(v0.mK0Short(), collision.centFT0M()); // filling the k0s namespace histograms for K0sh Splitting Numerator
829820
}
830-
// K0sh Signla Split Numerator End
831-
if (v0.has_mcParticle()) {
832-
auto v0mcParticle = v0.mcParticle();
833-
if (dotruthk0sh && (v0mcParticle.pdgCode() == kK0Short)) { // kzero matched
834-
if (v0mcParticle.isPhysicalPrimary()) {
835-
for (int i = 0; i < nKaonHistograms; i++) {
836-
if (kaonptedgevalues[i] <= v0.pt() && v0.pt() < kaonptedgevalues[i + 1]) { // finding v0s with pt within the range of our bin edges
837-
pthistos::kaonPt[i]->Fill(v0.mK0Short(), collision.centFT0M()); // filling the k0s namespace histograms
838-
}
821+
}
822+
// K0sh Signla Split Numerator End
823+
if (v0.has_mcParticle()) {
824+
auto v0mcParticle = v0.mcParticle();
825+
if (dotruthk0sh && (v0mcParticle.pdgCode() == kK0Short)) { // kzero matched
826+
if (v0mcParticle.isPhysicalPrimary()) {
827+
for (int i = 0; i < nKaonHistograms; i++) {
828+
if (kaonptedgevalues[i] <= v0.pt() && v0.pt() < kaonptedgevalues[i + 1]) { // finding v0s with pt within the range of our bin edges
829+
pthistos::kaonPt[i]->Fill(v0.mK0Short(), collision.centFT0M()); // filling the k0s namespace histograms
839830
}
840831
}
841-
if (!v0mcParticle.isPhysicalPrimary()) {
842-
auto v0mothers = v0mcParticle.mothers_as<aod::McParticles>(); // Get mothers
843-
if (!v0mothers.empty()) {
844-
auto& v0mcParticleMother = v0mothers.front(); // First mother
845-
rFeeddownMatrices.fill(HIST("hK0shFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
846-
if (v0mcParticleMother.pdgCode() == kPhi) { // Phi Mother Matched
847-
rFeeddownMatrices.fill(HIST("hK0shPhiFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
848-
}
832+
}
833+
if (!v0mcParticle.isPhysicalPrimary()) {
834+
auto v0mothers = v0mcParticle.mothers_as<aod::McParticles>(); // Get mothers
835+
if (!v0mothers.empty()) {
836+
auto& v0mcParticleMother = v0mothers.front(); // First mother
837+
rFeeddownMatrices.fill(HIST("hK0shFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
838+
if (v0mcParticleMother.pdgCode() == kPhi) { // Phi Mother Matched
839+
rFeeddownMatrices.fill(HIST("hK0shPhiFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
849840
}
850841
}
851842
}
852843
}
853844
}
854845
}
855-
// lambda analysis
856-
if (lambdaAnalysis == true) {
857-
if (acceptLambda(v0)) { // Lambda Selections
858-
// Lambda Signal Split Numerator Start
859-
for (int i = 0; i < nLambdaHistograms; i++) {
860-
if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) {
861-
pthistos::lambdaSplit[i]->Fill(v0.mLambda(), collision.centFT0M());
862-
}
846+
}
847+
// lambda analysis
848+
if (lambdaAnalysis == true) {
849+
if (acceptLambda(v0)) { // Lambda Selections
850+
// Lambda Signal Split Numerator Start
851+
for (int i = 0; i < nLambdaHistograms; i++) {
852+
if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) {
853+
pthistos::lambdaSplit[i]->Fill(v0.mLambda(), collision.centFT0M());
863854
}
864-
// Lambda Signal Split Numerator End
865-
if (v0.has_mcParticle()) {
866-
auto v0mcParticle = v0.mcParticle();
867-
if (dotruthLambda && (v0mcParticle.pdgCode() == kLambda0)) { // lambda matched
868-
if (v0mcParticle.isPhysicalPrimary()) {
869-
for (int i = 0; i < nLambdaHistograms; i++) {
870-
if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) {
871-
pthistos::lambdaPt[i]->Fill(v0.mLambda(), collision.centFT0M());
872-
}
855+
}
856+
// Lambda Signal Split Numerator End
857+
if (v0.has_mcParticle()) {
858+
auto v0mcParticle = v0.mcParticle();
859+
if (dotruthLambda && (v0mcParticle.pdgCode() == kLambda0)) { // lambda matched
860+
if (v0mcParticle.isPhysicalPrimary()) {
861+
for (int i = 0; i < nLambdaHistograms; i++) {
862+
if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) {
863+
pthistos::lambdaPt[i]->Fill(v0.mLambda(), collision.centFT0M());
873864
}
874865
}
875-
if (!v0mcParticle.isPhysicalPrimary()) {
876-
auto v0mothers = v0mcParticle.mothers_as<aod::McParticles>(); // Get mothers
877-
if (!v0mothers.empty()) {
878-
auto& v0mcParticleMother = v0mothers.front(); // First mother
879-
rFeeddownMatrices.fill(HIST("hLambdaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
880-
if (v0mcParticleMother.pdgCode() == kXiMinus) { // Xi Minus Mother Matched
881-
rFeeddownMatrices.fill(HIST("hLambdaXiMinusFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
882-
}
883-
if (v0mcParticleMother.pdgCode() == kXi0) { // Xi Zero Mother Matched
884-
rFeeddownMatrices.fill(HIST("hLambdaXiZeroFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
885-
}
886-
if (v0mcParticleMother.pdgCode() == kOmegaMinus) { // Omega Mother Matched
887-
rFeeddownMatrices.fill(HIST("hLambdaOmegaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
888-
}
866+
}
867+
if (!v0mcParticle.isPhysicalPrimary()) {
868+
auto v0mothers = v0mcParticle.mothers_as<aod::McParticles>(); // Get mothers
869+
if (!v0mothers.empty()) {
870+
auto& v0mcParticleMother = v0mothers.front(); // First mother
871+
rFeeddownMatrices.fill(HIST("hLambdaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
872+
if (v0mcParticleMother.pdgCode() == kXiMinus) { // Xi Minus Mother Matched
873+
rFeeddownMatrices.fill(HIST("hLambdaXiMinusFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
874+
}
875+
if (v0mcParticleMother.pdgCode() == kXi0) { // Xi Zero Mother Matched
876+
rFeeddownMatrices.fill(HIST("hLambdaXiZeroFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
877+
}
878+
if (v0mcParticleMother.pdgCode() == kOmegaMinus) { // Omega Mother Matched
879+
rFeeddownMatrices.fill(HIST("hLambdaOmegaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
889880
}
890881
}
891882
}
892883
}
893884
}
894885
}
895-
// antilambda analysis
896-
if (antiLambdaAnalysis == true) {
897-
if (acceptAntilambda(v0)) { // Antilambda Selections
898-
// Antilambda Signal Split Numerator End
899-
for (int i = 0; i < nAntilambdaHistograms; i++) {
900-
if (antilambdaPtedgevalues[i] <= v0.pt() && v0.pt() < antilambdaPtedgevalues[i + 1]) {
901-
pthistos::antilambdaSplit[i]->Fill(v0.mAntiLambda(), collision.centFT0M());
902-
}
886+
}
887+
// antilambda analysis
888+
if (antiLambdaAnalysis == true) {
889+
if (acceptAntilambda(v0)) { // Antilambda Selections
890+
// Antilambda Signal Split Numerator End
891+
for (int i = 0; i < nAntilambdaHistograms; i++) {
892+
if (antilambdaPtedgevalues[i] <= v0.pt() && v0.pt() < antilambdaPtedgevalues[i + 1]) {
893+
pthistos::antilambdaSplit[i]->Fill(v0.mAntiLambda(), collision.centFT0M());
903894
}
904-
// Antilambda Signal Split Numerator End
905-
if (v0.has_mcParticle()) {
906-
auto v0mcParticle = v0.mcParticle();
907-
if (dotruthAntilambda && (v0mcParticle.pdgCode() == kLambda0Bar)) { // antilambda matched
908-
if (v0mcParticle.isPhysicalPrimary()) {
909-
for (int i = 0; i < nAntilambdaHistograms; i++) {
910-
if (antilambdaPtedgevalues[i] <= v0.pt() && v0.pt() < antilambdaPtedgevalues[i + 1]) {
911-
pthistos::antilambdaPt[i]->Fill(v0.mAntiLambda(), collision.centFT0M());
912-
}
895+
}
896+
// Antilambda Signal Split Numerator End
897+
if (v0.has_mcParticle()) {
898+
auto v0mcParticle = v0.mcParticle();
899+
if (dotruthAntilambda && (v0mcParticle.pdgCode() == kLambda0Bar)) { // antilambda matched
900+
if (v0mcParticle.isPhysicalPrimary()) {
901+
for (int i = 0; i < nAntilambdaHistograms; i++) {
902+
if (antilambdaPtedgevalues[i] <= v0.pt() && v0.pt() < antilambdaPtedgevalues[i + 1]) {
903+
pthistos::antilambdaPt[i]->Fill(v0.mAntiLambda(), collision.centFT0M());
913904
}
914905
}
915-
if (!v0mcParticle.isPhysicalPrimary()) {
916-
auto v0mothers = v0mcParticle.mothers_as<aod::McParticles>(); // Get mothers
917-
if (!v0mothers.empty()) {
918-
auto& v0mcParticleMother = v0mothers.front(); // First mother
919-
rFeeddownMatrices.fill(HIST("hAntiLambdaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
920-
if (v0mcParticleMother.pdgCode() == kXiPlusBar) { // Xi Plus Mother Matched
921-
rFeeddownMatrices.fill(HIST("hAntiLambdaXiPlusFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
922-
}
923-
if (v0mcParticleMother.pdgCode() == -kXi0) { // Anti-Xi Zero Mother Matched
924-
rFeeddownMatrices.fill(HIST("hAntiLambdaAntiXiZeroFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
925-
}
926-
if (v0mcParticleMother.pdgCode() == kOmegaPlusBar) { // Anti-Omega (minus) Mother Matched
927-
rFeeddownMatrices.fill(HIST("hAntiLambdaAntiOmegaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
928-
}
906+
}
907+
if (!v0mcParticle.isPhysicalPrimary()) {
908+
auto v0mothers = v0mcParticle.mothers_as<aod::McParticles>(); // Get mothers
909+
if (!v0mothers.empty()) {
910+
auto& v0mcParticleMother = v0mothers.front(); // First mother
911+
rFeeddownMatrices.fill(HIST("hAntiLambdaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
912+
if (v0mcParticleMother.pdgCode() == kXiPlusBar) { // Xi Plus Mother Matched
913+
rFeeddownMatrices.fill(HIST("hAntiLambdaXiPlusFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
914+
}
915+
if (v0mcParticleMother.pdgCode() == -kXi0) { // Anti-Xi Zero Mother Matched
916+
rFeeddownMatrices.fill(HIST("hAntiLambdaAntiXiZeroFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
917+
}
918+
if (v0mcParticleMother.pdgCode() == kOmegaPlusBar) { // Anti-Omega (minus) Mother Matched
919+
rFeeddownMatrices.fill(HIST("hAntiLambdaAntiOmegaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt(), collision.centFT0M());
929920
}
930921
}
931922
}
@@ -969,8 +960,7 @@ struct V0PtInvMassPlots {
969960
if (!acceptEvent(collision)) { // Event Selection
970961
return;
971962
}
972-
rPtAnalysis.fill(HIST("hNRecEvents_Data"), 0.5); // Number of Reconstructed Events
973-
963+
rMCCorrections.fill(HIST("hNRecEvents"), 0.5, collision.centFT0M()); // Number of recorded events
974964
for (const auto& v0 : V0s) {
975965
// 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)
976966
if (!acceptV0(v0)) { // V0 Selection

0 commit comments

Comments
 (0)