Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ALICE3/Core/FastTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <fairlogger/Logger.h>

#include <map>
#include <string>
#include <vector>

Expand Down
8 changes: 4 additions & 4 deletions DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -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 <Framework/AnalysisTask.h>
#include <Framework/HistogramRegistry.h>
#include <Framework/StaticFor.h>
#include <Framework/runDataProcessing.h>

using namespace o2;
using namespace o2::framework;
Expand All @@ -49,8 +49,8 @@
ConfigurableAxis tofBetaBins{"tofBetaBins", {4000, 0, 2.f}, "Binning in the TOF beta plot"};
ConfigurableAxis trackLengthBins{"trackLengthBins", {100, 0, 1000.f}, "Binning in track length plot"};
Configurable<bool> requireGoodMatchTracks{"requireGoodMatchTracks", false, "Require good match tracks"};
Configurable<float> mMaxTOFChi2{"maxTOFChi2", 3.f, "Maximum TOF Chi2"};

Check failure on line 52 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<float> mEtaWindow{"etaWindow", 0.8f, "Window in eta for tracks"};

Check failure on line 53 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)

void init(o2::framework::InitContext&)
{
Expand Down Expand Up @@ -201,13 +201,13 @@

Filter eventFilter = (applyEvSel.node() == 0) ||
((applyEvSel.node() == 1) && (o2::aod::evsel::sel7 == true)) ||
((applyEvSel.node() == 2) && (o2::aod::evsel::sel8 == true));

Check failure on line 204 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
Filter trackFilter = (trackSelection.node() == 0) ||
((trackSelection.node() == 1) && requireGlobalTrackInFilter()) ||
((trackSelection.node() == 2) && requireGlobalTrackWoPtEtaInFilter()) ||

Check failure on line 207 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
((trackSelection.node() == 3) && requireGlobalTrackWoDCAInFilter()) ||

Check failure on line 208 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
((trackSelection.node() == 4) && requireQualityTracksInFilter()) ||

Check failure on line 209 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
((trackSelection.node() == 5) && requireInAcceptanceTracksInFilter());

Check failure on line 210 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
Filter etaFilter = (nabs(o2::aod::track::eta) < mEtaWindow);

using CollisionCandidate = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels>>::iterator;
Expand All @@ -224,7 +224,7 @@
if (!collision.sel7()) {
return;
}
} else if (applyEvSel == 2) {

Check failure on line 227 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
if (!collision.sel8()) {
return;
}
Expand All @@ -232,7 +232,7 @@

histos.fill(HIST("event/evsel"), 2);

if (std::abs(collision.posZ()) > 10.f) {

Check failure on line 235 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return;
}

Expand Down
17 changes: 12 additions & 5 deletions DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Framework/AnalysisTask.h>
#include <Framework/HistogramRegistry.h>
#include <Framework/StaticFor.h>
#include <Framework/runDataProcessing.h>

using namespace o2;
using namespace o2::framework;
Expand Down Expand Up @@ -55,6 +54,7 @@ std::array<std::shared_ptr<TH2>, NpNp> hNSigmaMC;
std::array<std::shared_ptr<TH2>, NpNp> hNSigmaMCprm;
std::array<std::shared_ptr<TH2>, NpNp> hNSigmaMCstr;
std::array<std::shared_ptr<TH2>, NpNp> hNSigmaMCmat;
std::array<std::shared_ptr<TH2>, NpNp> hNSigmaMCgoodmatch;

std::array<std::shared_ptr<TH2>, NpNp> hDeltaMCEvTime;
std::array<std::shared_ptr<TH2>, NpNp> hDeltaMCEvTimeTrueGoodEv;
Expand Down Expand Up @@ -278,6 +278,7 @@ struct pidTofQaMc {
const AxisSpec nSigmaAxis{binsNsigma, Form("N_{#sigma}^{TOF}(%s)", pT[massID])};

hNSigmaMC[mcID * Np + massID] = histos.add<TH2>(Form("nsigmaMC/%s/%s", pName[mcID], pName[massID]), pT[mcID], HistType::kTH2F, {ptAxis, nSigmaAxis});
hNSigmaMCgoodmatch[mcID * Np + massID] = histos.add<TH2>(Form("nsigmaMCgoodmatch/%s/%s", pName[mcID], pName[massID]), pT[mcID], HistType::kTH2F, {ptAxis, nSigmaAxis});
if (checkPrimaries) {
hNSigmaMCprm[mcID * Np + massID] = histos.add<TH2>(Form("nsigmaMCprm/%s/%s", pName[mcID], pName[massID]), pT[mcID], HistType::kTH2F, {ptAxis, nSigmaAxis});
hNSigmaMCstr[mcID * Np + massID] = histos.add<TH2>(Form("nsigmaMCstr/%s/%s", pName[mcID], pName[massID]), pT[mcID], HistType::kTH2F, {ptAxis, nSigmaAxis});
Expand Down Expand Up @@ -648,6 +649,12 @@ struct pidTofQaMc {
const float nsigmaMassID = o2::aod::pidutils::tofNSigma<massID>(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) {
Expand Down
104 changes: 65 additions & 39 deletions DPG/Tasks/AOTTrack/qaFakeHits.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Framework/AnalysisTask.h>
#include <Framework/HistogramRegistry.h>
#include <Framework/StaticFor.h>
#include <Framework/runDataProcessing.h>
#include <ReconstructionDataFormats/DCA.h>
#include <ReconstructionDataFormats/Track.h>

using namespace o2::framework;
// Particle information
Expand All @@ -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<std::shared_ptr<TH1>, nParticles> hPtAll;
std::array<std::shared_ptr<TH1>, nParticles> hPtITS;
std::array<std::shared_ptr<TH1>, nParticles> hPtTPC;
std::array<std::shared_ptr<TH1>, nParticles> hPtTRD;
std::array<std::shared_ptr<TH1>, nParticles> hPtTOF;
std::array<std::shared_ptr<TH1>, nParticles> hPtOverall;
std::array<std::shared_ptr<TH2>, nParticles> hPtAll;
std::array<std::shared_ptr<TH2>, nParticles> hPtITS;
std::array<std::shared_ptr<TH2>, nParticles> hPtITSAB;
std::array<std::shared_ptr<TH2>, nParticles> hPtITSTPC;
std::array<std::shared_ptr<TH2>, nParticles> hPtTPC;
std::array<std::shared_ptr<TH2>, nParticles> hPtTRD;
std::array<std::shared_ptr<TH2>, nParticles> hPtTOF;
std::array<std::shared_ptr<TH2>, nParticles> hPtOverall;
std::array<std::shared_ptr<TH2>, nParticles> hPtNoise;
std::array<std::shared_ptr<TH2>, nParticles> hPtNoMismatch;

struct QaFakeHits {
// Charge selection
Expand Down Expand Up @@ -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<TH1>(Form("MC/pdg%i/pt/all", PDGs[histogramIndex]), "All tracks " + tagPt, kTH1D, {axisPt});
hPtITS[histogramIndex] = histos.add<TH1>(Form("MC/pdg%i/pt/mismatched/its", PDGs[histogramIndex]), "ITS mismatch " + tagPt, kTH1D, {axisPt});
hPtTPC[histogramIndex] = histos.add<TH1>(Form("MC/pdg%i/pt/mismatched/tpc", PDGs[histogramIndex]), "TPC mismatch " + tagPt, kTH1D, {axisPt});
hPtTRD[histogramIndex] = histos.add<TH1>(Form("MC/pdg%i/pt/mismatched/trd", PDGs[histogramIndex]), "TRD mismatch " + tagPt, kTH1D, {axisPt});
hPtTOF[histogramIndex] = histos.add<TH1>(Form("MC/pdg%i/pt/mismatched/tof", PDGs[histogramIndex]), "TOF mismatch " + tagPt, kTH1D, {axisPt});
hPtOverall[histogramIndex] = histos.add<TH1>(Form("MC/pdg%i/pt/mismatched/overall", PDGs[histogramIndex]), "Overall mismatch " + tagPt, kTH1D, {axisPt});
hPtAll[histogramIndex] = histos.add<TH2>(Form("MC/pdg%i/pt/all", PDGs[histogramIndex]), "All tracks " + tagPt, kTH2D, {axisPt, axisPtDiff});
hPtITS[histogramIndex] = histos.add<TH2>(Form("MC/pdg%i/pt/mismatched/its", PDGs[histogramIndex]), "ITS mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff});
hPtITSAB[histogramIndex] = histos.add<TH2>(Form("MC/pdg%i/pt/mismatched/itsab", PDGs[histogramIndex]), "ITSAB mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff});
hPtTPC[histogramIndex] = histos.add<TH2>(Form("MC/pdg%i/pt/mismatched/tpc", PDGs[histogramIndex]), "TPC mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff});
hPtITSTPC[histogramIndex] = histos.add<TH2>(Form("MC/pdg%i/pt/mismatched/itstpc", PDGs[histogramIndex]), "ITSTPC mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff});
hPtTRD[histogramIndex] = histos.add<TH2>(Form("MC/pdg%i/pt/mismatched/trd", PDGs[histogramIndex]), "TRD mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff});
hPtTOF[histogramIndex] = histos.add<TH2>(Form("MC/pdg%i/pt/mismatched/tof", PDGs[histogramIndex]), "TOF mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff});
hPtOverall[histogramIndex] = histos.add<TH2>(Form("MC/pdg%i/pt/mismatched/overall", PDGs[histogramIndex]), "Overall mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff});
hPtNoise[histogramIndex] = histos.add<TH2>(Form("MC/pdg%i/pt/mismatched/noise", PDGs[histogramIndex]), "Noise " + tagPt, kTH2D, {axisPt, axisPtDiff});
hPtNoMismatch[histogramIndex] = histos.add<TH2>(Form("MC/pdg%i/pt/mismatched/no", PDGs[histogramIndex]), "No mismatch " + tagPt, kTH2D, {axisPt, axisPtDiff});

LOG(info) << "Done with particle: " << partName;
}
Expand Down Expand Up @@ -185,14 +191,18 @@ 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)) {
mismatchInITS = true;
break;
}
}
if (mismatchInITS) {
hPtITS[histogramIndex]->Fill(mcParticle.pt(), ptDiff);
}

bool mismatchInTPC = false;
for (int i = 7; i < 10; i++) {
Expand All @@ -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);
}
}

Expand All @@ -227,12 +249,16 @@ struct QaFakeHits {

// MC process
void process(o2::aod::Collision const& /*collision*/,
o2::soa::Join<TrackCandidates, o2::aod::McTrackLabels> 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<pdgSign, o2::track::PID::Electron>(track, doEl);
fillMCTrackHistograms<pdgSign, o2::track::PID::Muon>(track, doMu);
Expand Down
Loading