Skip to content

Commit d44e76e

Browse files
ddobrigkalibuild
andauthored
[PWGLF] Minor adjustments and improvements to strangeness TOF PID (#12616)
Co-authored-by: ALICE Builder <alibuild@users.noreply.github.com>
1 parent 8cb0709 commit d44e76e

File tree

6 files changed

+1191
-1325
lines changed

6 files changed

+1191
-1325
lines changed

PWGLF/DataModel/LFStrangenessPIDTables.h

Lines changed: 86 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ DECLARE_SOA_TABLE(DauTrackTOFPIDs, "AOD", "DAUTRACKTOFPID", // raw table (for po
4747

4848
namespace v0data
4949
{
50+
// define constants for NSigma operation
51+
const float kNoTOFValue = -1e+6;
52+
const float kEpsilon = 1e-4;
53+
5054
// ==== TOF INFORMATION ===
5155
// lengths as stored in the AO2D for TOF calculations
5256
DECLARE_SOA_COLUMN(PosTOFLengthToPV, posTOFLengthToPV, float); //! positive track length to PV
@@ -79,6 +83,45 @@ DECLARE_SOA_COLUMN(TOFNSigmaALaPi, tofNSigmaALaPi, float); //! positive
7983
DECLARE_SOA_COLUMN(TOFNSigmaK0PiPlus, tofNSigmaK0PiPlus, float); //! positive track NSigma from pion <- k0short expectation
8084
DECLARE_SOA_COLUMN(TOFNSigmaK0PiMinus, tofNSigmaK0PiMinus, float); //! negative track NSigma from pion <- k0short expectation
8185

86+
// dynamics based on n-sigmas with use-only-if-tof-present logic
87+
DECLARE_SOA_DYNAMIC_COLUMN(TofLambdaCompatibility, tofLambdaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
88+
[](float tofNSigmaLaPr, float tofNSigmaLaPi, float nsigma) -> float {
89+
bool compatible = true;
90+
if (std::abs(tofNSigmaLaPr - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaLaPr) > nsigma) {
91+
compatible = false; // reject only if info present and incompatible
92+
}
93+
if (std::abs(tofNSigmaLaPi - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaLaPi) > nsigma) {
94+
compatible = false; // reject only if info present and incompatible
95+
}
96+
return compatible;
97+
});
98+
99+
// dynamics based on n-sigmas with use-only-if-tof-present logic
100+
DECLARE_SOA_DYNAMIC_COLUMN(TofAntiLambdaCompatibility, tofAntiLambdaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
101+
[](float tofNSigmaALaPr, float tofNSigmaALaPi, float nsigma) -> float {
102+
bool compatible = true;
103+
if (std::abs(tofNSigmaALaPr - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaALaPr) > nsigma) {
104+
compatible = false; // reject only if info present and incompatible
105+
}
106+
if (std::abs(tofNSigmaALaPi - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaALaPi) > nsigma) {
107+
compatible = false; // reject only if info present and incompatible
108+
}
109+
return compatible;
110+
});
111+
112+
// dynamics based on n-sigmas with use-only-if-tof-present logic
113+
DECLARE_SOA_DYNAMIC_COLUMN(TofK0ShortCompatibility, tofK0ShortCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
114+
[](float tofNSigmaK0PiPlus, float tofNSigmaK0PiMinus, float nsigma) -> float {
115+
bool compatible = true;
116+
if (std::abs(tofNSigmaK0PiPlus - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaK0PiPlus) > nsigma) {
117+
compatible = false; // reject only if info present and incompatible
118+
}
119+
if (std::abs(tofNSigmaK0PiMinus - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaK0PiMinus) > nsigma) {
120+
compatible = false; // reject only if info present and incompatible
121+
}
122+
return compatible;
123+
});
124+
82125
// beta values
83126
DECLARE_SOA_COLUMN(TofBetaLambda, tofBetaLambda, float); //! beta value with Lambda hypothesis
84127
DECLARE_SOA_COLUMN(TofBetaAntiLambda, tofBetaAntiLambda, float); //! beta value with AntiLambda hypothesis
@@ -120,10 +163,17 @@ DECLARE_SOA_TABLE(V0TOFBetas, "AOD", "V0TOFBETA", // processed info table (for a
120163
DECLARE_SOA_TABLE(V0TOFNSigmas, "AOD", "V0TOFNSIGMA", // processed NSigma table (for analysis)
121164
v0data::TOFNSigmaLaPr, v0data::TOFNSigmaLaPi,
122165
v0data::TOFNSigmaALaPr, v0data::TOFNSigmaALaPi,
123-
v0data::TOFNSigmaK0PiPlus, v0data::TOFNSigmaK0PiMinus);
166+
v0data::TOFNSigmaK0PiPlus, v0data::TOFNSigmaK0PiMinus,
167+
v0data::TofLambdaCompatibility<v0data::TOFNSigmaLaPr, v0data::TOFNSigmaLaPi>,
168+
v0data::TofAntiLambdaCompatibility<v0data::TOFNSigmaALaPr, v0data::TOFNSigmaALaPi>,
169+
v0data::TofK0ShortCompatibility<v0data::TOFNSigmaK0PiPlus, v0data::TOFNSigmaK0PiMinus>);
124170

125171
namespace cascdata
126172
{
173+
// define constants for NSigma operation
174+
const float kNoTOFValue = -1e+6;
175+
const float kEpsilon = 1e-4;
176+
127177
// lengths as stored in the AO2D for TOF calculations
128178
DECLARE_SOA_COLUMN(PosTOFLengthToPV, posTOFLengthToPV, float); //! positive track length
129179
DECLARE_SOA_COLUMN(NegTOFLengthToPV, negTOFLengthToPV, float); //! negative track length
@@ -154,6 +204,38 @@ DECLARE_SOA_COLUMN(TOFNSigmaXiPi, tofNSigmaXiPi, float); //! bachelor track
154204
DECLARE_SOA_COLUMN(TOFNSigmaOmLaPi, tofNSigmaOmLaPi, float); //! meson track NSigma from pion <- lambda <- om expectation
155205
DECLARE_SOA_COLUMN(TOFNSigmaOmLaPr, tofNSigmaOmLaPr, float); //! baryon track NSigma from proton <- lambda <- om expectation
156206
DECLARE_SOA_COLUMN(TOFNSigmaOmKa, tofNSigmaOmKa, float); //! bachelor track NSigma from kaon <- om expectation
207+
208+
// dynamics based on n-sigmas with use-only-if-tof-present logic
209+
DECLARE_SOA_DYNAMIC_COLUMN(TofXiCompatibility, tofXiCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
210+
[](float tofNSigmaXiLaPr, float tofNSigmaXiLaPi, float tofNSigmaXiPi, float nsigma) -> float {
211+
bool compatible = true;
212+
if (std::abs(tofNSigmaXiLaPr - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaXiLaPr) > nsigma) {
213+
compatible = false; // reject only if info present and incompatible
214+
}
215+
if (std::abs(tofNSigmaXiLaPi - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaXiLaPi) > nsigma) {
216+
compatible = false; // reject only if info present and incompatible
217+
}
218+
if (std::abs(tofNSigmaXiPi - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaXiPi) > nsigma) {
219+
compatible = false; // reject only if info present and incompatible
220+
}
221+
return compatible;
222+
});
223+
224+
DECLARE_SOA_DYNAMIC_COLUMN(TofOmegaCompatibility, tofOmegaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
225+
[](float tofNSigmaOmLaPr, float tofNSigmaOmLaPi, float tofNSigmaOmKa, float nsigma) -> float {
226+
bool compatible = true;
227+
if (std::abs(tofNSigmaOmLaPr - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaOmLaPr) > nsigma) {
228+
compatible = false; // reject only if info present and incompatible
229+
}
230+
if (std::abs(tofNSigmaOmLaPi - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaOmLaPi) > nsigma) {
231+
compatible = false; // reject only if info present and incompatible
232+
}
233+
if (std::abs(tofNSigmaOmKa - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaOmKa) > nsigma) {
234+
compatible = false; // reject only if info present and incompatible
235+
}
236+
return compatible;
237+
});
238+
157239
} // namespace cascdata
158240

159241
// /-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/
@@ -173,7 +255,9 @@ DECLARE_SOA_TABLE(CascTOFPIDs, "AOD", "CASCTOFPID", // processed information for
173255
cascdata::BachTOFDeltaTOmKa);
174256
DECLARE_SOA_TABLE(CascTOFNSigmas, "AOD", "CascTOFNSigmas", // Nsigmas for cascades
175257
cascdata::TOFNSigmaXiLaPi, cascdata::TOFNSigmaXiLaPr, cascdata::TOFNSigmaXiPi,
176-
cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmKa);
258+
cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmKa,
259+
cascdata::TofXiCompatibility<cascdata::TOFNSigmaXiLaPr, cascdata::TOFNSigmaXiLaPi, cascdata::TOFNSigmaXiPi>,
260+
cascdata::TofOmegaCompatibility<cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmKa>);
177261
} // namespace o2::aod
178262

179263
#endif // PWGLF_DATAMODEL_LFSTRANGENESSPIDTABLES_H_

PWGLF/TableProducer/Strangeness/CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ o2physics_add_dpl_workflow(cascademcfinder
3636
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
3737
COMPONENT_NAME Analysis)
3838

39-
o2physics_add_dpl_workflow(cascadepid
40-
SOURCES cascadepid.cxx
39+
o2physics_add_dpl_workflow(strangenesstofpid
40+
SOURCES strangenesstofpid.cxx
4141
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsBase
4242
COMPONENT_NAME Analysis)
4343

@@ -81,11 +81,6 @@ o2physics_add_dpl_workflow(lambdakzeromcfinder
8181
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
8282
COMPONENT_NAME Analysis)
8383

84-
o2physics_add_dpl_workflow(lambdakzeropid
85-
SOURCES lambdakzeropid.cxx
86-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsBase
87-
COMPONENT_NAME Analysis)
88-
8984
o2physics_add_dpl_workflow(lambdakzerospawner
9085
SOURCES lambdakzerospawner.cxx
9186
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore

0 commit comments

Comments
 (0)