|
12 | 12 | /// |
13 | 13 | /// \file mcPidTof.cxx |
14 | 14 | /// \author Fabrizio Grosa fabrizio.grosa@cern.ch |
15 | | -/// \brief Task to produce PID tables for TOF split for pi, K, p, copied from https://github.com/AliceO2Group/O2Physics/blob/master/Common/TableProducer/PID/pidTofMerge.cxx |
| 15 | +/// \brief Task to produce PID tables for TOF split for pi, K, p, de, copied from https://github.com/AliceO2Group/O2Physics/blob/master/Common/TableProducer/PID/pidTofMerge.cxx |
16 | 16 | /// It works only for MC and adds the possibility to apply postcalibrations for MC. |
17 | 17 | /// |
18 | 18 |
|
@@ -722,18 +722,21 @@ struct tofEventTime { |
722 | 722 | static constexpr int idxPi = 2; |
723 | 723 | static constexpr int idxKa = 3; |
724 | 724 | static constexpr int idxPr = 4; |
| 725 | +static constexpr int idxDe = 5; |
725 | 726 |
|
726 | 727 | /// Task to produce the response table |
727 | 728 | struct mcPidTof { |
728 | 729 | // Tables to produce |
729 | 730 | Produces<o2::aod::pidTOFPi> tablePIDPi; |
730 | 731 | Produces<o2::aod::pidTOFKa> tablePIDKa; |
731 | 732 | Produces<o2::aod::pidTOFPr> tablePIDPr; |
| 733 | + Produces<o2::aod::pidTOFDe> tablePIDDe; |
732 | 734 |
|
733 | 735 | // Tables to produce (full) |
734 | 736 | Produces<o2::aod::pidTOFFullPi> tablePIDFullPi; |
735 | 737 | Produces<o2::aod::pidTOFFullKa> tablePIDFullKa; |
736 | 738 | Produces<o2::aod::pidTOFFullPr> tablePIDFullPr; |
| 739 | + Produces<o2::aod::pidTOFFullDe> tablePIDFullDe; |
737 | 740 |
|
738 | 741 | // Detector response parameters |
739 | 742 | o2::pid::tof::TOFResoParamsV3 mRespParamsV3; |
@@ -768,7 +771,7 @@ struct mcPidTof { |
768 | 771 | { |
769 | 772 | mTOFCalibConfig.inheritFromBaseTask(initContext); |
770 | 773 | // Checking the tables are requested in the workflow and enabling them (only pi, K, p) |
771 | | - std::array<int, 3> supportedSpecies = {idxPi, idxKa, idxPr}; |
| 774 | + std::array<int, 4> supportedSpecies = {idxPi, idxKa, idxPr, idxDe}; |
772 | 775 | for (auto iSpecie{0u}; iSpecie < supportedSpecies.size(); ++iSpecie) { |
773 | 776 | // First checking tiny |
774 | 777 | int flag = -1; |
@@ -881,6 +884,14 @@ struct mcPidTof { |
881 | 884 | tablePIDPr); |
882 | 885 | } |
883 | 886 | break; |
| 887 | + case idxDe: |
| 888 | + if (fullTable) { |
| 889 | + tablePIDFullDe(-999.f, -999.f); |
| 890 | + } else { |
| 891 | + aod::pidutils::packInTable<aod::pidtof_tiny::binning>(-999.f, |
| 892 | + tablePIDDe); |
| 893 | + } |
| 894 | + break; |
884 | 895 | default: |
885 | 896 | LOG(fatal) << "Wrong particle ID in makeTableEmpty() for " << (fullTable ? "full" : "tiny") << " tables"; |
886 | 897 | break; |
@@ -960,6 +971,7 @@ struct mcPidTof { |
960 | 971 | constexpr auto responsePi = ResponseImplementation<PID::Pion>(); |
961 | 972 | constexpr auto responseKa = ResponseImplementation<PID::Kaon>(); |
962 | 973 | constexpr auto responsePr = ResponseImplementation<PID::Proton>(); |
| 974 | + constexpr auto responseDe = ResponseImplementation<PID::Deuteron>(); |
963 | 975 |
|
964 | 976 | mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, bcs.iteratorAt(0)); // Update the calibration parameters |
965 | 977 |
|
@@ -1026,6 +1038,16 @@ struct mcPidTof { |
1026 | 1038 | aod::pidutils::packInTable<aod::pidtof_tiny::binning>(nSigma, tablePIDPr); |
1027 | 1039 | break; |
1028 | 1040 | } |
| 1041 | + case idxDe: { |
| 1042 | + nSigma = responseDe.GetSeparation(mRespParamsV3, trk); |
| 1043 | + if (enableMcRecalib && trk.has_mcParticle()) { |
| 1044 | + if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kDeuteron) { // we rescale only true signal |
| 1045 | + nSigma = applyMcRecalib(idxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to deuterons, to be checked |
| 1046 | + } |
| 1047 | + } |
| 1048 | + aod::pidutils::packInTable<aod::pidtof_tiny::binning>(nSigma, tablePIDDe); |
| 1049 | + break; |
| 1050 | + } |
1029 | 1051 | default: |
1030 | 1052 | LOG(fatal) << "Wrong particle ID for standard tables"; |
1031 | 1053 | break; |
@@ -1070,6 +1092,17 @@ struct mcPidTof { |
1070 | 1092 | tablePIDFullPr(resolution, nSigma); |
1071 | 1093 | break; |
1072 | 1094 | } |
| 1095 | + case idxDe: { |
| 1096 | + resolution = responseDe.GetExpectedSigma(mRespParamsV3, trk); |
| 1097 | + nSigma = responseDe.GetSeparation(mRespParamsV3, trk, resolution); |
| 1098 | + if (enableMcRecalib && trk.has_mcParticle()) { |
| 1099 | + if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kDeuteron) { // we rescale only true signal |
| 1100 | + nSigma = applyMcRecalib(idxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to deuterons, to be checked |
| 1101 | + } |
| 1102 | + } |
| 1103 | + tablePIDFullDe(resolution, nSigma); |
| 1104 | + break; |
| 1105 | + } |
1073 | 1106 | default: |
1074 | 1107 | LOG(fatal) << "Wrong particle ID for full tables"; |
1075 | 1108 | break; |
|
0 commit comments