Skip to content

Commit 5168762

Browse files
authored
more QA histograms for data vs MC comparison
1 parent 80c80ac commit 5168762

File tree

1 file changed

+49
-31
lines changed

1 file changed

+49
-31
lines changed

DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx

Lines changed: 49 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ using FullTracksIU = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TrackSelect
5151

5252
struct DetectorOccupancyQaTask {
5353
// configurables for study of occupancy in time windows
54-
Configurable<bool> confAddBasicQAhistos{"AddBasicQAhistos", true, "0 - add basic histograms, 1 - skip"}; // o2-linter: disable=name/configurable (temporary fix)
55-
Configurable<float> confTimeIntervalForOccupancyCalculation{"TimeIntervalForOccupancyCalculation", 100, "Time interval for TPC occupancy calculation, us"}; // o2-linter: disable=name/configurable (temporary fix)
56-
Configurable<float> confOccupancyHistCoeffNtracksForOccupancy{"HistCoeffNtracksForOccupancy", 1., "Coefficient for max nTracks in occupancy histos"}; // o2-linter: disable=name/configurable (temporary fix)
57-
Configurable<float> confOccupancyHistCoeffNbins2D{"HistCoeffNbins2D", 1., "Coefficient for nBins in occupancy 2D histos"}; // o2-linter: disable=name/configurable (temporary fix)
58-
Configurable<float> confOccupancyHistCoeffNbins3D{"HistCoeffNbins3D", 1., "Coefficient for nBins in occupancy 3D histos"}; // o2-linter: disable=name/configurable (temporary fix)
59-
Configurable<float> confCoeffMaxNtracksThisEvent{"CoeffMaxNtracksThisEvent", 1., "Coefficient for max nTracks or FT0 ampl in histos in a given event"}; // o2-linter: disable=name/configurable (temporary fix)
60-
Configurable<bool> confFlagApplyROFborderCut{"ApplyROFborderCut", true, "Use ROF border cut for a current event"}; // o2-linter: disable=name/configurable (temporary fix)
61-
Configurable<bool> confFlagApplyTFborderCut{"ApplyTFborderCut", true, "Use TF border cut for a current event"}; // o2-linter: disable=name/configurable (temporary fix)
54+
Configurable<bool> confAddBasicQAhistos{"AddBasicQAhistos", true, "0 - add basic histograms, 1 - skip"}; // o2-linter: disable=name/configurable (temporary fix)
55+
Configurable<float> confTimeIntervalForOccupancyCalculation{"TimeIntervalForOccupancyCalculation", 100, "Time interval for TPC occupancy calculation, us"}; // o2-linter: disable=name/configurable (temporary fix)
56+
Configurable<float> confOccupancyHistCoeffNtracksForOccupancy{"HistCoeffNtracksForOccupancy", 1., "Coefficient for max nTracks in occupancy histos"}; // o2-linter: disable=name/configurable (temporary fix)
57+
Configurable<float> confOccupancyHistCoeffNbins2D{"HistCoeffNbins2D", 1., "Coefficient for nBins in occupancy 2D histos"}; // o2-linter: disable=name/configurable (temporary fix)
58+
Configurable<float> confOccupancyHistCoeffNbins3D{"HistCoeffNbins3D", 1., "Coefficient for nBins in occupancy 3D histos"}; // o2-linter: disable=name/configurable (temporary fix)
59+
Configurable<float> confCoeffMaxNtracksThisEvent{"CoeffMaxNtracksThisEvent", 1., "Coefficient for max nTracks or FT0 ampl in histos in a given event"}; // o2-linter: disable=name/configurable (temporary fix)
60+
// Configurable<bool> confFlagApplyROFborderCut{"ApplyROFborderCut", true, "Use ROF border cut for a current event"}; // o2-linter: disable=name/configurable (temporary fix)
61+
// Configurable<bool> confFlagApplyTFborderCut{"ApplyTFborderCut", true, "Use TF border cut for a current event"}; // o2-linter: disable=name/configurable (temporary fix)
6262
Configurable<int> confFlagWhichTimeRange{"FlagWhichTimeRange", 0, "Whicn time range for occupancy calculation: 0 - symmetric, 1 - only past, 2 - only future"}; // o2-linter: disable=name/configurable (temporary fix)
6363
Configurable<bool> confFlagUseGlobalTracks{"FlagUseGlobalTracks", false, "For small time bins, use global tracks counter instead of ITSTPC tracks"}; // o2-linter: disable=name/configurable (temporary fix)
6464
Configurable<bool> confFlagUseNoCollInRofStrict{"FlagUseNoCollInRofStrict", false, "Suppress same-ROF events for occupancy historams"}; // o2-linter: disable=name/configurable (temporary fix)
@@ -101,8 +101,8 @@ struct DetectorOccupancyQaTask {
101101
int lastRunNumber = -1;
102102
int nOrbits;
103103
double minOrbit;
104-
int64_t bcSOR = 0; // global bc of the start of the first orbit, setting 0 by default for unanchored MC
105-
int64_t nBCsPerTF = 128 * nBCsPerOrbit; // duration of TF in bcs, should be 128*3564 or 32*3564, setting 128 orbits by default sfor unanchored MC
104+
int64_t bcSOR = 0; // global bc of the start of the first orbit, setting 0 by default for unanchored MC
105+
int64_t nBCsPerTF = 32 * nBCsPerOrbit; // duration of TF in bcs, should be 128*3564 or 32*3564, setting 128 orbits by default sfor unanchored MC
106106

107107
// save time "slices" for several collisions for QA
108108
bool flagFillQAtimeOccupHist = false;
@@ -117,8 +117,9 @@ struct DetectorOccupancyQaTask {
117117
ccdb->setLocalObjectValidityChecking();
118118

119119
const AxisSpec axisBCinTF{static_cast<int>(nBCsPerTF), 0, static_cast<double>(nBCsPerTF), "bc in TF"};
120-
histos.add("hNcolVsBcInTF", ";bc in TF; n collisions", kTH1F, {axisBCinTF});
121-
histos.add("hNcolVsBcInTFafterMaxBcCut", ";bc in TF; n collisions", kTH1F, {axisBCinTF});
120+
histos.add("hNcolVsBcInTF/hNcolVsBcInTF", ";bc in TF; n collisions", kTH1F, {axisBCinTF});
121+
histos.add("hNcolVsBcInTF/hNcolVsBcInTF_vertexTOFmatched", ";bc in TF; n collisions", kTH1F, {axisBCinTF});
122+
histos.add("hNcolVsBcInTF/hNcolVsBcInTFafterMaxBcCut", ";bc in TF; n collisions", kTH1F, {axisBCinTF});
122123

123124
// histograms for occupancy-in-time-window study
124125
double kMaxOccup = confOccupancyHistCoeffNtracksForOccupancy;
@@ -310,6 +311,12 @@ struct DetectorOccupancyQaTask {
310311
histos.add("track_distr_nITStrThisEv_10_200/hPt_vs_tpcInnerPt_vs_occup", ";p_{T};p_{T} TPC inner;weighted occupancy", kTH3D, {axisLogPtFor2D, axisLogPtTpcFor2D, axisOccupForKine});
311312
histos.add("track_distr_nITStrThisEv_above_2000/hPt_vs_tpcInnerPt_vs_occup", ";p_{T};p_{T} TPC inner;weighted occupancy", kTH3D, {axisLogPtFor2D, axisLogPtTpcFor2D, axisOccupForKine});
312313

314+
histos.add("hNcolVsBcInTF/hNcolVsBcInTF_vs_occupancy", ";bc in TF;weighted occupancy", kTH2F, {axisBCinTF, axisOccupForKine});
315+
histos.add("hNcolVsBcInTF/hNcolVsBcInTF_vs_occupancy_vertexTOFmatched", ";bc in TF;weighted occupancy", kTH2F, {axisBCinTF, axisOccupForKine});
316+
histos.add("hNcolVsBcInTF/hNcolVsBcInTF_vs_occupancy_nPV_10_200", ";bc in TF;weighted occupancy", kTH2F, {axisBCinTF, axisOccupForKine});
317+
histos.add("hNcolVsBcInTF/hNcolVsBcInTF_vs_occupancy_nPV_above2000", ";bc in TF;weighted occupancy", kTH2F, {axisBCinTF, axisOccupForKine});
318+
// end of July 2025: to compare data and MC (pt, eta, phi)
319+
313320
// 3D: pt vs centr vs occup
314321
if (confFlagManyHeavyHistos) {
315322
histos.add("ptGlobal_vs_centr_vs_occup", "", kTH3F, {{20, 0, 4000, "nITStrk cls567"}, axisOccupancyForDeDxStudies, axisLogPt});
@@ -451,8 +458,8 @@ struct DetectorOccupancyQaTask {
451458
histos.add("nTracksGlobal_vs_nPV_AntiNoCollInTimeRangeStandard", "nTracksGlobal_vs_nPV_AntiNoCollInTimeRangeStandard", kTH2F, {axisNtracks, axisNtracksGlobal});
452459
histos.add("nTracksGlobal_vs_nPV_AntiNoCollInTimeRangeNarrow", "nTracksGlobal_vs_nPV_AntiNoCollInTimeRangeNarrow", kTH2F, {axisNtracks, axisNtracksGlobal});
453460

454-
histos.add("nTracksGlobal_vs_nPV_QA_onlyVzCut_noTFROFborderCuts", "nTracksGlobal_vs_nPV_QA_onlyVzCut_noTFROFborderCuts", kTH2F, {axisNtracks, axisNtracksGlobal});
455-
histos.add("nTracksGlobal_vs_nPV_QA_after_TFborderCut", "nTracksGlobal_vs_nPV_QA_after_TFborderCut", kTH2F, {axisNtracks, axisNtracksGlobal});
461+
// histos.add("nTracksGlobal_vs_nPV_QA_onlyVzCut_noTFROFborderCuts", "nTracksGlobal_vs_nPV_QA_onlyVzCut_noTFROFborderCuts", kTH2F, {axisNtracks, axisNtracksGlobal});
462+
// histos.add("nTracksGlobal_vs_nPV_QA_after_TFborderCut", "nTracksGlobal_vs_nPV_QA_after_TFborderCut", kTH2F, {axisNtracks, axisNtracksGlobal});
456463

457464
histos.add("nTracksGlobal_vs_nPV_occupByFT0C_0_2500", "nTracksGlobal_vs_nPV_occupByFT0C_0_2500", kTH2F, {axisNtracks, axisNtracksGlobal});
458465
histos.add("nTracksGlobal_vs_nPV_occupByFT0C_0_20000", "nTracksGlobal_vs_nPV_occupByFT0C_0_20000", kTH2F, {axisNtracks, axisNtracksGlobal});
@@ -679,11 +686,11 @@ struct DetectorOccupancyQaTask {
679686
continue;
680687

681688
// skip if collision is close to TF border
682-
if (confFlagApplyTFborderCut && !col.selection_bit(kNoTimeFrameBorder))
689+
if (!col.selection_bit(kNoTimeFrameBorder))
683690
continue;
684691

685692
// skip if collision is close to ROF border
686-
if (confFlagApplyROFborderCut && !col.selection_bit(kNoITSROFrameBorder))
693+
if (!col.selection_bit(kNoITSROFrameBorder))
687694
continue;
688695

689696
std::vector<int> vCollsAssocToGivenColl = vCollsInTimeWin[colIndex];
@@ -912,24 +919,27 @@ struct DetectorOccupancyQaTask {
912919

913920
// ### occupancy event selection QA
914921
for (const auto& col : cols) {
915-
// if (!col.sel8()) {
916-
// continue;
917-
// }
918-
if (!col.selection_bit(kIsTriggerTVX))
922+
if (!col.sel8())
919923
continue;
924+
925+
// if (!col.selection_bit(kIsTriggerTVX))
926+
// continue;
927+
920928
// cut on vZ for a given collision
921929
if (col.posZ() < confCutVertZMinThisEvent || col.posZ() > confCutVertZMaxThisEvent)
922930
continue;
923931

924932
int32_t colIndex = col.globalIndex();
925933
int64_t bcInTF = (vFoundGlobalBC[colIndex] - bcSOR) % nBCsPerTF;
926-
histos.fill(HIST("hNcolVsBcInTF"), bcInTF);
934+
histos.fill(HIST("hNcolVsBcInTF/hNcolVsBcInTF"), bcInTF);
935+
if (col.selection_bit(kIsVertexTOFmatched))
936+
histos.fill(HIST("hNcolVsBcInTF/hNcolVsBcInTF_vertexTOFmatched"), bcInTF);
927937

928938
// cut on the max bcId in the time frame (to avoid the artificial fade-out tail in the MC productions)
929939
if (!vIsMarkedCollForAnalysis[colIndex])
930940
continue;
931941

932-
histos.fill(HIST("hNcolVsBcInTFafterMaxBcCut"), bcInTF);
942+
histos.fill(HIST("hNcolVsBcInTF/hNcolVsBcInTFafterMaxBcCut"), bcInTF);
933943

934944
auto multV0A = col.multFV0A();
935945
// auto multT0A = col.multFT0A();
@@ -938,7 +948,6 @@ struct DetectorOccupancyQaTask {
938948
int nGlobalTracks = 0;
939949

940950
int occupancy = col.trackOccupancyInTimeRange();
941-
942951
auto tracksGrouped = tracks.sliceBy(perCollision, col.globalIndex());
943952

944953
// pre-calc nPV
@@ -953,6 +962,15 @@ struct DetectorOccupancyQaTask {
953962
continue;
954963
nPV++;
955964
}
965+
if (occupancy >= 0) {
966+
histos.fill(HIST("hNcolVsBcInTF/hNcolVsBcInTF_vs_occupancy"), bcInTF, occupancy);
967+
if (col.selection_bit(kIsVertexTOFmatched))
968+
histos.fill(HIST("hNcolVsBcInTF/hNcolVsBcInTF_vs_occupancy_vertexTOFmatched"), bcInTF, occupancy);
969+
if (nPV >= 10 && nPV < 200)
970+
histos.fill(HIST("hNcolVsBcInTF/hNcolVsBcInTF_vs_occupancy_nPV_10_200"), bcInTF, occupancy);
971+
else if (nPV >= 2000)
972+
histos.fill(HIST("hNcolVsBcInTF/hNcolVsBcInTF_vs_occupancy_nPV_above2000"), bcInTF, occupancy);
973+
}
956974

957975
// main loop for dE/dx
958976
for (const auto& track : tracksGrouped) {
@@ -1136,19 +1154,19 @@ struct DetectorOccupancyQaTask {
11361154
}
11371155
} // end of track loop
11381156

1139-
if (confAddTracksVsFwdHistos)
1140-
histos.fill(HIST("nTracksGlobal_vs_nPV_QA_onlyVzCut_noTFROFborderCuts"), nPV, nGlobalTracks);
1157+
// if (confAddTracksVsFwdHistos)
1158+
// histos.fill(HIST("nTracksGlobal_vs_nPV_QA_onlyVzCut_noTFROFborderCuts"), nPV, nGlobalTracks);
11411159

11421160
// skip if collision is close to TF border
1143-
if (confFlagApplyTFborderCut && !col.selection_bit(kNoTimeFrameBorder))
1144-
continue;
1161+
// if (confFlagApplyTFborderCut && !col.selection_bit(kNoTimeFrameBorder))
1162+
// continue;
11451163

1146-
if (confAddTracksVsFwdHistos)
1147-
histos.fill(HIST("nTracksGlobal_vs_nPV_QA_after_TFborderCut"), nPV, nGlobalTracks);
1164+
// if (confAddTracksVsFwdHistos)
1165+
// histos.fill(HIST("nTracksGlobal_vs_nPV_QA_after_TFborderCut"), nPV, nGlobalTracks);
11481166

11491167
// skip if collision is close to ROF border
1150-
if (confFlagApplyROFborderCut && !col.selection_bit(kNoITSROFrameBorder))
1151-
continue;
1168+
// if (confFlagApplyROFborderCut && !col.selection_bit(kNoITSROFrameBorder))
1169+
// continue;
11521170

11531171
histos.fill(HIST("hOccupancy"), occupancy);
11541172
if (occupancy >= 0) {

0 commit comments

Comments
 (0)