Skip to content
Merged
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
38 changes: 26 additions & 12 deletions DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@
/// \brief Implementation for QA tasks of the TOF PID quantities
///

#include "Framework/AnalysisTask.h"
#include "Framework/runDataProcessing.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/StaticFor.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/FT0Corrected.h"
#include "Common/DataModel/PIDResponse.h"
#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"

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
Expand Down Expand Up @@ -122,7 +123,7 @@
Configurable<float> minP{"minP", 0.1f, "Minimum momentum in range"};
Configurable<float> maxP{"maxP", 5.f, "Maximum momentum in range"};
ConfigurableAxis etaBins{"etaBins", {100, -1.f, 1.f}, "Binning in eta"};
ConfigurableAxis phiBins{"phiBins", {100, 0, TMath::TwoPi()}, "Binning in eta"};

Check failure on line 126 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.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 trackLengthBins{"trackLengthBins", {100, 0, 1000.f}, "Binning in track length plot"};
ConfigurableAxis deltaBins{"deltaBins", {200, -1000.f, 1000.f}, "Binning in Delta (T-Texp-T0)"};
ConfigurableAxis expSigmaBins{"expSigmaBins", {200, 0.f, 200.f}, "Binning in expected Sigma"};
Expand All @@ -135,7 +136,7 @@
Configurable<float> ptDeltaTEtaPhiMapMin{"ptDeltaTEtaPhiMapMin", 1.45f, "Threshold in pT to build the map of the delta time as a function of eta and phi"};
Configurable<float> ptDeltaTEtaPhiMapMax{"ptDeltaTEtaPhiMapMax", 1.55f, "Threshold in pT to build the map of the delta time as a function of eta and phi"};
Configurable<bool> splitSignalPerCharge{"splitSignalPerCharge", true, "Split the signal per charge (reduces memory footprint if off)"};
Configurable<bool> enableVsMomentumHistograms{"enableVsMomentumHistograms", false, "Enables plots vs momentum instead of just pT (reduces memory footprint if off)"};
Configurable<int> enableVsMomentumHistograms{"enableVsMomentumHistograms", 0, "1: Enables plots vs momentum instead of just pT 2: Enables plots vs momentum vs eta instead of just pT (reduces memory footprint if off)"};
Configurable<bool> requireGoodMatchTracks{"requireGoodMatchTracks", false, "Require good match tracks"};
Configurable<float> pvContributorsMin{"pvContributorsMin", -10, "Minimum pvContributors"};
Configurable<float> pvContributorsMax{"pvContributorsMax", 10000, "Maximum pvContributors"};
Expand Down Expand Up @@ -238,11 +239,16 @@
return;
}

if (enableVsMomentumHistograms) {
if (enableVsMomentumHistograms == 1) {
histos.add(hdelta_evtime_fill[id].data(), axisTitle, kTH2F, {pAxis, deltaAxis});
histos.add(hdelta_evtime_tof[id].data(), axisTitle, kTH2F, {pAxis, deltaAxis});
histos.add(hdelta_evtime_ft0[id].data(), axisTitle, kTH2F, {pAxis, deltaAxis});
histos.add(hdelta_evtime_tofft0[id].data(), axisTitle, kTH2F, {pAxis, deltaAxis});
} else if (enableVsMomentumHistograms == 2) {

Check failure on line 247 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.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.
histos.add(hdelta_evtime_fill[id].data(), axisTitle, kTH3F, {pAxis, etaAxis, deltaAxis});
histos.add(hdelta_evtime_tof[id].data(), axisTitle, kTH3F, {pAxis, etaAxis, deltaAxis});
histos.add(hdelta_evtime_ft0[id].data(), axisTitle, kTH3F, {pAxis, etaAxis, deltaAxis});
histos.add(hdelta_evtime_tofft0[id].data(), axisTitle, kTH3F, {pAxis, etaAxis, deltaAxis});
}

if (splitSignalPerCharge) {
Expand Down Expand Up @@ -299,7 +305,7 @@
histos.add("event/pvcontributors", "", kTH1D, {contributorsAxis});
histos.add("event/vertexz", "", kTH1D, {vtxZAxis});
h = histos.add<TH1>("event/particlehypo", "", kTH1D, {{10, 0, 10, "PID in tracking"}});
for (int i = 0; i < 9; i++) {

Check failure on line 308 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.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.
h->GetXaxis()->SetBinLabel(i + 1, PID::getName(i));
}

Expand Down Expand Up @@ -345,7 +351,7 @@
if (!collision.sel7()) {
return false;
}
} else if (applyEvSel == 2) {

Check failure on line 354 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.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 false;
}
Expand All @@ -361,7 +367,7 @@
int evtimeflag = 0;

if constexpr (fillHistograms) {
for (auto t : tracks) {

Check failure on line 370 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!t.hasTOF()) { // Skipping tracks without TOF
continue;
}
Expand All @@ -381,7 +387,7 @@
}
}
}
if (std::abs(collision.posZ()) > 10.f) {

Check failure on line 390 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.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 false;
}
// Count the number of contributors
Expand Down Expand Up @@ -495,10 +501,10 @@

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 504 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.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 507 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.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()) ||
((trackSelection.node() == 4) && requireQualityTracksInFilter()) ||
((trackSelection.node() == 5) && requireInAcceptanceTracksInFilter());
Expand All @@ -511,7 +517,7 @@
soa::Filtered<TrackCandidates> const& tracks)
{
isEventSelected<true>(collision, tracks);
for (auto t : tracks) {

Check failure on line 520 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
isTrackSelected<true>(collision, t);
}
}
Expand All @@ -525,7 +531,7 @@
return;
}

for (auto t : tracks) {

Check failure on line 534 in DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!isTrackSelected<false>(collision, t)) {
continue;
}
Expand Down Expand Up @@ -598,35 +604,43 @@
// Filling info split per ev. time
if (enableEvTimeSplitting) {
if (t.isEvTimeTOF() && t.isEvTimeT0AC()) { // TOF + FT0 Ev. Time
if (enableVsMomentumHistograms) {
if (enableVsMomentumHistograms == 1) {
histos.fill(HIST(hdelta_evtime_tofft0[id]), t.p(), diff);
} else if (enableVsMomentumHistograms == 2) {
histos.fill(HIST(hdelta_evtime_tofft0[id]), t.p(), t.eta(), diff);
}
if (splitSignalPerCharge) {
histos.fill(HIST(hdelta_pt_evtime_tofft0[id]), t.pt(), diff, t.sign());
} else {
histos.fill(HIST(hdelta_pt_evtime_tofft0[id]), t.pt(), diff);
}
} else if (t.isEvTimeT0AC()) { // FT0 Ev. Time
if (enableVsMomentumHistograms) {
if (enableVsMomentumHistograms == 1) {
histos.fill(HIST(hdelta_evtime_ft0[id]), t.p(), diff);
} else if (enableVsMomentumHistograms == 2) {
histos.fill(HIST(hdelta_evtime_ft0[id]), t.p(), t.eta(), diff);
}
if (splitSignalPerCharge) {
histos.fill(HIST(hdelta_pt_evtime_ft0[id]), t.pt(), diff, t.sign());
} else {
histos.fill(HIST(hdelta_pt_evtime_ft0[id]), t.pt(), diff);
}
} else if (t.isEvTimeTOF()) { // TOF Ev. Time
if (enableVsMomentumHistograms) {
if (enableVsMomentumHistograms == 1) {
histos.fill(HIST(hdelta_evtime_tof[id]), t.p(), diff);
} else if (enableVsMomentumHistograms == 2) {
histos.fill(HIST(hdelta_evtime_tof[id]), t.p(), t.eta(), diff);
}
if (splitSignalPerCharge) {
histos.fill(HIST(hdelta_pt_evtime_tof[id]), t.pt(), diff, t.sign());
} else {
histos.fill(HIST(hdelta_pt_evtime_tof[id]), t.pt(), diff);
}
} else { // No Ev. Time -> Fill Ev. Time
if (enableVsMomentumHistograms) {
if (enableVsMomentumHistograms == 1) {
histos.fill(HIST(hdelta_evtime_fill[id]), t.p(), diff);
} else if (enableVsMomentumHistograms == 2) {
histos.fill(HIST(hdelta_evtime_fill[id]), t.p(), t.eta(), diff);
}
if (splitSignalPerCharge) {
histos.fill(HIST(hdelta_pt_evtime_fill[id]), t.pt(), diff, t.sign());
Expand Down
Loading