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
35 changes: 27 additions & 8 deletions DPG/Tasks/AOTTrack/qaEventTrack.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,23 @@

#include "qaEventTrack.h"

#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "ReconstructionDataFormats/DCA.h"
#include "Common/Core/MetadataHelper.h"
#include "Common/Core/TrackSelection.h"
#include "Common/Core/TrackSelectionDefaults.h"
#include "Common/Core/trackUtilities.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/Core/TrackSelection.h"
#include "Common/Core/TrackSelectionDefaults.h"
#include "Common/TableProducer/PID/pidTOFBase.h"

#include <Framework/AnalysisDataModel.h>
#include <Framework/AnalysisTask.h>
#include <Framework/HistogramRegistry.h>
#include <Framework/O2DatabasePDGPlugin.h>
#include <Framework/runDataProcessing.h>
#include <ReconstructionDataFormats/DCA.h>

#include <TH1.h>

#include <string>
#include <vector>

Expand All @@ -44,6 +48,8 @@
using namespace o2::framework::expressions;
using namespace o2::dataformats;

o2::common::core::MetadataHelper metadataInfo;

// TODO: add PID wagons as dependency + include impact parameter studies (same or separate task in workflow??)

//--------------------------------------------------------------------------------------------------
Expand All @@ -68,6 +74,9 @@
// option to apply a timeframe cut
Configurable<bool> tfCut{"tfCut", false, "applies timeframe cut"};

// option to add run info to the histograms
Configurable<bool> addRunInfo{"addRunInfo", true, "add run info (pass, data) to the histograms"};

// options to select only specific tracks
Configurable<int> trackSelection{"trackSelection", 1, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"};
Configurable<int> selectCharge{"selectCharge", 0, "select charge +1 or -1 (0 means no selection)"};
Expand Down Expand Up @@ -115,8 +124,8 @@
// TODO: ask if one can have different filters for both process functions
Filter trackFilter = (trackSelection.node() == 0) ||
((trackSelection.node() == 1) && requireGlobalTrackInFilter()) ||
((trackSelection.node() == 2) && requireGlobalTrackWoPtEtaInFilter()) ||

Check failure on line 127 in DPG/Tasks/AOTTrack/qaEventTrack.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 128 in DPG/Tasks/AOTTrack/qaEventTrack.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()) ||
((trackSelection.node() == 5) && requireTrackCutInFilter(TrackSelectionFlags::kInAcceptanceTracks)) ||
((trackSelection.node() == 6) && requireGlobalTrackWoTPCClusterInFilter()) ||
Expand Down Expand Up @@ -166,6 +175,14 @@
}
}

if (addRunInfo) {
auto hRunInfo = histos.add<TH1>("hRunInfo", "Run info", kTH1D, {{1, 0.5, 1.5, "Run info"}});
// hRunInfo->SetBit(TH1::kCanRebin); // allow dynamic bin creation based on label
if (metadataInfo.isFullyDefined()) {
hRunInfo->Fill(metadataInfo.makeMetadataLabel().c_str(), 1.0);
}
}

//
// Next section setups overwrite of configurableAxis if overwriteAxisRangeForPbPb is used.
//
Expand Down Expand Up @@ -205,7 +222,7 @@
const AxisSpec axisInvPt{binsInvPt, "1/#it{p}_{T, gen} [GeV/c]^{-1}"};
const AxisSpec axisSigned1Pt{binsSigned1Pt, "Q/#it{p}_{T, gen} [GeV/c]^{-1}"};
const AxisSpec axisEta{180, -0.9, 0.9, "#it{#eta}"};
const AxisSpec axisPhi{180, 0., 2 * M_PI, "#it{#varphi} [rad]"};

Check failure on line 225 in DPG/Tasks/AOTTrack/qaEventTrack.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pi-multiple-fraction]

Use multiples/fractions of PI defined in o2::constants::math.

Check failure on line 225 in DPG/Tasks/AOTTrack/qaEventTrack.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.
const AxisSpec axisVertexNumContrib{(overwriteAxisRangeForPbPb ? vecBinsVertexNumContribDefaultPbPb : vecBinsVertexNumContrib), "Number Of contributors to the PV"};
const AxisSpec axisVertexPosX{binsVertexPosXY, "X [cm]"};
const AxisSpec axisVertexPosY{binsVertexPosXY, "Y [cm]"};
Expand All @@ -216,7 +233,7 @@
const AxisSpec axisParX{300, 0, 600, "#it{x} [cm]"};
const AxisSpec axisParY{200, -0.5, 0.5, "#it{y} [cm]"};
const AxisSpec axisParZ{200, -11., 11., "#it{z} [cm]"};
const AxisSpec axisParAlpha{36, -M_PI, M_PI, "#alpha [rad]"};

Check failure on line 236 in DPG/Tasks/AOTTrack/qaEventTrack.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.
const AxisSpec axisParSigned1Pt{500, -8, 8, "#it{q}/#it{p}_{T}"};
const AxisSpec axisParSnp{11, -0.1, 0.1, "snp"};
const AxisSpec axisParTgl{200, -1., 1., "tgl"};
Expand Down Expand Up @@ -738,19 +755,19 @@
LOG(info) << "================================";
LOG(info) << "=== soa::Filtered<TrackTableData> const& tracks, size=" << tracks.size();
int iTrack = 0;
for (auto& t : tracks) {

Check failure on line 758 in DPG/Tasks/AOTTrack/qaEventTrack.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.
LOG(info) << "[" << iTrack << "] .index()=" << t.index() << ", .globalIndex()=" << t.globalIndex();
iTrack++;
}
LOG(info) << "=== aod::FullTracks const& tracksUnfiltered, size=" << tracksUnfiltered.size();
int iTrackUnfiltered = 0;
for (auto& tuf : tracksUnfiltered) {

Check failure on line 764 in DPG/Tasks/AOTTrack/qaEventTrack.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.
LOG(info) << "[" << iTrackUnfiltered << "] .index()=" << tuf.index() << ", .globalIndex()=" << tuf.globalIndex();
iTrackUnfiltered++;
}
LOG(info) << "=== aod::AmbiguousTracks const& ambitracks, size=" << ambitracks.size();
int iTrackAmbi = 0;
for (auto& tamb : ambitracks) {

Check failure on line 770 in DPG/Tasks/AOTTrack/qaEventTrack.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.
LOG(info) << "[" << iTrackAmbi << "] .index()=" << tamb.index() << ", .globalIndex()=" << tamb.globalIndex() << ", .trackId()=" << tamb.trackId();
iTrackAmbi++;
}
Expand Down Expand Up @@ -1067,7 +1084,7 @@

/// check correct track-to-vertex matching exploiting MC info
std::vector<int> vec_coll_index_mismatched = {};
for (auto& track : tracks) {

Check failure on line 1087 in DPG/Tasks/AOTTrack/qaEventTrack.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.
histos.fill(HIST("Tracks/TestMCtrackToVtxMatch/ptAllTracks"), track.pt());
bool has_MCparticle = track.has_mcParticle();
if (track.collisionId() >= 0) {
Expand Down Expand Up @@ -1153,6 +1170,8 @@

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
// Parse the metadata
metadataInfo.initMetadata(cfgc);
return WorkflowSpec{adaptAnalysisTask<qaEventTrack>(cfgc)};
}

Expand Down Expand Up @@ -1625,7 +1644,7 @@
auto pdgInfo = pdgDB->GetParticle(particle.pdgCode());
int sign = 0;
if (pdgInfo != nullptr) {
sign = pdgInfo->Charge() / abs(pdgInfo->Charge());

Check failure on line 1647 in DPG/Tasks/AOTTrack/qaEventTrack.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
}
// resolution plots
if (doExtraPIDqa && track.pidForTracking() != static_cast<unsigned int>(std::abs(PartIdentifier))) {
Expand Down
Loading