diff --git a/ALICE3/Core/FastTracker.h b/ALICE3/Core/FastTracker.h index e26ee3a2da0..b104563fa7c 100644 --- a/ALICE3/Core/FastTracker.h +++ b/ALICE3/Core/FastTracker.h @@ -19,6 +19,7 @@ #include +#include #include #include diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx index 4fe9551d434..2bcccc5a67b 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx @@ -21,10 +21,10 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "Common/TableProducer/PID/pidTOFBase.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx index 2e6987ce034..3a0f2de652f 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx @@ -15,14 +15,13 @@ /// \brief Task to produce QA output of the PID with TOF running on the MC e.g. to compute purity. /// -// O2 includes #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -55,6 +54,7 @@ std::array, NpNp> hNSigmaMC; std::array, NpNp> hNSigmaMCprm; std::array, NpNp> hNSigmaMCstr; std::array, NpNp> hNSigmaMCmat; +std::array, NpNp> hNSigmaMCgoodmatch; std::array, NpNp> hDeltaMCEvTime; std::array, NpNp> hDeltaMCEvTimeTrueGoodEv; @@ -278,6 +278,7 @@ struct pidTofQaMc { const AxisSpec nSigmaAxis{binsNsigma, Form("N_{#sigma}^{TOF}(%s)", pT[massID])}; hNSigmaMC[mcID * Np + massID] = histos.add(Form("nsigmaMC/%s/%s", pName[mcID], pName[massID]), pT[mcID], HistType::kTH2F, {ptAxis, nSigmaAxis}); + hNSigmaMCgoodmatch[mcID * Np + massID] = histos.add(Form("nsigmaMCgoodmatch/%s/%s", pName[mcID], pName[massID]), pT[mcID], HistType::kTH2F, {ptAxis, nSigmaAxis}); if (checkPrimaries) { hNSigmaMCprm[mcID * Np + massID] = histos.add(Form("nsigmaMCprm/%s/%s", pName[mcID], pName[massID]), pT[mcID], HistType::kTH2F, {ptAxis, nSigmaAxis}); hNSigmaMCstr[mcID * Np + massID] = histos.add(Form("nsigmaMCstr/%s/%s", pName[mcID], pName[massID]), pT[mcID], HistType::kTH2F, {ptAxis, nSigmaAxis}); @@ -648,6 +649,12 @@ struct pidTofQaMc { const float nsigmaMassID = o2::aod::pidutils::tofNSigma(track); hNSigmaMC[mcID * Np + massID]->Fill(track.pt(), nsigmaMassID); + if (track.hasTOF() && track.mcMask() & (0x1 << 15)) { + // Bad match + } else { + // Good match + hNSigmaMCgoodmatch[mcID * Np + massID]->Fill(track.pt(), nsigmaMassID); + } if (checkPrimaries) { if (!particle.isPhysicalPrimary()) { if (particle.getProcess() == 4) { diff --git a/DPG/Tasks/AOTTrack/qaFakeHits.cxx b/DPG/Tasks/AOTTrack/qaFakeHits.cxx index 1da3a6a6674..4005b0834c9 100644 --- a/DPG/Tasks/AOTTrack/qaFakeHits.cxx +++ b/DPG/Tasks/AOTTrack/qaFakeHits.cxx @@ -16,18 +16,19 @@ /// \brief Task to analyze the fraction of the true and fake hits depending on where the fake hits are picked /// -// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/Track.h" +#include "PWGLF/DataModel/LFParticleIdentification.h" + #include "Common/Core/TrackSelection.h" -#include "Common/DataModel/EventSelection.h" #include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "PWGLF/DataModel/LFParticleIdentification.h" + +#include +#include +#include +#include +#include +#include using namespace o2::framework; // Particle information @@ -38,12 +39,16 @@ static constexpr const char* particleTitle[nParticles] = {"e", "#mu", "#pi", "K" "e", "#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"}; static constexpr int PDGs[nParticles] = {11, 13, 211, 321, 2212, 1000010020, 1000010030, 1000020030, 1000020040, -11, -13, -211, -321, -2212, -1000010020, -1000010030, -1000020030, -1000020040}; -std::array, nParticles> hPtAll; -std::array, nParticles> hPtITS; -std::array, nParticles> hPtTPC; -std::array, nParticles> hPtTRD; -std::array, nParticles> hPtTOF; -std::array, nParticles> hPtOverall; +std::array, nParticles> hPtAll; +std::array, nParticles> hPtITS; +std::array, nParticles> hPtITSAB; +std::array, nParticles> hPtITSTPC; +std::array, nParticles> hPtTPC; +std::array, nParticles> hPtTRD; +std::array, nParticles> hPtTOF; +std::array, nParticles> hPtOverall; +std::array, nParticles> hPtNoise; +std::array, nParticles> hPtNoMismatch; struct QaFakeHits { // Charge selection @@ -103,23 +108,24 @@ struct QaFakeHits { LOG(fatal) << "Can't interpret pdgSign " << pdgSign; } - const AxisSpec axisPt{ptBins, "#it{p}_{T} (GeV/#it{c})"}; - // const AxisSpec axisP{ptBins, "#it{p} (GeV/#it{c})"}; - // const AxisSpec axisEta{etaBins, "#it{#eta}"}; - // const AxisSpec axisY{yBins, "#it{y}"}; - // const AxisSpec axisPhi{phiBins, "#it{#varphi} (rad)"}; + const AxisSpec axisPt{ptBins, "#it{p}_{T}^{gen} (GeV/#it{c})"}; + const AxisSpec axisPtDiff{100, -1, 1, "#it{p}_{T}^{gen} - #it{p}_{T}^{rec} (GeV/#it{c})"}; const char* partName = particleName(pdgSign, id); LOG(info) << "Preparing histograms for particle: " << partName << " pdgSign " << pdgSign; const int histogramIndex = id + pdgSign * nSpecies; const TString tagPt = Form("%s ", partName); - hPtAll[histogramIndex] = histos.add(Form("MC/pdg%i/pt/all", PDGs[histogramIndex]), "All tracks " + tagPt, kTH1D, {axisPt}); - hPtITS[histogramIndex] = histos.add(Form("MC/pdg%i/pt/mismatched/its", PDGs[histogramIndex]), "ITS mismatch " + tagPt, kTH1D, {axisPt}); - hPtTPC[histogramIndex] = histos.add(Form("MC/pdg%i/pt/mismatched/tpc", PDGs[histogramIndex]), "TPC mismatch " + tagPt, kTH1D, {axisPt}); - hPtTRD[histogramIndex] = histos.add(Form("MC/pdg%i/pt/mismatched/trd", PDGs[histogramIndex]), "TRD mismatch " + tagPt, kTH1D, {axisPt}); - hPtTOF[histogramIndex] = histos.add(Form("MC/pdg%i/pt/mismatched/tof", PDGs[histogramIndex]), "TOF mismatch " + tagPt, kTH1D, {axisPt}); - hPtOverall[histogramIndex] = histos.add(Form("MC/pdg%i/pt/mismatched/overall", PDGs[histogramIndex]), "Overall mismatch " + tagPt, kTH1D, {axisPt}); + hPtAll[histogramIndex] = histos.add(Form("MC/pdg%i/pt/all", PDGs[histogramIndex]), "All tracks " + tagPt, kTH2D, {axisPt, axisPtDiff}); + hPtITS[histogramIndex] = histos.add(Form("MC/pdg%i/pt/mismatched/its", PDGs[histogramIndex]), "ITS mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff}); + hPtITSAB[histogramIndex] = histos.add(Form("MC/pdg%i/pt/mismatched/itsab", PDGs[histogramIndex]), "ITSAB mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff}); + hPtTPC[histogramIndex] = histos.add(Form("MC/pdg%i/pt/mismatched/tpc", PDGs[histogramIndex]), "TPC mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff}); + hPtITSTPC[histogramIndex] = histos.add(Form("MC/pdg%i/pt/mismatched/itstpc", PDGs[histogramIndex]), "ITSTPC mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff}); + hPtTRD[histogramIndex] = histos.add(Form("MC/pdg%i/pt/mismatched/trd", PDGs[histogramIndex]), "TRD mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff}); + hPtTOF[histogramIndex] = histos.add(Form("MC/pdg%i/pt/mismatched/tof", PDGs[histogramIndex]), "TOF mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff}); + hPtOverall[histogramIndex] = histos.add(Form("MC/pdg%i/pt/mismatched/overall", PDGs[histogramIndex]), "Overall mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff}); + hPtNoise[histogramIndex] = histos.add(Form("MC/pdg%i/pt/mismatched/noise", PDGs[histogramIndex]), "Noise " + tagPt, kTH2D, {axisPt, axisPtDiff}); + hPtNoMismatch[histogramIndex] = histos.add(Form("MC/pdg%i/pt/mismatched/no", PDGs[histogramIndex]), "No mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff}); LOG(info) << "Done with particle: " << partName; } @@ -185,7 +191,8 @@ struct QaFakeHits { if (!track.isGlobalTrack()) { return; } - hPtAll[histogramIndex]->Fill(mcParticle.pt()); + const float ptDiff = mcParticle.pt() - track.pt(); + hPtAll[histogramIndex]->Fill(mcParticle.pt(), ptDiff); bool mismatchInITS = false; for (int i = 0; i < 7; i++) { if (isMismatched(track, i)) { @@ -193,6 +200,9 @@ struct QaFakeHits { break; } } + if (mismatchInITS) { + hPtITS[histogramIndex]->Fill(mcParticle.pt(), ptDiff); + } bool mismatchInTPC = false; for (int i = 7; i < 10; i++) { @@ -201,24 +211,36 @@ struct QaFakeHits { break; } } - const bool mismatchInTRD = isMismatched(track, 10); - const bool mismatchInTOF = isMismatched(track, 11); - const bool overallMismatch = isMismatched(track, 15); - - if (mismatchInITS) { - hPtITS[histogramIndex]->Fill(mcParticle.pt()); - } if (mismatchInTPC) { - hPtTPC[histogramIndex]->Fill(mcParticle.pt()); + hPtTPC[histogramIndex]->Fill(mcParticle.pt(), ptDiff); } + + if (track.mcMask() == 0) { + hPtNoMismatch[histogramIndex]->Fill(mcParticle.pt(), ptDiff); + } + const bool mismatchInTRD = isMismatched(track, 10); // Not set if (mismatchInTRD) { - hPtTRD[histogramIndex]->Fill(mcParticle.pt()); + hPtTRD[histogramIndex]->Fill(mcParticle.pt(), ptDiff); } + const bool mismatchInTOF = isMismatched(track, 15) && track.hasTOF(); if (mismatchInTOF) { - hPtTOF[histogramIndex]->Fill(mcParticle.pt()); + hPtTOF[histogramIndex]->Fill(mcParticle.pt(), ptDiff); + } + const bool itsAfterBurnerMismatch = isMismatched(track, 12); + if (itsAfterBurnerMismatch) { + hPtITSAB[histogramIndex]->Fill(mcParticle.pt(), ptDiff); } + const bool itstpcMismatch = isMismatched(track, 13); + if (itstpcMismatch) { + hPtITSTPC[histogramIndex]->Fill(mcParticle.pt(), ptDiff); + } + const bool isNoise = isMismatched(track, 14); + if (isNoise) { + hPtNoise[histogramIndex]->Fill(mcParticle.pt(), ptDiff); + } + const bool overallMismatch = isMismatched(track, 15); if (overallMismatch) { - hPtOverall[histogramIndex]->Fill(mcParticle.pt()); + hPtOverall[histogramIndex]->Fill(mcParticle.pt(), ptDiff); } } @@ -227,12 +249,16 @@ struct QaFakeHits { // MC process void process(o2::aod::Collision const& /*collision*/, - o2::soa::Join const& tracks, + TrackCandidatesMC const& tracks, o2::aod::McCollisions const&, o2::aod::McParticles const&) { // Track loop for (const auto& track : tracks) { + + LOG(debug) << "Processing track with global index " << track.globalIndex() << " and mask " << track.mcMask(); + LOG(debug) << "mcMask bits: " << std::bitset<16>(track.mcMask()); + static_for<0, 1>([&](auto pdgSign) { fillMCTrackHistograms(track, doEl); fillMCTrackHistograms(track, doMu);