Skip to content

Commit 4b44436

Browse files
author
nkaratze
committed
Bug Corrections
1 parent 74c7078 commit 4b44436

File tree

1 file changed

+52
-86
lines changed

1 file changed

+52
-86
lines changed

PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx

Lines changed: 52 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ struct V0PtInvMassPlots {
225225
rPtAnalysis.add("hNEvents", "hNEvents", {HistType::kTH1D, {{10, 0.f, 10.f}}});
226226
rPtAnalysis.add("hNRecEvents_Data", "hNRecEvents_Data", {HistType::kTH1D, {{1, 0.f, 1.f}}});
227227
rPtAnalysis.add("hNV0s", "hNV0s", {HistType::kTH1D, {{10, 0.f, 10.f}}});
228-
rPtAnalysis.add("hNK0sh", "hNK0sh", {HistType::kTH1D, {{10, 0.f, 10.f}}});
228+
rPtAnalysis.add("hNK0sh", "hNK0sh", {HistType::kTH1D, {{15, 0.f, 15.f}}});
229229
rPtAnalysis.add("hNLambda", "hNLambda", {HistType::kTH1D, {{10, 0.f, 10.f}}});
230230
rPtAnalysis.add("hNAntilambda", "hNAntilambda", {HistType::kTH1D, {{10, 0.f, 10.f}}});
231231

@@ -303,9 +303,6 @@ struct V0PtInvMassPlots {
303303
rMCCorrections.add("hK0ShSplitNumenatorPtSpectrum", "hK0ShSplitNumenatorPtSpectrum", {HistType::kTH1D, {k0ShortPtAxis}});
304304
rMCCorrections.add("hLambdaSplitNumenatorPtSpectrum", "hLambdaSplitNumenatorPtSpectrum", {HistType::kTH1D, {lambdaPtAxis}});
305305
rMCCorrections.add("hAntilambdaSplitNumenatorPtSpectrum", "hAntilambdaSplitNumenatorPtSpectrum", {HistType::kTH1F, {{antilambdaPtAxis}}});
306-
rMCCorrections.add("hK0ShBeforeEventSelectionPtSpectrum", "hK0ShBeforeEventSelectionPtSpectrum", {HistType::kTH1D, {k0ShortPtAxis}});
307-
rMCCorrections.add("hLambdaBeforeEventSelectionPtSpectrum", "hLambdaBeforeEventSelectionPtSpectrum", {HistType::kTH1D, {lambdaPtAxis}});
308-
rMCCorrections.add("hAntilambdaBeforeEventSelectionPtSpectrum", "hAntilambdaBeforeEventSelectionPtSpectrum", {HistType::kTH1F, {{antilambdaPtAxis}}});
309306
rMCCorrections.add("hK0ShAfterEventSelectionPtSpectrum", "hK0ShAfterEventSelectionPtSpectrum", {HistType::kTH1D, {k0ShortPtAxis}});
310307
rMCCorrections.add("hLambdaAfterEventSelectionPtSpectrum", "hLambdaAfterEventSelectionPtSpectrum", {HistType::kTH1D, {lambdaPtAxis}});
311308
rMCCorrections.add("hAntilambdaAfterEventSelectionPtSpectrum", "hAntilambdaAfterEventSelectionPtSpectrum", {HistType::kTH1F, {{antilambdaPtAxis}}});
@@ -392,29 +389,29 @@ struct V0PtInvMassPlots {
392389
const auto& posDaughterTrack = v0.template posTrack_as<DaughterTracks>(); // Positive Daughter track
393390
const auto& negDaughterTrack = v0.template negTrack_as<DaughterTracks>(); // Negative Daughter track
394391

395-
rPtAnalysis.fill(HIST("hNV0s"), 0.5);
396-
rPtAnalysis.get<TH1>(HIST("hNV0s"))->GetXaxis()->SetBinLabel(1, "All V0s");
397-
if (std::abs(v0.y()) > rapidityCut && doRapidityCut) { // V0 Rapidity Cut
392+
rPtAnalysis.fill(HIST("hNV0s"), 2.5);
393+
rPtAnalysis.get<TH1>(HIST("hNV0s"))->GetXaxis()->SetBinLabel(3, "All V0s");
394+
if ((std::abs(v0.rapidity(0)) > rapidityCut) && doRapidityCut) { // V0 Rapidity Cut
398395
return false;
399396
}
400-
rPtAnalysis.fill(HIST("hNV0s"), 1.5);
401-
rPtAnalysis.get<TH1>(HIST("hNV0s"))->GetXaxis()->SetBinLabel(2, "Rapidity");
402-
if ((std::abs(posDaughterTrack.eta()) > etadau && std::abs(negDaughterTrack.eta()) > etadau) && doDaughterPseudorapidityCut) { // Daughters Pseudorapidity Cut
397+
rPtAnalysis.fill(HIST("hNV0s"), 3.5);
398+
rPtAnalysis.get<TH1>(HIST("hNV0s"))->GetXaxis()->SetBinLabel(4, "Rapidity");
399+
if ((std::abs(posDaughterTrack.eta()) > etadau || std::abs(negDaughterTrack.eta()) > etadau) && doDaughterPseudorapidityCut) { // Daughters Pseudorapidity Cut
403400
return false;
404401
}
405-
rPtAnalysis.fill(HIST("hNV0s"), 2.5);
406-
rPtAnalysis.get<TH1>(HIST("hNV0s"))->GetXaxis()->SetBinLabel(3, "Dau Pseudorapidity");
402+
rPtAnalysis.fill(HIST("hNV0s"), 4.5);
403+
rPtAnalysis.get<TH1>(HIST("hNV0s"))->GetXaxis()->SetBinLabel(5, "Dau Pseudorapidity");
407404
if ((posDaughterTrack.isITSAfterburner() || negDaughterTrack.isITSAfterburner()) && !doisITSAfterburner) { // ITS After Burner on daughter tracks
408405
return false;
409406
}
410-
rPtAnalysis.fill(HIST("hNV0s"), 3.5);
411-
rPtAnalysis.get<TH1>(HIST("hNV0s"))->GetXaxis()->SetBinLabel(4, "ITS Afterburner");
412-
if (posDaughterTrack.itsNCls() <= itsMinHits && negDaughterTrack.itsNCls() <= itsMinHits && doitsMinHits) { // Minimum hits in the ITS
407+
rPtAnalysis.fill(HIST("hNV0s"), 5.5);
408+
rPtAnalysis.get<TH1>(HIST("hNV0s"))->GetXaxis()->SetBinLabel(6, "ITS Afterburner");
409+
if ((posDaughterTrack.itsNCls() <= itsMinHits || negDaughterTrack.itsNCls() <= itsMinHits) && doitsMinHits) { // Minimum hits in the ITS
413410
return false;
414-
rPtAnalysis.fill(HIST("hNV0s"), 4.5);
415-
rPtAnalysis.get<TH1>(HIST("hNV0s"))->GetXaxis()->SetBinLabel(5, "ITS Min Hits");
411+
rPtAnalysis.fill(HIST("hNV0s"), 6.5);
412+
rPtAnalysis.get<TH1>(HIST("hNV0s"))->GetXaxis()->SetBinLabel(7, "ITS Min Hits");
416413
// Cut Plots
417-
rPtAnalysis.fill(HIST("V0Rapidity"), v0.y());
414+
rPtAnalysis.fill(HIST("V0Rapidity"), v0.rapidity(0));
418415
rPtAnalysis.fill(HIST("hV0EtaDaughters"), v0.template posTrack_as<DaughterTracks>().eta());
419416
rPtAnalysis.fill(HIST("hV0EtaDaughters"), v0.template negTrack_as<DaughterTracks>().eta());
420417
}
@@ -428,62 +425,62 @@ struct V0PtInvMassPlots {
428425
const auto& posDaughterTrack = v0.template posTrack_as<DaughterTracks>(); // Positive Daughter track
429426
const auto& negDaughterTrack = v0.template negTrack_as<DaughterTracks>(); // Negative Daughter track
430427

431-
rPtAnalysis.fill(HIST("hNK0sh"), 0.5);
432-
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(1, "All");
428+
rPtAnalysis.fill(HIST("hNK0sh"), 1.5);
429+
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(2, "All");
433430
rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 0.5, v0.mK0Short());
434431
if ((std::abs(posDaughterTrack.tpcNSigmaPi()) > nSigmaTPCPion && std::abs(negDaughterTrack.tpcNSigmaPi()) > nSigmaTPCPion) && doK0shTPCPID) { // TPC PID for two pions
435432
return false;
436433
}
437-
rPtAnalysis.fill(HIST("hNK0sh"), 1.5);
438-
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(2, "TPC_PID");
434+
rPtAnalysis.fill(HIST("hNK0sh"), 2.5);
435+
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(3, "TPC_PID");
439436
rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 1.5, v0.mK0Short());
440437
if (std::abs(v0.mLambda() - o2::constants::physics::MassLambda0) < compv0masscut && std::abs(v0.mAntiLambda() - o2::constants::physics::MassLambda0) < compv0masscut && doK0shcomptmasscut) { // Kzero competitive v0 mass cut (cut out Lambdas and Anti-Lambdas)
441438
return false;
442439
}
443-
rPtAnalysis.fill(HIST("hNK0sh"), 2.5);
444-
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(3, "Compt_Mass");
440+
rPtAnalysis.fill(HIST("hNK0sh"), 3.5);
441+
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(4, "Compt_Mass");
445442
rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 2.5, v0.mK0Short());
446443
if (v0.v0radius() > kaonshmaxct && doK0shMaxct) { // K0sh max ct
447444
return false;
448445
}
449-
rPtAnalysis.fill(HIST("hNK0sh"), 3.5);
450-
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(4, "Max_ct");
446+
rPtAnalysis.fill(HIST("hNK0sh"), 4.5);
447+
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(5, "Max_ct");
451448
rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 3.5, v0.mK0Short());
452449
if (v0.qtarm() < (k0shparamArmenterosCut * std::abs(v0.alpha())) && doK0shArmenterosCut) { // K0sh Armenteros Cut
453450
return false;
454451
}
455-
rPtAnalysis.fill(HIST("hNK0sh"), 4.5);
456-
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(5, "Armenteros");
452+
rPtAnalysis.fill(HIST("hNK0sh"), 5.5);
453+
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(6, "Armenteros");
457454
rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 4.5, v0.mK0Short());
458455
if (v0.v0cosPA() < kaonshSettingcosPA && doK0shcosPACut) { // K0sh cosPA Topological Cut
459456
return false;
460457
}
461-
rPtAnalysis.fill(HIST("hNK0sh"), 5.5);
462-
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(6, "cosPA");
458+
rPtAnalysis.fill(HIST("hNK0sh"), 6.5);
459+
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(7, "cosPA");
463460
rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 5.5, v0.mK0Short());
464461
if (v0.dcaV0daughters() > kaonshSettingdcav0dau && doK0shDCAdauCut) { // K0sh DCAdaughters Topological Cut
465462
return false;
466463
}
467-
rPtAnalysis.fill(HIST("hNK0sh"), 6.5);
468-
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(7, "DCAdau");
464+
rPtAnalysis.fill(HIST("hNK0sh"), 7.5);
465+
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(8, "DCAdau");
469466
rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 6.5, v0.mK0Short());
470467
if (v0.v0radius() < kaonshSettingradius && doK0shv0radiusCut) { // K0sh v0radius Topological Cut
471468
return false;
472469
}
473-
rPtAnalysis.fill(HIST("hNK0sh"), 7.5);
474-
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(8, "v0radius");
470+
rPtAnalysis.fill(HIST("hNK0sh"), 8.5);
471+
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(9, "v0radius");
475472
rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 7.5, v0.mK0Short());
476473
if (std::abs(v0.dcapostopv()) < kaonshSettingdcapostopv && doK0shdcaposdautopv) { // K0sh DCAPosDaughterToPV Topological Cut
477474
return false;
478475
}
479-
rPtAnalysis.fill(HIST("hNK0sh"), 8.5);
480-
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(9, "DCAPosDautoPV");
476+
rPtAnalysis.fill(HIST("hNK0sh"), 9.5);
477+
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(10, "DCAPosDautoPV");
481478
rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 8.5, v0.mK0Short());
482479
if (std::abs(v0.dcanegtopv()) < kaonshSettingdcanegtopv && doK0shdcanegdautopv) { // K0sh DCANegDaughterToPV Topological Cut
483480
return false;
484481
}
485-
rPtAnalysis.fill(HIST("hNK0sh"), 9.5);
486-
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(10, "DCANegDautoPV");
482+
rPtAnalysis.fill(HIST("hNK0sh"), 10.5);
483+
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(11, "DCANegDautoPV");
487484
rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 9.5, v0.mK0Short());
488485

489486
// Cut Plots
@@ -745,7 +742,7 @@ struct V0PtInvMassPlots {
745742
void recMCProcess(soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels, aod::PVMults>::iterator const& collision,
746743
soa::Join<aod::V0Datas, aod::McV0Labels> const& V0s,
747744
DaughterTracks const&, // no need to define a variable for tracks, if we don't access them directly
748-
aod::McParticles const& mcParticles)
745+
aod::McParticles const& /*mcParticles*/)
749746
{
750747
// tokenise strings into individual values
751748
pthistos::kaonPtBins = o2::utils::Str::tokenize(kzeroSettingPtBinsString, ',');
@@ -767,58 +764,31 @@ struct V0PtInvMassPlots {
767764
}
768765
rMCCorrections.fill(HIST("hNRecEvents_MC"), 0.5); // Event Split Numenator
769766

770-
// v0 Signal Splitting Numenator Start
771-
for (const auto& mcParticle : mcParticles) {
772-
if (mcParticle.isPhysicalPrimary()) {
773-
if (std::abs(mcParticle.y()) < rapidityCut) {
774-
if (mcParticle.pdgCode() == kK0Short) { // kzero matched
775-
rMCCorrections.fill(HIST("hK0ShSplitNumenatorPtSpectrum"), mcParticle.pt());
776-
}
777-
if (mcParticle.pdgCode() == kLambda0) { // lambda matched
778-
rMCCorrections.fill(HIST("hLambdaSplitNumenatorPtSpectrum"), mcParticle.pt());
779-
}
780-
if (mcParticle.pdgCode() == kLambda0Bar) { // antilambda matched
781-
rMCCorrections.fill(HIST("hAntilambdaSplitNumenatorPtSpectrum"), mcParticle.pt());
782-
}
783-
}
784-
}
785-
}
786-
// V0 Signal Splitting Numenator End
787-
788767
for (const auto& v0 : V0s) {
789-
// 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)
768+
rPtAnalysis.fill(HIST("hNV0s"), 0.5);
769+
rPtAnalysis.get<TH1>(HIST("hNV0s"))->GetXaxis()->SetBinLabel(1, "All_MCs");
790770
if (v0.has_mcParticle()) {
791771
auto v0mcParticle = v0.mcParticle();
792-
793-
// signal splitting demoninator
794-
if (v0mcParticle.isPhysicalPrimary()) {
795-
if (v0mcParticle.pdgCode() == kK0Short) { // kzero matched
796-
rMCCorrections.fill(HIST("hK0ShSplitDenominatorPtSpectrum"), v0mcParticle.pt());
797-
}
798-
if (v0mcParticle.pdgCode() == kLambda0) { // lambda matched
799-
rMCCorrections.fill(HIST("hLambdaSplitDenominatorPtSpectrum"), v0mcParticle.pt());
800-
}
801-
if (v0mcParticle.pdgCode() == kLambda0Bar) { // antilambda matched
802-
rMCCorrections.fill(HIST("hAntilambdaSplitDenominatorPtSpectrum"), v0mcParticle.pt());
803-
}
804-
}
805-
// signal splitting demoninator end
806-
807-
if (!acceptV0(v0)) { // V0 Selections
772+
rPtAnalysis.fill(HIST("hNV0s"), 1.5);
773+
rPtAnalysis.get<TH1>(HIST("hNV0s"))->GetXaxis()->SetBinLabel(2, "has_mcparticle");
774+
if (!acceptV0(v0)) { // V0 Selections on generated particle attributes
808775
continue;
809776
}
810777
rPtAnalysis.fill(HIST("hArmenterosPodolanskiPlot"), v0.alpha(), v0.qtarm());
811778
// kzero analysis
812779
if (kzeroAnalysis == true) {
813780
if (v0mcParticle.pdgCode() == kK0Short) { // kzero matched
814-
if (!acceptK0sh(v0)) { // K0sh Selection
781+
rPtAnalysis.fill(HIST("hNK0sh"), 0.5);
782+
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(1, "Matched");
783+
if (!acceptK0sh(v0)) { // K0sh Selection
815784
continue;
816785
}
817-
818786
if (v0mcParticle.isPhysicalPrimary()) {
787+
rPtAnalysis.fill(HIST("hNK0sh"), 11.5);
788+
rPtAnalysis.get<TH1>(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(12, "PhysicalPrimary");
819789
for (int i = 0; i < nmaxHistograms; i++) {
820-
if (kaonptedgevalues[i] <= v0.pt() && v0.pt() < kaonptedgevalues[i + 1]) { // finding v0s with pt within the range of our bin edges
821-
pthistos::kaonPt[i]->Fill(v0.mK0Short()); // filling the k0s namespace histograms
790+
if (kaonptedgevalues[i] <= v0mcParticle.pt() && v0mcParticle.pt() < kaonptedgevalues[i + 1]) { // finding v0s with pt within the range of our bin edges
791+
pthistos::kaonPt[i]->Fill(v0.mK0Short()); // filling the k0s namespace histograms
822792
}
823793
}
824794
}
@@ -837,14 +807,12 @@ struct V0PtInvMassPlots {
837807
// lambda analysis
838808
if (lambdaAnalysis == true) {
839809
if (v0mcParticle.pdgCode() == kLambda0) { // lambda matched
840-
841-
if (!acceptLambda(v0)) { // Lambda Selections
810+
if (!acceptLambda(v0)) { // Lambda Selections
842811
continue;
843812
}
844-
845813
if (v0mcParticle.isPhysicalPrimary()) {
846814
for (int i = 0; i < nmaxHistograms; i++) {
847-
if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) {
815+
if (lambdaptedgevalues[i] <= v0mcParticle.pt() && v0mcParticle.pt() < lambdaptedgevalues[i + 1]) {
848816
pthistos::lambdaPt[i]->Fill(v0.mLambda());
849817
}
850818
}
@@ -870,14 +838,12 @@ struct V0PtInvMassPlots {
870838
// antilambda analysis
871839
if (antiLambdaAnalysis == true) {
872840
if (v0mcParticle.pdgCode() == kLambda0Bar) { // antilambda matched
873-
874-
if (!acceptAntilambda(v0)) { // Antilambda Selections
841+
if (!acceptAntilambda(v0)) { // Antilambda Selections
875842
continue;
876843
}
877-
878844
if (v0mcParticle.isPhysicalPrimary()) {
879845
for (int i = 0; i < nmaxHistograms; i++) {
880-
if (antilambdaPtedgevalues[i] <= v0.pt() && v0.pt() < antilambdaPtedgevalues[i + 1]) {
846+
if (antilambdaPtedgevalues[i] <= v0mcParticle.pt() && v0mcParticle.pt() < antilambdaPtedgevalues[i + 1]) {
881847
pthistos::antilambdaPt[i]->Fill(v0.mAntiLambda());
882848
}
883849
}

0 commit comments

Comments
 (0)