Skip to content
Merged
Changes from 2 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
39 changes: 28 additions & 11 deletions DPG/Tasks/AOTTrack/qaImpPar.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/qaImpPar.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-process]

Use constant references for table subscriptions in process functions.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -15,6 +15,8 @@
/// PID: o2-analysis-pid-tpc-full | o2-analysis-pid-tof-full
/// Working configuration (2021 Oct 20th): o2-analysis-trackextension -b --aod-file ./AO2D.root | o2-analysis-trackselection -b --isRun3 1 | o2-analysis-pid-tpc-full -b | o2-analysis-pid-tof-full -b | o2-analysis-pp-qa-impact-parameter -b

#include <string>

#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "ReconstructionDataFormats/DCA.h"
Expand Down Expand Up @@ -62,7 +64,7 @@
ConfigurableAxis binningPulls{"binningPulls", {200, -10.f, 10.f}, "Pulls binning"};
ConfigurableAxis binningPt{"binningPt", {100, 0.f, 10.f}, "Pt binning"};
ConfigurableAxis binningEta{"binningEta", {40, -2.f, 2.f}, "Eta binning"};
ConfigurableAxis binningPhi{"binningPhi", {24, 0.f, TMath::TwoPi()}, "Phi binning"};

Check failure on line 67 in DPG/Tasks/AOTTrack/qaImpPar.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
ConfigurableAxis binningPDG{"binningPDG", {5, -1.5f, 3.5f}, "PDG species binning (-1: not matched, 0: unknown, 1: pi, 2: K, 3: p)"};
ConfigurableAxis binningCharge{"binningCharge", {2, -2.f, 2.f}, "charge binning (-1: negative; +1: positive)"};
ConfigurableAxis binningIuPosX{"binningIuPosX", {100, -10.f, 10.f}, "Track IU x position"};
Expand Down Expand Up @@ -116,6 +118,7 @@
Configurable<int> customITShitmap_exclude{"customITShitmap_exclude", 0, "Custom ITS hitmap of layers to be excluded (consider the binary representation)"};
Configurable<int> n_customMinITShits{"n_customMinITShits", 0, "Minimum number of layers crossed by a track among those in \"customITShitmap\""};
Configurable<bool> custom_forceITSTPCmatching{"custom_forceITSTPCmatching", false, "Consider or not only ITS-TPC macthed tracks when using custom ITS hitmap"};
Configurable<float> downsamplingFraction{"downsamplingFraction", 1.1, "Fraction of tracks to be used to fill the output objects"};

/// Custom cut selection objects
TrackSelection selector_ITShitmap;
Expand All @@ -128,11 +131,11 @@
// with Run 3 Reco/MC enable '--isRun3 1' option
Filter trackFilter = (trackSelection.node() == 0) ||
((trackSelection.node() == 1) && requireGlobalTrackInFilter()) || /// filterbit 4 track selections + tight DCA cuts
((trackSelection.node() == 2) && requireGlobalTrackWoPtEtaInFilter()) ||

Check failure on line 134 in DPG/Tasks/AOTTrack/qaImpPar.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 135 in DPG/Tasks/AOTTrack/qaImpPar.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 136 in DPG/Tasks/AOTTrack/qaImpPar.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) && requireTrackCutInFilter(TrackSelectionFlags::kInAcceptanceTracks)) ||

Check failure on line 137 in DPG/Tasks/AOTTrack/qaImpPar.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() == 6) && requireTrackCutInFilter(TrackSelectionFlags::kGlobalTrackWoDCAxy));

Check failure on line 138 in DPG/Tasks/AOTTrack/qaImpPar.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.
// Pt selection
Filter ptMinFilter = o2::aod::track::pt > ptMin;

Expand Down Expand Up @@ -163,7 +166,7 @@
const trackTable& tracksUnfiltered,
const o2::soa::Filtered<trackFullTable>& tracks,
const trackTableIU& tracksIU,
o2::aod::BCsWithTimestamps const&)

Check failure on line 169 in DPG/Tasks/AOTTrack/qaImpPar.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-process]

Argument o2::soa::Filtered<collisionRecoTable>::iterator& collision is not const&.
{
/// here call the template processReco function
auto bc = collision.bc_as<o2::aod::BCsWithTimestamps>();
Expand All @@ -180,7 +183,7 @@
const trackTableIU& tracksIU,
const o2::aod::McParticles& mcParticles,
const o2::aod::McCollisions&,
o2::aod::BCsWithTimestamps const&)

Check failure on line 186 in DPG/Tasks/AOTTrack/qaImpPar.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-process]

Argument o2::soa::Filtered<collisionMCRecoTable>::iterator& collision is not const&.
{
/// here call the template processReco function
auto bc = collision.bc_as<o2::aod::BCsWithTimestamps>();
Expand Down Expand Up @@ -245,7 +248,7 @@
/// Custom cut selection objects - ITS layers that must be present
std::set<uint8_t> set_customITShitmap; // = {};
if (use_customITSHitMap) {
for (int index_ITSlayer = 0; index_ITSlayer < 7; index_ITSlayer++) {

Check failure on line 251 in DPG/Tasks/AOTTrack/qaImpPar.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 ((customITShitmap & (1 << index_ITSlayer)) > 0) {
set_customITShitmap.insert(static_cast<uint8_t>(index_ITSlayer));
}
Expand Down Expand Up @@ -492,6 +495,11 @@
/// loop over tracks
float pt = -999.f;
float p = -999.f;
float eta = -999.f;
float phi = -999.f;
int8_t sign = -1;
bool isPvContributor = false;
int nContributors = -1;
float impParRPhi = -999.f;
float impParZ = -999.f;
float impParRPhiSigma = 999.f;
Expand All @@ -511,7 +519,8 @@
int cnt = 0;
for (const auto& track : tracks) {

if (keepOnlyPvContrib && !track.isPVContributor()) {
isPvContributor = track.isPVContributor();
if (keepOnlyPvContrib && !isPvContributor) {
/// let's skip all tracks that were not PV contributors originally
/// this let us ignore tracks flagged as ambiguous
continue;
Expand Down Expand Up @@ -710,25 +719,33 @@
}

/// all tracks
histograms.fill(HIST("Reco/h4ImpPar"), pt, impParRPhi, track.eta(), track.phi(), pdgIndex, track.sign(), collision.numContrib(), track.isPVContributor());
histograms.fill(HIST("Reco/h4ImpParZ"), pt, impParZ, track.eta(), track.phi(), pdgIndex, track.sign(), collision.numContrib(), track.isPVContributor());
if ((pt * 1000 - static_cast<int>(pt * 1000)) > downsamplingFraction) {
// downsampling - do not consider the current track
continue;
}
eta = track.eta();
phi = track.phi();
sign = track.sign();
nContributors = collision.numContrib();
histograms.fill(HIST("Reco/h4ImpPar"), pt, impParRPhi, eta, phi, pdgIndex, sign, nContributors, isPvContributor);
histograms.fill(HIST("Reco/h4ImpParZ"), pt, impParZ, eta, phi, pdgIndex, sign, nContributors, isPvContributor);
if (addTrackIUinfo) {
histograms.fill(HIST("Reco/h4ClusterSizeIU"), p, impParRPhi, trackIuPosX, trackIuPosY, trackIuPosZ, clusterSizeInLayer0);
// histograms.fill(HIST("Reco/h4ImpParIU"), p, impParRPhi, trackIuPosX, trackIuPosY, trackIuPosZ);
histograms.fill(HIST("Reco/h4ImpParZIU"), p, impParZ, trackIuPosX, trackIuPosY, trackIuPosZ);
}
if (fEnablePulls) {
histograms.fill(HIST("Reco/h4ImpParPulls"), pt, impParRPhi / impParRPhiSigma, track.eta(), track.phi(), pdgIndex, track.sign(), collision.numContrib(), track.isPVContributor());
histograms.fill(HIST("Reco/h4ImpParZPulls"), pt, impParZ / impParZSigma, track.eta(), track.phi(), pdgIndex, track.sign(), collision.numContrib(), track.isPVContributor());
histograms.fill(HIST("Reco/h4ImpParPulls"), pt, impParRPhi / impParRPhiSigma, eta, phi, pdgIndex, sign, nContributors, isPvContributor);
histograms.fill(HIST("Reco/h4ImpParZPulls"), pt, impParZ / impParZSigma, eta, phi, pdgIndex, sign, nContributors, isPvContributor);
}

if (isPIDPionApplied && nSigmaTPCPionMin < tpcNSigmaPion && tpcNSigmaPion < nSigmaTPCPionMax && nSigmaTOFPionMin < tofNSigmaPion && tofNSigmaPion < nSigmaTOFPionMax) {
/// PID selected pions
if (addTrackIUinfo) {
histograms.fill(HIST("Reco/h4ClusterSizeIU_Pion"), p, impParRPhi, trackIuPosX, trackIuPosY, trackIuPosZ, clusterSizeInLayer0);
}
histograms.fill(HIST("Reco/h4ImpPar_Pion"), pt, impParRPhi, track.eta(), track.phi(), pdgIndex, track.sign(), collision.numContrib(), track.isPVContributor());
histograms.fill(HIST("Reco/h4ImpParZ_Pion"), pt, impParZ, track.eta(), track.phi(), pdgIndex, track.sign(), collision.numContrib(), track.isPVContributor());
histograms.fill(HIST("Reco/h4ImpPar_Pion"), pt, impParRPhi, eta, phi, pdgIndex, sign, nContributors, isPvContributor);
histograms.fill(HIST("Reco/h4ImpParZ_Pion"), pt, impParZ, eta, phi, pdgIndex, sign, nContributors, isPvContributor);
histograms.fill(HIST("Reco/hNSigmaTPCPion_afterPID"), pt, tpcNSigmaPion);
histograms.fill(HIST("Reco/hNSigmaTOFPion_afterPID"), pt, tofNSigmaPion);
}
Expand All @@ -737,8 +754,8 @@
if (addTrackIUinfo) {
histograms.fill(HIST("Reco/h4ClusterSizeIU_Kaon"), p, impParRPhi, trackIuPosX, trackIuPosY, trackIuPosZ, clusterSizeInLayer0);
}
histograms.fill(HIST("Reco/h4ImpPar_Kaon"), pt, impParRPhi, track.eta(), track.phi(), pdgIndex, track.sign(), collision.numContrib(), track.isPVContributor());
histograms.fill(HIST("Reco/h4ImpParZ_Kaon"), pt, impParZ, track.eta(), track.phi(), pdgIndex, track.sign(), collision.numContrib(), track.isPVContributor());
histograms.fill(HIST("Reco/h4ImpPar_Kaon"), pt, impParRPhi, eta, phi, pdgIndex, sign, nContributors, isPvContributor);
histograms.fill(HIST("Reco/h4ImpParZ_Kaon"), pt, impParZ, eta, phi, pdgIndex, sign, nContributors, isPvContributor);
histograms.fill(HIST("Reco/hNSigmaTPCKaon_afterPID"), pt, tpcNSigmaKaon);
histograms.fill(HIST("Reco/hNSigmaTOFKaon_afterPID"), pt, tofNSigmaKaon);
}
Expand All @@ -747,8 +764,8 @@
if (addTrackIUinfo) {
histograms.fill(HIST("Reco/h4ClusterSizeIU_Proton"), p, impParRPhi, trackIuPosX, trackIuPosY, trackIuPosZ, clusterSizeInLayer0);
}
histograms.fill(HIST("Reco/h4ImpPar_Proton"), pt, impParRPhi, track.eta(), track.phi(), pdgIndex, track.sign(), collision.numContrib(), track.isPVContributor());
histograms.fill(HIST("Reco/h4ImpParZ_Proton"), pt, impParZ, track.eta(), track.phi(), pdgIndex, track.sign(), collision.numContrib(), track.isPVContributor());
histograms.fill(HIST("Reco/h4ImpPar_Proton"), pt, impParRPhi, eta, phi, pdgIndex, sign, nContributors, isPvContributor);
histograms.fill(HIST("Reco/h4ImpParZ_Proton"), pt, impParZ, eta, phi, pdgIndex, sign, nContributors, isPvContributor);
histograms.fill(HIST("Reco/hNSigmaTPCProton_afterPID"), pt, tpcNSigmaProton);
histograms.fill(HIST("Reco/hNSigmaTOFProton_afterPID"), pt, tofNSigmaProton);
}
Expand Down
Loading