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
66 changes: 50 additions & 16 deletions DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,31 @@
///
/// \author Igor Altsybeev <Igor.Altsybeev@cern.ch>

#include <vector>
#include <map>

#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/CCDB/EventSelectionParams.h"
#include "CCDB/BasicCCDBManager.h"
#include "Framework/HistogramRegistry.h"
#include "CommonDataFormat/BunchFilling.h"
#include "DataFormatsParameters/GRPLHCIFData.h"
#include "DataFormatsParameters/GRPECSObject.h"
#include "Common/Core/TrackSelection.h"
#include "Common/Core/TrackSelectionDefaults.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "CCDB/BasicCCDBManager.h"
#include "CommonDataFormat/BunchFilling.h"
#include "DataFormatsParameters/AggregatedRunInfo.h"
#include "DataFormatsParameters/GRPECSObject.h"
#include "DataFormatsParameters/GRPLHCIFData.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/runDataProcessing.h"

#include "TH1F.h"
#include "TH2F.h"
#include "TH3.h"

#include <map>
#include <vector>

using namespace o2;
using namespace o2::framework;
using namespace o2::aod::evsel;
Expand Down Expand Up @@ -90,11 +91,14 @@

Configurable<int> nMaxBcInTFforAnalysis{"nMaxBcInTFforAnalysis", -1, "When to stop taking collisions in TF, if -1: take all collisions"}; // o2-linter: disable=name/configurable (temporary fix)

Configurable<int> confNPhiBins{"nPhiBins", 810, "N phi bits for histograms"}; // o2-linter: disable=name/configurable (temporary fix)

ConfigurableAxis confAxisPtBinsForPhiStudy{"PtBinsForPhiStudy", {VARIABLE_WIDTH, 0.2, 0.6, 1.0, 2.0, 10}, "pt axis"};
ConfigurableAxis confAxisOccupForKine{"AxisOccupForKine", {VARIABLE_WIDTH, 0, 500, 1000, 2000, 4000, 6000, 8000, 10000, 20000}, "weighted occupancy"};

Configurable<bool> confUsePhiAtTPCinnerR{"UsePhiAtTPCinnerR", false, "0 - not use, 1 - use"}; // o2-linter: disable=name/configurable (temporary fix)
Configurable<int> confUseAorCsideForPhiStudy{"UseAorCsideForPhiStudy", -1, "-1 - use full eta range, 0 - A, 1 - C sides"}; // o2-linter: disable=name/configurable (temporary fix)
Configurable<float> confRadiusForPhiCorrection{"RadiusForPhiCorrection", 0.8, "default: inner TPC radius, cm"}; // o2-linter: disable=name/configurable (temporary fix)

uint64_t minGlobalBC = 0;
Service<o2::ccdb::BasicCCDBManager> ccdb;
Expand Down Expand Up @@ -263,7 +267,7 @@
histos.add("track_distr_nITStrThisEv_above_2000/hEta_highOccupInDistantFuture", ";#eta;n tracks", kTH1D, {axisEta});
histos.add("track_distr_nITStrThisEv_above_2000/hEta_highOccupInNeighbourEvents", ";#eta;n tracks", kTH1D, {axisEta});

const int nPhiBins = 810; // 18*45
const int nPhiBins = confNPhiBins; // 810=18*45
AxisSpec axisPhi{nPhiBins, 0, TMath::TwoPi(), "#varphi"}; // o2-linter: disable=external-pi (temporary fix)
histos.add("track_distr_nITStrThisEv_10_200/hPhi_lowOccupInTPC", ";#varphi;n tracks", kTH1D, {axisPhi});
histos.add("track_distr_nITStrThisEv_10_200/hPhi_highOccupInRecentPast", ";#varphi;n tracks", kTH1D, {axisPhi});
Expand Down Expand Up @@ -303,6 +307,13 @@
histos.add("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_pos", ";#varphi;n tracks", kTH3D, {axisPhi, confAxisOccupForKine, confAxisPtBinsForPhiStudy});
histos.add("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_neg", ";#varphi;n tracks", kTH3D, {axisPhi, confAxisOccupForKine, confAxisPtBinsForPhiStudy});

histos.add("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_tpcNClsFindable_pos", ";#varphi;n tracks", kTH3D, {axisPhi, confAxisOccupForKine, confAxisPtBinsForPhiStudy});
histos.add("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_tpcNClsFound_pos", ";#varphi;n tracks", kTH3D, {axisPhi, confAxisOccupForKine, confAxisPtBinsForPhiStudy});
histos.add("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_tpcNClsCrossedRows_pos", ";#varphi;n tracks", kTH3D, {axisPhi, confAxisOccupForKine, confAxisPtBinsForPhiStudy});
histos.add("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_tpcNClsFindable_neg", ";#varphi;n tracks", kTH3D, {axisPhi, confAxisOccupForKine, confAxisPtBinsForPhiStudy});
histos.add("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_tpcNClsFound_neg", ";#varphi;n tracks", kTH3D, {axisPhi, confAxisOccupForKine, confAxisPtBinsForPhiStudy});
histos.add("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_tpcNClsCrossedRows_neg", ";#varphi;n tracks", kTH3D, {axisPhi, confAxisOccupForKine, confAxisPtBinsForPhiStudy});

histos.add("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/PV_hPt_pos", ";p_{T};weighted occupancy", kTH2D, {axisLogPt, confAxisOccupForKine});
histos.add("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/PV_hPt_neg", ";p_{T};weighted occupancy", kTH2D, {axisLogPt, confAxisOccupForKine});
histos.add("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/PV_hEta_pos", ";#eta;weighted occupancy", kTH2D, {axisEta, confAxisOccupForKine});
Expand All @@ -316,10 +327,10 @@
histos.add("track_distr_nITStrThisEv_above_2000/kine_vs_weighted_occup/hEta_neg", ";#eta;weighted occupancy", kTH2D, {axisEta, confAxisOccupForKine});
histos.add("track_distr_nITStrThisEv_above_2000/kine_vs_weighted_occup/hPhi_pos", ";#varphi;n tracks", kTH3D, {axisPhi, confAxisOccupForKine, confAxisPtBinsForPhiStudy});
histos.add("track_distr_nITStrThisEv_above_2000/kine_vs_weighted_occup/hPhi_neg", ";#varphi;n tracks", kTH3D, {axisPhi, confAxisOccupForKine, confAxisPtBinsForPhiStudy});
histos.add("track_distr_nITStrThisEv_above_2000/kine_vs_weighted_occup/hPhi_posInitialQA", ";#varphi;n tracks", kTH1D, {{3 * 810, -TMath::TwoPi(), 2 * TMath::TwoPi(), "#varphi"}});

Check failure on line 330 in DPG/Tasks/AOTEvent/detectorOccupancyQa.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.
histos.add("track_distr_nITStrThisEv_above_2000/kine_vs_weighted_occup/hPhi_posModifiedQA", ";#varphi;n tracks", kTH1D, {{3 * 810, -TMath::TwoPi(), 2 * TMath::TwoPi(), "#varphi"}});

Check failure on line 331 in DPG/Tasks/AOTEvent/detectorOccupancyQa.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.
histos.add("track_distr_nITStrThisEv_above_2000/kine_vs_weighted_occup/hPhi_negInitialQA", ";#varphi;n tracks", kTH1D, {{3 * 810, -TMath::TwoPi(), 2 * TMath::TwoPi(), "#varphi"}});

Check failure on line 332 in DPG/Tasks/AOTEvent/detectorOccupancyQa.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.
histos.add("track_distr_nITStrThisEv_above_2000/kine_vs_weighted_occup/hPhi_negModifiedQA", ";#varphi;n tracks", kTH1D, {{3 * 810, -TMath::TwoPi(), 2 * TMath::TwoPi(), "#varphi"}});

Check failure on line 333 in DPG/Tasks/AOTEvent/detectorOccupancyQa.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.

histos.add("track_distr_nITStrThisEv_above_2000/kine_vs_weighted_occup/PV_hPt_pos", ";p_{T};weighted occupancy", kTH2D, {axisLogPt, confAxisOccupForKine});
histos.add("track_distr_nITStrThisEv_above_2000/kine_vs_weighted_occup/PV_hPt_neg", ";p_{T};weighted occupancy", kTH2D, {axisLogPt, confAxisOccupForKine});
Expand All @@ -328,6 +339,12 @@
histos.add("track_distr_nITStrThisEv_above_2000/kine_vs_weighted_occup/PV_hPhi_pos", ";#varphi;n tracks", kTH3D, {axisPhi, confAxisOccupForKine, confAxisPtBinsForPhiStudy});
histos.add("track_distr_nITStrThisEv_above_2000/kine_vs_weighted_occup/PV_hPhi_neg", ";#varphi;n tracks", kTH3D, {axisPhi, confAxisOccupForKine, confAxisPtBinsForPhiStudy});

// QA nTPCcls
AxisSpec axisNTPCclsPlusMinusQA{521, -260, 260, "n TPC clusters"};
histos.add("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/QA_tpcNClsFindable_pos", "", kTH1D, {axisNTPCclsPlusMinusQA});
histos.add("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/QA_tpcNClsFound_pos", "", kTH1D, {axisNTPCclsPlusMinusQA});
histos.add("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/QA_tpcNClsCrossedRows_pos", "", kTH1D, {axisNTPCclsPlusMinusQA});

AxisSpec axisLogPtFor2D{50, 0.05, 10, "p_{T}"};
AxisSpec axisLogPtTpcFor2D{50, 0.05, 10, "p_{T} TPC inner"};
histos.add("track_distr_nITStrThisEv_10_200/hPt_vs_tpcInnerPt_vs_occup", ";p_{T};p_{T} TPC inner;weighted occupancy", kTH3D, {axisLogPtFor2D, axisLogPtTpcFor2D, confAxisOccupForKine});
Expand Down Expand Up @@ -1235,11 +1252,11 @@
float phiInitial = phi;

if (confUsePhiAtTPCinnerR) {
phi -= asin(0.8 /*inner TPC radius*/ / 2 * 0.3 * sign * 0.5 / pt);
phi -= asin(confRadiusForPhiCorrection /*inner TPC radius*/ / 2 * 0.3 * sign * 0.5 / pt);

Check failure on line 1255 in DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
if (phi < 0)
phi += TMath::TwoPi();

Check failure on line 1257 in DPG/Tasks/AOTEvent/detectorOccupancyQa.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.

Check failure on line 1257 in DPG/Tasks/AOTEvent/detectorOccupancyQa.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.
else if (phi > TMath::TwoPi())

Check failure on line 1258 in DPG/Tasks/AOTEvent/detectorOccupancyQa.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.
phi -= TMath::TwoPi();

Check failure on line 1259 in DPG/Tasks/AOTEvent/detectorOccupancyQa.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.
}

bool etaInRange = true;
Expand All @@ -1248,7 +1265,7 @@
if (confUseAorCsideForPhiStudy == 1 && eta > -0.1) // check if we are in C side
etaInRange = false;

if (occupancy >= 0 && fabs(eta) < 0.8 && pt > 0.15 && etaInRange) {

Check failure on line 1268 in DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
if (nPV >= 10 && nPV < 200) {
if (isGoodGlobal) {
if (flagWhichDeltaTimeWin == 1 && flagNoCollNearby) {
Expand Down Expand Up @@ -1280,6 +1297,11 @@
} // end of TPC good global

// July 2025: for data vs MC kine distr comparison

int tpcNClsFindable = track.tpcNClsFindable();
int tpcNClsFound = track.tpcNClsFound();
int tpcNClsCrossedRows = track.tpcNClsCrossedRows();

if (sign > 0) // positive tracks
{
histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/PV_hPt_pos"), pt, occupancy);
Expand All @@ -1289,6 +1311,14 @@
histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPt_pos"), pt, occupancy);
histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hEta_pos"), eta, occupancy);
histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_pos"), phi, occupancy, pt);

histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_tpcNClsFindable_pos"), phi, occupancy, pt, tpcNClsFindable);
histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_tpcNClsFound_pos"), phi, occupancy, pt, tpcNClsFound);
histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_tpcNClsCrossedRows_pos"), phi, occupancy, pt, tpcNClsCrossedRows);

histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/QA_tpcNClsFindable_pos"), tpcNClsFindable);
histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/QA_tpcNClsFound_pos"), tpcNClsFound);
histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/QA_tpcNClsCrossedRows_pos"), tpcNClsCrossedRows);
}
} else // negative tracks
{
Expand All @@ -1299,6 +1329,10 @@
histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPt_neg"), pt, occupancy);
histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hEta_neg"), eta, occupancy);
histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_neg"), phi, occupancy, pt);

histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_tpcNClsFindable_neg"), phi, occupancy, pt, tpcNClsFindable);
histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_tpcNClsFound_neg"), phi, occupancy, pt, tpcNClsFound);
histos.fill(HIST("track_distr_nITStrThisEv_10_200/kine_vs_weighted_occup/hPhi_tpcNClsCrossedRows_neg"), phi, occupancy, pt, tpcNClsCrossedRows);
}
}
// end of July 2025: for data vs MC kine distr comparison
Expand Down
16 changes: 16 additions & 0 deletions DPG/Tasks/AOTEvent/lightIonsEvSelQa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -641,9 +641,18 @@ struct LightIonsEvSelQa {
histos.add("hSecondsCollisions/noPU_good", "", kTH1F, {axisSeconds});

const AxisSpec axisDiffMeanVz{80, -4, 4, ""};
const AxisSpec axisVzNarrow{40, -10, 10, ""};
histos.add("hSecondsCollisions/noPU_meanDiffVz", "", kTH2F, {axisSeconds, axisDiffMeanVz});
histos.add("hSecondsCollisions/noPU_meanDiffVz_lowMult", "", kTH2F, {axisSeconds, axisDiffMeanVz});
histos.add("hSecondsCollisions/noPU_meanDiffVz_highMult", "", kTH2F, {axisSeconds, axisDiffMeanVz});
histos.add("hSecondsCollisions/noPU_Vz", "", kTH2F, {axisSeconds, axisVzNarrow});
histos.add("hSecondsCollisions/noPU_VzByFT0", "", kTH2F, {axisSeconds, axisVzNarrow});

const AxisSpec axisVz{200, -20, 20, ""};
histos.add("noSpecSelections/Vz", "", kTH1F, {axisVz});
histos.add("noPU/Vz", "", kTH1F, {axisVz});
histos.add("noPU_badVzDiff/Vz", "", kTH1F, {axisVz});
histos.add("noPU_goodVzDiff/Vz", "", kTH1F, {axisVz});

} // end of runNumber check

Expand Down Expand Up @@ -958,10 +967,12 @@ struct LightIonsEvSelQa {

histos.fill(HIST("noSpecSelections/hBcColNoSel8"), localBC);
histos.fill(HIST("noSpecSelections/hBcOrigNoSel8"), bcOriginal);
histos.fill(HIST("noSpecSelections/Vz"), vZ);

if (noPU) {
histos.fill(HIST("noPU/hBcColNoSel8"), localBC);
histos.fill(HIST("noPU/hBcOrigNoSel8"), bcOriginal);
histos.fill(HIST("noPU/Vz"), vZ);
}
if (noPU && pvTOFmatched) {
histos.fill(HIST("noPU_pvTOFmatched/hBcColNoSel8"), localBC);
Expand All @@ -986,9 +997,11 @@ struct LightIonsEvSelQa {
}
if (noPU && badVzDiff) {
histos.fill(HIST("noPU_badVzDiff/hBcColNoSel8"), localBC);
histos.fill(HIST("noPU_badVzDiff/Vz"), vZ);
}
if (noPU && !badVzDiff) {
histos.fill(HIST("noPU_goodVzDiff/hBcColNoSel8"), localBC);
histos.fill(HIST("noPU_goodVzDiff/Vz"), vZ);
}
if (noPU && !badVzDiff && narrowTimeVeto) {
histos.fill(HIST("noPU_goodVzDiff_narrowTimeVeto/hBcColNoSel8"), localBC);
Expand Down Expand Up @@ -1043,6 +1056,9 @@ struct LightIonsEvSelQa {
if (!underLine && !grassOnTheRight)
histos.fill(HIST("hSecondsCollisions/noPU_good"), secFromSOR);

histos.fill(HIST("hSecondsCollisions/noPU_Vz"), secFromSOR, vZ);
histos.fill(HIST("hSecondsCollisions/noPU_VzByFT0"), secFromSOR, vZft0);

if (std::abs(diffVz) < 4) {
histos.fill(HIST("hSecondsCollisions/noPU_meanDiffVz"), secFromSOR, diffVz);
if (multT0M < 1000)
Expand Down
Loading