Skip to content

Commit ada6fc3

Browse files
committed
Add tr and helium3 into the mcPidTof task
1 parent e693b41 commit ada6fc3

File tree

1 file changed

+82
-2
lines changed

1 file changed

+82
-2
lines changed

PWGHF/TableProducer/mcPidTof.cxx

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
///
1313
/// \file mcPidTof.cxx
1414
/// \author Fabrizio Grosa fabrizio.grosa@cern.ch
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
15+
/// \brief Task to produce PID tables for TOF split for pi, K, p, de, tr, he3 copied from https://github.com/AliceO2Group/O2Physics/blob/master/Common/TableProducer/PID/pidTofMerge.cxx
1616
/// It works only for MC and adds the possibility to apply postcalibrations for MC.
1717
///
1818

@@ -720,6 +720,8 @@ static constexpr int IdxPi = 2;
720720
static constexpr int IdxKa = 3;
721721
static constexpr int IdxPr = 4;
722722
static constexpr int IdxDe = 5;
723+
static constexpr int IdxTr = 6;
724+
static constexpr int IdxHe = 7;
723725

724726
/// Task to produce the response table
725727
struct McPidTof {
@@ -728,12 +730,16 @@ struct McPidTof {
728730
Produces<o2::aod::pidTOFKa> tablePIDKa;
729731
Produces<o2::aod::pidTOFPr> tablePIDPr;
730732
Produces<o2::aod::pidTOFDe> tablePIDDe;
733+
Produces<o2::aod::pidTOFTr> tablePIDTr;
734+
Produces<o2::aod::pidTOFHe> tablePIDHe;
731735

732736
// Tables to produce (full)
733737
Produces<o2::aod::pidTOFFullPi> tablePIDFullPi;
734738
Produces<o2::aod::pidTOFFullKa> tablePIDFullKa;
735739
Produces<o2::aod::pidTOFFullPr> tablePIDFullPr;
736740
Produces<o2::aod::pidTOFFullDe> tablePIDFullDe;
741+
Produces<o2::aod::pidTOFFullTr> tablePIDFullTr;
742+
Produces<o2::aod::pidTOFFullHe> tablePIDFullHe;
737743

738744
// Detector response parameters
739745
o2::pid::tof::TOFResoParamsV3 mRespParamsV3;
@@ -768,7 +774,7 @@ struct McPidTof {
768774
{
769775
mTOFCalibConfig.inheritFromBaseTask(initContext);
770776
// Checking the tables are requested in the workflow and enabling them (only pi, K, p)
771-
std::array<int, 4> supportedSpecies = {IdxPi, IdxKa, IdxPr, IdxDe};
777+
std::array<int, 6> supportedSpecies = {IdxPi, IdxKa, IdxPr, IdxDe, IdxTr, IdxHe};
772778
for (auto iSpecie{0u}; iSpecie < supportedSpecies.size(); ++iSpecie) {
773779
// First checking tiny
774780
int flag = -1;
@@ -855,6 +861,22 @@ struct McPidTof {
855861
}
856862
break;
857863
}
864+
case IdxTr: {
865+
if (fullTable) {
866+
tablePIDFullTr.reserve(size);
867+
} else {
868+
tablePIDTr.reserve(size);
869+
}
870+
break;
871+
}
872+
case IdxHe: {
873+
if (fullTable) {
874+
tablePIDFullHe.reserve(size);
875+
} else {
876+
tablePIDHe.reserve(size);
877+
}
878+
break;
879+
}
858880
default:
859881
LOG(fatal) << "Wrong particle ID in reserveTable() for " << (fullTable ? "full" : "tiny") << " tables";
860882
break;
@@ -893,6 +915,20 @@ struct McPidTof {
893915
aod::pidtof_tiny::binning::packInTable(-999.f, tablePIDDe);
894916
}
895917
break;
918+
case IdxTr:
919+
if (fullTable) {
920+
tablePIDFullTr(-999.f, -999.f);
921+
} else {
922+
aod::pidtof_tiny::binning::packInTable(-999.f, tablePIDTr);
923+
}
924+
break;
925+
case IdxHe:
926+
if (fullTable) {
927+
tablePIDFullHe(-999.f, -999.f);
928+
} else {
929+
aod::pidtof_tiny::binning::packInTable(-999.f, tablePIDHe);
930+
}
931+
break;
896932
default:
897933
LOG(fatal) << "Wrong particle ID in makeTableEmpty() for " << (fullTable ? "full" : "tiny") << " tables";
898934
break;
@@ -974,6 +1010,8 @@ struct McPidTof {
9741010
constexpr auto ResponseKa = ResponseImplementation<PID::Kaon>();
9751011
constexpr auto ResponsePr = ResponseImplementation<PID::Proton>();
9761012
constexpr auto ResponseDe = ResponseImplementation<PID::Deuteron>();
1013+
constexpr auto ResponseTr = ResponseImplementation<PID::Triton>();
1014+
constexpr auto ResponseHe = ResponseImplementation<PID::Helium3>();
9771015

9781016
mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, bcs.iteratorAt(0)); // Update the calibration parameters
9791017

@@ -1050,6 +1088,26 @@ struct McPidTof {
10501088
aod::pidtof_tiny::binning::packInTable(nSigma, tablePIDDe);
10511089
break;
10521090
}
1091+
case IdxTr: {
1092+
nSigma = ResponseTr.GetSeparation(mRespParamsV3, trk);
1093+
if (enableMcRecalib && trk.has_mcParticle()) {
1094+
if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kTriton) { // we rescale only true signal
1095+
nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to deuterons, to be checked
1096+
}
1097+
}
1098+
aod::pidtof_tiny::binning::packInTable(nSigma, tablePIDTr);
1099+
break;
1100+
}
1101+
case IdxHe: {
1102+
nSigma = ResponseHe.GetSeparation(mRespParamsV3, trk);
1103+
if (enableMcRecalib && trk.has_mcParticle()) {
1104+
if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kHelium3) { // we rescale only true signal
1105+
nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to deuterons, to be checked
1106+
}
1107+
}
1108+
aod::pidtof_tiny::binning::packInTable(nSigma, tablePIDHe);
1109+
break;
1110+
}
10531111
default:
10541112
LOG(fatal) << "Wrong particle ID for standard tables";
10551113
break;
@@ -1105,6 +1163,28 @@ struct McPidTof {
11051163
tablePIDFullDe(resolution, nSigma);
11061164
break;
11071165
}
1166+
case IdxTr: {
1167+
resolution = ResponseTr.GetExpectedSigma(mRespParamsV3, trk);
1168+
nSigma = ResponseTr.GetSeparation(mRespParamsV3, trk, resolution);
1169+
if (enableMcRecalib && trk.has_mcParticle()) {
1170+
if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kTriton) { // we rescale only true signal
1171+
nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to deuterons, to be checked
1172+
}
1173+
}
1174+
tablePIDFullTr(resolution, nSigma);
1175+
break;
1176+
}
1177+
case IdxHe: {
1178+
resolution = ResponseHe.GetExpectedSigma(mRespParamsV3, trk);
1179+
nSigma = ResponseHe.GetSeparation(mRespParamsV3, trk, resolution);
1180+
if (enableMcRecalib && trk.has_mcParticle()) {
1181+
if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kHelium3) { // we rescale only true signal
1182+
nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to deuterons, to be checked
1183+
}
1184+
}
1185+
tablePIDFullHe(resolution, nSigma);
1186+
break;
1187+
}
11081188
default:
11091189
LOG(fatal) << "Wrong particle ID for full tables";
11101190
break;

0 commit comments

Comments
 (0)