diff --git a/ALICE3/Tasks/alice3TrackingPerformance.cxx b/ALICE3/Tasks/alice3TrackingPerformance.cxx index f0af7813136..fa69139b33a 100644 --- a/ALICE3/Tasks/alice3TrackingPerformance.cxx +++ b/ALICE3/Tasks/alice3TrackingPerformance.cxx @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -46,9 +47,20 @@ using namespace o2::framework; struct Alice3TrackingPerformance { Configurable> pdgCodes{"pdgCodes", {211}, "List of signed PDG codes to consider for performance evaluation"}; HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - ConfigurableAxis ptAxis{"ptAxis", {500, 0, 100}, "#it{p}_{T} (GeV/#it{c})"}; - ConfigurableAxis etaAxis{"etaAxis", {100, -5.f, 5.f}, "#eta"}; - ConfigurableAxis invPtDeltaAxis{"invPtDeltaAxis", {1000, -0.1f, 0.1f}, "1./#it{p}_{T}^{gen} - 1./#it{p}_{T}^{reco} (GeV/#it{c})^{-1}"}; + struct : ConfigurableGroup { + std::string prefix = "Axes"; // JSON group name + ConfigurableAxis ptAxis{"ptAxis", {500, 0, 100}, "#it{p}_{T} (GeV/#it{c})"}; + ConfigurableAxis etaAxis{"etaAxis", {100, -5.f, 5.f}, "#eta"}; + ConfigurableAxis invPtDeltaAxis{"invPtDeltaAxis", {1000, -0.1f, 0.1f}, "1./#it{p}_{T}^{gen} - 1./#it{p}_{T}^{reco} (GeV/#it{c})^{-1}"}; + ConfigurableAxis dcaAxis{"dcaAxis", {1000, -0.1f, 0.1f}, "DCA (cm)"}; + } settingsAxes; + + struct : ConfigurableGroup { + std::string prefix = "Selections"; // JSON group name + Configurable vtxSelX{"vtxSelX", -1.f, "Vertex selection in X (cm), if negative no selection is applied"}; + Configurable vtxSelY{"vtxSelY", -1.f, "Vertex selection in Y (cm), if negative no selection is applied"}; + Configurable vtxSelZ{"vtxSelZ", -1.f, "Vertex selection in Z (cm), if negative no selection is applied"}; + } settingsSelections; // Histograms std::shared_ptr particlePdgCodes; @@ -75,8 +87,11 @@ struct Alice3TrackingPerformance { pdgCodes.value.push_back(0); } const AxisSpec axisPtDelta{100, -1, 1, "(#it{p}_{T}^{reco} - #it{p}_{T}^{gen}) / #it{p}_{T}^{gen}"}; - const AxisSpec axisDcaXy{100, -1, 1, "DCA_{xy} (cm)"}; - const AxisSpec axisDcaZ{100, -1, 1, "DCA_{z} (cm)"}; + const AxisSpec axisPt{settingsAxes.ptAxis, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec axisInvPt{settingsAxes.invPtDeltaAxis, "1/#it{p}_{T} (GeV/#it{c})^{-1}"}; + const AxisSpec axisEta{settingsAxes.etaAxis, "#eta"}; + const AxisSpec axisDcaXy{settingsAxes.dcaAxis, "DCA_{xy} (cm)"}; + const AxisSpec axisDcaZ{settingsAxes.dcaAxis, "DCA_{z} (cm)"}; const AxisSpec axisCovariancePtPt{100, 0, 10, "cov(#it{p}_{T}, #it{p}_{T}) ((GeV/#it{c})^{2})"}; const AxisSpec axisCovarianceDcaXyDcaXy{100, 0, 1, "cov(DCA_{xy}, DCA_{xy}) (cm^{2})"}; const AxisSpec axisCovarianceDcaZDcaZ{100, 0, 1, "cov(DCA_{z}, DCA_{z}) (cm^{2})"}; @@ -90,25 +105,26 @@ struct Alice3TrackingPerformance { const std::string tag = "_" + prefix; prefix += "/"; auto histoName = [&](const std::string& name) { return Form("%s%s%s", prefix.c_str(), name.c_str(), tag.c_str()); }; - particlePtDistribution[pdg] = histos.add(histoName("particlePtDistribution"), "", kTH1D, {ptAxis}); + particlePtDistribution[pdg] = histos.add(histoName("particlePtDistribution"), "", kTH1D, {axisPt}); LOG(info) << "Added histogram: " << histoName("particlePtDistribution"); - particleEtaDistribution[pdg] = histos.add(histoName("particleEtaDistribution"), "", kTH1D, {etaAxis}); - - ptDistribution[pdg] = histos.add(histoName("ptDistribution"), "", kTH1D, {ptAxis}); - ptResolutionVsPt[pdg] = histos.add(histoName("ptResolutionVsPt"), "", kTH2D, {ptAxis, axisPtDelta}); - ptResolutionVsEta[pdg] = histos.add(histoName("ptResolutionVsEta"), "", kTProfile2D, {ptAxis, etaAxis}); - invPtResolutionVsPt[pdg] = histos.add(histoName("invPtResolutionVsPt"), "", kTH2D, {ptAxis, invPtDeltaAxis}); - invPtResolutionVsEta[pdg] = histos.add(histoName("invPtResolutionVsEta"), "", kTProfile2D, {ptAxis, etaAxis}); - dcaXyResolutionVsPt[pdg] = histos.add(histoName("dcaXyResolutionVsPt"), "", kTH2D, {ptAxis, axisDcaXy}); - dcaZResolutionVsPt[pdg] = histos.add(histoName("dcaZResolutionVsPt"), "", kTH2D, {ptAxis, axisDcaZ}); - covariancePtPtVsPt[pdg] = histos.add(histoName("covariancePtPtVsPt"), "", kTH2D, {ptAxis, axisCovariancePtPt}); - covarianceDcaXyDcaXyVsPt[pdg] = histos.add(histoName("covarianceDcaXyDcaXyVsPt"), "", kTH2D, {ptAxis, axisCovarianceDcaXyDcaXy}); - covarianceDcaZDcaZVsPt[pdg] = histos.add(histoName("covarianceDcaZDcaZVsPt"), "", kTH2D, {ptAxis, axisCovarianceDcaZDcaZ}); + particleEtaDistribution[pdg] = histos.add(histoName("particleEtaDistribution"), "", kTH1D, {axisEta}); + + ptDistribution[pdg] = histos.add(histoName("ptDistribution"), "", kTH1D, {axisPt}); + ptResolutionVsPt[pdg] = histos.add(histoName("ptResolutionVsPt"), "", kTH2D, {axisPt, axisPtDelta}); + ptResolutionVsEta[pdg] = histos.add(histoName("ptResolutionVsEta"), "", kTProfile2D, {axisPt, axisEta}); + invPtResolutionVsPt[pdg] = histos.add(histoName("invPtResolutionVsPt"), "", kTH2D, {axisPt, axisInvPt}); + invPtResolutionVsEta[pdg] = histos.add(histoName("invPtResolutionVsEta"), "", kTProfile2D, {axisPt, axisEta}); + dcaXyResolutionVsPt[pdg] = histos.add(histoName("dcaXyResolutionVsPt"), "", kTH2D, {axisPt, axisDcaXy}); + dcaZResolutionVsPt[pdg] = histos.add(histoName("dcaZResolutionVsPt"), "", kTH2D, {axisPt, axisDcaZ}); + covariancePtPtVsPt[pdg] = histos.add(histoName("covariancePtPtVsPt"), "", kTH2D, {axisPt, axisCovariancePtPt}); + covarianceDcaXyDcaXyVsPt[pdg] = histos.add(histoName("covarianceDcaXyDcaXyVsPt"), "", kTH2D, {axisPt, axisCovarianceDcaXyDcaXy}); + covarianceDcaZDcaZVsPt[pdg] = histos.add(histoName("covarianceDcaZDcaZVsPt"), "", kTH2D, {axisPt, axisCovarianceDcaZDcaZ}); } } void process(soa::Join const& tracks, - aod::McParticles const& mcParticles) + aod::McParticles const& mcParticles, + aod::McCollisions const&) { auto isParticleSelected = [&](const o2::aod::McParticle& p) { if (!p.isPhysicalPrimary()) { @@ -119,6 +135,18 @@ struct Alice3TrackingPerformance { }; for (const auto& mcParticle : mcParticles) { + // Selecting collisions + const auto& collision = mcParticle.mcCollision(); + if (settingsSelections.vtxSelX >= 0.f && std::abs(collision.posX()) > settingsSelections.vtxSelX) { + continue; + } + if (settingsSelections.vtxSelY >= 0.f && std::abs(collision.posY()) > settingsSelections.vtxSelY) { + continue; + } + if (settingsSelections.vtxSelZ >= 0.f && std::abs(collision.posZ()) > settingsSelections.vtxSelZ) { + continue; + } + particlePdgCodes->Fill(Form("%d", mcParticle.pdgCode()), 1); if (!isParticleSelected(mcParticle)) { continue;