Skip to content

Commit 9bdc841

Browse files
zchochulZuzanna
andauthored
[PWGCF] FemtoUniverse -- Add LF PID for phi daughters (#10759)
Co-authored-by: Zuzanna <01150674@pw.edu.pl>
1 parent b2df287 commit 9bdc841

File tree

1 file changed

+34
-103
lines changed

1 file changed

+34
-103
lines changed

PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx

Lines changed: 34 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -292,20 +292,17 @@ struct FemtoUniverseProducerTask {
292292
Configurable<float> confPhiInvMassLowLimit{"confPhiInvMassLowLimit", 1.011, "Lower limit of the Phi invariant mass"};
293293
Configurable<float> confPhiInvMassUpLimit{"confPhiInvMassUpLimit", 1.027, "Upper limit of the Phi invariant mass"};
294294
// Phi meson daughters
295-
Configurable<bool> confLooseTPCNSigma{"confLooseTPCNSigma", false, "Use loose TPC N sigmas for Kaon PID."};
296-
Configurable<float> confLooseTPCNSigmaValue{"confLooseTPCNSigmaValue", 10, "Value for the loose TPC N Sigma for Kaon PID."};
297-
Configurable<bool> confLooseTOFNSigma{"confLooseTOFNSigma", false, "Use loose TPC N sigmas for Kaon PID."};
298-
Configurable<float> confTrackPionNsigmaReject{"confTrackPionNsigmaReject", 3.0, "Reject if particle could be a Pion combined nsigma value."};
299-
Configurable<float> confTrackProtonNsigmaReject{"confTrackProtonNsigmaReject", 3.0, "Reject if particle could be a Proton combined nsigma value."};
300-
Configurable<float> confLooseTOFNSigmaValue{"confLooseTOFNSigmaValue", 10, "Value for the loose TOF N Sigma for Kaon PID."};
295+
Configurable<float> confPhiKaonRejectPionNsigma{"confPhiKaonRejectPionNsigma", 3.0, "Reject if particle could be a Pion combined nsigma value."};
296+
Configurable<float> confPhiKaonRejectProtonNsigma{"confPhiKaonRejectProtonNsigma", 3.0, "Reject if particle could be a Proton combined nsigma value."};
301297
// Kaons
302-
Configurable<float> confTrackKaonNsigmaTPCfrom0_0to0_3{"confTrackKaonNsigmaTPCfrom0_0to0_3", 3.0, "Reject if Kaons in 0.0-0.3 are have TPC n sigma above this value."};
303-
Configurable<float> confTrackKaonNsigmaTPCfrom0_3to0_45{"confTrackKaonNsigmaTPCfrom0_3to0_45", 2.0, "Reject if Kaons in 0.3-0.45 are have TPC n sigma above this value."};
304-
Configurable<float> confTrackKaonNsigmaTPCfrom0_45to0_55{"confTrackKaonNsigmaTPCfrom0_45to0_55", 1.0, "Reject if Kaons in 0.45-0.55 are have TPC n sigma above this value."};
305-
Configurable<float> confTrackKaonNsigmaTPCfrom0_55to1_5{"confTrackKaonNsigmaTPCfrom0_55to1_5", 3.0, "Reject if Kaons in 0.55-1.5 are have TPC n sigma above this value."};
306-
Configurable<float> confTrackKaonNsigmaTOFfrom0_55to1_5{"confTrackKaonNsigmaTOFfrom0_55to1_5", 3.0, "Reject if Kaons in 0.55-1.5 are have TOF n sigma above this value."};
307-
Configurable<float> confTrackKaonNsigmaTPCfrom1_5{"confTrackKaonNsigmaTPCfrom1_5", 3.0, "Reject if Kaons above 1.5 are have TPC n sigma above this value."};
308-
Configurable<float> confTrackKaonNsigmaTOFfrom1_5{"confTrackKaonNsigmaTOFfrom1_5", 3.0, "Reject if Kaons above 1.5 are have TOF n sigma above this value."};
298+
Configurable<bool> confPhiDoLFPID4Kaons{"confPhiDoLFPID4Kaons", true, "Switch on do PID for Kaons as in LF"};
299+
Configurable<float> confPhiKaonNsigmaTPCfrom0_0to0_3{"confPhiKaonNsigmaTPCfrom0_0to0_3", 3.0, "Reject if Kaons in 0.0-0.3 are have TPC n sigma above this value."};
300+
Configurable<float> confPhiKaonNsigmaTPCfrom0_3to0_45{"confPhiKaonNsigmaTPCfrom0_3to0_45", 2.0, "Reject if Kaons in 0.3-0.45 are have TPC n sigma above this value."};
301+
Configurable<float> confPhiKaonNsigmaTPCfrom0_45to0_55{"confPhiKaonNsigmaTPCfrom0_45to0_55", 1.0, "Reject if Kaons in 0.45-0.55 are have TPC n sigma above this value."};
302+
Configurable<float> confPhiKaonNsigmaTPCfrom0_55to1_5{"confPhiKaonNsigmaTPCfrom0_55to1_5", 3.0, "Reject if Kaons in 0.55-1.5 are have TPC n sigma above this value."};
303+
Configurable<float> confPhiKaonNsigmaTOFfrom0_55to1_5{"confPhiKaonNsigmaTOFfrom0_55to1_5", 3.0, "Reject if Kaons in 0.55-1.5 are have TOF n sigma above this value."};
304+
Configurable<float> confPhiKaonNsigmaTPCfrom1_5{"confPhiKaonNsigmaTPCfrom1_5", 3.0, "Reject if Kaons above 1.5 are have TPC n sigma above this value."};
305+
Configurable<float> confPhiKaonNsigmaTOFfrom1_5{"confPhiKaonNsigmaTOFfrom1_5", 3.0, "Reject if Kaons above 1.5 are have TOF n sigma above this value."};
309306
} ConfPhiSelection;
310307

311308
// PDG codes for fillMCParticle function
@@ -327,33 +324,33 @@ struct FemtoUniverseProducerTask {
327324
{
328325

329326
if (mom < 0.3) { // 0.0-0.3
330-
if (std::abs(nsigmaTPCK) < ConfPhiSelection.confTrackKaonNsigmaTPCfrom0_0to0_3) {
327+
if (std::abs(nsigmaTPCK) < ConfPhiSelection.confPhiKaonNsigmaTPCfrom0_0to0_3) {
331328
return true;
332329
} else {
333330
return false;
334331
}
335332
} else if (mom < 0.45) { // 0.30 - 0.45
336-
if (std::abs(nsigmaTPCK) < ConfPhiSelection.confTrackKaonNsigmaTPCfrom0_3to0_45) {
333+
if (std::abs(nsigmaTPCK) < ConfPhiSelection.confPhiKaonNsigmaTPCfrom0_3to0_45) {
337334
return true;
338335
} else {
339336
return false;
340337
}
341338
} else if (mom < 0.55) { // 0.45-0.55
342-
if (std::abs(nsigmaTPCK) < ConfPhiSelection.confTrackKaonNsigmaTPCfrom0_45to0_55) {
339+
if (std::abs(nsigmaTPCK) < ConfPhiSelection.confPhiKaonNsigmaTPCfrom0_45to0_55) {
343340
return true;
344341
} else {
345342
return false;
346343
}
347344
} else if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF)
348-
if ((std::abs(nsigmaTOFK) < ConfPhiSelection.confTrackKaonNsigmaTOFfrom0_55to1_5) && (std::abs(nsigmaTPCK) < ConfPhiSelection.confTrackKaonNsigmaTPCfrom0_55to1_5)) {
345+
if ((std::abs(nsigmaTOFK) < ConfPhiSelection.confPhiKaonNsigmaTOFfrom0_55to1_5) && (std::abs(nsigmaTPCK) < ConfPhiSelection.confPhiKaonNsigmaTPCfrom0_55to1_5)) {
349346
{
350347
return true;
351348
}
352349
} else {
353350
return false;
354351
}
355352
} else if (mom > 1.5) { // 1.5 -
356-
if ((std::abs(nsigmaTOFK) < ConfPhiSelection.confTrackKaonNsigmaTOFfrom1_5) && (std::abs(nsigmaTPCK) < ConfPhiSelection.confTrackKaonNsigmaTPCfrom1_5)) {
353+
if ((std::abs(nsigmaTOFK) < ConfPhiSelection.confPhiKaonNsigmaTOFfrom1_5) && (std::abs(nsigmaTPCK) < ConfPhiSelection.confPhiKaonNsigmaTPCfrom1_5)) {
357354
return true;
358355
} else {
359356
return false;
@@ -363,77 +360,23 @@ struct FemtoUniverseProducerTask {
363360
}
364361
}
365362

366-
bool isKaonNSigmaTPCLoose(float mom, float nsigmaTPCK, float nsigmaTOFK)
363+
bool isKaonNSigmaLF(float mom, float nsigmaTPCK, float nsigmaTOFK, bool hasTOF)
367364
{
368-
369-
if (mom < 0.3) { // 0.0-0.3
370-
if (std::abs(nsigmaTPCK) < ConfPhiSelection.confLooseTPCNSigmaValue.value) {
371-
return true;
372-
} else {
373-
return false;
374-
}
375-
} else if (mom < 0.45) { // 0.30 - 0.45
376-
if (std::abs(nsigmaTPCK) < ConfPhiSelection.confLooseTPCNSigmaValue.value) {
377-
return true;
378-
} else {
379-
return false;
380-
}
381-
} else if (mom < 0.55) { // 0.45-0.55
382-
if (std::abs(nsigmaTPCK) < ConfPhiSelection.confLooseTPCNSigmaValue.value) {
383-
return true;
384-
} else {
385-
return false;
386-
}
387-
} else if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF)
388-
if ((std::abs(nsigmaTOFK) < 3.0) && (std::abs(nsigmaTPCK) < ConfPhiSelection.confLooseTPCNSigmaValue.value)) {
389-
return true;
390-
} else {
391-
return false;
392-
}
393-
} else if (mom > 1.5) { // 1.5 -
394-
if ((std::abs(nsigmaTOFK) < 2.0) && (std::abs(nsigmaTPCK) < ConfPhiSelection.confLooseTPCNSigmaValue.value)) {
395-
return true;
396-
} else {
397-
return false;
398-
}
399-
} else {
400-
return false;
401-
}
402-
}
403-
404-
bool isKaonNSigmaTOFLoose(float mom, float nsigmaTPCK, float nsigmaTOFK)
405-
{
406-
if (mom < 0.3) { // 0.0-0.3
365+
if (mom < 0.5) {
407366
if (std::abs(nsigmaTPCK) < 3.0) {
408367
return true;
409368
} else {
410369
return false;
411370
}
412-
} else if (mom < 0.45) { // 0.30 - 0.45
413-
if (std::abs(nsigmaTPCK) < 2.0) {
414-
return true;
415-
} else {
371+
} else if (mom >= 0.5) { // 0.55-1.5 (now we use TPC and TOF)
372+
if (!hasTOF) {
416373
return false;
417-
}
418-
} else if (mom < 0.55) { // 0.45-0.55
419-
if (std::abs(nsigmaTPCK) < 1.0) {
420-
return true;
421374
} else {
422-
return false;
423-
}
424-
} else if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF)
425-
if ((std::abs(nsigmaTOFK) < ConfPhiSelection.confLooseTOFNSigmaValue.value) && (std::abs(nsigmaTPCK) < 3.0)) {
426-
{
375+
if (std::sqrt(nsigmaTPCK * nsigmaTPCK + nsigmaTOFK * nsigmaTOFK) < 3.0) {
427376
return true;
377+
} else {
378+
return false;
428379
}
429-
} else {
430-
return false;
431-
}
432-
} else if (mom > 1.5) { // 1.5 -
433-
if ((std::abs(nsigmaTOFK) < ConfPhiSelection.confLooseTOFNSigmaValue.value) && (std::abs(nsigmaTPCK) < 3.0)) {
434-
return true;
435-
} else {
436-
return false;
437380
}
438381
} else {
439382
return false;
@@ -443,16 +386,16 @@ struct FemtoUniverseProducerTask {
443386
bool isKaonRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi)
444387
{
445388
if (mom < 0.5) {
446-
if (std::abs(nsigmaTPCPi) < ConfPhiSelection.confTrackPionNsigmaReject.value) {
389+
if (std::abs(nsigmaTPCPi) < ConfPhiSelection.confPhiKaonRejectPionNsigma.value) {
447390
return true;
448-
} else if (std::abs(nsigmaTPCPr) < ConfPhiSelection.confTrackProtonNsigmaReject.value) {
391+
} else if (std::abs(nsigmaTPCPr) < ConfPhiSelection.confPhiKaonRejectProtonNsigma.value) {
449392
return true;
450393
}
451394
}
452395
if (mom > 0.5) {
453-
if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfPhiSelection.confTrackPionNsigmaReject.value) {
396+
if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfPhiSelection.confPhiKaonRejectPionNsigma.value) {
454397
return true;
455-
} else if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfPhiSelection.confTrackProtonNsigmaReject.value) {
398+
} else if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfPhiSelection.confPhiKaonRejectProtonNsigma.value) {
456399
return true;
457400
} else {
458401
return false;
@@ -1601,38 +1544,26 @@ struct FemtoUniverseProducerTask {
16011544
if (!trackCuts.isSelectedMinimal(p1) || !trackCuts.isSelectedMinimal(p1)) {
16021545
continue;
16031546
}
1604-
// implementing PID cuts for phi children
1605-
if (ConfPhiSelection.confLooseTPCNSigma.value) {
1606-
if (!(isKaonNSigmaTPCLoose(p1.pt(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon)))) {
1607-
continue;
1608-
}
1609-
if (!(isKaonNSigmaTPCLoose(p2.pt(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon)))) {
1610-
continue;
1611-
}
1547+
if ((!(p1.sign() == 1)) || (!(p2.sign() == -1))) {
1548+
continue;
16121549
}
1613-
if (ConfPhiSelection.confLooseTOFNSigma.value) {
1614-
if (!(isKaonNSigmaTOFLoose(p1.pt(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon)))) {
1550+
// implementing PID cuts for phi children
1551+
if (ConfPhiSelection.confPhiDoLFPID4Kaons) {
1552+
if (!(isKaonNSigmaLF(p1.pt(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), p1.hasTOF()))) {
16151553
continue;
1616-
}
1617-
if (!(isKaonNSigmaTOFLoose(p2.pt(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon)))) {
1554+
} else if (!(isKaonNSigmaLF(p2.pt(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), p2.hasTOF()))) {
16181555
continue;
16191556
}
16201557
} else {
16211558
if (!(isKaonNSigma(p1.pt(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon)))) {
16221559
continue;
1623-
}
1624-
if (!(isKaonNSigma(p2.pt(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon)))) {
1560+
} else if (!(isKaonNSigma(p2.pt(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon)))) {
16251561
continue;
16261562
}
16271563
}
16281564
if (isKaonRejected(p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion))) {
16291565
continue;
1630-
}
1631-
if (isKaonRejected(p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion))) {
1632-
continue;
1633-
}
1634-
1635-
if ((!(p1.sign() == 1)) || (!(p2.sign() == -1))) {
1566+
} else if (isKaonRejected(p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion))) {
16361567
continue;
16371568
}
16381569

0 commit comments

Comments
 (0)