Skip to content

Commit 025aae9

Browse files
sarjeetagamisarjeeta gami
andauthored
[PWGLF] added different PID strategy (#8367)
Co-authored-by: sarjeeta gami <sarjeetagami@sarjeetas-MacBook-Air.local>
1 parent 35f6282 commit 025aae9

File tree

1 file changed

+176
-6
lines changed

1 file changed

+176
-6
lines changed

PWGLF/Tasks/Resonances/kstarpbpb.cxx

Lines changed: 176 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ struct kstarpbpb {
102102
Configurable<bool> additionalEvsel{"additionalEvsel", false, "Additional event selcection"};
103103
Configurable<bool> timFrameEvsel{"timFrameEvsel", false, "TPC Time frame boundary cut"};
104104
Configurable<bool> ispTdepPID{"ispTdepPID", true, "pT dependent PID"};
105+
Configurable<int> strategyPID{"strategyPID", 2, "PID strategy"};
105106
Configurable<bool> isGI{"isGI", false, "pT dependent PID"};
106107
Configurable<bool> additionalQAplots{"additionalQAplots", true, "Additional QA plots"};
107108
Configurable<float> confMinRot{"confMinRot", 5.0 * TMath::Pi() / 6.0, "Minimum of rotation"};
@@ -118,7 +119,7 @@ struct kstarpbpb {
118119
Filter DCAcutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz);
119120

120121
using EventCandidates = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::FT0Mults, aod::FV0Mults, aod::TPCMults, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0Cs, aod::CentFT0As, aod::EPCalibrationTables, aod::Mults>>;
121-
using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPi, aod::pidTOFFullPi>>;
122+
using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTOFbeta, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPi, aod::pidTOFFullPi>>;
122123

123124
SliceCache cache;
124125
Partition<TrackCandidates> posTracks = aod::track::signed1Pt > cfgCutCharge;
@@ -154,6 +155,10 @@ struct kstarpbpb {
154155
histos.add("hPsiFT0C", "PsiFT0C", kTH2F, {centAxis, phiAxis});
155156
histos.add("hPsiFT0A", "PsiFT0A", kTH2F, {centAxis, phiAxis});
156157
histos.add("hPsiTPC", "PsiTPC", kTH2F, {centAxis, phiAxis});
158+
histos.add("TPC_Nsigma_pi", "TPC_Nsigma_pi", kTH2F, {{60, 0.0f, 6.0f}, {500, -5, 5}});
159+
histos.add("TPC_Nsigma_ka", "TPC_Nsigma_ka", kTH2F, {{60, 0.0f, 6.0f}, {500, -5, 5}});
160+
histos.add("TOF_Nsigma_pi", "TOF_Nsigma_pi", kTH2F, {{60, 0.0f, 6.0f}, {500, -5, 5}});
161+
histos.add("TOF_Nsigma_ka", "TOF_Nsigma_ka", kTH2F, {{60, 0.0f, 6.0f}, {500, -5, 5}});
157162
histos.add("hSparseV2SASameEvent_V2", "hSparseV2SASameEvent_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality});
158163
histos.add("hSparseV2SAlikeEventNN_V2", "hSparseV2SAlikeEventNN_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality});
159164
histos.add("hSparseV2SAlikeEventPP_V2", "hSparseV2SAlikeEventPP_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality});
@@ -283,6 +288,66 @@ struct kstarpbpb {
283288
return false;
284289
}
285290

291+
template <typename T>
292+
bool strategySelectionPID(const T& candidate, int PID, int strategy)
293+
{
294+
if (PID == 0) {
295+
if (strategy == 0) {
296+
if (candidate.pt() < 0.5 && TMath::Abs(candidate.tpcNSigmaKa()) < nsigmaCutTPC) {
297+
return true;
298+
}
299+
if (candidate.pt() >= 0.5 && TMath::Abs(candidate.tpcNSigmaKa()) < nsigmaCutTPC && candidate.hasTOF() && TMath::Abs(candidate.tofNSigmaKa()) < nsigmaCutTOF && candidate.beta() > 0.5) {
300+
return true;
301+
}
302+
} else if (strategy == 1) {
303+
if (candidate.pt() < 0.5 && TMath::Abs(candidate.tpcNSigmaKa()) < nsigmaCutTPC) {
304+
return true;
305+
}
306+
if (candidate.pt() >= 0.5 && TMath::Sqrt(candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa() + candidate.tofNSigmaKa() * candidate.tofNSigmaKa()) < nsigmaCutTOF && candidate.beta() > 0.5) {
307+
return true;
308+
}
309+
} else if (strategy == 2) {
310+
if (candidate.pt() < 0.5 && TMath::Abs(candidate.tpcNSigmaKa()) < nsigmaCutTPC) {
311+
return true;
312+
}
313+
if (candidate.pt() >= 0.5 && TMath::Abs(candidate.tpcNSigmaKa()) < nsigmaCutTPC && candidate.hasTOF() && TMath::Abs(candidate.tofNSigmaKa()) < nsigmaCutTOF && candidate.beta() > 0.5) {
314+
return true;
315+
}
316+
if (candidate.pt() >= 0.5 && TMath::Abs(candidate.tpcNSigmaKa()) < nsigmaCutTPC && !candidate.hasTOF()) {
317+
return true;
318+
}
319+
}
320+
}
321+
if (PID == 1) {
322+
if (strategy == 0) {
323+
if (candidate.pt() < 0.5 && TMath::Abs(candidate.tpcNSigmaPi()) < nsigmaCutTPC) {
324+
return true;
325+
}
326+
if (candidate.pt() >= 0.5 && TMath::Abs(candidate.tpcNSigmaPi()) < nsigmaCutTPC && candidate.hasTOF() && TMath::Abs(candidate.tofNSigmaPi()) < nsigmaCutTOF && candidate.beta() > 0.5) {
327+
return true;
328+
}
329+
} else if (strategy == 1) {
330+
if (candidate.pt() < 0.5 && TMath::Abs(candidate.tpcNSigmaPi()) < nsigmaCutTPC) {
331+
return true;
332+
}
333+
if (candidate.pt() >= 0.5 && TMath::Sqrt(candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + candidate.tofNSigmaPi() * candidate.tofNSigmaPi()) < nsigmaCutTOF && candidate.beta() > 0.5) {
334+
return true;
335+
}
336+
} else if (strategy == 2) {
337+
if (candidate.pt() < 0.5 && TMath::Abs(candidate.tpcNSigmaPi()) < nsigmaCutTPC) {
338+
return true;
339+
}
340+
if (candidate.pt() >= 0.5 && TMath::Abs(candidate.tpcNSigmaPi()) < nsigmaCutTPC && candidate.hasTOF() && TMath::Abs(candidate.tofNSigmaPi()) < nsigmaCutTOF && candidate.beta() > 0.5) {
341+
return true;
342+
}
343+
if (candidate.pt() >= 0.5 && TMath::Abs(candidate.tpcNSigmaPi()) < nsigmaCutTPC && !candidate.hasTOF()) {
344+
return true;
345+
}
346+
}
347+
}
348+
return false;
349+
}
350+
286351
double GetPhiInRange(double phi)
287352
{
288353
double result = phi;
@@ -311,7 +376,113 @@ struct kstarpbpb {
311376
using BinningTypeVertexContributor = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C, aod::epcalibrationtable::PsiFT0C>;
312377
ROOT::Math::PxPyPzMVector KstarMother, daughter1, daughter2, kaonrot, kstarrot;
313378

314-
void processSameEvent(EventCandidates::iterator const& collision, TrackCandidates const& tracks, aod::BCs const&)
379+
void processSE(EventCandidates::iterator const& collision, TrackCandidates const& tracks, aod::BCs const&)
380+
{
381+
if (!collision.sel8() || !collision.triggereventep() || !collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder) || !collision.selection_bit(aod::evsel::kNoSameBunchPileup) || !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) || !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) {
382+
return;
383+
}
384+
auto centrality = collision.centFT0C();
385+
auto multTPC = collision.multNTracksPV();
386+
int occupancy = collision.trackOccupancyInTimeRange();
387+
auto psiFT0C = collision.psiFT0C();
388+
auto psiFT0A = collision.psiFT0A();
389+
auto psiTPC = collision.psiTPC();
390+
if (fillOccupancy && occupancy >= cfgOccupancyCut) {
391+
return;
392+
}
393+
if (additionalEvsel && !eventSelected(collision, centrality)) {
394+
return;
395+
}
396+
histos.fill(HIST("hFTOCvsTPCSelected"), centrality, multTPC);
397+
histos.fill(HIST("hPsiFT0C"), centrality, psiFT0C);
398+
histos.fill(HIST("hPsiFT0A"), centrality, psiFT0A);
399+
histos.fill(HIST("hPsiTPC"), centrality, psiTPC);
400+
histos.fill(HIST("ResFT0CTPC"), centrality, TMath::Cos(2.0 * (psiFT0C - psiTPC)));
401+
histos.fill(HIST("ResFT0CFT0A"), centrality, TMath::Cos(2.0 * (psiFT0C - psiFT0A)));
402+
histos.fill(HIST("ResFT0ATPC"), centrality, TMath::Cos(2.0 * (psiTPC - psiFT0A)));
403+
histos.fill(HIST("hCentrality"), centrality);
404+
histos.fill(HIST("hOccupancy"), occupancy);
405+
histos.fill(HIST("hVtxZ"), collision.posZ());
406+
for (auto track1 : tracks) {
407+
if (!selectionTrack(track1)) {
408+
continue;
409+
}
410+
bool track1kaon = false;
411+
auto track1ID = track1.globalIndex();
412+
if (!strategySelectionPID(track1, 0, strategyPID)) {
413+
continue;
414+
}
415+
track1kaon = true;
416+
histos.fill(HIST("TPC_Nsigma_ka"), track1.p(), track1.tpcNSigmaKa());
417+
if (track1.hasTOF()) {
418+
histos.fill(HIST("TOF_Nsigma_ka"), track1.p(), track1.tofNSigmaKa());
419+
}
420+
for (auto track2 : tracks) {
421+
if (!selectionTrack(track2)) {
422+
continue;
423+
}
424+
bool track2pion = false;
425+
auto track2ID = track2.globalIndex();
426+
if (!strategySelectionPID(track2, 1, strategyPID)) {
427+
continue;
428+
}
429+
track2pion = true;
430+
histos.fill(HIST("TPC_Nsigma_pi"), track2.p(), track1.tpcNSigmaPi());
431+
if (track2.hasTOF()) {
432+
histos.fill(HIST("TOF_Nsigma_pi"), track2.p(), track1.tofNSigmaPi());
433+
}
434+
if (track2ID == track1ID) {
435+
continue;
436+
}
437+
if (!track1kaon || !track2pion) {
438+
continue;
439+
}
440+
daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
441+
daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
442+
KstarMother = daughter1 + daughter2;
443+
if (TMath::Abs(KstarMother.Rapidity()) > confRapidity) {
444+
continue;
445+
}
446+
auto phiminuspsi = GetPhiInRange(KstarMother.Phi() - psiFT0C);
447+
auto v2 = TMath::Cos(2.0 * phiminuspsi);
448+
// unlike sign
449+
if (track1.sign() * track2.sign() < 0) {
450+
histos.fill(HIST("hSparseV2SASameEvent_V2"), KstarMother.M(), KstarMother.Pt(), v2, centrality);
451+
if (fillRotation) {
452+
for (int nrotbkg = 0; nrotbkg < nBkgRotations; nrotbkg++) {
453+
auto anglestart = confMinRot;
454+
auto angleend = confMaxRot;
455+
auto anglestep = (angleend - anglestart) / (1.0 * (nBkgRotations - 1));
456+
auto rotangle = anglestart + nrotbkg * anglestep;
457+
histos.fill(HIST("hRotation"), rotangle);
458+
auto rotkaonPx = track1.px() * std::cos(rotangle) - track1.py() * std::sin(rotangle);
459+
auto rotkaonPy = track1.px() * std::sin(rotangle) + track1.py() * std::cos(rotangle);
460+
kaonrot = ROOT::Math::PxPyPzMVector(rotkaonPx, rotkaonPy, track1.pz(), massKa);
461+
kstarrot = kaonrot + daughter2;
462+
if (TMath::Abs(kstarrot.Rapidity()) > confRapidity) {
463+
continue;
464+
}
465+
auto phiminuspsiRot = GetPhiInRange(kstarrot.Phi() - psiFT0C);
466+
auto v2Rot = TMath::Cos(2.0 * phiminuspsiRot);
467+
histos.fill(HIST("hSparseV2SASameEventRotational_V2"), kstarrot.M(), kstarrot.Pt(), v2Rot, centrality);
468+
}
469+
}
470+
}
471+
// like sign
472+
if (track1.sign() * track2.sign() > 0) {
473+
if (track1.sign() > 0 && track2.sign() > 0) {
474+
histos.fill(HIST("hSparseV2SAlikeEventPP_V2"), KstarMother.M(), KstarMother.Pt(), v2, centrality);
475+
}
476+
if (track1.sign() < 0 && track2.sign() < 0) {
477+
histos.fill(HIST("hSparseV2SAlikeEventNN_V2"), KstarMother.M(), KstarMother.Pt(), v2, centrality);
478+
}
479+
}
480+
}
481+
}
482+
}
483+
PROCESS_SWITCH(kstarpbpb, processSE, "Process Same event latest", true);
484+
485+
void processSameEvent(EventCandidates::iterator const& collision, TrackCandidates const& /*tracks*/, aod::BCs const&)
315486
{
316487
if (!collision.sel8()) {
317488
return;
@@ -497,14 +668,13 @@ struct kstarpbpb {
497668
}
498669
}
499670
}
500-
PROCESS_SWITCH(kstarpbpb, processSameEvent, "Process Same event", true);
671+
PROCESS_SWITCH(kstarpbpb, processSameEvent, "Process Same event", false);
501672
void processlikeEvent(EventCandidates::iterator const& collision, TrackCandidates const& tracks, aod::BCs const&)
502673
{
503674
if (!collision.sel8()) {
504675
return;
505676
}
506677
auto centrality = collision.centFT0C();
507-
auto multTPC = collision.multNTracksPV();
508678
if (!collision.triggereventep()) {
509679
return;
510680
}
@@ -618,7 +788,7 @@ struct kstarpbpb {
618788
}
619789
}
620790

621-
PROCESS_SWITCH(kstarpbpb, processlikeEvent, "Process like event", true);
791+
PROCESS_SWITCH(kstarpbpb, processlikeEvent, "Process like event", false);
622792
void processMixedEvent(EventCandidates const& collisions, TrackCandidates const& /*tracks*/)
623793
{
624794
BinningTypeVertexContributor binningOnPositions{{axisVertex, axisMultiplicityClass, axisEPAngle}, true};
@@ -740,7 +910,7 @@ struct kstarpbpb {
740910
}
741911
}
742912
}
743-
PROCESS_SWITCH(kstarpbpb, processMixedEvent, "Process Mixed event", true);
913+
PROCESS_SWITCH(kstarpbpb, processMixedEvent, "Process Mixed event", false);
744914
};
745915
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
746916
{

0 commit comments

Comments
 (0)