forked from AliceO2Group/O2Physics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLFStrangenessPIDTables.h
More file actions
383 lines (333 loc) · 24.4 KB
/
LFStrangenessPIDTables.h
File metadata and controls
383 lines (333 loc) · 24.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
// Defines TOF PID tables for strangeness.
// Entries calculated per candidate, tables are joinable with v0/cascdata tables.
#ifndef PWGLF_DATAMODEL_LFSTRANGENESSPIDTABLES_H_
#define PWGLF_DATAMODEL_LFSTRANGENESSPIDTABLES_H_
#include "PWGLF/DataModel/LFStrangenessTables.h"
#include "Common/Core/RecoDecay.h"
#include "CommonConstants/PhysicsConstants.h"
#include "Framework/AnalysisDataModel.h"
#include <cmath>
namespace o2::aod
{
namespace dautrack
{
// ==== define packing helpers ===
namespace packing
{
// define variables for packing
static constexpr int nbins = (1 << 8 * sizeof(int8_t)) - 2;
static constexpr int8_t overflowBin = nbins >> 1;
static constexpr int8_t underflowBin = -(nbins >> 1);
static constexpr float binned_max = 6.35;
static constexpr float binned_min = -6.35;
static constexpr float bin_width = (binned_max - binned_min) / nbins;
static constexpr float underflow_return = -100.0f;
static constexpr float overflow_return = +100.0f;
// define helper function to do packing
int8_t packInInt8(float nSigma)
{
// calculate
if (nSigma <= binned_min)
return underflowBin;
if (nSigma >= binned_max)
return overflowBin;
if (nSigma >= 0) {
return static_cast<int8_t>((nSigma / bin_width) + 0.5f);
}
// automatic: this is the case in which nSigma < 0
return static_cast<int8_t>((nSigma / bin_width) - 0.5f);
}
// define helper function to do unpacking
float unpackInt8(int8_t nSigma)
{
if (nSigma == underflowBin) {
return underflow_return;
}
if (nSigma == overflowBin) {
return overflow_return;
}
return bin_width * nSigma;
}
} // namespace packing
} // namespace dautrack
namespace dautrack_legacy
{
// ==== LEGACY TPC INFORMATION (full size tables) ===
DECLARE_SOA_COLUMN(TPCNSigmaEl, tpcNSigmaEl, float); //! Nsigma proton
DECLARE_SOA_COLUMN(TPCNSigmaPi, tpcNSigmaPi, float); //! Nsigma proton
DECLARE_SOA_COLUMN(TPCNSigmaKa, tpcNSigmaKa, float); //! Nsigma proton
DECLARE_SOA_COLUMN(TPCNSigmaPr, tpcNSigmaPr, float); //! Nsigma proton
DECLARE_SOA_COLUMN(TPCNSigmaHe, tpcNSigmaHe, float); //! Nsigma proton
} // namespace dautrack_legacy
namespace dautrack
{
// ==== COMPACT TPC INFORMATION (full size tables) ===
DECLARE_SOA_COLUMN(TPCSignal, tpcSignal, float); //! track TPC signal
DECLARE_SOA_COLUMN(PackedTPCNSigmaEl, packedTpcNSigmaEl, int8_t); //! Nsigma proton
DECLARE_SOA_COLUMN(PackedTPCNSigmaPi, packedTpcNSigmaPi, int8_t); //! Nsigma proton
DECLARE_SOA_COLUMN(PackedTPCNSigmaKa, packedTpcNSigmaKa, int8_t); //! Nsigma proton
DECLARE_SOA_COLUMN(PackedTPCNSigmaPr, packedTpcNSigmaPr, int8_t); //! Nsigma proton
DECLARE_SOA_DYNAMIC_COLUMN(TPCNSigmaEl, tpcNSigmaEl, //! unpacked TPC nsigma
[](int8_t nsigma_packed) -> float { return o2::aod::dautrack::packing::unpackInt8(nsigma_packed); });
DECLARE_SOA_DYNAMIC_COLUMN(TPCNSigmaPi, tpcNSigmaPi, //! unpacked TPC nsigma
[](int8_t nsigma_packed) -> float { return o2::aod::dautrack::packing::unpackInt8(nsigma_packed); });
DECLARE_SOA_DYNAMIC_COLUMN(TPCNSigmaKa, tpcNSigmaKa, //! unpacked TPC nsigma
[](int8_t nsigma_packed) -> float { return o2::aod::dautrack::packing::unpackInt8(nsigma_packed); });
DECLARE_SOA_DYNAMIC_COLUMN(TPCNSigmaPr, tpcNSigmaPr, //! unpacked TPC nsigma
[](int8_t nsigma_packed) -> float { return o2::aod::dautrack::packing::unpackInt8(nsigma_packed); });
// ==== TOF INFORMATION ===
DECLARE_SOA_INDEX_COLUMN(DauTrackExtra, dauTrackExtra); //! point to daughter this TOF info belongs to
DECLARE_SOA_INDEX_COLUMN(StraCollision, straCollision); //! point to collision associated with this track (not the V0/Casc)
DECLARE_SOA_COLUMN(TOFSignal, tofSignal, float); //! track TOF signal
DECLARE_SOA_COLUMN(TOFEvTime, tofEvTime, float); //! event time
DECLARE_SOA_COLUMN(Length, length, float); //! track length (to assigned PV)
DECLARE_SOA_COLUMN(TOFExpMom, tofExpMom, float); //! tof Exp Mom (to assigned PV)
// dynamics with expected times
DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimeEl, tofExpTimeEl, //! Expected time for the track to reach the TOF under the electron hypothesis
[](float length, float tofExpMom) -> float {
constexpr float massSquared = o2::constants::physics::MassElectron * o2::constants::physics::MassElectron;
return o2::framework::pid::tof::MassToExpTime(tofExpMom, length, massSquared);
});
DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimePi, tofExpTimePi, //! Expected time for the track to reach the TOF under the pion hypothesis
[](float length, float tofExpMom) -> float {
constexpr float massSquared = o2::constants::physics::MassPionCharged * o2::constants::physics::MassPionCharged;
return o2::framework::pid::tof::MassToExpTime(tofExpMom, length, massSquared);
});
DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimeKa, tofExpTimeKa, //! Expected time for the track to reach the TOF under the kaon hypothesis
[](float length, float tofExpMom) -> float {
constexpr float massSquared = o2::constants::physics::MassKaonCharged * o2::constants::physics::MassKaonCharged;
return o2::framework::pid::tof::MassToExpTime(tofExpMom, length, massSquared);
});
DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimePr, tofExpTimePr, //! Expected time for the track to reach the TOF under the proton hypothesis
[](float length, float tofExpMom) -> float {
constexpr float massSquared = o2::constants::physics::MassProton * o2::constants::physics::MassProton;
return o2::framework::pid::tof::MassToExpTime(tofExpMom, length, massSquared);
});
} // namespace dautrack
DECLARE_SOA_TABLE(DauTrackTPCPIDs_000, "AOD", "DAUTRACKTPCPID", // nsigma table (for analysis)
dautrack::TPCSignal, dautrack_legacy::TPCNSigmaEl,
dautrack_legacy::TPCNSigmaPi, dautrack_legacy::TPCNSigmaKa,
dautrack_legacy::TPCNSigmaPr, dautrack_legacy::TPCNSigmaHe);
DECLARE_SOA_TABLE_VERSIONED(DauTrackTPCPIDs_001, "AOD", "DAUTRACKTPCPID", 1, // nsigma table (for analysis)
dautrack::TPCSignal,
dautrack::PackedTPCNSigmaEl, dautrack::PackedTPCNSigmaPi,
dautrack::PackedTPCNSigmaKa, dautrack::PackedTPCNSigmaPr,
dautrack::TPCNSigmaEl<dautrack::PackedTPCNSigmaEl>,
dautrack::TPCNSigmaPi<dautrack::PackedTPCNSigmaPi>,
dautrack::TPCNSigmaKa<dautrack::PackedTPCNSigmaKa>,
dautrack::TPCNSigmaPr<dautrack::PackedTPCNSigmaPr>);
using DauTrackTPCPIDs = DauTrackTPCPIDs_001; // second gen: packed Nsigma, no He
DECLARE_SOA_TABLE(DauTrackTOFPIDs_000, "AOD", "DAUTRACKTOFPID", // raw table (for posterior TOF calculation)
dautrack::TOFSignal, dautrack::TOFEvTime, dautrack::Length);
DECLARE_SOA_TABLE_VERSIONED(DauTrackTOFPIDs_001, "AOD", "DAUTRACKTOFPID", 1, // raw table (for posterior TOF calculation)
o2::soa::Index<>,
dautrack::StraCollisionId, dautrack::DauTrackExtraId,
dautrack::TOFSignal, dautrack::TOFEvTime,
dautrack::Length, dautrack::TOFExpMom,
dautrack::TOFExpTimeEl<dautrack::Length, dautrack::TOFExpMom>,
dautrack::TOFExpTimePi<dautrack::Length, dautrack::TOFExpMom>,
dautrack::TOFExpTimeKa<dautrack::Length, dautrack::TOFExpMom>,
dautrack::TOFExpTimePr<dautrack::Length, dautrack::TOFExpMom>);
using DauTrackTOFPIDs = DauTrackTOFPIDs_001; // second gen: with collision Id, with TOFExpMom
namespace v0data
{
// define constants for NSigma operation
const float kNoTOFValue = -1e+6;
const float kEpsilon = 1e-4;
// ==== TOF INFORMATION ===
// lengths as stored in the AO2D for TOF calculations
DECLARE_SOA_COLUMN(PosTOFLengthToPV, posTOFLengthToPV, float); //! positive track length to PV
DECLARE_SOA_COLUMN(NegTOFLengthToPV, negTOFLengthToPV, float); //! negative track length to PV
DECLARE_SOA_COLUMN(PosTOFSignal, posTOFSignal, float); //! positive track signal
DECLARE_SOA_COLUMN(NegTOFSignal, negTOFSignal, float); //! negative track signal
DECLARE_SOA_COLUMN(PosTOFEventTime, posTOFEventTime, float); //! positive track event time
DECLARE_SOA_COLUMN(NegTOFEventTime, negTOFEventTime, float); //! negative track event time
DECLARE_SOA_COLUMN(PosTOFLength, posTOFLength, float); //! positive track length, recalculated
DECLARE_SOA_COLUMN(NegTOFLength, negTOFLength, float); //! negative track length, recalculated
// delta-times
DECLARE_SOA_COLUMN(PosTOFDeltaTLaPi, posTOFDeltaTLaPi, float); //! positive track TOFDeltaT from pion <- lambda expectation
DECLARE_SOA_COLUMN(PosTOFDeltaTLaPr, posTOFDeltaTLaPr, float); //! positive track TOFDeltaT from proton <- lambda expectation
DECLARE_SOA_COLUMN(NegTOFDeltaTLaPi, negTOFDeltaTLaPi, float); //! negative track TOFDeltaT from pion <- lambda expectation
DECLARE_SOA_COLUMN(NegTOFDeltaTLaPr, negTOFDeltaTLaPr, float); //! negative track TOFDeltaT from proton <- lambda expectation
DECLARE_SOA_COLUMN(PosTOFDeltaTK0Pi, posTOFDeltaTK0Pi, float); //! positive track TOFDeltaT from pion <- k0short expectation
DECLARE_SOA_COLUMN(NegTOFDeltaTK0Pi, negTOFDeltaTK0Pi, float); //! positive track TOFDeltaT from pion <- k0short expectation
// delta-decay-times (event-time-independent)
DECLARE_SOA_COLUMN(DeltaDecayTimeLambda, deltaDecayTimeLambda, float); //! delta-decay time estimate from proton/pion from Lambda
DECLARE_SOA_COLUMN(DeltaDecayTimeAntiLambda, deltaDecayTimeAntiLambda, float); //! delta-decay time estimate from pion/proton from AntiLambda
DECLARE_SOA_COLUMN(DeltaDecayTimeK0Short, deltaDecayTimeK0Short, float); //! delta-decay time estimate from pion/pion from K0Short
// n-sigmas
DECLARE_SOA_COLUMN(TOFNSigmaLaPr, tofNSigmaLaPr, float); //! positive track NSigma from proton <- lambda expectation
DECLARE_SOA_COLUMN(TOFNSigmaLaPi, tofNSigmaLaPi, float); //! negative track NSigma from pion <- lambda expectation
DECLARE_SOA_COLUMN(TOFNSigmaALaPr, tofNSigmaALaPr, float); //! negative track NSigma from proton <- antilambda expectation
DECLARE_SOA_COLUMN(TOFNSigmaALaPi, tofNSigmaALaPi, float); //! positive track NSigma from pion <- antilambda expectation
DECLARE_SOA_COLUMN(TOFNSigmaK0PiPlus, tofNSigmaK0PiPlus, float); //! positive track NSigma from pion <- k0short expectation
DECLARE_SOA_COLUMN(TOFNSigmaK0PiMinus, tofNSigmaK0PiMinus, float); //! negative track NSigma from pion <- k0short expectation
// dynamics based on n-sigmas with use-only-if-tof-present logic
DECLARE_SOA_DYNAMIC_COLUMN(TofLambdaCompatibility, tofLambdaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
[](float tofNSigmaLaPr, float tofNSigmaLaPi, float nsigma) -> float {
bool compatible = true;
if (std::abs(tofNSigmaLaPr - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaLaPr) > nsigma) {
compatible = false; // reject only if info present and incompatible
}
if (std::abs(tofNSigmaLaPi - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaLaPi) > nsigma) {
compatible = false; // reject only if info present and incompatible
}
return compatible;
});
// dynamics based on n-sigmas with use-only-if-tof-present logic
DECLARE_SOA_DYNAMIC_COLUMN(TofAntiLambdaCompatibility, tofAntiLambdaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
[](float tofNSigmaALaPr, float tofNSigmaALaPi, float nsigma) -> float {
bool compatible = true;
if (std::abs(tofNSigmaALaPr - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaALaPr) > nsigma) {
compatible = false; // reject only if info present and incompatible
}
if (std::abs(tofNSigmaALaPi - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaALaPi) > nsigma) {
compatible = false; // reject only if info present and incompatible
}
return compatible;
});
// dynamics based on n-sigmas with use-only-if-tof-present logic
DECLARE_SOA_DYNAMIC_COLUMN(TofK0ShortCompatibility, tofK0ShortCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
[](float tofNSigmaK0PiPlus, float tofNSigmaK0PiMinus, float nsigma) -> float {
bool compatible = true;
if (std::abs(tofNSigmaK0PiPlus - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaK0PiPlus) > nsigma) {
compatible = false; // reject only if info present and incompatible
}
if (std::abs(tofNSigmaK0PiMinus - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaK0PiMinus) > nsigma) {
compatible = false; // reject only if info present and incompatible
}
return compatible;
});
// beta values
DECLARE_SOA_COLUMN(TofBetaLambda, tofBetaLambda, float); //! beta value with Lambda hypothesis
DECLARE_SOA_COLUMN(TofBetaAntiLambda, tofBetaAntiLambda, float); //! beta value with AntiLambda hypothesis
DECLARE_SOA_COLUMN(TofBetaK0Short, tofBetaK0Short, float); //! beta value with K0Short hypothesis
// debug quantities
DECLARE_SOA_COLUMN(V0LifetimeLambda, v0LifetimeLambda, float); //! lifetime of V0 assuming lambda mass (ps)
DECLARE_SOA_COLUMN(V0LifetimeK0Short, v0LifetimeK0Short, float); //! lifetime of V0 assuming K0 mass (ps)
DECLARE_SOA_COLUMN(PosLifetimePr, posLifetimePr, float); //! lifetime (to TOF) of pos prong assuming proton mass (ps)
DECLARE_SOA_COLUMN(PosLifetimePi, posLifetimePi, float); //! lifetime (to TOF) of pos prong assuming pion mass (ps)
DECLARE_SOA_COLUMN(NegLifetimePr, negLifetimePr, float); //! lifetime (to TOF) of neg prong assuming proton mass (ps)
DECLARE_SOA_COLUMN(NegLifetimePi, negLifetimePi, float); //! lifetime (to TOF) of neg prong assuming pion mass (ps)
} // namespace v0data
// /-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/
// DEPRECATED - DO NOT USE - KEPT FOR BACKWARDS COMPATIBILITY, TO BE REMOVED
DECLARE_SOA_TABLE(V0TOFs, "AOD", "V0TOF", // raw information table (for debug, etc)
v0data::PosTOFLengthToPV, v0data::NegTOFLengthToPV,
v0data::PosTOFSignal, v0data::NegTOFSignal,
v0data::PosTOFEventTime, v0data::NegTOFEventTime);
// /-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/
DECLARE_SOA_TABLE(V0TOFPIDs, "AOD", "V0TOFPID", // processed info table (for analysis)
v0data::PosTOFDeltaTLaPi, v0data::PosTOFDeltaTLaPr,
v0data::NegTOFDeltaTLaPi, v0data::NegTOFDeltaTLaPr,
v0data::PosTOFDeltaTK0Pi, v0data::NegTOFDeltaTK0Pi,
v0data::DeltaDecayTimeLambda,
v0data::DeltaDecayTimeAntiLambda,
v0data::DeltaDecayTimeK0Short);
DECLARE_SOA_TABLE(V0TOFDebugs, "AOD", "V0TOFDEBUG", // table with intermediate information solely for debugging
v0data::V0LifetimeLambda, v0data::V0LifetimeK0Short,
v0data::PosLifetimePr, v0data::PosLifetimePi,
v0data::NegLifetimePr, v0data::NegLifetimePi);
DECLARE_SOA_TABLE(V0TOFBetas, "AOD", "V0TOFBETA", // processed info table (for analysis)
v0data::TofBetaLambda, v0data::TofBetaAntiLambda, v0data::TofBetaK0Short);
DECLARE_SOA_TABLE(V0TOFNSigmas, "AOD", "V0TOFNSIGMA", // processed NSigma table (for analysis)
v0data::TOFNSigmaLaPr, v0data::TOFNSigmaLaPi,
v0data::TOFNSigmaALaPr, v0data::TOFNSigmaALaPi,
v0data::TOFNSigmaK0PiPlus, v0data::TOFNSigmaK0PiMinus,
v0data::TofLambdaCompatibility<v0data::TOFNSigmaLaPr, v0data::TOFNSigmaLaPi>,
v0data::TofAntiLambdaCompatibility<v0data::TOFNSigmaALaPr, v0data::TOFNSigmaALaPi>,
v0data::TofK0ShortCompatibility<v0data::TOFNSigmaK0PiPlus, v0data::TOFNSigmaK0PiMinus>);
namespace cascdata
{
// define constants for NSigma operation
const float kNoTOFValue = -1e+6;
const float kEpsilon = 1e-4;
// lengths as stored in the AO2D for TOF calculations
DECLARE_SOA_COLUMN(PosTOFLengthToPV, posTOFLengthToPV, float); //! positive track length
DECLARE_SOA_COLUMN(NegTOFLengthToPV, negTOFLengthToPV, float); //! negative track length
DECLARE_SOA_COLUMN(BachTOFLengthToPV, bachTOFLengthToPV, float); //! bachelor track length
DECLARE_SOA_COLUMN(PosTOFSignal, posTOFSignal, float); //! positive track signal
DECLARE_SOA_COLUMN(NegTOFSignal, negTOFSignal, float); //! negative track signal
DECLARE_SOA_COLUMN(BachTOFSignal, bachTOFSignal, float); //! bachelor track signal
DECLARE_SOA_COLUMN(PosTOFEventTime, posTOFEventTime, float); //! positive track event time
DECLARE_SOA_COLUMN(NegTOFEventTime, negTOFEventTime, float); //! negative track event time
DECLARE_SOA_COLUMN(BachTOFEventTime, bachTOFEventTime, float); //! bachelor track event time
// delta-times
DECLARE_SOA_COLUMN(PosTOFDeltaTXiPi, posTOFDeltaTXiPi, float); //! positive track TOFDeltaT from pion <- lambda <- xi expectation
DECLARE_SOA_COLUMN(PosTOFDeltaTXiPr, posTOFDeltaTXiPr, float); //! positive track TOFDeltaT from proton <- lambda <- xi expectation
DECLARE_SOA_COLUMN(NegTOFDeltaTXiPi, negTOFDeltaTXiPi, float); //! negative track TOFDeltaT from pion <- lambda <- xi expectation
DECLARE_SOA_COLUMN(NegTOFDeltaTXiPr, negTOFDeltaTXiPr, float); //! negative track TOFDeltaT from proton <- lambda <- xi expectation
DECLARE_SOA_COLUMN(BachTOFDeltaTXiPi, bachTOFDeltaTXiPi, float); //! bachelor track TOFDeltaT from pion <- xi expectation
DECLARE_SOA_COLUMN(PosTOFDeltaTOmPi, posTOFDeltaTOmPi, float); //! positive track TOFDeltaT from pion <- lambda <- omega expectation
DECLARE_SOA_COLUMN(PosTOFDeltaTOmPr, posTOFDeltaTOmPr, float); //! positive track TOFDeltaT from proton <- lambda <- omega expectation
DECLARE_SOA_COLUMN(NegTOFDeltaTOmPi, negTOFDeltaTOmPi, float); //! negative track TOFDeltaT from pion <- lambda <- omega expectation
DECLARE_SOA_COLUMN(NegTOFDeltaTOmPr, negTOFDeltaTOmPr, float); //! negative track TOFDeltaT from proton <- lambda <- omega expectation
DECLARE_SOA_COLUMN(BachTOFDeltaTOmKa, bachTOFDeltaTOmKa, float); //! bachelor track TOFDeltaT from kaon <- omega expectation
// n-sigmas
DECLARE_SOA_COLUMN(TOFNSigmaXiLaPi, tofNSigmaXiLaPi, float); //! meson track NSigma from pion <- lambda <- xi expectation
DECLARE_SOA_COLUMN(TOFNSigmaXiLaPr, tofNSigmaXiLaPr, float); //! baryon track NSigma from proton <- lambda <- xi expectation
DECLARE_SOA_COLUMN(TOFNSigmaXiPi, tofNSigmaXiPi, float); //! bachelor track NSigma from pion <- xi expectation
DECLARE_SOA_COLUMN(TOFNSigmaOmLaPi, tofNSigmaOmLaPi, float); //! meson track NSigma from pion <- lambda <- om expectation
DECLARE_SOA_COLUMN(TOFNSigmaOmLaPr, tofNSigmaOmLaPr, float); //! baryon track NSigma from proton <- lambda <- om expectation
DECLARE_SOA_COLUMN(TOFNSigmaOmKa, tofNSigmaOmKa, float); //! bachelor track NSigma from kaon <- om expectation
// dynamics based on n-sigmas with use-only-if-tof-present logic
DECLARE_SOA_DYNAMIC_COLUMN(TofXiCompatibility, tofXiCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
[](float tofNSigmaXiLaPr, float tofNSigmaXiLaPi, float tofNSigmaXiPi, float nsigma) -> float {
bool compatible = true;
if (std::abs(tofNSigmaXiLaPr - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaXiLaPr) > nsigma) {
compatible = false; // reject only if info present and incompatible
}
if (std::abs(tofNSigmaXiLaPi - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaXiLaPi) > nsigma) {
compatible = false; // reject only if info present and incompatible
}
if (std::abs(tofNSigmaXiPi - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaXiPi) > nsigma) {
compatible = false; // reject only if info present and incompatible
}
return compatible;
});
DECLARE_SOA_DYNAMIC_COLUMN(TofOmegaCompatibility, tofOmegaCompatibility, //! compatibility with being lambda, checked only if TOF present. Argument: number of sigmas
[](float tofNSigmaOmLaPr, float tofNSigmaOmLaPi, float tofNSigmaOmKa, float nsigma) -> float {
bool compatible = true;
if (std::abs(tofNSigmaOmLaPr - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaOmLaPr) > nsigma) {
compatible = false; // reject only if info present and incompatible
}
if (std::abs(tofNSigmaOmLaPi - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaOmLaPi) > nsigma) {
compatible = false; // reject only if info present and incompatible
}
if (std::abs(tofNSigmaOmKa - kNoTOFValue) > kEpsilon && std::abs(tofNSigmaOmKa) > nsigma) {
compatible = false; // reject only if info present and incompatible
}
return compatible;
});
} // namespace cascdata
// /-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/
// DEPRECATED - DO NOT USE - KEPT FOR BACKWARDS COMPATIBILITY, TO BE REMOVED
DECLARE_SOA_TABLE(CascTOFs, "AOD", "CascTOF", // raw information table (for debug, etc)
cascdata::PosTOFLengthToPV, cascdata::NegTOFLengthToPV, cascdata::BachTOFLengthToPV,
cascdata::PosTOFSignal, cascdata::NegTOFSignal, cascdata::BachTOFSignal,
cascdata::PosTOFEventTime, cascdata::NegTOFEventTime, cascdata::BachTOFEventTime);
// /-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/-|-\-|-/
DECLARE_SOA_TABLE(CascTOFPIDs, "AOD", "CASCTOFPID", // processed information for analysis
cascdata::PosTOFDeltaTXiPi, cascdata::PosTOFDeltaTXiPr,
cascdata::NegTOFDeltaTXiPi, cascdata::NegTOFDeltaTXiPr,
cascdata::BachTOFDeltaTXiPi,
cascdata::PosTOFDeltaTOmPi, cascdata::PosTOFDeltaTOmPr,
cascdata::NegTOFDeltaTOmPi, cascdata::NegTOFDeltaTOmPr,
cascdata::BachTOFDeltaTOmKa);
DECLARE_SOA_TABLE(CascTOFNSigmas, "AOD", "CascTOFNSigmas", // Nsigmas for cascades
cascdata::TOFNSigmaXiLaPi, cascdata::TOFNSigmaXiLaPr, cascdata::TOFNSigmaXiPi,
cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmKa,
cascdata::TofXiCompatibility<cascdata::TOFNSigmaXiLaPr, cascdata::TOFNSigmaXiLaPi, cascdata::TOFNSigmaXiPi>,
cascdata::TofOmegaCompatibility<cascdata::TOFNSigmaOmLaPr, cascdata::TOFNSigmaOmLaPi, cascdata::TOFNSigmaOmKa>);
} // namespace o2::aod
#endif // PWGLF_DATAMODEL_LFSTRANGENESSPIDTABLES_H_