Skip to content

Commit a9fcaa7

Browse files
committed
Old process function
1 parent cade617 commit a9fcaa7

File tree

2 files changed

+56
-14
lines changed

2 files changed

+56
-14
lines changed

PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,16 @@ struct f1protonreducedtable {
161161
{"hInvMassf1Like", "hInvMassf1Like", {HistType::kTH2F, {{400, 1.1f, 1.9f}, {100, 0.0f, 10.0f}}}},
162162
{"hInvMassf1kstar", "hInvMassf1kstar", {HistType::kTH3F, {{400, 1.1f, 1.9f}, {100, 0.0f, 10.0f}, {8, 0.0f, 0.8f}}}},
163163
{"hkstarDist", "hkstarDist", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}},
164-
{"hDCAxy", "hDCAxy", {HistType::kTH1F, {{100, -5.0f, 5.0f}}}},
165-
{"hDCAz", "hDCAz", {HistType::kTH1F, {{100, -5.0f, 5.0f}}}},
164+
{"hDCAxy", "hDCAxy", {HistType::kTH3F, {{100, -0.05f, 0.05f}, {5, -2.5, 2.5}, {40, 0.0, 4.0}}}},
165+
{"hDCAz", "hDCAz", {HistType::kTH3F, {{100, -0.05f, 0.05f}, {2, 0, 2}, {40, 0.0, 4.0}}}},
166166
{"hPhi", "hPhi", {HistType::kTH1F, {{1400, -7.0f, 7.0f}}}},
167167
{"hPhiSphero", "hPhiSphero", {HistType::kTH1F, {{1400, -7.0f, 7.0f}}}},
168168
{"hEta", "hEta", {HistType::kTH1F, {{20, -1.0f, 1.0f}}}},
169169
{"hNsigmaPtpionTPC", "hNsigmaPtpionTPC", {HistType::kTH2F, {{200, -10.0f, 10.0f}, {100, 0.0f, 10.0f}}}},
170170
{"hNsigmaPtpionTOF", "hNsigmaPtpionTOF", {HistType::kTH2F, {{200, -10.0f, 10.0f}, {100, 0.0f, 10.0f}}}},
171171
{"hNsigmaPtkaonTPC", "hNsigmaPtkaonTPC", {HistType::kTH3F, {{200, -10.0f, 10.0f}, {200, -20.0f, 20.0f}, {100, 0.0f, 10.0f}}}},
172172
{"hNsigmaPtkaonTOF", "hNsigmaPtkaonTOF", {HistType::kTH2F, {{200, -10.0f, 10.0f}, {100, 0.0f, 10.0f}}}},
173-
{"hNsigmaPtprotonTPC", "hNsigmaPtprotonTPC", {HistType::kTH2F, {{200, -10.0f, 10.0f}, {100, 0.0f, 10.0f}}}},
173+
{"hNsigmaPtprotonTPC", "hNsigmaPtprotonTPC", {HistType::kTH3F, {{100, -5.0f, 5.0f}, {100, -5.0f, 5.0f}, {100, 0.0f, 10.0f}}}},
174174
{"hNsigmaPtprotonTOF", "hNsigmaPtprotonTOF", {HistType::kTH2F, {{200, -10.0f, 10.0f}, {100, 0.0f, 10.0f}}}},
175175
{"hInvMassk0", "hInvMassk0", {HistType::kTH2F, {{200, 0.4f, 0.6f}, {100, 0.0f, 10.0f}}}},
176176
},
@@ -266,7 +266,7 @@ struct f1protonreducedtable {
266266
bool selectionGlobalTrack(const T& candidate)
267267
{
268268
if (!(candidate.isGlobalTrack() && candidate.isPVContributor())) {
269-
return false;
269+
// return false;
270270
}
271271
return true;
272272
}
@@ -348,6 +348,33 @@ struct f1protonreducedtable {
348348
return false;
349349
}
350350

351+
inline bool passProtonPID(float nsigmaTPC, float nsigmaTOF, float TOFHit, ROOT::Math::PtEtaPhiMVector proton)
352+
{
353+
// pidMode:
354+
// 0 = default: p < thr -> |TPC| < 2.5 ; p >= thr -> TOF mandatory AND circular(TPC,TOF) < 2.0
355+
// 1 = syst-1: p < thr -> |TPC| < 2.0 ; p >= thr -> TOF mandatory AND circular(TPC,TOF) < 2.0
356+
// 2 = syst-2: p < thr -> |TPC| < 2.5 ; p >= thr -> TOF mandatory AND circular(TPC,TOF) < 2.5
357+
358+
if (proton.Pt() > 4.0 || proton.Pt() < 0.15) {
359+
return false;
360+
}
361+
362+
if (proton.P() < 0.7) {
363+
return (std::abs(nsigmaTPC) < 2.5);
364+
}
365+
366+
// above threshold: TOF must exist
367+
if (TOFHit != 1) {
368+
return false;
369+
}
370+
371+
372+
const float nsTPC = nsigmaTPC;
373+
const float nsTOF = nsigmaTOF;
374+
const float comb = std::sqrt(nsTPC * nsTPC + nsTOF * nsTOF);
375+
return (comb < 2.5);
376+
}
377+
351378
template <typename Collision, typename V0>
352379
bool SelectionV0(Collision const& collision, V0 const& candidate)
353380
{
@@ -682,8 +709,6 @@ struct f1protonreducedtable {
682709
if (!selectionGlobalTrack(track)) {
683710
continue;
684711
}
685-
qaRegistry.fill(HIST("hDCAxy"), track.dcaXY());
686-
qaRegistry.fill(HIST("hDCAz"), track.dcaZ());
687712
qaRegistry.fill(HIST("hEta"), track.eta());
688713
qaRegistry.fill(HIST("hPhi"), track.phi());
689714
double nTPCSigmaP[3]{track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()};
@@ -778,17 +803,15 @@ struct f1protonreducedtable {
778803
ProtonIndex.push_back(track.globalIndex());
779804
ProtonCharge.push_back(track.sign());
780805

781-
ProtonDcaxy.push_back(std::abs(track.dcaXY()));
782-
ProtonDcaz.push_back(std::abs(track.dcaZ()));
806+
ProtonDcaxy.push_back(track.dcaXY());
807+
ProtonDcaz.push_back(track.dcaZ());
783808
ProtonTPCNcls.push_back(std::abs(track.tpcNClsFound()));
784809
ProtonTPCNcrs.push_back(std::abs(track.tpcNClsCrossedRows()));
785810

786811
if (track.sign() > 0) {
787-
qaRegistry.fill(HIST("hNsigmaPtprotonTPC"), nTPCSigmaP[2], track.pt());
788812
ProtonTPCNsigma.push_back(nTPCSigmaP[2]);
789813
}
790814
if (track.sign() < 0) {
791-
qaRegistry.fill(HIST("hNsigmaPtprotonTPC"), nTPCSigmaN[2], track.pt());
792815
ProtonTPCNsigma.push_back(nTPCSigmaN[2]);
793816
}
794817
if (track.hasTOF()) {
@@ -961,6 +984,24 @@ struct f1protonreducedtable {
961984
}
962985
}
963986
qaRegistry.fill(HIST("hEventstat"), 0.5);
987+
988+
for (auto iproton = protons.begin(); iproton != protons.end(); ++iproton) {
989+
auto i6 = std::distance(protons.begin(), iproton);
990+
ProtonVectorDummy2 = protons.at(i6);
991+
if (std::abs(ProtonDcaxy.at(i6)) < 0.05 && std::abs(ProtonDcaz.at(i6)) < 0.05) {
992+
if (ProtonTOFHit.at(i6) && ProtonVectorDummy2.P() > 0.7) {
993+
qaRegistry.fill(HIST("hNsigmaPtprotonTPC"),ProtonTPCNsigma.at(i6), ProtonTOFNsigma.at(i6), ProtonVectorDummy2.Pt());
994+
}
995+
if (ProtonVectorDummy2.P() < 0.7) {
996+
qaRegistry.fill(HIST("hNsigmaPtprotonTPC"),ProtonTPCNsigma.at(i6), 4.999, ProtonVectorDummy2.Pt());
997+
}
998+
}
999+
if (passProtonPID(ProtonTPCNsigma.at(i6), ProtonTOFNsigma.at(i6), ProtonTOFHit.at(i6), ProtonVectorDummy2)) {
1000+
qaRegistry.fill(HIST("hDCAxy"), ProtonDcaxy.at(i6), ProtonCharge.at(i6), ProtonVectorDummy2.Pt());
1001+
qaRegistry.fill(HIST("hDCAz"), ProtonDcaz.at(i6), ProtonCharge.at(i6), ProtonVectorDummy2.Pt());
1002+
}
1003+
}
1004+
9641005
if (numberF1 > 0 && (f1resonance.size() == f1signal.size()) && (f1resonance.size() == f1kaonkshortmass.size()) && (f1resonance.size() == f1resonanced1.size()) && (f1resonance.size() == f1resonanced2.size()) && (f1resonance.size() == f1resonanced3.size())) {
9651006
qaRegistry.fill(HIST("hEventstat"), 1.5);
9661007
if (keepEventF1Proton) {

PWGLF/Tasks/Resonances/f1protoncorrelation.cxx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ struct f1protoncorrelation {
607607
}
608608
auto relative_momentum = getkstar(F1, Proton);
609609
if (relative_momentum <= 0.5) {
610-
histos.fill(HIST("hNsigmaProtonTPC"), protontrack.protonNsigmaTPC(), Proton.Pt());
610+
histos.fill(HIST("hNsigmaProtonTPC"), protontrack.protonNsigmaTPC(), protontrack.protonNsigmaTOF(), Proton.Pt());
611611
}
612612
histos.fill(HIST("h2SameEventPtCorrelation"), relative_momentum, F1.Pt(), Proton.Pt());
613613

@@ -977,7 +977,7 @@ struct f1protoncorrelation {
977977
Kaon.SetXYZM(f1track.f1d2Px(), f1track.f1d2Py(), f1track.f1d2Pz(), 0.493);
978978
Kshort.SetXYZM(f1track.f1d3Px(), f1track.f1d3Py(), f1track.f1d3Pz(), 0.497);
979979
KaonKshortPair = Kaon + Kshort;
980-
980+
if (F1.Pt() < lowPtF1 || F1.Pt() > 50.0) continue;
981981
std::vector<int> activeSys;
982982
activeSys.reserve((size_t)nSysTotal);
983983

@@ -1023,7 +1023,7 @@ struct f1protoncorrelation {
10231023

10241024
const auto& sc0 = sysCuts[0];
10251025

1026-
if (countf1 && passPrimary(protontrack.protonDcaxy(), protontrack.protonDcaz(), protontrack.protonTPCNcrs(), protontrack.protonTPCNcls(), sc0)) {
1026+
if (countf1 && passPrimary(protontrack.protonDcaxy(), protontrack.protonDcaz(), protontrack.protonTPCNcrs(), protontrack.protonTPCNcls(), sc0) && passProtonPID(0, protontrack, Proton, pMinP, pMaxP, pTofP)) {
10271027
histos.fill(HIST("hNsigmaProtonTPC"), protontrack.protonNsigmaTPC(), protontrack.protonNsigmaTOF(), Proton.Pt());
10281028
}
10291029

@@ -1055,7 +1055,7 @@ struct f1protoncorrelation {
10551055
histos.fill(HIST("hPhaseSpaceProtonKaonSame"), Proton.Eta() - Kaon.Eta(), PhiAtSpecificRadiiTPC(Proton, Kaon, protontrack.protonCharge(), kaonCharge, bz, bz), relative_momentum); // Phase Space Proton kaon
10561056
if (pionCharge == protontrack.protonCharge())
10571057
histos.fill(HIST("hPhaseSpaceProtonPionSame"), Proton.Eta() - Pion.Eta(), PhiAtSpecificRadiiTPC(Proton, Pion, protontrack.protonCharge(), pionCharge, bz, bz), relative_momentum); // Phase Space Proton Pion
1058-
histos.fill(HIST("h2SameEventf1pptCorrelation"), F1.M(), relative_momentum, Proton.Pt());
1058+
histos.fill(HIST("h2SameEventf1pptCorrelation"), F1.M(), relative_momentum, Proton.Pt());
10591059
}
10601060
activePair.push_back(sysId);
10611061
}
@@ -1119,6 +1119,7 @@ struct f1protoncorrelation {
11191119
Kshort.SetXYZM(t1.f1d3Px(), t1.f1d3Py(), t1.f1d3Pz(), 0.497);
11201120
KaonKshortPair = Kaon + Kshort;
11211121
Proton.SetXYZM(t2.protonPx(), t2.protonPy(), t2.protonPz(), 0.938);
1122+
if (F1.Pt() < lowPtF1 || F1.Pt() > 50.0) continue;
11221123
auto relative_momentum = getkstar(F1, Proton);
11231124
auto mT = getmT(F1, Proton);
11241125
// sys list for this (F1, p) pair

0 commit comments

Comments
 (0)