|
45 | 45 | #include "Common/DataModel/TrackSelectionTables.h" |
46 | 46 | #include "Tools/ML/MlResponse.h" |
47 | 47 |
|
48 | | -#include "MathUtils/BetheBlochAleph.h" |
49 | 48 | #include <CCDB/BasicCCDBManager.h> // for PV refit |
50 | 49 | #include <CCDB/CcdbApi.h> |
51 | 50 | #include <CommonConstants/PhysicsConstants.h> |
|
66 | 65 | #include <Framework/InitContext.h> |
67 | 66 | #include <Framework/Logger.h> |
68 | 67 | #include <Framework/runDataProcessing.h> |
| 68 | +#include <MathUtils/BetheBlochAleph.h> |
69 | 69 | #include <ReconstructionDataFormats/Track.h> |
70 | 70 | #include <ReconstructionDataFormats/Vertex.h> // for PV refit |
71 | 71 |
|
@@ -1303,8 +1303,8 @@ struct HfTrackIndexSkimCreator { |
1303 | 1303 | Configurable<LabeledArray<double>> cutsDstarToD0Pi{"cutsDstarToD0Pi", {hf_cuts_presel_dstar::Cuts[0], hf_cuts_presel_dstar::NBinsPt, hf_cuts_presel_dstar::NCutVars, hf_cuts_presel_dstar::labelsPt, hf_cuts_presel_dstar::labelsCutVar}, "D*+->D0pi selections per pT bin"}; |
1304 | 1304 |
|
1305 | 1305 | // CharmNuclei track selection |
1306 | | - Configurable<LabeledArray<float>> selectionsLightNuclei{"selectionsLightNuclei", {hf_presel_lightnuclei::CutsTrackQuality[0], 3, 10, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsCutsTrack}, "nuclei track selections for deuteron / triton / helium applied if proper process function enabled"}; |
1307 | | - Configurable<LabeledArray<float>> tpcPidBBParamsLightNuclei{"tpcPidBBParamsLightNuclei", {hf_presel_lightnuclei::BetheBlochParams[0], 3, 6, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsBetheBlochParams}, |
| 1306 | + Configurable<LabeledArray<float>> selectionsLightNuclei{"selectionsLightNuclei", {hf_presel_lightnuclei::CutsTrackQuality[0], hf_presel_lightnuclei::NParticleRows, hf_presel_lightnuclei::NVarCuts, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsCutsTrack}, "nuclei track selections for deuteron / triton / helium applied if proper process function enabled"}; |
| 1307 | + Configurable<LabeledArray<float>> tpcPidBBParamsLightNuclei{"tpcPidBBParamsLightNuclei", {hf_presel_lightnuclei::BetheBlochParams[0], hf_presel_lightnuclei::NParticleRows, hf_presel_lightnuclei::NBetheBlochParams, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsBetheBlochParams}, |
1308 | 1308 | "TPC PID Bethe–Bloch parameter configurations for light nuclei " |
1309 | 1309 | "(deuteron, triton, helium-3), used in BB-based PID when enabled"}; |
1310 | 1310 |
|
@@ -1676,71 +1676,67 @@ struct HfTrackIndexSkimCreator { |
1676 | 1676 | return false; |
1677 | 1677 | } |
1678 | 1678 |
|
1679 | | - float nSigmaItsNuclei = -999.f; |
| 1679 | + float itsPidNsigma = -999.f; |
1680 | 1680 |
|
1681 | 1681 | switch (lightnuclei) { |
1682 | 1682 | case ChannelsNucleiQA::Deuteron: |
1683 | | - nSigmaItsNuclei = track.itsNSigmaDe(); |
| 1683 | + itsPidNsigma = track.itsNSigmaDe(); |
1684 | 1684 | break; |
1685 | 1685 | case ChannelsNucleiQA::Triton: |
1686 | | - nSigmaItsNuclei = track.itsNSigmaTr(); |
| 1686 | + itsPidNsigma = track.itsNSigmaTr(); |
1687 | 1687 | break; |
1688 | 1688 | case ChannelsNucleiQA::Helium3: |
1689 | | - nSigmaItsNuclei = track.itsNSigmaHe(); |
| 1689 | + itsPidNsigma = track.itsNSigmaHe(); |
1690 | 1690 | break; |
1691 | 1691 | default: |
1692 | | - return false; |
| 1692 | + LOG(fatal) << "Unhandled ChannelsNucleiQA " << static_cast<int>(lightnuclei); |
1693 | 1693 | } |
1694 | 1694 |
|
1695 | 1695 | // Load cuts for the selected species. |
1696 | | - const float minItsNSigmaPid = config.selectionsLightNuclei->get(row, 0u); |
1697 | | - const int minItsClusterSizes = config.selectionsLightNuclei->get(row, 1u); |
1698 | | - const int minItsCluster = config.selectionsLightNuclei->get(row, 2u); |
1699 | | - const int minItsIbCluster = config.selectionsLightNuclei->get(row, 3u); |
1700 | | - const int minTpcCluster = config.selectionsLightNuclei->get(row, 4u); |
1701 | | - const int minTpcRow = config.selectionsLightNuclei->get(row, 5u); |
1702 | | - const float minTpcCrossedOverFound = config.selectionsLightNuclei->get(row, 6u); |
1703 | | - const int maxTpcShared = config.selectionsLightNuclei->get(row, 7u); |
1704 | | - const float maxTpcFracShared = config.selectionsLightNuclei->get(row, 8u); |
| 1696 | + const float itsPidNsigmaMin = config.selectionsLightNuclei->get(row, 0u); |
| 1697 | + const float itsClusterSizeMin = config.selectionsLightNuclei->get(row, 1u); |
| 1698 | + const float itsClusterMin = config.selectionsLightNuclei->get(row, 2u); |
| 1699 | + const float itsIbClusterMin = config.selectionsLightNuclei->get(row, 3u); |
| 1700 | + const float tpcClusterMin = config.selectionsLightNuclei->get(row, 4u); |
| 1701 | + const float tpcCrossedRowsMin = config.selectionsLightNuclei->get(row, 5u); |
| 1702 | + const float tpcCrossedRowsOverFindMin = config.selectionsLightNuclei->get(row, 6u); |
| 1703 | + const float tpcSharedMax = config.selectionsLightNuclei->get(row, 7u); |
| 1704 | + const float tpcFracSharedMax = config.selectionsLightNuclei->get(row, 8u); |
1705 | 1705 |
|
1706 | 1706 | // Optional: BB-based TPC nσ selection (only if enabled) |
1707 | | - const float maxTPCnSigmaBB = config.selectionsLightNuclei->get(row, 9u); |
| 1707 | + const float tpcBbPidNsigmaMax = config.selectionsLightNuclei->get(row, 9u); |
1708 | 1708 |
|
1709 | | - if (nSigmaItsNuclei < minItsNSigmaPid) { |
| 1709 | + if (itsPidNsigma < itsPidNsigmaMin) { |
1710 | 1710 | return false; |
1711 | 1711 | } |
1712 | | - if (track.itsClusterSizes() < static_cast<unsigned int>(minItsClusterSizes)) { |
| 1712 | + if (track.itsClusterSizes() < static_cast<unsigned int>(itsClusterSizeMin)) { |
1713 | 1713 | return false; |
1714 | 1714 | } |
1715 | | - if (track.itsNCls() < minItsCluster) { |
| 1715 | + if (track.itsNCls() < itsClusterMin) { |
1716 | 1716 | return false; |
1717 | 1717 | } |
1718 | | - if (track.itsNClsInnerBarrel() < minItsIbCluster) { |
| 1718 | + if (track.itsNClsInnerBarrel() < itsIbClusterMin) { |
1719 | 1719 | return false; |
1720 | 1720 | } |
1721 | | - if (track.tpcNClsFound() < minTpcCluster) { |
| 1721 | + if (track.tpcNClsFound() < tpcClusterMin) { |
1722 | 1722 | return false; |
1723 | 1723 | } |
1724 | | - if (track.tpcNClsCrossedRows() < minTpcRow) { |
| 1724 | + if (track.tpcNClsCrossedRows() < tpcCrossedRowsMin) { |
1725 | 1725 | return false; |
1726 | 1726 | } |
1727 | | - if (track.tpcCrossedRowsOverFindableCls() < minTpcCrossedOverFound) { |
| 1727 | + if (track.tpcCrossedRowsOverFindableCls() < tpcCrossedRowsOverFindMin) { |
1728 | 1728 | return false; |
1729 | 1729 | } |
1730 | | - if (maxTpcShared >= 0 && track.tpcNClsShared() > maxTpcShared) { |
| 1730 | + if (track.tpcNClsShared() > tpcSharedMax) { |
1731 | 1731 | return false; |
1732 | 1732 | } |
1733 | | - if (track.tpcFractionSharedCls() > maxTpcFracShared) { |
| 1733 | + if (track.tpcFractionSharedCls() > tpcFracSharedMax) { |
1734 | 1734 | return false; |
1735 | 1735 | } |
1736 | 1736 |
|
1737 | 1737 | if (config.applyLightNucleiTpcPidBasedOnBB) { |
1738 | | - const float nSigmaTpcNuclei = getTPCnSigmaBB(track, lightnuclei); |
1739 | | - if (nSigmaTpcNuclei < -999.f) { // invalid marker |
1740 | | - return false; |
1741 | | - } |
1742 | | - // Correct inequality: reject if |nσ| exceeds allowed window |
1743 | | - if (std::abs(nSigmaTpcNuclei) > maxTPCnSigmaBB) { |
| 1738 | + const float tpcBbPidNsigma = getTPCnSigmaBB(track, lightnuclei); |
| 1739 | + if (std::abs(tpcBbPidNsigma) > tpcBbPidNsigmaMax) { |
1744 | 1740 | return false; |
1745 | 1741 | } |
1746 | 1742 | } |
@@ -1779,9 +1775,20 @@ struct HfTrackIndexSkimCreator { |
1779 | 1775 | } |
1780 | 1776 |
|
1781 | 1777 | // Mass/charge hypothesis for the selected nucleus. |
1782 | | - const double mass = |
1783 | | - (lightnuclei == ChannelsNucleiQA::Deuteron) ? MassDeuteron : (lightnuclei == ChannelsNucleiQA::Triton) ? MassTriton |
1784 | | - : MassHelium3; |
| 1778 | + double mass = 0.; |
| 1779 | + switch (lightnuclei) { |
| 1780 | + case ChannelsNucleiQA::Deuteron: |
| 1781 | + mass = MassDeuteron; |
| 1782 | + break; |
| 1783 | + case ChannelsNucleiQA::Triton: |
| 1784 | + mass = MassTriton; |
| 1785 | + break; |
| 1786 | + case ChannelsNucleiQA::Helium3: |
| 1787 | + mass = MassHelium3; |
| 1788 | + break; |
| 1789 | + default: |
| 1790 | + LOG(fatal) << "Unhandled ChannelsNucleiQA " << static_cast<int>(lightnuclei); |
| 1791 | + } |
1785 | 1792 |
|
1786 | 1793 | const int charge = (lightnuclei == ChannelsNucleiQA::Helium3) ? 2 : 1; |
1787 | 1794 |
|
@@ -1853,9 +1860,23 @@ struct HfTrackIndexSkimCreator { |
1853 | 1860 | iDecay3P == hf_cand_3prong::DecayType::CtToTrKPi || |
1854 | 1861 | iDecay3P == hf_cand_3prong::DecayType::ChToHeKPi)) { |
1855 | 1862 |
|
1856 | | - ChannelsNucleiQA nucleiType = |
1857 | | - (iDecay3P == hf_cand_3prong::DecayType::CdToDeKPi) ? ChannelsNucleiQA::Deuteron : (iDecay3P == hf_cand_3prong::DecayType::CtToTrKPi) ? ChannelsNucleiQA::Triton |
1858 | | - : ChannelsNucleiQA::Helium3; |
| 1863 | + ChannelsNucleiQA nucleiType; |
| 1864 | + |
| 1865 | + switch (iDecay3P) { |
| 1866 | + case hf_cand_3prong::DecayType::CdToDeKPi: |
| 1867 | + nucleiType = ChannelsNucleiQA::Deuteron; |
| 1868 | + break; |
| 1869 | + case hf_cand_3prong::DecayType::CtToTrKPi: |
| 1870 | + nucleiType = ChannelsNucleiQA::Triton; |
| 1871 | + break; |
| 1872 | + case hf_cand_3prong::DecayType::ChToHeKPi: |
| 1873 | + nucleiType = ChannelsNucleiQA::Helium3; |
| 1874 | + break; |
| 1875 | + default: |
| 1876 | + LOG(fatal) << "Unhandled DecayType " << static_cast<int>(iDecay3P); |
| 1877 | + continue; |
| 1878 | + } |
| 1879 | + |
1859 | 1880 | // hypo0: nucleus on track0 |
1860 | 1881 | if (!applyTrackSelectionForCharmNuclei(track0, nucleiType)) { |
1861 | 1882 | CLRBIT(whichHypo[iDecay3P], 0); |
|
0 commit comments