Skip to content

Commit f32cff4

Browse files
ddobrigkalibuild
andauthored
PWGLF: TOF PID checking hasTOF (#5403)
* PWGLF: TOF PID checking hasTOF * Please consider the following formatting changes (#272) * Change to hasTOF also for cascadePID --------- Co-authored-by: ALICE Builder <alibuild@users.noreply.github.com>
1 parent 191c76a commit f32cff4

2 files changed

Lines changed: 42 additions & 16 deletions

File tree

PWGLF/TableProducer/cascadepid.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -383,19 +383,23 @@ struct cascadepid {
383383
float negDeltaTimeAsOmPi = -1e+6, negDeltaTimeAsOmPr = -1e+6;
384384
float bachDeltaTimeAsOmKa = -1e+6;
385385

386-
if (cascade.posTOFSignal() > 0 && cascade.posTOFEventTime() > 0) {
386+
auto pTra = cascade.posTrackExtra_as<dauTracks>();
387+
auto nTra = cascade.negTrackExtra_as<dauTracks>();
388+
auto bTra = cascade.negTrackExtra_as<dauTracks>();
389+
390+
if (pTra.hasTOF()) {
387391
posDeltaTimeAsXiPi = (cascade.posTOFSignal() - cascade.posTOFEventTime()) - (xiFlight + lambdaFlight + posFlightPi);
388392
posDeltaTimeAsXiPr = (cascade.posTOFSignal() - cascade.posTOFEventTime()) - (xiFlight + lambdaFlight + posFlightPr);
389393
posDeltaTimeAsOmPi = (cascade.posTOFSignal() - cascade.posTOFEventTime()) - (omFlight + lambdaFlight + posFlightPi);
390394
posDeltaTimeAsOmPr = (cascade.posTOFSignal() - cascade.posTOFEventTime()) - (omFlight + lambdaFlight + posFlightPr);
391395
}
392-
if (cascade.negTOFSignal() > 0 && cascade.negTOFEventTime() > 0) {
396+
if (nTra.hasTOF()) {
393397
negDeltaTimeAsXiPi = (cascade.negTOFSignal() - cascade.negTOFEventTime()) - (xiFlight + lambdaFlight + negFlightPi);
394398
negDeltaTimeAsXiPr = (cascade.negTOFSignal() - cascade.negTOFEventTime()) - (xiFlight + lambdaFlight + negFlightPr);
395399
negDeltaTimeAsOmPi = (cascade.negTOFSignal() - cascade.negTOFEventTime()) - (omFlight + lambdaFlight + negFlightPi);
396400
negDeltaTimeAsOmPr = (cascade.negTOFSignal() - cascade.negTOFEventTime()) - (omFlight + lambdaFlight + negFlightPr);
397401
}
398-
if (cascade.bachTOFSignal() > 0 && cascade.bachTOFEventTime() > 0) {
402+
if (bTra.hasTOF()) {
399403
bachDeltaTimeAsXiPi = (cascade.bachTOFSignal() - cascade.bachTOFEventTime()) - (xiFlight + bachFlightPi);
400404
bachDeltaTimeAsOmKa = (cascade.bachTOFSignal() - cascade.bachTOFEventTime()) - (omFlight + bachFlightKa);
401405
}
@@ -407,10 +411,6 @@ struct cascadepid {
407411
);
408412

409413
if (doQA) {
410-
auto pTra = cascade.posTrackExtra_as<dauTracks>();
411-
auto nTra = cascade.negTrackExtra_as<dauTracks>();
412-
auto bTra = cascade.negTrackExtra_as<dauTracks>();
413-
414414
// fill QA histograms for cross-checking
415415
histos.fill(HIST("hArcDebug"), cascade.pt(), lengthCascade - d3d); // for debugging purposes
416416

PWGLF/TableProducer/lambdakzeropid.cxx

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ struct lambdakzeropid {
116116
float maxSnp; // max sine phi for propagation
117117
float maxStep; // max step size (cm) for propagation
118118

119+
// enum to keep track of the TOF-related properties for V0s
120+
enum tofEnum { kLength = 0,
121+
kHasTOF,
122+
kNEnums };
123+
119124
/// function to calculate track length of this track up to a certain segment of a detector
120125
/// to be used internally in another funcrtion that calculates length until it finds the proper one
121126
/// warning: this could be optimised further for speed
@@ -289,6 +294,9 @@ struct lambdakzeropid {
289294
histos.add("h2dDeltaTimePositiveK0ShortPi", "h2dDeltaTimePositiveK0ShortPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}});
290295
histos.add("h2dDeltaTimeNegativeK0ShortPi", "h2dDeltaTimeNegativeK0ShortPi", {HistType::kTH3F, {axisPt, axisEta, axisDeltaTime}});
291296

297+
histos.add("h2dPositiveTOFProperties", "h2dPositiveTOFProperties", {HistType::kTH2F, {axisPt, {4, -0.5, 3.5f}}});
298+
histos.add("h2dNegativeTOFProperties", "h2dNegativeTOFProperties", {HistType::kTH2F, {axisPt, {4, -0.5, 3.5f}}});
299+
292300
if (doQANSigma) {
293301
// standard NSigma values
294302
histos.add("h2dNSigmaPositiveLambdaPi", "h2dNSigmaPositiveLambdaPi", {HistType::kTH2F, {axisPt, axisNSigma}});
@@ -411,6 +419,9 @@ struct lambdakzeropid {
411419
o2::track::TrackPar posTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxpos(), v0.pypos(), v0.pzpos()}, +1);
412420
o2::track::TrackPar negTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxneg(), v0.pyneg(), v0.pzneg()}, -1);
413421

422+
auto pTra = v0.posTrackExtra_as<dauTracks>();
423+
auto nTra = v0.negTrackExtra_as<dauTracks>();
424+
414425
float deltaTimePositiveLambdaPi = -1e+6;
415426
float deltaTimeNegativeLambdaPi = -1e+6;
416427
float deltaTimePositiveLambdaPr = -1e+6;
@@ -437,20 +448,38 @@ struct lambdakzeropid {
437448
float timeNegativePr = lengthNegative / velocityNegativePr;
438449
float timeNegativePi = lengthNegative / velocityNegativePi;
439450

440-
if (v0.posTOFSignal() > 0 && v0.posTOFEventTime() > 0 && lengthPositive > 0) {
451+
if (pTra.hasTOF() && lengthPositive > 0) {
441452
deltaTimePositiveLambdaPr = (v0.posTOFSignal() - v0.posTOFEventTime()) - (timeLambda + timePositivePr);
442453
deltaTimePositiveLambdaPi = (v0.posTOFSignal() - v0.posTOFEventTime()) - (timeLambda + timePositivePi);
443454
deltaTimePositiveK0ShortPi = (v0.posTOFSignal() - v0.posTOFEventTime()) - (timeK0Short + timePositivePi);
444455
}
445-
if (v0.negTOFSignal() > 0 && v0.negTOFEventTime() > 0 && lengthNegative > 0) {
456+
if (nTra.hasTOF() && lengthNegative > 0) {
446457
deltaTimeNegativeLambdaPr = (v0.negTOFSignal() - v0.negTOFEventTime()) - (timeLambda + timeNegativePr);
447458
deltaTimeNegativeLambdaPi = (v0.negTOFSignal() - v0.negTOFEventTime()) - (timeLambda + timeNegativePi);
448459
deltaTimeNegativeK0ShortPi = (v0.negTOFSignal() - v0.negTOFEventTime()) - (timeK0Short + timeNegativePi);
449460
}
461+
462+
if (doQA) {
463+
// calculate and pack properties for QA purposes
464+
int posProperties = 0;
465+
if (lengthPositive > 0)
466+
posProperties = posProperties | (int(1) << kLength);
467+
if (pTra.hasTOF())
468+
posProperties = posProperties | (int(1) << kHasTOF);
469+
int negProperties = 0;
470+
if (lengthNegative > 0)
471+
negProperties = negProperties | (int(1) << kLength);
472+
if (nTra.hasTOF())
473+
negProperties = negProperties | (int(1) << kHasTOF);
474+
475+
histos.fill(HIST("h2dPositiveTOFProperties"), v0.pt(), posProperties);
476+
histos.fill(HIST("h2dNegativeTOFProperties"), v0.pt(), negProperties);
477+
}
478+
450479
float deltaDecayTimeLambda = -10e+4;
451480
float deltaDecayTimeAntiLambda = -10e+4;
452481
float deltaDecayTimeK0Short = -10e+4;
453-
if (v0.posTOFSignal() > 0 && v0.negTOFSignal() > 0 && lengthPositive > 0 && lengthNegative > 0) { // does not depend on event time
482+
if (nTra.hasTOF() && pTra.hasTOF() > 0 && lengthPositive > 0 && lengthNegative > 0) { // does not depend on event time
454483
deltaDecayTimeLambda = (v0.posTOFSignal() - timePositivePr) - (v0.negTOFSignal() - timeNegativePi);
455484
deltaDecayTimeAntiLambda = (v0.posTOFSignal() - timePositivePi) - (v0.negTOFSignal() - timeNegativePr);
456485
deltaDecayTimeK0Short = (v0.posTOFSignal() - timePositivePi) - (v0.negTOFSignal() - timeNegativePi);
@@ -467,7 +496,7 @@ struct lambdakzeropid {
467496
float betaAntiLambda = -1e+6;
468497
float betaK0Short = -1e+6;
469498

470-
if (v0.posTOFSignal() > 0 && v0.negTOFSignal() > 0 && v0.posTOFEventTime() > 0 && v0.negTOFEventTime() > 0) {
499+
if (nTra.hasTOF() && pTra.hasTOF()) {
471500
betaLambda = (lengthV0 / decayTimeLambda) / 0.0299792458;
472501
betaAntiLambda = (lengthV0 / decayTimeAntiLambda) / 0.0299792458;
473502
betaK0Short = (lengthV0 / decayTimeK0Short) / 0.0299792458;
@@ -505,10 +534,7 @@ struct lambdakzeropid {
505534
}
506535

507536
if (doQA) {
508-
auto pTra = v0.posTrackExtra_as<dauTracks>();
509-
auto nTra = v0.negTrackExtra_as<dauTracks>();
510-
511-
if (v0.posTOFSignal() > 0 && v0.posTOFEventTime() > 0) {
537+
if (pTra.hasTOF()) {
512538
histos.fill(HIST("h2dProtonMeasuredVsExpected"),
513539
(timeLambda + timePositivePr),
514540
(v0.posTOFSignal() - v0.posTOFEventTime()));
@@ -531,7 +557,7 @@ struct lambdakzeropid {
531557
}
532558
}
533559

534-
if (v0.negTOFSignal() > 0 && v0.negTOFEventTime() > 0) {
560+
if (nTra.hasTOF()) {
535561
histos.fill(HIST("h2dPionMeasuredVsExpected"),
536562
(timeLambda + timeNegativePi),
537563
(v0.negTOFSignal() - v0.negTOFEventTime()));

0 commit comments

Comments
 (0)