Skip to content

Commit 84f9df9

Browse files
RD0407alibuild
andauthored
[PWGLF] spectraTOF add the occupancy axis (#8412)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 8a7fe5b commit 84f9df9

File tree

1 file changed

+31
-26
lines changed

1 file changed

+31
-26
lines changed

PWGLF/Tasks/Nuspex/spectraTOF.cxx

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
///
1919

2020
// O2 includes
21+
#include <string>
2122
#include "ReconstructionDataFormats/Track.h"
2223
#include "Framework/runDataProcessing.h"
2324
#include "Framework/AnalysisTask.h"
@@ -38,7 +39,6 @@
3839
#include "PWGLF/DataModel/mcCentrality.h"
3940
#include "Common/Core/RecoDecay.h"
4041
#include "TPDGCode.h"
41-
4242
using namespace o2;
4343
using namespace o2::track;
4444
using namespace o2::framework;
@@ -416,12 +416,12 @@ struct tofSpectra {
416416
histos.add("Data/neg/pt/tpc", "neg TPC", kTH1D, {ptAxis});
417417

418418
if (includeCentralityToTracks) {
419-
histos.add("Data/cent/pos/pt/its_tpc_tof", "pos ITS-TPC-TOF", kTH2D, {ptAxis, multAxis});
420-
histos.add("Data/cent/neg/pt/its_tpc_tof", "neg ITS-TPC-TOF", kTH2D, {ptAxis, multAxis});
421-
histos.add("Data/cent/pos/pt/its_tpc", "pos ITS-TPC", kTH2D, {ptAxis, multAxis});
422-
histos.add("Data/cent/neg/pt/its_tpc", "neg ITS-TPC", kTH2D, {ptAxis, multAxis});
423-
histos.add("Data/cent/pos/pt/its_tof", "pos ITS-TOF", kTH2D, {ptAxis, multAxis});
424-
histos.add("Data/cent/neg/pt/its_tof", "neg ITS-TOF", kTH2D, {ptAxis, multAxis});
419+
histos.add("Data/cent/pos/pt/its_tpc_tof", "pos ITS-TPC-TOF", kTH3D, {ptAxis, multAxis, occupancyAxis});
420+
histos.add("Data/cent/neg/pt/its_tpc_tof", "neg ITS-TPC-TOF", kTH3D, {ptAxis, multAxis, occupancyAxis});
421+
histos.add("Data/cent/pos/pt/its_tpc", "pos ITS-TPC", kTH3D, {ptAxis, multAxis, occupancyAxis});
422+
histos.add("Data/cent/neg/pt/its_tpc", "neg ITS-TPC", kTH3D, {ptAxis, multAxis, occupancyAxis});
423+
histos.add("Data/cent/pos/pt/its_tof", "pos ITS-TOF", kTH3D, {ptAxis, multAxis, occupancyAxis});
424+
histos.add("Data/cent/neg/pt/its_tof", "neg ITS-TOF", kTH3D, {ptAxis, multAxis, occupancyAxis});
425425
}
426426

427427
if (doprocessOccupancy) {
@@ -634,7 +634,6 @@ struct tofSpectra {
634634
}
635635
histos.add(hpt_den_prm_mcgoodev[i].data(), pTCharge[i], kTH2D, {ptAxis, multAxis});
636636
histos.add(hpt_den_prm_mcbadev[i].data(), pTCharge[i], kTH2D, {ptAxis, multAxis});
637-
638637
const std::string cpName = Form("/%s/%s", (i < Np) ? "pos" : "neg", pN[i % Np]);
639638
if (enableDCAxyzHistograms) {
640639
hDcaXYZPrm[i] = histos.add<TH3>("dcaprm" + cpName, pTCharge[i], kTH3D, {ptAxis, dcaXyAxis, dcaZAxis});
@@ -1210,14 +1209,8 @@ struct tofSpectra {
12101209
if (track.hasITS() && track.hasTPC() && track.hasTOF()) {
12111210
if (track.sign() > 0) {
12121211
histos.fill(HIST("Data/pos/pt/its_tpc_tof"), track.pt());
1213-
if (includeCentralityToTracks) {
1214-
histos.fill(HIST("Data/cent/pos/pt/its_tpc_tof"), track.pt(), collision.centFT0C());
1215-
}
12161212
} else {
12171213
histos.fill(HIST("Data/neg/pt/its_tpc_tof"), track.pt());
1218-
if (includeCentralityToTracks) {
1219-
histos.fill(HIST("Data/cent/neg/pt/its_tpc_tof"), track.pt(), collision.centFT0C());
1220-
}
12211214
}
12221215
}
12231216
if (track.hasITS() && track.hasTRD() && track.hasTOF()) {
@@ -1237,14 +1230,8 @@ struct tofSpectra {
12371230
if (track.hasITS() && track.hasTPC()) {
12381231
if (track.sign() > 0) {
12391232
histos.fill(HIST("Data/pos/pt/its_tpc"), track.pt());
1240-
if (includeCentralityToTracks) {
1241-
histos.fill(HIST("Data/cent/pos/pt/its_tpc"), track.pt(), collision.centFT0C());
1242-
}
12431233
} else {
12441234
histos.fill(HIST("Data/neg/pt/its_tpc"), track.pt());
1245-
if (includeCentralityToTracks) {
1246-
histos.fill(HIST("Data/cent/neg/pt/its_tpc"), track.pt(), collision.centFT0C());
1247-
}
12481235
}
12491236
}
12501237
if (track.hasTRD() && track.hasTOF()) {
@@ -1264,14 +1251,8 @@ struct tofSpectra {
12641251
if (track.hasITS() && track.hasTOF()) {
12651252
if (track.sign() > 0) {
12661253
histos.fill(HIST("Data/pos/pt/its_tof"), track.pt());
1267-
if (includeCentralityToTracks) {
1268-
histos.fill(HIST("Data/cent/pos/pt/its_tof"), track.pt(), collision.centFT0C());
1269-
}
12701254
} else {
12711255
histos.fill(HIST("Data/neg/pt/its_tof"), track.pt());
1272-
if (includeCentralityToTracks) {
1273-
histos.fill(HIST("Data/cent/neg/pt/its_tof"), track.pt(), collision.centFT0C());
1274-
}
12751256
}
12761257
}
12771258
if (track.hasTPC() && track.hasTRD()) {
@@ -1353,6 +1334,30 @@ struct tofSpectra {
13531334
if (!isTrackSelected<true>(track, collision)) {
13541335
continue;
13551336
}
1337+
if (includeCentralityToTracks) {
1338+
1339+
if (track.sign() > 0) {
1340+
if (track.hasITS() && track.hasTPC() && track.hasTOF()) {
1341+
histos.fill(HIST("Data/cent/pos/pt/its_tpc_tof"), track.pt(), collision.centFT0C(), occupancy);
1342+
}
1343+
if (track.hasITS() && track.hasTOF()) {
1344+
histos.fill(HIST("Data/cent/pos/pt/its_tof"), track.pt(), collision.centFT0C(), occupancy);
1345+
}
1346+
if (track.hasITS() && track.hasTPC()) {
1347+
histos.fill(HIST("Data/cent/pos/pt/its_tpc"), track.pt(), collision.centFT0C(), occupancy);
1348+
}
1349+
} else {
1350+
if (track.hasITS() && track.hasTPC() && track.hasTOF()) {
1351+
histos.fill(HIST("Data/cent/neg/pt/its_tpc_tof"), track.pt(), collision.centFT0C(), occupancy);
1352+
}
1353+
if (track.hasITS() && track.hasTPC()) {
1354+
histos.fill(HIST("Data/cent/neg/pt/its_tpc"), track.pt(), collision.centFT0C(), occupancy);
1355+
}
1356+
if (track.hasITS() && track.hasTOF()) {
1357+
histos.fill(HIST("Data/cent/neg/pt/its_tof"), track.pt(), collision.centFT0C(), occupancy);
1358+
}
1359+
}
1360+
}
13561361
const auto& nsigmaTPCPi = o2::aod::pidutils::tpcNSigma<2>(track);
13571362
const auto& nsigmaTPCKa = o2::aod::pidutils::tpcNSigma<3>(track);
13581363
const auto& nsigmaTPCPr = o2::aod::pidutils::tpcNSigma<4>(track);

0 commit comments

Comments
 (0)