From a2a6b90d779e94218aee9e0d6aecfd039c97b1f6 Mon Sep 17 00:00:00 2001 From: Henrique Zanoli Date: Fri, 11 Dec 2020 10:57:50 +0100 Subject: [PATCH 1/6] Add physical primary requirements --- Analysis/Tasks/PWGHF/qaTask.cxx | 203 +++++++++++++++++++++++++------- 1 file changed, 161 insertions(+), 42 deletions(-) diff --git a/Analysis/Tasks/PWGHF/qaTask.cxx b/Analysis/Tasks/PWGHF/qaTask.cxx index 04da7b327d955..3a7e6b256c8db 100644 --- a/Analysis/Tasks/PWGHF/qaTask.cxx +++ b/Analysis/Tasks/PWGHF/qaTask.cxx @@ -18,15 +18,15 @@ #include "Framework/HistogramRegistry.h" #include "AnalysisCore/trackUtilities.h" #include "ReconstructionDataFormats/DCA.h" +#include "AnalysisCore/MC.h" #include "TH1D.h" #include #include -#include +#include #include "boost/algorithm/string.hpp" -using namespace o2::framework; namespace o2fw = o2::framework; namespace o2exp = o2::framework::expressions; namespace o2df = o2::dataformats; @@ -77,6 +77,21 @@ bool GetImpactParameterAndError(const Track& track, const o2df::VertexBase& prim } return propagate; } + + +/// Returns wheter the particle is an electron, muon, pion, kaon or proton. +/// \param particle the simulated particle. +template +bool isPossibleToTrack(MCParticle particle) +{ + const int pdg_particle = std::abs(particle.pdgCode()); + const std::vector particles = {11, 13, 211, 321, 2212}; + + if (std::find(particles.begin(), particles.end(), pdg_particle) != particles.end()) { + return true; + } + return false; +} } // namespace track_utils namespace o2::qa::features @@ -140,7 +155,7 @@ class Feature std::string MakeTitle(std::vector axisTitles, const std::string& counts = "Counts") { axisTitles.push_back(counts); - return ";" + boost::algorithm::join(axisTitles, ";"); + return "; " + boost::algorithm::join(axisTitles, "; "); } Feature Eta("#eta"); @@ -154,6 +169,15 @@ Feature ImpactParameterRPhi("Impact Parameter r#varphi", "#mum"); Feature ImpactParameterRPhiError("Impact Parameter Error r#varphi", "#mum"); Feature ImpactParameterZ("Impact Parameter Z", "#mum"); Feature ImpactParameterZError("Impact Parameter Z Error", "#mum"); +Feature NumberOfContributors("Number Of contributors to the PV."); +Feature CovarianceXX("Cov_{xx}", "cm^{2}"); +Feature CovarianceXY("Cov_{xy}", "cm^{2}"); +Feature CovarianceXZ("Cov_{xz}", "cm^{2}"); +Feature CovarianceYY("Cov_{yy}", "cm^{2}"); +Feature CovarianceYZ("Cov_{yz}", "cm^{2}"); +Feature CovarianceZZ("Cov_{zz}", "cm^{2}"); +Feature VertexChi2("#Chi^{2}"); + } // namespace o2::qa::features namespace qafeat = o2::qa::features; @@ -161,41 +185,65 @@ namespace qafeat = o2::qa::features; /// Task to QA global observables of the event struct QAGlobalObservables { o2fw::Configurable nBinsNumberOfTracks{"nBinsNumberOfTracks", 2000, "Number of bins for the Number of Tracks"}; - o2fw::Configurable nBinsVertexPosition{"nBinsPt", 100, "Number of bins for the Vertex Position"}; + + o2fw::Configurable nBinsVertexPosition{"nBinsVertexPosition", 100, "Number of bins for the Vertex Position"}; + + o2fw::Configurable nBinsNumberOfContributorsVertex{ + "nBinsNumberOfContributorsVertex", 200, "Number bins for the number of contributors to the primary vertex"}; + + o2fw::Configurable numberOfContributorsVertexMax{ + "numberOfContributorsVertexMax", 200, "Maximum value for the Number of contributors to the primary vertex"}; + + o2fw::Configurable nBinsVertexCovarianceMatrix{"nBinsVertexCovarianceMatrix", 100, + "Number bins for the vertex covariance matrix"}; std::array collisionZRange = {-20., 20.}; std::array collisionXYRange = {-0.01, 0.01}; - std::array numberOfTracksRange = {0, 400}; + std::array vertexCovarianceMatrixRange = {-0.1, 0.1}; o2fw::OutputObj eventCount{TH1D("eventCount", qafeat::MakeTitle({"Selected Events"}).c_str(), 2, 0, 2)}; o2fw::HistogramRegistry histograms{"HistogramsGlobalQA"}; void init(o2fw::InitContext&) { - histograms.add("collision/collisionX", qafeat::MakeTitle({qafeat::VertexX}).c_str(), o2fw::kTH1D, - {{nBinsVertexPosition, collisionXYRange[0], collisionXYRange[1]}}); + o2fw::AxisSpec collisionXAxis{nBinsVertexPosition, collisionXYRange[0], collisionXYRange[1]}; + o2fw::AxisSpec collisionYAxis{nBinsVertexPosition, collisionXYRange[0], collisionXYRange[1]}; + o2fw::AxisSpec collisionZAxis{nBinsVertexPosition, collisionZRange[0], collisionZRange[1]}; - histograms.add("collision/collisionY", qafeat::MakeTitle({qafeat::VertexY}).c_str(), o2fw::kTH1D, - {{nBinsVertexPosition, collisionXYRange[0], collisionXYRange[1]}}); + o2fw::AxisSpec numberOfContributorsAxis{nBinsNumberOfContributorsVertex, 0, float(numberOfContributorsVertexMax)}; + o2fw::AxisSpec numberOfTrackAxis{nBinsNumberOfTracks, numberOfTracksRange[0], numberOfTracksRange[1]}; - histograms.add("collision/collisionZ", qafeat::MakeTitle({qafeat::VertexZ}).c_str(), o2fw::kTH1D, - {{nBinsVertexPosition, collisionZRange[0], collisionZRange[1]}}); + o2fw::AxisSpec vertexCovarianceMatrixAxis{nBinsVertexCovarianceMatrix, vertexCovarianceMatrixRange[0], + vertexCovarianceMatrixRange[1]}; + + histograms.add("collision/collisionX", qafeat::MakeTitle({qafeat::VertexX}).c_str(), o2fw::kTH1D, {collisionXAxis}); + + histograms.add("collision/collisionY", qafeat::MakeTitle({qafeat::VertexY}).c_str(), o2fw::kTH1D, {collisionYAxis}); + + histograms.add("collision/collisionZ", qafeat::MakeTitle({qafeat::VertexZ}).c_str(), o2fw::kTH1D, {collisionZAxis}); + + histograms.add("collision/numberOfContributors", qafeat::MakeTitle({qafeat::NumberOfContributors}).c_str(), + o2fw::kTH1D, {numberOfContributorsAxis}); + + histograms.add("collision/vertexChi2", qafeat::MakeTitle({qafeat::VertexChi2}).c_str(), + o2fw::kTH1D, {{100, 0, 10}}); histograms.add("multiplicity/numberOfTracks", qafeat::MakeTitle({qafeat::TrackMultiplicity}).c_str(), o2fw::kTH1D, - {{nBinsNumberOfTracks, numberOfTracksRange[0], numberOfTracksRange[1]}}); - - // covariance histograms - histograms.add("Covariance/xx", "xx;Cov_{xx} [cm^{2}]", kTH1D, {{200, -0.1, 0.1}}); - histograms.add("Covariance/xy", "xy;Cov_{xy} [cm^{2}]", kTH1D, {{200, -0.1, 0.1}}); - histograms.add("Covariance/xz", "xz;Cov_{xz} [cm^{2}]", kTH1D, {{200, -0.1, 0.1}}); - histograms.add("Covariance/yy", "yy;Cov_{yy} [cm^{2}]", kTH1D, {{200, -0.1, 0.1}}); - histograms.add("Covariance/yz", "yz;Cov_{yz} [cm^{2}]", kTH1D, {{200, -0.1, 0.1}}); - histograms.add("Covariance/zz", "zz;Cov_{zz} [cm^{2}]", kTH1D, {{200, -0.1, 0.1}}); - - // quality histograms - histograms.add("Quality/Chi2", "#Chi^{2};#Chi^{2}", kTH1D, {{100, 0, 10}}); - histograms.add("Quality/Contributors", "Contributors;Contributors", kTH1D, {{100, 0, 100}}); + {numberOfTrackAxis}); + + histograms.add("covariance/xx", qafeat::MakeTitle({qafeat::CovarianceXX}).c_str(), o2fw::kTH1D, + {vertexCovarianceMatrixAxis}); + histograms.add("covariance/xy", qafeat::MakeTitle({qafeat::CovarianceXY}).c_str(), o2fw::kTH1D, + {vertexCovarianceMatrixAxis}); + histograms.add("covariance/xz", qafeat::MakeTitle({qafeat::CovarianceXZ}).c_str(), o2fw::kTH1D, + {vertexCovarianceMatrixAxis}); + histograms.add("covariance/yy", qafeat::MakeTitle({qafeat::CovarianceYY}).c_str(), o2fw::kTH1D, + {vertexCovarianceMatrixAxis}); + histograms.add("covariance/yz", qafeat::MakeTitle({qafeat::CovarianceYZ}).c_str(), o2fw::kTH1D, + {vertexCovarianceMatrixAxis}); + histograms.add("covariance/zz", qafeat::MakeTitle({qafeat::CovarianceZZ}).c_str(), o2fw::kTH1D, + {vertexCovarianceMatrixAxis}); } void process(const o2::aod::Collision& collision, const o2::aod::Tracks& tracks) @@ -205,24 +253,22 @@ struct QAGlobalObservables { histograms.fill("collision/collisionY", collision.posY()); histograms.fill("collision/collisionZ", collision.posZ()); + histograms.fill("collision/numberOfContributors", collision.numContrib()); + histograms.fill("collision/vertexChi2", collision.chi2()); + + histograms.fill("covariance/xx", collision.covXX()); + histograms.fill("covariance/xy", collision.covXY()); + histograms.fill("covariance/xz", collision.covXZ()); + histograms.fill("covariance/yy", collision.covYY()); + histograms.fill("covariance/yz", collision.covYZ()); + histograms.fill("covariance/zz", collision.covZZ()); + int nTracks(0); for (const auto& track : tracks) { nTracks++; } histograms.fill("multiplicity/numberOfTracks", nTracks); - - // fill covariance variables - histograms.fill("Covariance/xx", collision.covXX()); - histograms.fill("Covariance/xy", collision.covXY()); - histograms.fill("Covariance/xz", collision.covXZ()); - histograms.fill("Covariance/yy", collision.covYY()); - histograms.fill("Covariance/yz", collision.covYZ()); - histograms.fill("Covariance/zz", collision.covZZ()); - - // fill quality variables - histograms.fill("Quality/Chi2", collision.chi2()); - histograms.fill("Quality/Contributors", collision.numContrib()); } }; @@ -257,10 +303,21 @@ struct QATrackingKine { /// Task to evaluate the tracking resolution (Pt, Eta, Phi and impact parameter) struct QATrackingResolution { - std::vector ptBins = {0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.12, - 0.14, 0.16, 0.18, 0.2, 0.225, 0.25, 0.275, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, 3.0, - 3.5, 4., 5., 6., 8., 10., 15., 20., 30., 50., 100.}; + std::vector ptBins = { + 0.01, 0.0101, 0.0102, 0.0103, 0.0104, 0.0105, 0.0106, 0.0107, 0.0108, 0.0109, 0.011, 0.0111, 0.0112, 0.0113, + 0.0114, 0.0115, 0.0116, 0.0117, 0.0118, 0.0119, 0.012, 0.0121, 0.0122, 0.0123, 0.0124, 0.0125, 0.0126, 0.0127, + 0.0128, 0.0129, 0.013, 0.0131, 0.0132, 0.0133, 0.0134, 0.0135, 0.0136, 0.0137, 0.0138, 0.0139, 0.014, 0.0141, + 0.0142, 0.0143, 0.0144, 0.0145, 0.0146, 0.0147, 0.0148, 0.0149, 0.015, 0.0151, 0.0152, 0.0153, 0.0154, 0.0155, + 0.0156, 0.0157, 0.0158, 0.0159, 0.016, 0.0161, 0.0162, 0.0163, 0.0164, 0.0165, 0.0166, 0.0167, 0.0168, 0.0169, + 0.017, 0.0171, 0.0172, 0.0173, 0.0174, 0.0175, 0.0176, 0.0177, 0.0178, 0.0179, 0.018, 0.0181, 0.0182, 0.0183, + 0.0184, 0.0185, 0.0186, 0.0187, 0.0188, 0.0189, 0.019, 0.0191, 0.0192, 0.0193, 0.0194, 0.0195, 0.0196, 0.0197, + 0.0198, 0.0199, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.155, + 0.16, 0.165, 0.175, 0.18, 0.185, 0.2, 0.225, 0.25, 0.25, 0.275, 0.3, 0.35, 0.35, 0.4, + 0.45, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, + 3.0, 3.5, 4.0, 5.0, 6.0, 8.0, 10.0, 15.0, 20.0, 30.0, 50.0, 100.}; + + o2fw::Configurable useOnlyPhysicsPrimary{"useOnlyPhysicsPrimary", true, + "Whether to use only physical primary particles for the resolution."}; o2fw::Configurable nBinsEta{"nBinsEta", 60, "Number of bins for the pseudorapidity"}; std::array etaRange = {-3, 3}; @@ -392,6 +449,12 @@ struct QATrackingResolution { const o2df::VertexBase primaryVertex = getPrimaryVertex(collision); for (const auto& track : tracks) { + if (useOnlyPhysicsPrimary) { + const auto mcParticle = track.label(); + if (!MC::isPhysicalPrimary(mcParticle, mcParticles)) { + continue; + } + } const double deltaPt = track.label().pt() - track.pt(); histos.fill("pt/ptDiffMCRec", deltaPt); @@ -437,9 +500,65 @@ struct QATrackingResolution { } }; +/// Task to QA the kinematic properties of the tracks +struct QATrackingEfficiency { + std::vector ptBins = { + 0.01, 0.0101, 0.0102, 0.0103, 0.0104, 0.0105, 0.0106, 0.0107, 0.0108, 0.0109, 0.011, 0.0111, 0.0112, 0.0113, + 0.0114, 0.0115, 0.0116, 0.0117, 0.0118, 0.0119, 0.012, 0.0121, 0.0122, 0.0123, 0.0124, 0.0125, 0.0126, 0.0127, + 0.0128, 0.0129, 0.013, 0.0131, 0.0132, 0.0133, 0.0134, 0.0135, 0.0136, 0.0137, 0.0138, 0.0139, 0.014, 0.0141, + 0.0142, 0.0143, 0.0144, 0.0145, 0.0146, 0.0147, 0.0148, 0.0149, 0.015, 0.0151, 0.0152, 0.0153, 0.0154, 0.0155, + 0.0156, 0.0157, 0.0158, 0.0159, 0.016, 0.0161, 0.0162, 0.0163, 0.0164, 0.0165, 0.0166, 0.0167, 0.0168, 0.0169, + 0.017, 0.0171, 0.0172, 0.0173, 0.0174, 0.0175, 0.0176, 0.0177, 0.0178, 0.0179, 0.018, 0.0181, 0.0182, 0.0183, + 0.0184, 0.0185, 0.0186, 0.0187, 0.0188, 0.0189, 0.019, 0.0191, 0.0192, 0.0193, 0.0194, 0.0195, 0.0196, 0.0197, + 0.0198, 0.0199, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.155, + 0.16, 0.165, 0.175, 0.18, 0.185, 0.2, 0.225, 0.25, 0.25, 0.275, 0.3, 0.35, 0.35, 0.4, + 0.45, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, + 3.0, 3.5, 4.0, 5.0, 6.0, 8.0, 10.0, 15.0, 20.0, 30.0, 50.0, 100.}; + + o2fw::Configurable nBinsEta{"nBinsEta", 30, "Number of bins for the pseudorapidity"}; + std::array etaRange = {-3, 3}; + + o2fw::Configurable nBinsPhi{"nBinsPhi", 20, "Number of bins for Phi"}; + std::array phiRange = {0, 2 * M_PI}; + + o2fw::HistogramRegistry histos{"HistogramsTrackingEfficiencyQA"}; + + void init(o2fw::InitContext&) + { + o2fw::AxisSpec ptAxis{ptBins}; + o2fw::AxisSpec phiAxis{nBinsPhi, phiRange[0], phiRange[1]}; + o2fw::AxisSpec etaAxis{nBinsEta, etaRange[0], etaRange[1]}; + + histos.add("reconstructed_kinematics", + qafeat::MakeTitle({qafeat::Pt.MC(), qafeat::Eta.MC(), qafeat::Phi.MC()}).c_str(), o2fw::kTH3D, + {ptAxis, etaAxis, phiAxis}); + + histos.add("generated_kinematics", qafeat::MakeTitle({qafeat::Pt.MC(), qafeat::Eta.MC(), qafeat::Phi.MC()}).c_str(), + o2fw::kTH3D, {ptAxis, etaAxis, phiAxis}); + } + + void process(const o2::soa::Join& tracks, + const o2::aod::McParticles& mcParticles) + { + for (const auto& track : tracks) { + const auto mcParticle = track.label(); + if (MC::isPhysicalPrimary(mcParticle, mcParticles) && track_utils::isPossibleToTrack(mcParticle)) { + histos.fill("reconstructed_kinematics", mcParticle.pt(), mcParticle.eta(), mcParticle.phi()); + } + } + + for (const auto& mcParticle : mcParticles) { + if (MC::isPhysicalPrimary(mcParticle, mcParticles) && track_utils::isPossibleToTrack(mcParticle)) { + histos.fill("generated_kinematics", mcParticle.pt(), mcParticle.eta(), mcParticle.phi()); + } + } + } +}; + o2fw::WorkflowSpec defineDataProcessing(o2fw::ConfigContext const&) { return o2fw::WorkflowSpec{o2fw::adaptAnalysisTask("qa-global-observables"), o2fw::adaptAnalysisTask("qa-tracking-kine"), - o2fw::adaptAnalysisTask("qa-tracking-resolution")}; -} + o2fw::adaptAnalysisTask("qa-tracking-resolution"), + o2fw::adaptAnalysisTask("qa-tracking-efficiency")}; +}; From 3e1b1aac984d71bec1d801cc24b5ee9219a76c8d Mon Sep 17 00:00:00 2001 From: Henrique Zanoli Date: Fri, 11 Dec 2020 18:11:17 +0100 Subject: [PATCH 2/6] Fix order mc and add particle spefic eff --- Analysis/Tasks/PWGHF/qaTask.cxx | 63 ++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/Analysis/Tasks/PWGHF/qaTask.cxx b/Analysis/Tasks/PWGHF/qaTask.cxx index 3a7e6b256c8db..9e728f677c6a5 100644 --- a/Analysis/Tasks/PWGHF/qaTask.cxx +++ b/Analysis/Tasks/PWGHF/qaTask.cxx @@ -78,7 +78,6 @@ bool GetImpactParameterAndError(const Track& track, const o2df::VertexBase& prim return propagate; } - /// Returns wheter the particle is an electron, muon, pion, kaon or proton. /// \param particle the simulated particle. template @@ -304,17 +303,17 @@ struct QATrackingKine { /// Task to evaluate the tracking resolution (Pt, Eta, Phi and impact parameter) struct QATrackingResolution { std::vector ptBins = { - 0.01, 0.0101, 0.0102, 0.0103, 0.0104, 0.0105, 0.0106, 0.0107, 0.0108, 0.0109, 0.011, 0.0111, 0.0112, 0.0113, - 0.0114, 0.0115, 0.0116, 0.0117, 0.0118, 0.0119, 0.012, 0.0121, 0.0122, 0.0123, 0.0124, 0.0125, 0.0126, 0.0127, - 0.0128, 0.0129, 0.013, 0.0131, 0.0132, 0.0133, 0.0134, 0.0135, 0.0136, 0.0137, 0.0138, 0.0139, 0.014, 0.0141, - 0.0142, 0.0143, 0.0144, 0.0145, 0.0146, 0.0147, 0.0148, 0.0149, 0.015, 0.0151, 0.0152, 0.0153, 0.0154, 0.0155, - 0.0156, 0.0157, 0.0158, 0.0159, 0.016, 0.0161, 0.0162, 0.0163, 0.0164, 0.0165, 0.0166, 0.0167, 0.0168, 0.0169, - 0.017, 0.0171, 0.0172, 0.0173, 0.0174, 0.0175, 0.0176, 0.0177, 0.0178, 0.0179, 0.018, 0.0181, 0.0182, 0.0183, - 0.0184, 0.0185, 0.0186, 0.0187, 0.0188, 0.0189, 0.019, 0.0191, 0.0192, 0.0193, 0.0194, 0.0195, 0.0196, 0.0197, - 0.0198, 0.0199, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.155, - 0.16, 0.165, 0.175, 0.18, 0.185, 0.2, 0.225, 0.25, 0.25, 0.275, 0.3, 0.35, 0.35, 0.4, - 0.45, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, - 3.0, 3.5, 4.0, 5.0, 6.0, 8.0, 10.0, 15.0, 20.0, 30.0, 50.0, 100.}; + 0.01, 0.0101, 0.0102, 0.0103, 0.0104, 0.0105, 0.0106, 0.0107, 0.0108, 0.0109, 0.011, 0.0111, 0.0112, 0.0113, + 0.0114, 0.0115, 0.0116, 0.0117, 0.0118, 0.0119, 0.012, 0.0121, 0.0122, 0.0123, 0.0124, 0.0125, 0.0126, 0.0127, + 0.0128, 0.0129, 0.013, 0.0131, 0.0132, 0.0133, 0.0134, 0.0135, 0.0136, 0.0137, 0.0138, 0.0139, 0.014, 0.0141, + 0.0142, 0.0143, 0.0144, 0.0145, 0.0146, 0.0147, 0.0148, 0.0149, 0.015, 0.0151, 0.0152, 0.0153, 0.0154, 0.0155, + 0.0156, 0.0157, 0.0158, 0.0159, 0.016, 0.0161, 0.0162, 0.0163, 0.0164, 0.0165, 0.0166, 0.0167, 0.0168, 0.0169, + 0.017, 0.0171, 0.0172, 0.0173, 0.0174, 0.0175, 0.0176, 0.0177, 0.0178, 0.0179, 0.018, 0.0181, 0.0182, 0.0183, + 0.0184, 0.0185, 0.0186, 0.0187, 0.0188, 0.0189, 0.019, 0.0191, 0.0192, 0.0193, 0.0194, 0.0195, 0.0196, 0.0197, + 0.0198, 0.0199, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.155, + 0.16, 0.165, 0.175, 0.18, 0.185, 0.2, 0.225, 0.25, 0.25, 0.275, 0.3, 0.35, 0.35, 0.4, + 0.45, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, + 3.0, 3.5, 4.0, 5.0, 6.0, 8.0, 10.0, 15.0, 20.0, 30.0, 50.0, 100.}; o2fw::Configurable useOnlyPhysicsPrimary{"useOnlyPhysicsPrimary", true, "Whether to use only physical primary particles for the resolution."}; @@ -451,7 +450,7 @@ struct QATrackingResolution { for (const auto& track : tracks) { if (useOnlyPhysicsPrimary) { const auto mcParticle = track.label(); - if (!MC::isPhysicalPrimary(mcParticle, mcParticles)) { + if (!MC::isPhysicalPrimary(mcParticles, mcParticle)) { continue; } } @@ -503,17 +502,19 @@ struct QATrackingResolution { /// Task to QA the kinematic properties of the tracks struct QATrackingEfficiency { std::vector ptBins = { - 0.01, 0.0101, 0.0102, 0.0103, 0.0104, 0.0105, 0.0106, 0.0107, 0.0108, 0.0109, 0.011, 0.0111, 0.0112, 0.0113, - 0.0114, 0.0115, 0.0116, 0.0117, 0.0118, 0.0119, 0.012, 0.0121, 0.0122, 0.0123, 0.0124, 0.0125, 0.0126, 0.0127, - 0.0128, 0.0129, 0.013, 0.0131, 0.0132, 0.0133, 0.0134, 0.0135, 0.0136, 0.0137, 0.0138, 0.0139, 0.014, 0.0141, - 0.0142, 0.0143, 0.0144, 0.0145, 0.0146, 0.0147, 0.0148, 0.0149, 0.015, 0.0151, 0.0152, 0.0153, 0.0154, 0.0155, - 0.0156, 0.0157, 0.0158, 0.0159, 0.016, 0.0161, 0.0162, 0.0163, 0.0164, 0.0165, 0.0166, 0.0167, 0.0168, 0.0169, - 0.017, 0.0171, 0.0172, 0.0173, 0.0174, 0.0175, 0.0176, 0.0177, 0.0178, 0.0179, 0.018, 0.0181, 0.0182, 0.0183, - 0.0184, 0.0185, 0.0186, 0.0187, 0.0188, 0.0189, 0.019, 0.0191, 0.0192, 0.0193, 0.0194, 0.0195, 0.0196, 0.0197, - 0.0198, 0.0199, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.155, - 0.16, 0.165, 0.175, 0.18, 0.185, 0.2, 0.225, 0.25, 0.25, 0.275, 0.3, 0.35, 0.35, 0.4, - 0.45, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, - 3.0, 3.5, 4.0, 5.0, 6.0, 8.0, 10.0, 15.0, 20.0, 30.0, 50.0, 100.}; + 0.01, 0.0101, 0.0102, 0.0103, 0.0104, 0.0105, 0.0106, 0.0107, 0.0108, 0.0109, 0.011, 0.0111, 0.0112, 0.0113, + 0.0114, 0.0115, 0.0116, 0.0117, 0.0118, 0.0119, 0.012, 0.0121, 0.0122, 0.0123, 0.0124, 0.0125, 0.0126, 0.0127, + 0.0128, 0.0129, 0.013, 0.0131, 0.0132, 0.0133, 0.0134, 0.0135, 0.0136, 0.0137, 0.0138, 0.0139, 0.014, 0.0141, + 0.0142, 0.0143, 0.0144, 0.0145, 0.0146, 0.0147, 0.0148, 0.0149, 0.015, 0.0151, 0.0152, 0.0153, 0.0154, 0.0155, + 0.0156, 0.0157, 0.0158, 0.0159, 0.016, 0.0161, 0.0162, 0.0163, 0.0164, 0.0165, 0.0166, 0.0167, 0.0168, 0.0169, + 0.017, 0.0171, 0.0172, 0.0173, 0.0174, 0.0175, 0.0176, 0.0177, 0.0178, 0.0179, 0.018, 0.0181, 0.0182, 0.0183, + 0.0184, 0.0185, 0.0186, 0.0187, 0.0188, 0.0189, 0.019, 0.0191, 0.0192, 0.0193, 0.0194, 0.0195, 0.0196, 0.0197, + 0.0198, 0.0199, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.155, + 0.16, 0.165, 0.175, 0.18, 0.185, 0.2, 0.225, 0.25, 0.25, 0.275, 0.3, 0.35, 0.35, 0.4, + 0.45, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, + 3.0, 3.5, 4.0, 5.0, 6.0, 8.0, 10.0, 15.0, 20.0, 30.0, 50.0, 100.}; + + o2fw::Configurable particlePDG{"particlePDG", 211, "Absolute value of the particle pdg to select"}; o2fw::Configurable nBinsEta{"nBinsEta", 30, "Number of bins for the pseudorapidity"}; std::array etaRange = {-3, 3}; @@ -538,17 +539,21 @@ struct QATrackingEfficiency { } void process(const o2::soa::Join& tracks, - const o2::aod::McParticles& mcParticles) + o2::aod::McParticles& mcParticles) { for (const auto& track : tracks) { - const auto mcParticle = track.label(); - if (MC::isPhysicalPrimary(mcParticle, mcParticles) && track_utils::isPossibleToTrack(mcParticle)) { + auto mcParticle = track.label(); + if (MC::isPhysicalPrimary(mcParticles, mcParticle) && + track_utils::isPossibleToTrack(mcParticle) && + abs(mcParticle.pdgCode()) == particlePDG) { histos.fill("reconstructed_kinematics", mcParticle.pt(), mcParticle.eta(), mcParticle.phi()); } } - for (const auto& mcParticle : mcParticles) { - if (MC::isPhysicalPrimary(mcParticle, mcParticles) && track_utils::isPossibleToTrack(mcParticle)) { + for (auto& mcParticle : mcParticles) { + if (MC::isPhysicalPrimary(mcParticles, mcParticle) && + track_utils::isPossibleToTrack(mcParticle) && + abs(mcParticle.pdgCode()) == particlePDG) { histos.fill("generated_kinematics", mcParticle.pt(), mcParticle.eta(), mcParticle.phi()); } } From 800fef9ad682383fe1cdbcc51fbece88bf906476 Mon Sep 17 00:00:00 2001 From: Henrique Zanoli Date: Mon, 14 Dec 2020 11:32:27 +0100 Subject: [PATCH 3/6] Particle dependent efficiency --- Analysis/Tasks/PWGHF/qaTask.cxx | 35 ++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/Analysis/Tasks/PWGHF/qaTask.cxx b/Analysis/Tasks/PWGHF/qaTask.cxx index 9e728f677c6a5..b3f4e0cdb3563 100644 --- a/Analysis/Tasks/PWGHF/qaTask.cxx +++ b/Analysis/Tasks/PWGHF/qaTask.cxx @@ -19,6 +19,7 @@ #include "AnalysisCore/trackUtilities.h" #include "ReconstructionDataFormats/DCA.h" #include "AnalysisCore/MC.h" +#include "TPDGCode.h" #include "TH1D.h" @@ -499,7 +500,8 @@ struct QATrackingResolution { } }; -/// Task to QA the kinematic properties of the tracks +/// Task to QA the efficiency of a particular particle defined by particlePDG +template struct QATrackingEfficiency { std::vector ptBins = { 0.01, 0.0101, 0.0102, 0.0103, 0.0104, 0.0105, 0.0106, 0.0107, 0.0108, 0.0109, 0.011, 0.0111, 0.0112, 0.0113, @@ -514,15 +516,13 @@ struct QATrackingEfficiency { 0.45, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 6.0, 8.0, 10.0, 15.0, 20.0, 30.0, 50.0, 100.}; - o2fw::Configurable particlePDG{"particlePDG", 211, "Absolute value of the particle pdg to select"}; - o2fw::Configurable nBinsEta{"nBinsEta", 30, "Number of bins for the pseudorapidity"}; std::array etaRange = {-3, 3}; o2fw::Configurable nBinsPhi{"nBinsPhi", 20, "Number of bins for Phi"}; std::array phiRange = {0, 2 * M_PI}; - o2fw::HistogramRegistry histos{"HistogramsTrackingEfficiencyQA"}; + o2fw::HistogramRegistry histos{"histogramsTrackingEfficiencyQA"}; void init(o2fw::InitContext&) { @@ -530,31 +530,30 @@ struct QATrackingEfficiency { o2fw::AxisSpec phiAxis{nBinsPhi, phiRange[0], phiRange[1]}; o2fw::AxisSpec etaAxis{nBinsEta, etaRange[0], etaRange[1]}; - histos.add("reconstructed_kinematics", - qafeat::MakeTitle({qafeat::Pt.MC(), qafeat::Eta.MC(), qafeat::Phi.MC()}).c_str(), o2fw::kTH3D, - {ptAxis, etaAxis, phiAxis}); + histos.add("reconstructedKinematics", + qafeat::MakeTitle({qafeat::Pt.MC(), qafeat::Eta.MC(), qafeat::Phi.MC()}).c_str(), + o2fw::kTH3D, {ptAxis, etaAxis, phiAxis}); - histos.add("generated_kinematics", qafeat::MakeTitle({qafeat::Pt.MC(), qafeat::Eta.MC(), qafeat::Phi.MC()}).c_str(), + histos.add("generatedKinematics", + qafeat::MakeTitle({qafeat::Pt.MC(), qafeat::Eta.MC(), qafeat::Phi.MC()}).c_str(), o2fw::kTH3D, {ptAxis, etaAxis, phiAxis}); } void process(const o2::soa::Join& tracks, - o2::aod::McParticles& mcParticles) + const o2::aod::McParticles& mcParticles) { for (const auto& track : tracks) { - auto mcParticle = track.label(); + const auto mcParticle = track.label(); if (MC::isPhysicalPrimary(mcParticles, mcParticle) && - track_utils::isPossibleToTrack(mcParticle) && abs(mcParticle.pdgCode()) == particlePDG) { - histos.fill("reconstructed_kinematics", mcParticle.pt(), mcParticle.eta(), mcParticle.phi()); + histos.fill("reconstructedKinematics", mcParticle.pt(), mcParticle.eta(), mcParticle.phi()); } } - for (auto& mcParticle : mcParticles) { + for (const auto& mcParticle : mcParticles) { if (MC::isPhysicalPrimary(mcParticles, mcParticle) && - track_utils::isPossibleToTrack(mcParticle) && abs(mcParticle.pdgCode()) == particlePDG) { - histos.fill("generated_kinematics", mcParticle.pt(), mcParticle.eta(), mcParticle.phi()); + histos.fill("generatedKinematics", mcParticle.pt(), mcParticle.eta(), mcParticle.phi()); } } } @@ -565,5 +564,9 @@ o2fw::WorkflowSpec defineDataProcessing(o2fw::ConfigContext const&) return o2fw::WorkflowSpec{o2fw::adaptAnalysisTask("qa-global-observables"), o2fw::adaptAnalysisTask("qa-tracking-kine"), o2fw::adaptAnalysisTask("qa-tracking-resolution"), - o2fw::adaptAnalysisTask("qa-tracking-efficiency")}; + o2fw::adaptAnalysisTask>("qa-tracking-efficiency-pion"), + o2fw::adaptAnalysisTask>("qa-tracking-efficiency-proton"), + o2fw::adaptAnalysisTask>("qa-tracking-efficiency-electron"), + o2fw::adaptAnalysisTask>("qa-tracking-efficiency-muon"), + o2fw::adaptAnalysisTask>("qa-tracking-efficiency-kaon")}; }; From d58b0a14b5a8307e5fa1f5c1ac8289258016f99e Mon Sep 17 00:00:00 2001 From: Henrique Zanoli Date: Thu, 17 Dec 2020 12:00:01 +0100 Subject: [PATCH 4/6] Fix pt bins --- Analysis/Tasks/PWGHF/qaTask.cxx | 68 +++++++++++++++------------------ 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/Analysis/Tasks/PWGHF/qaTask.cxx b/Analysis/Tasks/PWGHF/qaTask.cxx index b3f4e0cdb3563..ce2722c513c91 100644 --- a/Analysis/Tasks/PWGHF/qaTask.cxx +++ b/Analysis/Tasks/PWGHF/qaTask.cxx @@ -79,19 +79,6 @@ bool GetImpactParameterAndError(const Track& track, const o2df::VertexBase& prim return propagate; } -/// Returns wheter the particle is an electron, muon, pion, kaon or proton. -/// \param particle the simulated particle. -template -bool isPossibleToTrack(MCParticle particle) -{ - const int pdg_particle = std::abs(particle.pdgCode()); - const std::vector particles = {11, 13, 211, 321, 2212}; - - if (std::find(particles.begin(), particles.end(), pdg_particle) != particles.end()) { - return true; - } - return false; -} } // namespace track_utils namespace o2::qa::features @@ -304,17 +291,20 @@ struct QATrackingKine { /// Task to evaluate the tracking resolution (Pt, Eta, Phi and impact parameter) struct QATrackingResolution { std::vector ptBins = { - 0.01, 0.0101, 0.0102, 0.0103, 0.0104, 0.0105, 0.0106, 0.0107, 0.0108, 0.0109, 0.011, 0.0111, 0.0112, 0.0113, - 0.0114, 0.0115, 0.0116, 0.0117, 0.0118, 0.0119, 0.012, 0.0121, 0.0122, 0.0123, 0.0124, 0.0125, 0.0126, 0.0127, - 0.0128, 0.0129, 0.013, 0.0131, 0.0132, 0.0133, 0.0134, 0.0135, 0.0136, 0.0137, 0.0138, 0.0139, 0.014, 0.0141, - 0.0142, 0.0143, 0.0144, 0.0145, 0.0146, 0.0147, 0.0148, 0.0149, 0.015, 0.0151, 0.0152, 0.0153, 0.0154, 0.0155, - 0.0156, 0.0157, 0.0158, 0.0159, 0.016, 0.0161, 0.0162, 0.0163, 0.0164, 0.0165, 0.0166, 0.0167, 0.0168, 0.0169, - 0.017, 0.0171, 0.0172, 0.0173, 0.0174, 0.0175, 0.0176, 0.0177, 0.0178, 0.0179, 0.018, 0.0181, 0.0182, 0.0183, - 0.0184, 0.0185, 0.0186, 0.0187, 0.0188, 0.0189, 0.019, 0.0191, 0.0192, 0.0193, 0.0194, 0.0195, 0.0196, 0.0197, - 0.0198, 0.0199, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.155, - 0.16, 0.165, 0.175, 0.18, 0.185, 0.2, 0.225, 0.25, 0.25, 0.275, 0.3, 0.35, 0.35, 0.4, - 0.45, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, - 3.0, 3.5, 4.0, 5.0, 6.0, 8.0, 10.0, 15.0, 20.0, 30.0, 50.0, 100.}; + 0.01, 0.0101, 0.0102, 0.0103, 0.0104, 0.0105, 0.0106, 0.0107, 0.0108, 0.0109, 0.011, + 0.0111, 0.0112, 0.0113, 0.0114, 0.0115, 0.0116, 0.0117, 0.0118, 0.0119, 0.012, + 0.0121, 0.0122, 0.0123, 0.0124, 0.0125, 0.0126, 0.0127, 0.0128, 0.0129, 0.013, + 0.0131, 0.0132, 0.0133, 0.0134, 0.0135, 0.0136, 0.0137, 0.0138, 0.0139, 0.014, + 0.0141, 0.0142, 0.0143, 0.0144, 0.0145, 0.0146, 0.0147, 0.0148, 0.0149, 0.015, + 0.0151, 0.0152, 0.0153, 0.0154, 0.0155, 0.0156, 0.0157, 0.0158, 0.0159, 0.016, + 0.0161, 0.0162, 0.0163, 0.0164, 0.0165, 0.0166, 0.0167, 0.0168, 0.0169, 0.017, + 0.0171, 0.0172, 0.0173, 0.0174, 0.0175, 0.0176, 0.0177, 0.0178, 0.0179, 0.018, + 0.0181, 0.0182, 0.0183, 0.0184, 0.0185, 0.0186, 0.0187, 0.0188, 0.0189, 0.019, + 0.0191, 0.0192, 0.0193, 0.0194, 0.0195, 0.0196, 0.0197, 0.0198, 0.0199, 0.02, + 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.155, 0.16, 0.165, + 0.175, 0.18, 0.185, 0.2, 0.225, 0.25, 0.275, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, + 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 6.0, + 8.0, 10.0, 15.0, 20.0, 30.0, 50.0, 100.0}; o2fw::Configurable useOnlyPhysicsPrimary{"useOnlyPhysicsPrimary", true, "Whether to use only physical primary particles for the resolution."}; @@ -334,9 +324,9 @@ struct QATrackingResolution { o2fw::Configurable nBinsDeltaEta{"nBinsDeltaEta", 100, "Number of bins for the pseudorapidity differences"}; std::array deltaEtaRange = {-0.1, 0.1}; - o2fw::Configurable nBinsImpactParameter{"nBinsImpactParameter", 1000, "Number of bins for the Impact parameter"}; + o2fw::Configurable nBinsImpactParameter{"nBinsImpactParameter", 2000, "Number of bins for the Impact parameter"}; - std::array impactParameterRange = {-1500, 1500}; // micrometer + std::array impactParameterRange = {-500, 500}; // micrometer std::array impactParameterResolutionRange = {0, 1000}; // micrometer // Registry of histograms @@ -449,6 +439,7 @@ struct QATrackingResolution { const o2df::VertexBase primaryVertex = getPrimaryVertex(collision); for (const auto& track : tracks) { + if (useOnlyPhysicsPrimary) { const auto mcParticle = track.label(); if (!MC::isPhysicalPrimary(mcParticles, mcParticle)) { @@ -504,17 +495,20 @@ struct QATrackingResolution { template struct QATrackingEfficiency { std::vector ptBins = { - 0.01, 0.0101, 0.0102, 0.0103, 0.0104, 0.0105, 0.0106, 0.0107, 0.0108, 0.0109, 0.011, 0.0111, 0.0112, 0.0113, - 0.0114, 0.0115, 0.0116, 0.0117, 0.0118, 0.0119, 0.012, 0.0121, 0.0122, 0.0123, 0.0124, 0.0125, 0.0126, 0.0127, - 0.0128, 0.0129, 0.013, 0.0131, 0.0132, 0.0133, 0.0134, 0.0135, 0.0136, 0.0137, 0.0138, 0.0139, 0.014, 0.0141, - 0.0142, 0.0143, 0.0144, 0.0145, 0.0146, 0.0147, 0.0148, 0.0149, 0.015, 0.0151, 0.0152, 0.0153, 0.0154, 0.0155, - 0.0156, 0.0157, 0.0158, 0.0159, 0.016, 0.0161, 0.0162, 0.0163, 0.0164, 0.0165, 0.0166, 0.0167, 0.0168, 0.0169, - 0.017, 0.0171, 0.0172, 0.0173, 0.0174, 0.0175, 0.0176, 0.0177, 0.0178, 0.0179, 0.018, 0.0181, 0.0182, 0.0183, - 0.0184, 0.0185, 0.0186, 0.0187, 0.0188, 0.0189, 0.019, 0.0191, 0.0192, 0.0193, 0.0194, 0.0195, 0.0196, 0.0197, - 0.0198, 0.0199, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.155, - 0.16, 0.165, 0.175, 0.18, 0.185, 0.2, 0.225, 0.25, 0.25, 0.275, 0.3, 0.35, 0.35, 0.4, - 0.45, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, - 3.0, 3.5, 4.0, 5.0, 6.0, 8.0, 10.0, 15.0, 20.0, 30.0, 50.0, 100.}; + 0.01, 0.0101, 0.0102, 0.0103, 0.0104, 0.0105, 0.0106, 0.0107, 0.0108, 0.0109, 0.011, + 0.0111, 0.0112, 0.0113, 0.0114, 0.0115, 0.0116, 0.0117, 0.0118, 0.0119, 0.012, + 0.0121, 0.0122, 0.0123, 0.0124, 0.0125, 0.0126, 0.0127, 0.0128, 0.0129, 0.013, + 0.0131, 0.0132, 0.0133, 0.0134, 0.0135, 0.0136, 0.0137, 0.0138, 0.0139, 0.014, + 0.0141, 0.0142, 0.0143, 0.0144, 0.0145, 0.0146, 0.0147, 0.0148, 0.0149, 0.015, + 0.0151, 0.0152, 0.0153, 0.0154, 0.0155, 0.0156, 0.0157, 0.0158, 0.0159, 0.016, + 0.0161, 0.0162, 0.0163, 0.0164, 0.0165, 0.0166, 0.0167, 0.0168, 0.0169, 0.017, + 0.0171, 0.0172, 0.0173, 0.0174, 0.0175, 0.0176, 0.0177, 0.0178, 0.0179, 0.018, + 0.0181, 0.0182, 0.0183, 0.0184, 0.0185, 0.0186, 0.0187, 0.0188, 0.0189, 0.019, + 0.0191, 0.0192, 0.0193, 0.0194, 0.0195, 0.0196, 0.0197, 0.0198, 0.0199, 0.02, + 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.155, 0.16, 0.165, + 0.175, 0.18, 0.185, 0.2, 0.225, 0.25, 0.275, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, + 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 6.0, + 8.0, 10.0, 15.0, 20.0, 30.0, 50.0, 100.0}; o2fw::Configurable nBinsEta{"nBinsEta", 30, "Number of bins for the pseudorapidity"}; std::array etaRange = {-3, 3}; From 99bb72d231ecf01ede8b385dfd7249836a6afa4a Mon Sep 17 00:00:00 2001 From: Henrique Zanoli Date: Fri, 18 Dec 2020 10:36:05 +0100 Subject: [PATCH 5/6] Unify Pt bins --- Analysis/Tasks/PWGHF/qaTask.cxx | 59 +++++++++++---------------------- 1 file changed, 20 insertions(+), 39 deletions(-) diff --git a/Analysis/Tasks/PWGHF/qaTask.cxx b/Analysis/Tasks/PWGHF/qaTask.cxx index ce2722c513c91..802394e43ad81 100644 --- a/Analysis/Tasks/PWGHF/qaTask.cxx +++ b/Analysis/Tasks/PWGHF/qaTask.cxx @@ -165,6 +165,22 @@ Feature CovarianceYZ("Cov_{yz}", "cm^{2}"); Feature CovarianceZZ("Cov_{zz}", "cm^{2}"); Feature VertexChi2("#Chi^{2}"); +std::vector PtBins = { + 0.01, 0.0101, 0.0102, 0.0103, 0.0104, 0.0105, 0.0106, 0.0107, 0.0108, 0.0109, 0.011, + 0.0111, 0.0112, 0.0113, 0.0114, 0.0115, 0.0116, 0.0117, 0.0118, 0.0119, 0.012, + 0.0121, 0.0122, 0.0123, 0.0124, 0.0125, 0.0126, 0.0127, 0.0128, 0.0129, 0.013, + 0.0131, 0.0132, 0.0133, 0.0134, 0.0135, 0.0136, 0.0137, 0.0138, 0.0139, 0.014, + 0.0141, 0.0142, 0.0143, 0.0144, 0.0145, 0.0146, 0.0147, 0.0148, 0.0149, 0.015, + 0.0151, 0.0152, 0.0153, 0.0154, 0.0155, 0.0156, 0.0157, 0.0158, 0.0159, 0.016, + 0.0161, 0.0162, 0.0163, 0.0164, 0.0165, 0.0166, 0.0167, 0.0168, 0.0169, 0.017, + 0.0171, 0.0172, 0.0173, 0.0174, 0.0175, 0.0176, 0.0177, 0.0178, 0.0179, 0.018, + 0.0181, 0.0182, 0.0183, 0.0184, 0.0185, 0.0186, 0.0187, 0.0188, 0.0189, 0.019, + 0.0191, 0.0192, 0.0193, 0.0194, 0.0195, 0.0196, 0.0197, 0.0198, 0.0199, 0.02, + 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.155, 0.16, 0.165, + 0.175, 0.18, 0.185, 0.2, 0.225, 0.25, 0.275, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, + 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 6.0, + 8.0, 10.0, 15.0, 20.0, 30.0, 50.0, 100.0}; + } // namespace o2::qa::features namespace qafeat = o2::qa::features; @@ -261,9 +277,6 @@ struct QAGlobalObservables { /// Task to QA the kinematic properties of the tracks struct QATrackingKine { - o2fw::Configurable nBinsPt{"nBinsPt", 100, "Number of bins for Pt"}; - std::array ptRange = {0, 10.}; - o2fw::Configurable nBinsPhi{"nBinsPhi", 100, "Number of bins for Phi"}; o2fw::Configurable nBinsEta{"nBinsEta", 100, "Number of bins for the eta histogram."}; @@ -274,7 +287,7 @@ struct QATrackingKine { void init(o2fw::InitContext&) { histos.add("tracking/pt", qafeat::MakeTitle({qafeat::Pt}).c_str(), o2fw::kTH1D, - {{nBinsPt, ptRange[0], ptRange[1]}}); + {qafeat::PtBins}); histos.add("tracking/eta", qafeat::MakeTitle({qafeat::Eta.NameRaw()}).c_str(), o2fw::kTH1D, {{nBinsEta, etaRange[0], etaRange[1]}}); histos.add("tracking/phi", qafeat::MakeTitle({qafeat::Phi}).c_str(), o2fw::kTH1D, {{nBinsPhi, 0, 2 * M_PI}}); @@ -290,22 +303,6 @@ struct QATrackingKine { /// Task to evaluate the tracking resolution (Pt, Eta, Phi and impact parameter) struct QATrackingResolution { - std::vector ptBins = { - 0.01, 0.0101, 0.0102, 0.0103, 0.0104, 0.0105, 0.0106, 0.0107, 0.0108, 0.0109, 0.011, - 0.0111, 0.0112, 0.0113, 0.0114, 0.0115, 0.0116, 0.0117, 0.0118, 0.0119, 0.012, - 0.0121, 0.0122, 0.0123, 0.0124, 0.0125, 0.0126, 0.0127, 0.0128, 0.0129, 0.013, - 0.0131, 0.0132, 0.0133, 0.0134, 0.0135, 0.0136, 0.0137, 0.0138, 0.0139, 0.014, - 0.0141, 0.0142, 0.0143, 0.0144, 0.0145, 0.0146, 0.0147, 0.0148, 0.0149, 0.015, - 0.0151, 0.0152, 0.0153, 0.0154, 0.0155, 0.0156, 0.0157, 0.0158, 0.0159, 0.016, - 0.0161, 0.0162, 0.0163, 0.0164, 0.0165, 0.0166, 0.0167, 0.0168, 0.0169, 0.017, - 0.0171, 0.0172, 0.0173, 0.0174, 0.0175, 0.0176, 0.0177, 0.0178, 0.0179, 0.018, - 0.0181, 0.0182, 0.0183, 0.0184, 0.0185, 0.0186, 0.0187, 0.0188, 0.0189, 0.019, - 0.0191, 0.0192, 0.0193, 0.0194, 0.0195, 0.0196, 0.0197, 0.0198, 0.0199, 0.02, - 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.155, 0.16, 0.165, - 0.175, 0.18, 0.185, 0.2, 0.225, 0.25, 0.275, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, - 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 6.0, - 8.0, 10.0, 15.0, 20.0, 30.0, 50.0, 100.0}; - o2fw::Configurable useOnlyPhysicsPrimary{"useOnlyPhysicsPrimary", true, "Whether to use only physical primary particles for the resolution."}; @@ -326,7 +323,7 @@ struct QATrackingResolution { o2fw::Configurable nBinsImpactParameter{"nBinsImpactParameter", 2000, "Number of bins for the Impact parameter"}; - std::array impactParameterRange = {-500, 500}; // micrometer + std::array impactParameterRange = {-500, 500}; // micrometer std::array impactParameterResolutionRange = {0, 1000}; // micrometer // Registry of histograms @@ -336,7 +333,7 @@ struct QATrackingResolution { { // Histogram axis definitions - o2fw::AxisSpec ptAxis{ptBins}; + o2fw::AxisSpec ptAxis{qafeat::PtBins}; o2fw::AxisSpec deltaPtAxis{nBinsDeltaPt, deltaPtRange[0], deltaPtRange[1]}; o2fw::AxisSpec deltaPtRelativeAxis{nBinsDeltaPt, deltaPtRange[0], deltaPtRange[1]}; o2fw::AxisSpec deltaPtAbsoluteRelativeAxis{nBinsDeltaPt, 0., deltaPtRange[1]}; @@ -494,22 +491,6 @@ struct QATrackingResolution { /// Task to QA the efficiency of a particular particle defined by particlePDG template struct QATrackingEfficiency { - std::vector ptBins = { - 0.01, 0.0101, 0.0102, 0.0103, 0.0104, 0.0105, 0.0106, 0.0107, 0.0108, 0.0109, 0.011, - 0.0111, 0.0112, 0.0113, 0.0114, 0.0115, 0.0116, 0.0117, 0.0118, 0.0119, 0.012, - 0.0121, 0.0122, 0.0123, 0.0124, 0.0125, 0.0126, 0.0127, 0.0128, 0.0129, 0.013, - 0.0131, 0.0132, 0.0133, 0.0134, 0.0135, 0.0136, 0.0137, 0.0138, 0.0139, 0.014, - 0.0141, 0.0142, 0.0143, 0.0144, 0.0145, 0.0146, 0.0147, 0.0148, 0.0149, 0.015, - 0.0151, 0.0152, 0.0153, 0.0154, 0.0155, 0.0156, 0.0157, 0.0158, 0.0159, 0.016, - 0.0161, 0.0162, 0.0163, 0.0164, 0.0165, 0.0166, 0.0167, 0.0168, 0.0169, 0.017, - 0.0171, 0.0172, 0.0173, 0.0174, 0.0175, 0.0176, 0.0177, 0.0178, 0.0179, 0.018, - 0.0181, 0.0182, 0.0183, 0.0184, 0.0185, 0.0186, 0.0187, 0.0188, 0.0189, 0.019, - 0.0191, 0.0192, 0.0193, 0.0194, 0.0195, 0.0196, 0.0197, 0.0198, 0.0199, 0.02, - 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.155, 0.16, 0.165, - 0.175, 0.18, 0.185, 0.2, 0.225, 0.25, 0.275, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, - 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 6.0, - 8.0, 10.0, 15.0, 20.0, 30.0, 50.0, 100.0}; - o2fw::Configurable nBinsEta{"nBinsEta", 30, "Number of bins for the pseudorapidity"}; std::array etaRange = {-3, 3}; @@ -520,7 +501,7 @@ struct QATrackingEfficiency { void init(o2fw::InitContext&) { - o2fw::AxisSpec ptAxis{ptBins}; + o2fw::AxisSpec ptAxis{qafeat::PtBins}; o2fw::AxisSpec phiAxis{nBinsPhi, phiRange[0], phiRange[1]}; o2fw::AxisSpec etaAxis{nBinsEta, etaRange[0], etaRange[1]}; From f2e69f94b40d88b120170ab8c8a9d0e8ca221f99 Mon Sep 17 00:00:00 2001 From: Henrique Zanoli Date: Mon, 21 Dec 2020 11:02:20 +0100 Subject: [PATCH 6/6] Fix another histogram name --- Analysis/Tasks/PWGHF/qaTask.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Analysis/Tasks/PWGHF/qaTask.cxx b/Analysis/Tasks/PWGHF/qaTask.cxx index fa5ab97087794..6bf15bd54e282 100644 --- a/Analysis/Tasks/PWGHF/qaTask.cxx +++ b/Analysis/Tasks/PWGHF/qaTask.cxx @@ -18,6 +18,7 @@ #include "Framework/HistogramRegistry.h" #include "AnalysisCore/trackUtilities.h" #include "ReconstructionDataFormats/DCA.h" +#include "AnalysisDataModel/TrackSelectionTables.h" #include "AnalysisCore/MC.h" #include "TPDGCode.h" @@ -257,7 +258,7 @@ struct QAGlobalObservables { histograms.fill(HIST("collision/collisionZ"), collision.posZ()); histograms.fill(HIST("collision/numberOfContributors"), collision.numContrib()); - histograms.fill("collision/vertexChi2", collision.chi2()); + histograms.fill(HIST("collision/vertexChi2"), collision.chi2()); histograms.fill(HIST("covariance/xx"), collision.covXX()); histograms.fill(HIST("covariance/xy"), collision.covXY());