Skip to content

Commit 8490e1f

Browse files
authored
Update HadNucleiFemto.cxx
1 parent 14faea5 commit 8490e1f

1 file changed

Lines changed: 71 additions & 30 deletions

File tree

PWGCF/Femto/FemtoNuclei/TableProducer/HadNucleiFemto.cxx

Lines changed: 71 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ struct HadNucleiFemto {
192192
Configurable<float> settingCutClSizeItsDe{"settingCutClSizeItsDe", 4.0f, "Minimum ITS cluster size for De"};
193193
Configurable<float> settingCutDeptMin{"settingCutDeptMin", 0.6f, "Minimum PT cut on De"};
194194
Configurable<float> settingCutDeptMax{"settingCutDeptMax", 1.6f, "Maximum PT cut on De"};
195-
Configurable<float> settingCutDeDCAzMin{"settingCutDeDCAzMin", 0.2f, "DCAxy Min for De"};
196195
Configurable<float> settingCutPinMinTOFITSDe{"settingCutPinMinTOFITSDe", 1.2f, "Minimum p to apply the TOF ITS cut on De"};
197196
Configurable<float> settingCutNsigmaTPCDe{"settingCutNsigmaTPCDe", 2.5f, "Value of the TPC Nsigma cut on De"};
198197
Configurable<float> settingCutNsigmaITSDe{"settingCutNsigmaITSDe", 2.5f, "Value of the ITD Nsigma cut on De"};
@@ -255,11 +254,11 @@ struct HadNucleiFemto {
255254
{"hEmptyPool", "svPoolCreator did not find track pairs false/true", {HistType::kTH1F, {{2, -0.5, 1.5}}}},
256255

257256
// Candidate topology and kinematics
258-
{"hTrackSel", "Accepted tracks", {HistType::kTH1F, {{Selections::kAll, -0.5, static_cast<double>(Selections::kAll) - 0.5}}}},
257+
{"hTrackSel", "Accepted hadron tracks", {HistType::kTH1F, {{Selections::kAll, -0.5, static_cast<double>(Selections::kAll) - 0.5}}}},
258+
{"hTrackSelDe", "Accepted deuteron tracks", {HistType::kTH1F, {{Selections::kAll, -0.5, static_cast<double>(Selections::kAll) - 0.5}}}},
259259

260260
{"hdcaxyNu", ";DCA_{xy} (cm)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}},
261261
{"hdcazNu", ";DCA_{z} (cm)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}},
262-
{"hdcazNu_min", ";DCA_{z}-min (cm)", {HistType::kTH1F, {{20, -1.0f, 1.0f}}}},
263262
{"hNClsNuITS", ";N_{ITS} Cluster", {HistType::kTH1F, {{20, -10.0f, 10.0f}}}},
264263
{"hNuPt", "#it{p}_{T} distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{240, -6.0f, 6.0f}}}},
265264
{"hSingleNuPt", "#it{p}_{T} distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{240, -6.0f, 6.0f}}}},
@@ -409,6 +408,7 @@ struct HadNucleiFemto {
409408
std::vector<std::string> selectionLabels = {"All", "Track selection", "PID"};
410409
for (int i = 0; i < Selections::kAll; i++) {
411410
mQaRegistry.get<TH1>(HIST("hTrackSel"))->GetXaxis()->SetBinLabel(i + 1, selectionLabels[i].c_str());
411+
mQaRegistry.get<TH1>(HIST("hTrackSelDe"))->GetXaxis()->SetBinLabel(i + 1, selectionLabels[i].c_str());
412412
}
413413

414414
std::vector<std::string> eventsLabels = {"All", "Selected", "Zorro De events"};
@@ -513,6 +513,34 @@ struct HadNucleiFemto {
513513
return true;
514514
}
515515

516+
template <typename Ttrack>
517+
bool selectTrackDe(const Ttrack& candidate)
518+
{
519+
if (std::abs(candidate.eta()) > settingCutEta) {
520+
return false;
521+
}
522+
523+
constexpr int minTPCNClsFound = 110;
524+
constexpr int minTPCNClsCrossedRows = 100;
525+
constexpr float minTPCCrossedRowsOverFound = 0.f;
526+
constexpr int maxTPCNClsShared = 160;
527+
constexpr float maxSharedTPCFraction = 1.f;
528+
constexpr int minITSNClsInnerBarrel = 1;
529+
const float tpcCrossedRowsOverFound = candidate.tpcNClsFound() > 0 ? static_cast<float>(candidate.tpcNClsCrossedRows()) / candidate.tpcNClsFound() : 0.f;
530+
531+
if (candidate.tpcNClsFound() < minTPCNClsFound ||
532+
candidate.tpcNClsCrossedRows() < minTPCNClsCrossedRows ||
533+
tpcCrossedRowsOverFound < minTPCCrossedRowsOverFound ||
534+
candidate.tpcNClsShared() > maxTPCNClsShared ||
535+
candidate.tpcFractionSharedCls() > maxSharedTPCFraction ||
536+
candidate.itsNCls() < settingCutNCls ||
537+
candidate.itsNClsInnerBarrel() < minITSNClsInnerBarrel) {
538+
return false;
539+
}
540+
541+
return true;
542+
}
543+
516544
template <typename Ttrack>
517545
bool selectionPIDKaon(const Ttrack& candidate)
518546
{
@@ -582,7 +610,7 @@ struct HadNucleiFemto {
582610
return false;
583611
mQaRegistry.fill(HIST("h2NsigmaHadPrTOF"), candidate.tofNSigmaPr());
584612

585-
if (candidate.hasTOF() && candidate.tpcInnerParam() >= settingCutPinMinTOFHad) {
613+
if (candidate.hasTOF() && std::abs(candidate.pt()) > settingCutPinMinTOFHad) {
586614
auto tofNSigmaPi = candidate.tofNSigmaPi();
587615
auto combNsigma = std::sqrt(tofNSigmaPi * tofNSigmaPi + tpcNSigmaPi * tpcNSigmaPi);
588616

@@ -598,7 +626,7 @@ struct HadNucleiFemto {
598626
mQaRegistry.fill(HIST("h2NsigmaHadComb"), candidate.sign() * candidate.pt(), combNsigma);
599627
mQaRegistry.fill(HIST("h2dEdxHadcandidates"), candidate.sign() * candidate.tpcInnerParam(), candidate.tpcSignal());
600628
return true;
601-
} else if (candidate.tpcInnerParam() < settingCutPinMinTOFHad) {
629+
} else if (std::abs(candidate.pt()) <= settingCutPinMinTOFHad) {
602630
if (std::abs(tpcNSigmaPi) > settingCutNsigmaTPCHad) {
603631
return false;
604632
}
@@ -639,10 +667,6 @@ struct HadNucleiFemto {
639667
float tpcInnerParam = candidate.tpcInnerParam();
640668
mQaRegistry.fill(HIST("h2dEdx"), candidate.sign() * tpcInnerParam, candidate.tpcSignal());
641669

642-
float DeDCAxyMin = 0.015 + 0.0305 / TMath::Power(candidate.pt(), 1.1);
643-
if (std::abs(candidate.dcaXY()) > DeDCAxyMin || std::abs(candidate.dcaZ()) > settingCutDeDCAzMin)
644-
return false;
645-
646670
if (std::abs(tpcInnerParam) < settingCutPinMinDe) {
647671
return false;
648672
}
@@ -657,6 +681,15 @@ struct HadNucleiFemto {
657681
mQaRegistry.fill(HIST("h2NsigmaNuTPC_preselecComp"), candidate.sign() * candidate.pt(), candidate.tpcNSigmaDe());
658682
if (std::abs(candidate.pt()) < settingCutDeptMin || std::abs(candidate.pt()) > settingCutDeptMax)
659683
return false;
684+
const float absPt = std::abs(candidate.pt());
685+
if (absPt <= 0.f) {
686+
return false;
687+
}
688+
const float deDCAxyMax = 0.004f + 0.013f / absPt;
689+
const float deDCAzMax = 0.004f + 0.013f / absPt;
690+
if (std::abs(candidate.dcaXY()) > deDCAxyMax || std::abs(candidate.dcaZ()) > deDCAzMax)
691+
return false;
692+
660693
if (candidate.hasTOF() && candidate.tpcInnerParam() > settingCutPinMinTOFITSDe) {
661694
auto tofNSigmaDe = candidate.tofNSigmaDe();
662695
auto combNsigma = std::sqrt(tofNSigmaDe * tofNSigmaDe + tpcNSigmaDe * tpcNSigmaDe);
@@ -908,7 +941,7 @@ struct HadNucleiFemto {
908941

909942
mQaRegistry.fill(HIST("hTrackSel"), Selections::kNoCuts);
910943

911-
if (!selectTrack(track0)) {
944+
if (!selectTrackDe(track0)) {
912945
continue;
913946
}
914947
mQaRegistry.fill(HIST("hTrackSel"), Selections::kTrackCuts);
@@ -985,7 +1018,7 @@ struct HadNucleiFemto {
9851018
void pairTracksEventMixing(T& DeCands, T& hadCands)
9861019
{
9871020
for (const auto& DeCand : DeCands) {
988-
if (!selectTrack(DeCand) || !selectionPIDDe(DeCand)) {
1021+
if (!selectTrackDe(DeCand) || !selectionPIDDe(DeCand)) {
9891022
continue;
9901023
}
9911024
for (const auto& hadCand : hadCands) {
@@ -1101,7 +1134,6 @@ struct HadNucleiFemto {
11011134
mQaRegistry.fill(HIST("hdcazNu"), hadNucand.dcazNu);
11021135
mQaRegistry.fill(HIST("hdcaxyHad"), hadNucand.dcaxyHad);
11031136
mQaRegistry.fill(HIST("hdcazHad"), hadNucand.dcazHad);
1104-
mQaRegistry.fill(HIST("hdcazNu_min"), (std::abs(hadNucand.dcazNu) - settingCutDeDCAzMin));
11051137
mQaRegistry.fill(HIST("hNClsNuITS"), hadNucand.nClsItsNu);
11061138
mQaRegistry.fill(HIST("hNClsHadITS"), hadNucand.nClsItsHad);
11071139
mQaRegistry.fill(HIST("hisBkgEM"), hadNucand.isBkgEM);
@@ -1364,21 +1396,27 @@ PROCESS_SWITCH(HadNucleiFemto, processMixedEventHyper, "Process Mixed event", fa
13641396
trackTableThisCollision.bindExternalIndices(&tracks);
13651397

13661398
for (const auto& track : trackTableThisCollision) {
1399+
const bool passTrackHad = selectTrack(track);
1400+
const bool passTrackDe = selectTrackDe(track);
1401+
13671402
mQaRegistry.fill(HIST("hTrackSel"), Selections::kNoCuts);
1403+
if (passTrackHad) {
1404+
mQaRegistry.fill(HIST("hTrackSel"), Selections::kTrackCuts);
1405+
}
13681406

1369-
if (!selectTrack(track)) {
1370-
continue;
1407+
mQaRegistry.fill(HIST("hTrackSelDe"), Selections::kNoCuts);
1408+
if (passTrackDe) {
1409+
mQaRegistry.fill(HIST("hTrackSelDe"), Selections::kTrackCuts);
13711410
}
1372-
mQaRegistry.fill(HIST("hTrackSel"), Selections::kTrackCuts);
13731411

1374-
if (settingHadPDGCode == PDG_t::kPiPlus) {
1412+
if (passTrackHad && settingHadPDGCode == PDG_t::kPiPlus) {
13751413
const float tpcNSigmaHad = track.tpcNSigmaPi();
13761414
mQaRegistry.fill(HIST("purity/h2NsigmaHadTPC_preselection"), track.sign() * track.pt(), tpcNSigmaHad);
1377-
if (track.hasTOF() && track.tpcInnerParam() >= settingCutPinMinTOFHad) {
1415+
if (track.hasTOF() && std::abs(track.pt()) > settingCutPinMinTOFHad) {
13781416
const float tofNSigmaHad = track.tofNSigmaPi();
13791417
mQaRegistry.fill(HIST("purity/h2NsigmaHadTOF_preselection"), track.sign() * track.pt(), tofNSigmaHad);
13801418
}
1381-
} else if (settingHadPDGCode == PDG_t::kKPlus) {
1419+
} else if (passTrackHad && settingHadPDGCode == PDG_t::kKPlus) {
13821420
const float tpcNSigmaHad = track.tpcNSigmaKa();
13831421
mQaRegistry.fill(HIST("purity/h2NsigmaHadTPC_preselection"), track.sign() * track.pt(), tpcNSigmaHad);
13841422
if (track.hasTOF() && track.tpcInnerParam() >= settingCutPinMinTOFHad) {
@@ -1387,29 +1425,32 @@ PROCESS_SWITCH(HadNucleiFemto, processMixedEventHyper, "Process Mixed event", fa
13871425
}
13881426
}
13891427

1390-
const float tpcNSigmaDe = settingUseBBcomputeDeNsigma ? computeNSigmaDe(track) : track.tpcNSigmaDe();
1391-
mQaRegistry.fill(HIST("purity/h2NsigmaNuTPC_preselection"), track.sign() * track.pt(), tpcNSigmaDe);
1392-
mQaRegistry.fill(HIST("purity/h2NsigmaNuTPC_preselecComp"), track.sign() * track.pt(), track.tpcNSigmaDe());
1393-
if (track.hasTOF() && track.tpcInnerParam() > settingCutPinMinTOFITSDe) {
1394-
const float tofNSigmaDe = track.tofNSigmaDe();
1395-
mQaRegistry.fill(HIST("purity/h2NsigmaNuTOF_preselection"), track.sign() * track.pt(), tofNSigmaDe);
1396-
} else if (track.tpcInnerParam() <= settingCutPinMinTOFITSDe) {
1397-
const float itsNSigmaDe = itsResponse.nSigmaITS<o2::track::PID::Deuteron>(track.itsClusterSizes(), track.p(), track.eta());
1398-
mQaRegistry.fill(HIST("purity/h2NSigmaNuITS_preselection"), track.sign() * track.pt(), itsNSigmaDe);
1428+
if (passTrackDe) {
1429+
const float tpcNSigmaDe = settingUseBBcomputeDeNsigma ? computeNSigmaDe(track) : track.tpcNSigmaDe();
1430+
mQaRegistry.fill(HIST("purity/h2NsigmaNuTPC_preselection"), track.sign() * track.pt(), tpcNSigmaDe);
1431+
mQaRegistry.fill(HIST("purity/h2NsigmaNuTPC_preselecComp"), track.sign() * track.pt(), track.tpcNSigmaDe());
1432+
if (track.hasTOF() && track.tpcInnerParam() > settingCutPinMinTOFITSDe) {
1433+
const float tofNSigmaDe = track.tofNSigmaDe();
1434+
mQaRegistry.fill(HIST("purity/h2NsigmaNuTOF_preselection"), track.sign() * track.pt(), tofNSigmaDe);
1435+
} else if (track.tpcInnerParam() <= settingCutPinMinTOFITSDe) {
1436+
const float itsNSigmaDe = itsResponse.nSigmaITS<o2::track::PID::Deuteron>(track.itsClusterSizes(), track.p(), track.eta());
1437+
mQaRegistry.fill(HIST("purity/h2NSigmaNuITS_preselection"), track.sign() * track.pt(), itsNSigmaDe);
1438+
}
13991439
}
14001440

1401-
const bool isHadronSelected = selectionPIDHadron(track);
1402-
const bool isDeuteronSelected = selectionPIDDe(track);
1441+
const bool isHadronSelected = passTrackHad && selectionPIDHadron(track);
1442+
const bool isDeuteronSelected = passTrackDe && selectionPIDDe(track);
14031443
if (!isHadronSelected && !isDeuteronSelected) {
14041444
continue;
14051445
}
1406-
mQaRegistry.fill(HIST("hTrackSel"), Selections::kPID);
14071446

14081447
if (isHadronSelected) {
1448+
mQaRegistry.fill(HIST("hTrackSel"), Selections::kPID);
14091449
mQaRegistry.fill(HIST("hSingleHadPt"), track.pt() * track.sign());
14101450
}
14111451

14121452
if (isDeuteronSelected) {
1453+
mQaRegistry.fill(HIST("hTrackSelDe"), Selections::kPID);
14131454
mQaRegistry.fill(HIST("hSingleNuPt"), track.pt() * track.sign());
14141455
mQaRegistry.fill(HIST("hSingleNuPin"), track.tpcInnerParam() * track.sign());
14151456
}

0 commit comments

Comments
 (0)