Skip to content

Commit b91d8b3

Browse files
victor-gonzalezVictor
andauthored
[PWGCF] DptDpt - Enhanced the information about TPC sector chambers (AliceO2Group#10139)
Co-authored-by: Victor <[email protected]>
1 parent d6a6ba0 commit b91d8b3

File tree

1 file changed

+94
-2
lines changed

1 file changed

+94
-2
lines changed

PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx

Lines changed: 94 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ TpcExcludeTrack tpcExcluder; ///< the TPC excluder object instance
5959

6060
namespace efficiencyandqatask
6161
{
62-
/// \enum KindOfProcessQA
62+
/// \enum KindOfData
6363
/// \brief The kind of data for templating the procedures
6464
enum KindOfData {
6565
kReco = 0, ///< processing over reconstructed particles/tracks
@@ -127,14 +127,26 @@ struct QADataCollectingEngine {
127127
std::vector<std::shared_ptr<TH2>> fhPtVsEtaB{2, nullptr};
128128
std::vector<std::shared_ptr<TH2>> fhPtVsZvtxB{2, nullptr};
129129
std::shared_ptr<TH2> fhPhiVsPtPosB{nullptr};
130+
std::shared_ptr<TH3> fhNchVsPhiVsPtPosB{nullptr};
131+
TH2* fhPerColNchVsPhiVsPtPosB{nullptr};
130132
std::shared_ptr<TH2> fhPhiVsInnerWallMomPosB{nullptr};
133+
std::shared_ptr<TH3> fhNchVsPhiVsInnerWallMomPosB{nullptr};
134+
TH2* fhPerColNchVsPhiVsInnerWallMomPosB{nullptr};
131135
std::shared_ptr<TH2> fhPhiVsPtNegB{nullptr};
136+
std::shared_ptr<TH3> fhNchVsPhiVsPtNegB{nullptr};
137+
TH2* fhPerColNchVsPhiVsPtNegB{nullptr};
132138
std::shared_ptr<TH2> fhPhiVsInnerWallMomNegB{nullptr};
139+
std::shared_ptr<TH3> fhNchVsPhiVsInnerWallMomNegB{nullptr};
140+
TH2* fhPerColNchVsPhiVsInnerWallMomNegB{nullptr};
133141
std::vector<std::vector<std::shared_ptr<TH1>>> fhPtA{2, {nsp, nullptr}};
134142
std::vector<std::vector<std::shared_ptr<TH2>>> fhPtVsEtaA{2, {nsp, nullptr}};
135143
std::vector<std::vector<std::shared_ptr<TH2>>> fhPtVsZvtxA{2, {nsp, nullptr}};
136144
std::vector<std::shared_ptr<TH2>> fhPhiVsPtA{nsp, nullptr};
145+
std::vector<std::shared_ptr<TH3>> fhNchVsPhiVsPtA{nsp, nullptr};
146+
std::vector<TH2*> fhPerColNchVsPhiVsPtA{nsp, nullptr};
137147
std::vector<std::shared_ptr<TH2>> fhPhiVsInnerWallMomA{nsp, nullptr};
148+
std::vector<std::shared_ptr<TH3>> fhNchVsPhiVsInnerWallMomA{nsp, nullptr};
149+
std::vector<TH2*> fhPerColNchVsPhiVsInnerWallMomA{nsp, nullptr};
138150
std::vector<std::shared_ptr<TH2>> fhPhiShiftedVsPtA{nsp, nullptr};
139151
std::vector<std::shared_ptr<TH2>> fhPhiShiftedVsInnerWallMomA{nsp, nullptr};
140152
std::shared_ptr<TH2> fhPtVsEtaItsAcc{nullptr};
@@ -197,13 +209,17 @@ struct QADataCollectingEngine {
197209
using namespace analysis::dptdptfilter;
198210

199211
AxisSpec pidPtAxis{150, 0.1, 5.0, "#it{p}_{T} (GeV/#it{c})"};
212+
AxisSpec pidPtAxisReduced{50, 0.1, 5.0, "#it{p}_{T} (GeV/#it{c})"};
200213
AxisSpec pidPAxis{150, 0.1, 5.0, "#it{p} (GeV/#it{c})"};
214+
AxisSpec pidPAxisReduced{50, 0.1, 5.0, "#it{p} (GeV/#it{c})"};
201215
pidPtAxis.makeLogarithmic();
202216
pidPAxis.makeLogarithmic();
203217
const AxisSpec ptAxis{ptbins, ptlow, ptup, "#it{p}_{T} (GeV/c)"};
204218
const AxisSpec etaAxis{etabins, etalow, etaup, "#eta"};
205219
const AxisSpec phiAxis{360, 0.0f, constants::math::TwoPI, "#varphi (rad)"};
206-
const AxisSpec phiSectorAxis{144, 0.0f, 0.36, "#varphi (mod(2#pi/18) (rad))"};
220+
const AxisSpec phiSectorAxis{144, 0.0f, 0.36f, "#varphi (mod(2#pi/18) (rad))"};
221+
const AxisSpec phiSectorAxisReduced{36, 0.0f, 0.36f, "#varphi (mod(2#pi/18) (rad))"};
222+
const AxisSpec nChargeAxis{100, 0.0f, 100.0f, "#it{N}_{ch}"};
207223
const AxisSpec phiShiftedSectorAxis{220, -55.0f, 55.0f, "% of the sector"};
208224
const AxisSpec zvtxAxis{zvtxbins, zvtxlow, zvtxup, "#it{z}_{vtx}"};
209225
const AxisSpec itsNClsAxis{8, -0.5, 7.5, "ITS n clusters"};
@@ -228,9 +244,13 @@ struct QADataCollectingEngine {
228244
if constexpr (kindOfData == kReco) {
229245
/* only the reconstructed level histograms*/
230246
fhPhiVsPtPosB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "PhiVsPtPos", "#varphi (mod(2#pi/18))", kTH2F, {pidPtAxis, phiSectorAxis});
247+
fhNchVsPhiVsPtPosB = ADDHISTOGRAM(TH3, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "NchVsPhiVsPtPos", "#it{N}_{ch}^{#plus} #varphi (mod(2#pi/18))", kTH3F, {pidPtAxisReduced, phiSectorAxisReduced, nChargeAxis});
231248
fhPhiVsInnerWallMomPosB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "PhiVsIwMomPos", "#varphi (mod(2#pi/18)) TPC_{iw} #it{p}", kTH2F, {pidPAxis, phiSectorAxis});
249+
fhNchVsPhiVsInnerWallMomPosB = ADDHISTOGRAM(TH3, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "NchVsPhiVsIwMomPos", "#it{N}_{ch}^{#plus} #varphi (mod(2#pi/18)) TPC_{iw} #it{p}", kTH3F, {pidPAxisReduced, phiSectorAxisReduced, nChargeAxis});
232250
fhPhiVsPtNegB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "PhiVsPtNeg", "#varphi (mod(2#pi/18))", kTH2F, {pidPtAxis, phiSectorAxis});
251+
fhNchVsPhiVsPtNegB = ADDHISTOGRAM(TH3, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "NchVsPhiVsPtNeg", "#it{N}_{ch}^{#minus} #varphi (mod(2#pi/18))", kTH3F, {pidPtAxisReduced, phiSectorAxisReduced, nChargeAxis});
233252
fhPhiVsInnerWallMomNegB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "PhiVsIwMomNeg", "#varphi (mod(2#pi/18)) TPC_{iw} #it{p}", kTH2F, {pidPAxis, phiSectorAxis});
253+
fhNchVsPhiVsInnerWallMomNegB = ADDHISTOGRAM(TH3, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "NchVsPhiVsIwMomNeg", "#it{N}_{ch}^{#minus} #varphi (mod(2#pi/18)) TPC_{iw} #it{p}", kTH3F, {pidPAxisReduced, phiSectorAxisReduced, nChargeAxis});
234254
fhItsNClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "ITSNCls", "ITS clusters", kTH2F, {ptAxis, itsNClsAxis});
235255
fhItsChi2NClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "ITSChi2NCls", "ITS #Chi^{2}", kTH2F, {ptAxis, itsCh2Axis});
236256
fhTpcFindableNClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCFindableNCls", "TPC findable clusters", kTH2F, {ptAxis, tpcNClsAxis});
@@ -248,9 +268,25 @@ struct QADataCollectingEngine {
248268
fhPtVsEtaItsTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsTofAcc", "ITS&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis});
249269
fhPtVsEtaTpcTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptTpcTofAcc", "TPC&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis});
250270
fhPtVsEtaItsTpcTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsTpcTofAcc", "ITS&TPC&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis});
271+
/* per collision histograms not going to the results file */
272+
int nPtBins = fhNchVsPhiVsPtPosB->GetNbinsX();
273+
float ptLow = fhNchVsPhiVsPtNegB->GetXaxis()->GetBinLowEdge(1);
274+
float ptHigh = fhNchVsPhiVsPtNegB->GetXaxis()->GetBinUpEdge(nPtBins);
275+
int nTpcIwMomBins = fhNchVsPhiVsInnerWallMomNegB->GetNbinsX();
276+
float tpcIwMomLow = fhNchVsPhiVsInnerWallMomNegB->GetXaxis()->GetBinLowEdge(1);
277+
float tpcIwMomHigh = fhNchVsPhiVsInnerWallMomNegB->GetXaxis()->GetBinUpEdge(nTpcIwMomBins);
278+
int nPhiSectorBins = fhNchVsPhiVsPtPosB->GetNbinsY();
279+
float phiSectorLow = fhNchVsPhiVsPtNegB->GetYaxis()->GetBinLowEdge(1);
280+
float phiSectorHigh = fhNchVsPhiVsPtNegB->GetYaxis()->GetBinUpEdge(nPhiSectorBins);
281+
fhPerColNchVsPhiVsPtPosB = new TH2F("PerColNchVsPhiVsPtPosB", "", nPtBins, ptLow, ptHigh, nPhiSectorBins, phiSectorLow, phiSectorHigh);
282+
fhPerColNchVsPhiVsInnerWallMomPosB = new TH2F("PerColNchVsPhiVsInnerWallMomPosB", "", nTpcIwMomBins, tpcIwMomLow, tpcIwMomHigh, nPhiSectorBins, phiSectorLow, phiSectorHigh);
283+
fhPerColNchVsPhiVsPtNegB = new TH2F("PerColNchVsPhiVsPtNegB", "", nPtBins, ptLow, ptHigh, nPhiSectorBins, phiSectorLow, phiSectorHigh);
284+
fhPerColNchVsPhiVsInnerWallMomNegB = new TH2F("PerColNchVsPhiVsInnerWallMomNegB", "", nTpcIwMomBins, tpcIwMomLow, tpcIwMomHigh, nPhiSectorBins, phiSectorLow, phiSectorHigh);
251285
for (uint isp = 0; isp < nsp; ++isp) {
252286
fhPhiVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("PhiVsPt_%s", tnames[isp].c_str()), HTITLESTRING("#varphi %s (mod(2#pi/18))", tnames[isp].c_str()), kTH2F, {pidPtAxis, phiSectorAxis});
287+
fhNchVsPhiVsPtA[isp] = ADDHISTOGRAM(TH3, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("NchVsPhiVsPt_%s", tnames[isp].c_str()), HTITLESTRING("#it{N}_{ch}^{%s} #varphi (mod(2#pi/18))", tnames[isp].c_str()), kTH3F, {pidPtAxisReduced, phiSectorAxisReduced, nChargeAxis});
253288
fhPhiVsInnerWallMomA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("PhiVsIwMom_%s", tnames[isp].c_str()), HTITLESTRING("#varphi %s (mod(2#pi/18)) TPC_{iw} #it{p}", tnames[isp].c_str()), kTH2F, {pidPAxis, phiSectorAxis});
289+
fhNchVsPhiVsInnerWallMomA[isp] = ADDHISTOGRAM(TH3, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), HNAMESTRING("NchVsPhiVsIwMom_%s", tnames[isp].c_str()), HTITLESTRING("#it{N}_{ch}^{%s} #varphi (mod(2#pi/18)) TPC_{iw} #it{p}", tnames[isp].c_str()), kTH3F, {pidPAxisReduced, phiSectorAxisReduced, nChargeAxis});
254290
fhPhiShiftedVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("PhiShiftedVsPt_%s", tnames[isp].c_str()), HTITLESTRING("%s TPC sector %%", tnames[isp].c_str()), kTH2F, {pidPtAxis, phiShiftedSectorAxis});
255291
fhPhiShiftedVsInnerWallMomA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("PhiShiftedVsIwMom_%s", tnames[isp].c_str()), HTITLESTRING("%s TPC sector %% TPC_{iw} #it{p}", tnames[isp].c_str()), kTH2F, {pidPAxis, phiShiftedSectorAxis});
256292
fhItsNClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("ITSNCls_%s", tnames[isp].c_str()), HTITLESTRING("ITS clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, itsNClsAxis});
@@ -269,6 +305,9 @@ struct QADataCollectingEngine {
269305
fhPtVsEtaItsTofA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptItsTof_%s", tnames[isp].c_str()), HTITLESTRING("ITS&TOF %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis});
270306
fhPtVsEtaTpcTofA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptTpcTof_%s", tnames[isp].c_str()), HTITLESTRING("TPC&TOF %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis});
271307
fhPtVsEtaItsTpcTofA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptItsTpcTof_%s", tnames[isp].c_str()), HTITLESTRING("ITS&TPC&TOF %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis});
308+
/* per collision histograms not going to the results file */
309+
fhPerColNchVsPhiVsPtA[isp] = new TH2F(HNAMESTRING("PerColNchVsPhiVsPt_%s", tnames[isp].c_str()), "", nPtBins, ptLow, ptHigh, nPhiSectorBins, phiSectorLow, phiSectorHigh);
310+
fhPerColNchVsPhiVsInnerWallMomA[isp] = new TH2F(HNAMESTRING("PerColNchVsPhiVsInnerWallMom_%s", tnames[isp].c_str()), "", nTpcIwMomBins, tpcIwMomLow, tpcIwMomHigh, nPhiSectorBins, phiSectorLow, phiSectorHigh);
272311
}
273312
} else {
274313
AxisSpec recoSpecies{static_cast<int>(nsp) + 1, -0.5, nsp - 0.5, "reco species"};
@@ -369,10 +408,14 @@ struct QADataCollectingEngine {
369408
phiShiftedPercentInTpcSector = (phiShiftedPercentInTpcSector > 50.0f) ? (phiShiftedPercentInTpcSector - 100.0f) : phiShiftedPercentInTpcSector;
370409
if (track.sign() > 0) {
371410
fhPhiVsPtPosB->Fill(track.pt(), phiInTpcSector);
411+
fhPerColNchVsPhiVsPtPosB->Fill(track.pt(), phiInTpcSector);
372412
fhPhiVsInnerWallMomPosB->Fill(track.tpcInnerParam(), phiInTpcSector);
413+
fhPerColNchVsPhiVsInnerWallMomPosB->Fill(track.tpcInnerParam(), phiInTpcSector);
373414
} else {
374415
fhPhiVsPtNegB->Fill(track.pt(), phiInTpcSector);
416+
fhPerColNchVsPhiVsPtNegB->Fill(track.pt(), phiInTpcSector);
375417
fhPhiVsInnerWallMomNegB->Fill(track.tpcInnerParam(), phiInTpcSector);
418+
fhPerColNchVsPhiVsInnerWallMomNegB->Fill(track.tpcInnerParam(), phiInTpcSector);
376419
}
377420
fhItsNClsVsPtB->Fill(track.pt(), track.itsNCls());
378421
fhItsChi2NClsVsPtB->Fill(track.pt(), track.itsChi2NCl());
@@ -394,7 +437,9 @@ struct QADataCollectingEngine {
394437
}
395438
if (!(track.trackacceptedid() < 0)) {
396439
fhPhiVsPtA[track.trackacceptedid()]->Fill(track.pt(), phiInTpcSector);
440+
fhPerColNchVsPhiVsPtA[track.trackacceptedid()]->Fill(track.pt(), phiInTpcSector);
397441
fhPhiVsInnerWallMomA[track.trackacceptedid()]->Fill(track.tpcInnerParam(), phiInTpcSector);
442+
fhPerColNchVsPhiVsInnerWallMomA[track.trackacceptedid()]->Fill(track.tpcInnerParam(), phiInTpcSector);
398443
fhPhiShiftedVsPtA[track.trackacceptedid()]->Fill(track.pt(), phiShiftedPercentInTpcSector);
399444
fhPhiShiftedVsInnerWallMomA[track.trackacceptedid()]->Fill(track.tpcInnerParam(), phiShiftedPercentInTpcSector);
400445
fhItsNClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.itsNCls());
@@ -481,6 +526,47 @@ struct QADataCollectingEngine {
481526
}
482527
}
483528
}
529+
530+
template <efficiencyandqatask::KindOfData kindOfData>
531+
void newCollision()
532+
{
533+
using namespace efficiencyandqatask;
534+
if constexpr (kindOfData == kReco) {
535+
fhPerColNchVsPhiVsPtPosB->Reset();
536+
fhPerColNchVsPhiVsPtNegB->Reset();
537+
fhPerColNchVsPhiVsInnerWallMomPosB->Reset();
538+
fhPerColNchVsPhiVsInnerWallMomNegB->Reset();
539+
for (uint isp = 0; isp < nsp; ++isp) {
540+
fhPerColNchVsPhiVsPtA[isp]->Reset();
541+
fhPerColNchVsPhiVsInnerWallMomA[isp]->Reset();
542+
}
543+
}
544+
}
545+
546+
template <efficiencyandqatask::KindOfData kindOfData>
547+
void finishedCollision()
548+
{
549+
using namespace efficiencyandqatask;
550+
if constexpr (kindOfData == kReco) {
551+
auto fillHistogram = [](auto& th, const TH2* sh) {
552+
int nBinsX = sh->GetNbinsX();
553+
int nBinsY = sh->GetNbinsY();
554+
for (int ix = 0; ix < nBinsX; ++ix) {
555+
for (int iy = 0; iy < nBinsY; ++iy) {
556+
th->Fill(sh->GetXaxis()->GetBinCenter(ix + 1), sh->GetYaxis()->GetBinCenter(iy + 1), sh->GetBinContent(ix + 1, iy + 1));
557+
}
558+
}
559+
};
560+
fillHistogram(fhNchVsPhiVsPtPosB, fhPerColNchVsPhiVsPtPosB);
561+
fillHistogram(fhNchVsPhiVsPtNegB, fhPerColNchVsPhiVsPtNegB);
562+
fillHistogram(fhNchVsPhiVsInnerWallMomPosB, fhPerColNchVsPhiVsInnerWallMomPosB);
563+
fillHistogram(fhNchVsPhiVsInnerWallMomNegB, fhPerColNchVsPhiVsInnerWallMomNegB);
564+
for (uint isp = 0; isp < nsp; ++isp) {
565+
fillHistogram(fhNchVsPhiVsPtA[isp], fhPerColNchVsPhiVsPtA[isp]);
566+
fillHistogram(fhNchVsPhiVsInnerWallMomA[isp], fhPerColNchVsPhiVsInnerWallMomA[isp]);
567+
}
568+
}
569+
}
484570
};
485571

486572
/* the PID data collecting engine */
@@ -986,6 +1072,9 @@ struct DptDptEfficiencyAndQc {
9861072

9871073
int ixDCE = getDCEindex(collision);
9881074
if (!(ixDCE < 0)) {
1075+
if constexpr (kindOfProcess == kBASIC) {
1076+
qaDataCE[ixDCE]->newCollision<kindOfData>();
1077+
}
9891078
for (auto const& track : tracks) {
9901079
float tpcmom = track.p();
9911080
float tofmom = track.p();
@@ -1004,6 +1093,9 @@ struct DptDptEfficiencyAndQc {
10041093
pidExtraDataCE[ixDCE]->processTrack<kindOfData>(track, tpcmom, tofmom);
10051094
}
10061095
}
1096+
if constexpr (kindOfProcess == kBASIC) {
1097+
qaDataCE[ixDCE]->finishedCollision<kindOfData>();
1098+
}
10071099
}
10081100
}
10091101

0 commit comments

Comments
 (0)