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
25 changes: 13 additions & 12 deletions DPG/Tasks/AOTTrack/qaMatchEff.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,27 @@
//

#include "Common/CCDB/EventSelectionParams.h"
#include "Common/Core/RecoDecay.h"
#include "Common/Core/TrackSelection.h"
#include "Common/Core/TrackSelectionDefaults.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/PIDResponseTOF.h"
#include "Common/DataModel/PIDResponseTPC.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/DataModel/PIDResponse.h"
#include "CommonConstants/MathConstants.h"

#include "CCDB/BasicCCDBManager.h"
#include "Common/Core/RecoDecay.h"
#include "CommonConstants/MathConstants.h"
//
#include "Framework/AnalysisTask.h"
#include "Framework/RunningWorkflowInfo.h"
#include "Framework/runDataProcessing.h"
//
#include <cmath>
#include <set>
#include <string>
#include <vector>
#include <set>
#include <cmath>

//
namespace extConfPar
Expand Down Expand Up @@ -149,21 +150,21 @@
// TRD presence
Configurable<int> isTRDThere{"isTRDThere", 2, "Integer to turn the presence of TRD off, on, don't care (0,1,anything else)"};
Configurable<int> isTOFThere{"isTOFThere", 2, "Integer to turn the presence of TOF off, on, don't care (0,1,anything else)"};

Configurable<bool> isitMC{"isitMC", false, "Reading MC files, data if false"};
Configurable<bool> doDebug{"doDebug", false, "Flag of debug information"};
// Histogram configuration

// histos bins
Configurable<int> etaBins{"eta-bins", 40, "Number of eta bins"};
Configurable<int> phiBins{"phi-bins", 18, "Number of phi bins"};
Configurable<int> qoptBins{"qopt-bins", 500, "Number of Q/pt bins"};

// special histo, few particles explicitly stored, then pdg>3000
Configurable<int> pdgBins{"pdg-bins", 14, "Number of pdg values counted"};

// histo axes

ConfigurableAxis ptBins{"ptBins", {100, 0.f, 20.f}, "pT binning"};
ConfigurableAxis XBins{"XBins", {400, -2.f, 2.f}, "X binning"};
ConfigurableAxis ZBins{"ZBins", {400, -20.f, 20.f}, "Z binning"};
Expand Down Expand Up @@ -1608,10 +1609,10 @@
// histos.get<TH1>(HIST("MC/control/etahist_diff"))->Fill(mcpart.eta() - track.eta());
auto delta = RecoDecay::constrainAngle(mcpart.phi() - track.phi(), -o2::constants::math::PI);
if (delta > o2::constants::math::PI) {
delta -= o2::constants::math::TwoPI;

Check failure on line 1612 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
}
if (delta < o2::constants::math::PI) {
delta += o2::constants::math::TwoPI;

Check failure on line 1615 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
}
// histos.get<TH1>(HIST("MC/control/phihist_diff"))->Fill(delta);
}
Expand Down Expand Up @@ -1687,7 +1688,7 @@
if (makethn) {
if constexpr (IS_MC) {
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
if (siPDGCode == 211 || siPDGCode == 321) // pions and kaons together

Check failure on line 1691 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), 10, signOfTrack, hasdet);
} else {
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
Expand All @@ -1704,7 +1705,7 @@
if (makethn) {
if constexpr (IS_MC) {
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
if (siPDGCode == 211 || siPDGCode == 321) // pions and kaons together

Check failure on line 1708 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), 10, signOfTrack, hasdet);
} else {
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
Expand All @@ -1721,7 +1722,7 @@
if (makethn) {
if constexpr (IS_MC) {
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
if (siPDGCode == 211 || siPDGCode == 321) // pions and kaons together

Check failure on line 1725 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), 10, signOfTrack, hasdet);
} else {
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
Expand All @@ -1738,7 +1739,7 @@
if (makethn) {
if constexpr (IS_MC) {
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
if (siPDGCode == 211 || siPDGCode == 321) // pions and kaons together

Check failure on line 1742 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), 10, signOfTrack, hasdet);
} else {
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
Expand All @@ -1755,7 +1756,7 @@
if (makethn) {
if constexpr (IS_MC) {
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
if (siPDGCode == 211 || siPDGCode == 321) // pions and kaons together

Check failure on line 1759 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), 10, signOfTrack, hasdet);
} else {
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
Expand All @@ -1772,7 +1773,7 @@
if (makethn) {
if constexpr (IS_MC) {
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
if (siPDGCode == 211 || siPDGCode == 321) // pions and kaons together

Check failure on line 1776 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), 10, signOfTrack, hasdet);
} else {
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
Expand All @@ -1789,7 +1790,7 @@
if (makethn) {
if constexpr (IS_MC) {
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
if (siPDGCode == 211 || siPDGCode == 321) // pions and kaons together

Check failure on line 1793 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), 10, signOfTrack, hasdet);
} else {
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
Expand All @@ -1806,7 +1807,7 @@
if (makethn) {
if constexpr (IS_MC) {
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
if (siPDGCode == 211 || siPDGCode == 321) // pions and kaons together

Check failure on line 1810 in DPG/Tasks/AOTTrack/qaMatchEff.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("MC/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), 10, signOfTrack, hasdet);
} else {
histos.fill(HIST("data/sparse/thnsforfrac"), track.dcaXY(), track.dcaZ(), trackPt, track.eta(), sayPrim, track.phi(), specind, signOfTrack, hasdet);
Expand Down Expand Up @@ -3361,7 +3362,7 @@
if (doDebug)
LOGF(info, "Event selection not passed, skipping...");
return;
}
}
fillHistograms<true>(tracks, mcParticles, mcParticles); /// 3rd argument non-sense in this case
fillGeneralHistos<true>(collision);
}
Expand Down Expand Up @@ -3464,7 +3465,7 @@
if (doDebug)
LOGF(info, "Event selection not passed, skipping...");
return;
}
}
fillHistograms<false>(tracks, tracks, tracks); // 2nd and 3rd arguments not used in this case
fillGeneralHistos<false>(collision);
}
Expand Down
Loading