From 6159e4143bb6501a3ea58dda44fda5051c50df66 Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Sat, 30 Aug 2025 10:27:46 +0200 Subject: [PATCH 1/8] Latest test developments --- .../Strangeness/strangenesstofpid.cxx | 543 ++++++++++++------ 1 file changed, 376 insertions(+), 167 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index c9f4d76b726..0c5af3817e2 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -100,6 +100,12 @@ struct strangenesstofpid { Configurable calculateV0s{"calculateV0s", -1, "calculate V0-related TOF PID (0: no, 1: yes, -1: auto)"}; Configurable calculateCascades{"calculateCascades", -1, "calculate cascade-related TOF PID (0: no, 1: yes, -1: auto)"}; Configurable correctELossInclination{"correctELossInclination", true, "factor out inclination when doing effective e-loss correction (0: no, 1: yes)"}; + Configurable numberOfAlphaRotations{"numberOfAlphaRotations", 6, "Max number of alpha rotations to attempt before converging"}; + + // regulate e-loss calculation to save CPU + Configurable maxPionMomentumForEloss{"maxPionMomentumForEloss",1.0f, "above this momentum, do fast analytical TOF calculation for pions"}; + Configurable maxKaonMomentumForEloss{"maxKaonMomentumForEloss",1.5f, "above this momentum, do fast analytical TOF calculation for kaons"}; + Configurable maxProtonMomentumForEloss{"maxProtonMomentumForEloss",2.f, "above this momentum, do fast analytical TOF calculation for protons"}; // Operation and minimisation criteria Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; @@ -108,6 +114,7 @@ struct strangenesstofpid { Configurable doNSigmas{"doNSigmas", false, "calculate TOF N-sigma"}; Configurable doQANSigma{"doQANSigma", true, "create QA of Nsigma histos"}; + // configurables related to V0s struct : ConfigurableGroup { std::string prefix = "v0Calibration"; @@ -150,6 +157,7 @@ struct strangenesstofpid { ConfigurableAxis axisTime{"axisTime", {400, 10000.0f, +50000.0f}, "T (ps)"}; ConfigurableAxis axisNSigma{"axisNSigma", {200, -10.0f, +10.0f}, "N(#sigma)"}; ConfigurableAxis axisRatioMethods{"axisRatioMethods", {400, 0.9f, 1.9f}, "T_{method 1}/T_{method 0}"}; + ConfigurableAxis axisSnp{"axisSnp", {220, -1.1f, 1.1f}, "snp"}; // master p axis ConfigurableAxis axisP{"axisP", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "p_{T} (GeV/c)"}; @@ -307,8 +315,9 @@ struct strangenesstofpid { float x2 = TMath::Cos(theta) * (+halfWidth) + TMath::Sin(theta) * tofPosition; float y2 = -TMath::Sin(theta) * (+halfWidth) + TMath::Cos(theta) * tofPosition; float thisLength = trackLengthToSegment(track, x1, y1, x2, y2, magneticField); - if (thisLength < length && thisLength > 0) + if (thisLength < length && thisLength > 0){ length = thisLength; + } } if (length > 1e+5) length = -100; // force negative to avoid misunderstandings @@ -340,55 +349,168 @@ struct strangenesstofpid { float trackX = -100; static constexpr float MAX_SIN_PHI = 0.85f; static constexpr float MAX_STEP = 2.0f; + static constexpr float MAX_STEP_LABR = 2.0f; static constexpr float MAX_STEP_FINAL_STAGE = 0.5f; static constexpr float MAX_FINAL_X = 390.0f; // maximum extra X on top of TOF X for correcting value - bool trackOK = track.getXatLabR(tofPosition, trackX, d_bz); - if (trackOK) { - // propagate outwards to TOF: bulk of propagation - o2::base::Propagator::Instance()->propagateToX(track, trackX, d_bz, MAX_SIN_PHI, MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrLUT, <Integral); - - // mark start position, define variables - std::array xyz; - track.getXYZGlo(xyz); - float segmentedR = segmentedRadius(xyz[0], xyz[1]); - float currentTime = ltIntegral.getTOF(track.getPID()); - if (calculationMethod.value == 2) { - histos.fill(HIST("hTOFPosition"), xyz[0], xyz[1]); // for debugging purposes + //____________________________________________________________ + // stage 1: propagate to TOF-inscribed circle at tofPosition + + // define standard variables + std::array xyz; + std::array pxpypz; + track.getXYZGlo(xyz); + float segmentedRstart = segmentedRadius(xyz[0], xyz[1]); + + bool firstPropag; + for(int iRot = 0; iRot < numberOfAlphaRotations.value; iRot++){ + track.rotateParam(track.getPhi()); // start rotated + float currentX = track.getX(); + float tofX = currentX; + bool getXatLabRok = track.getXatLabR(tofPosition, tofX, d_bz, o2::track::DirOutward); + if(std::abs(tofX-currentX)<10.0f){ + // signal conclusion + histos.fill(HIST("hAlphaRotations"), iRot); // store number of steps + break; } + float nextX = std::min(currentX + MAX_STEP_LABR,tofX); + firstPropag = o2::base::Propagator::Instance()->propagateToX(track, nextX, d_bz, MAX_SIN_PHI, MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrLUT, <Integral); + } + + // bool firstPropag = o2::base::Propagator::Instance()->propagateToX(track, trackX, d_bz, MAX_SIN_PHI, MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrLUT, <Integral); + + // if(!firstPropag){ + + // float attemptPartial = tofPosition*(1.0f - 1.0f/static_cast(iRot+1.333)); + // track.getPxPyPzGlo(pxpypz); + // track.rotateParam(std::atan2(pxpypz[1], pxpypz[0])); + // trackOK = track.getXatLabR(attemptPartial, trackX, d_bz, o2::track::DirOutward); + // firstPropag = o2::base::Propagator::Instance()->propagateToX(track, trackX, d_bz, MAX_SIN_PHI, MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrLUT, <Integral); + // track.getXYZGlo(xyz); + // if(firstPropag && std::abs(segmentedRadius(xyz[0], xyz[1])-tofPosition)<10.0f){ + // // close enough, stop + // histos.fill(HIST("hAlphaRotations"), iRot+1); // for debugging purposes + // break; //stop 'for' if successful + // } + // } + // } + // } + + // mark start position of next step + track.getXYZGlo(xyz); + float snp = track.getSnp(); + float segmentedR = segmentedRadius(xyz[0], xyz[1]); + float segmentedRintermediate = segmentedR; + histos.fill(HIST("hSegRadiusFirstPropagVsStart"), segmentedRstart, segmentedR); // for debugging purposes + float currentTime = ltIntegral.getTOF(track.getPID()); + if (calculationMethod.value == 2) { + histos.fill(HIST("hSnp"), track.getSnp()); // for debugging purposes + histos.fill(HIST("hTOFPosition"), xyz[0], xyz[1]); // for debugging purposes + histos.fill(HIST("hSegRadius"), segmentedR); // for debugging purposes + if(!firstPropag){ + histos.fill(HIST("hTOFPositionFirstPropagFail"), xyz[0], xyz[1]); // for debugging purposes + histos.fill(HIST("hSegRadiusFirstPropagFail"), segmentedR); // for debugging purposes + histos.fill(HIST("hSnpFirstPropagFail"), track.getSnp()); // for debugging purposes + } + } - // correct for TOF segmentation - float trackXextra = trackX; - bool trackOKextra = true; - while (trackXextra < MAX_FINAL_X) { - // propagate one step further - trackXextra += MAX_STEP_FINAL_STAGE; - trackOKextra = o2::base::Propagator::Instance()->propagateToX(track, trackXextra, d_bz, MAX_SIN_PHI, MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrLUT, <Integral); - if (!trackOKextra) { - time = -1e+6; - return; // propagation failed, skip, won't look reasonable + // correct for TOF segmentation + float trackXextra = track.getX(); + bool trackOKextra = true; + int propagationSteps = 0; + while (trackXextra < MAX_FINAL_X && propagationSteps < 1000) { + // continue with alpha aligned with pT + track.getPxPyPzGlo(pxpypz); + track.rotateParam(std::atan2(pxpypz[1], pxpypz[0])); + trackXextra = track.getX() + MAX_STEP_FINAL_STAGE; + trackOKextra = o2::base::Propagator::Instance()->propagateToX(track, trackXextra, d_bz, MAX_SIN_PHI, MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrLUT, <Integral); + if (!trackOKextra) { + if (calculationMethod.value == 2) { + track.getXYZGlo(xyz); + histos.fill(HIST("hTOFPositionStopped"), xyz[0], xyz[1]); // for debugging purposes + histos.fill(HIST("hSnpStopped"), snp); // for debugging purposes + histos.fill(HIST("hSegRadiusStopped"), segmentedRadius(xyz[0], xyz[1])); // for debugging purposes + histos.fill(HIST("hSegRadiusStoppedVsFirstPropag"), segmentedRintermediate, segmentedRadius(xyz[0], xyz[1])); // for debugging purposes } + time = -1e+6; + return; // propagation failed, skip, won't look reasonable + } - // re-evaluate - did we cross? if yes break - float previousX = xyz[0], previousY = xyz[1]; - track.getXYZGlo(xyz); - if (segmentedRadius(xyz[0], xyz[1]) > tofPosition) { - // crossed boundary -> do proportional scaling with how much we actually crossed the boundary - float segmentedRFinal = segmentedRadius(xyz[0], xyz[1]); - float timeFinal = ltIntegral.getTOF(track.getPID()); - float fraction = (tofPosition - segmentedR) / (segmentedRFinal - segmentedR + 1e-6); // proportional fraction - time = currentTime + (timeFinal - currentTime) * fraction; - if (calculationMethod.value == 2) { - histos.fill(HIST("hTOFPositionFinal"), previousX + fraction * (xyz[0] - previousX), previousY + fraction * (xyz[1] - previousY)); // for debugging purposes - } - return; // get out of the entire function and return (don't just break) + // re-evaluate - did we cross? if yes break + float previousX = xyz[0], previousY = xyz[1]; + track.getXYZGlo(xyz); + if (segmentedRadius(xyz[0], xyz[1]) > tofPosition) { + // crossed boundary -> do proportional scaling with how much we actually crossed the boundary + float segmentedRFinal = segmentedRadius(xyz[0], xyz[1]); + float timeFinal = ltIntegral.getTOF(track.getPID()); + float fraction = (tofPosition - segmentedR) / (segmentedRFinal - segmentedR + 1e-6); // proportional fraction + time = currentTime + (timeFinal - currentTime) * fraction; + if (calculationMethod.value == 2) { + histos.fill(HIST("hTOFPositionFinal"), previousX + fraction * (xyz[0] - previousX), previousY + fraction * (xyz[1] - previousY)); // for debugging purposes + histos.fill(HIST("hSegRadiusFinal"), segmentedRadius(previousX + fraction * (xyz[0] - previousX), previousY + fraction * (xyz[1] - previousY))); // for debugging purposes + histos.fill(HIST("hSnpFinal"), track.getSnp()); // for debugging purposes + histos.fill(HIST("hSegRadiusFinalVsFirstPropag"), segmentedRintermediate, segmentedRadius(previousX + fraction * (xyz[0] - previousX), previousY + fraction * (xyz[1] - previousY))); // for debugging purposes } - - // prepare for next step by setting current position and desired variables - segmentedR = segmentedRadius(xyz[0], xyz[1]); - currentTime = ltIntegral.getTOF(track.getPID()); + histos.fill(HIST("hPropagationSteps"), propagationSteps, 1.0f); // for debugging purposes + return; // get out of the entire function and return (don't just break) } + + // prepare for next step by setting current position and desired variables + segmentedR = segmentedRadius(xyz[0], xyz[1]); + currentTime = ltIntegral.getTOF(track.getPID()); + propagationSteps++; } + histos.fill(HIST("hPropagationSteps"), propagationSteps, 0.0f); // for debugging purposes + track.getXYZGlo(xyz); + histos.fill(HIST("hSegRadiusGotLost"), segmentedRadius(xyz[0], xyz[1])); // for debugging purposes + + // newton's method quantities + // float deltaX = 1.0f; // size of X change to calculate derivative + // float deltaY = 0.0f; // estimated change in segmented radius + // float targetPrecision = 0.25; // precision expected in finding TOF + // float slowFactor = 0.75f; // regulate convergence + // float nextX = track.getX(); // + // // LOGF(info, "started at segmented radius %.1f", segmentedR); + // int propagationSteps = 0; + // while(propagationSteps < 1000){ + // track.rotateParam(track.getPhi()); + // float trackX = track.getX(); + // track.getXYZGlo(xyz); + // float segmentedR1 = std::abs(segmentedRadius(xyz[0], xyz[1])-tofPosition); + // bool trackOKextra = o2::base::Propagator::Instance()->propagateToX(track, trackX+deltaX, d_bz, MAX_SIN_PHI, MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrLUT, <Integral); + // if (!trackOKextra) { + // // LOGF(info, "failed propagation from %.3f to %.3f, this has momentum of %.3f and is at segRad %.3f", trackX, trackX+deltaX, track.getP(), segmentedR1); + // track.getXYZGlo(xyz); + // histos.fill(HIST("hTOFPositionStopped"), xyz[0], xyz[1]); // for debugging purposes + // histos.fill(HIST("hSnpStopped"), snp); // for debugging purposes + // histos.fill(HIST("hSegRadiusStopped"), segmentedRadius(xyz[0], xyz[1])); // for debugging purposes + // histos.fill(HIST("hSegRadiusStoppedVsFirstPropag"), segmentedRintermediate, segmentedRadius(xyz[0], xyz[1])); // for debugging purposes + // return; + // } + // track.getXYZGlo(xyz); + // float segmentedR2 = std::abs(segmentedRadius(xyz[0], xyz[1])-tofPosition); + // deltaY = (segmentedR2 - segmentedR1); + // if(std::abs(deltaY)<0.1f){ + // deltaY=0.1f; // don't exaggerate in case the derivative makes this relatively unstable + // } + + // nextX = trackX - slowFactor*(segmentedR2)*deltaX/deltaY; + // // LOGF(info, "step %i segRad1 %.2f SegRad 2 %.2f current X %.2f next X %.2f, bool %i", propagationSteps, segmentedR1, segmentedR1, trackX, nextX, trackOKextra); + // trackOKextra = o2::base::Propagator::Instance()->propagateToX(track, nextX, d_bz, MAX_SIN_PHI, MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrLUT, <Integral); + + // track.getXYZGlo(xyz); + // if(std::abs(segmentedRadius(xyz[0], xyz[1])-tofPosition)getForRun(ccdbConfigurations.lutPath, runNumber)); o2::base::Propagator::Instance()->setMatLUT(lut); + o2::base::Propagator::Instance()->setTGeoFallBackAllowed(false); LOG(info) << "Material look-up table loaded!"; } mRunNumber = runNumber; @@ -691,8 +840,8 @@ struct strangenesstofpid { float timeLambda = lengthV0 / velocityLambda; // in picoseconds // initialize from V0 position and momenta - o2::track::TrackPar posTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxpos(), v0.pypos(), v0.pzpos()}, +1); - o2::track::TrackPar negTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxneg(), v0.pyneg(), v0.pzneg()}, -1); + o2::track::TrackPar posTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxpos(), v0.pypos(), v0.pzpos()}, +1, false); + o2::track::TrackPar negTrack = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, {v0.pxneg(), v0.pyneg(), v0.pzneg()}, -1, false); // at minimum float positiveP = std::hypot(v0.pxpos(), v0.pypos(), v0.pzpos()); @@ -727,20 +876,21 @@ struct strangenesstofpid { float timeNegativePr_Method1 = o2::aod::v0data::kNoTOFValue; float timeNegativePi_Method1 = o2::aod::v0data::kNoTOFValue; - if (calculationMethod.value == 0 || calculationMethod.value == 2) { - float velocityPositivePr = velocity(posTrack.getP(), o2::constants::physics::MassProton); - float velocityPositivePi = velocity(posTrack.getP(), o2::constants::physics::MassPionCharged); - float velocityNegativePr = velocity(negTrack.getP(), o2::constants::physics::MassProton); - float velocityNegativePi = velocity(negTrack.getP(), o2::constants::physics::MassPionCharged); + float velocityPositivePr = velocity(posTrack.getP(), o2::constants::physics::MassProton); + float velocityPositivePi = velocity(posTrack.getP(), o2::constants::physics::MassPionCharged); + float velocityNegativePr = velocity(negTrack.getP(), o2::constants::physics::MassProton); + float velocityNegativePi = velocity(negTrack.getP(), o2::constants::physics::MassPionCharged); + if (pTra.hasTOF() && pTra.hasITS()) { float lengthPositive = findInterceptLength(posTrack, d_bz); // FIXME: tofPosition ok? adjust? - float lengthNegative = findInterceptLength(negTrack, d_bz); // FIXME: tofPosition ok? adjust? - - if (lengthPositive > 0) { + if(lengthPositive > 0){ timePositivePr_Method0 = lengthPositive / velocityPositivePr; timePositivePi_Method0 = lengthPositive / velocityPositivePi; } - if (lengthNegative > 0) { + } + if (nTra.hasTOF() && nTra.hasITS()) { + float lengthNegative = findInterceptLength(negTrack, d_bz); // FIXME: tofPosition ok? adjust? + if (lengthNegative > 0){ timeNegativePr_Method0 = lengthNegative / velocityNegativePr; timeNegativePi_Method0 = lengthNegative / velocityNegativePi; } @@ -748,23 +898,38 @@ struct strangenesstofpid { if (calculationMethod.value > 0) { // method to calculate the time and length via Propagator TrackLTIntegral - if (pTra.hasTOF()) { // calculate if signal present, otherwise skip - o2::track::TrackPar posTrackAsProton(posTrack); - posTrackAsProton.setPID(o2::track::PID::Proton); - calculateTOF(posTrackAsProton, timePositivePr_Method1); - - o2::track::TrackPar posTrackAsPion(posTrack); - posTrackAsPion.setPID(o2::track::PID::Pion); - calculateTOF(posTrackAsPion, timePositivePi_Method1); + if (pTra.hasTOF() && pTra.hasITS()) { // calculate if signal present, otherwise skip + if(posTrack.getP() 0) { + if (calculationMethod.value == 2){ + //do analysis of successes and failures + bool positiveSuccessMethod0 = std::abs(timePositivePr_Method0-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; + bool negativeSuccessMethod0 = std::abs(timeNegativePr_Method0-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; + bool positiveSuccessMethod1 = std::abs(timePositivePr_Method1-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; + bool negativeSuccessMethod1 = std::abs(timeNegativePr_Method1-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; + bool positiveSuccessMethod0Pi = std::abs(timePositivePi_Method0-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; + bool negativeSuccessMethod0Pi = std::abs(timeNegativePi_Method0-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; + bool positiveSuccessMethod1Pi = std::abs(timePositivePi_Method1-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; + bool negativeSuccessMethod1Pi = std::abs(timeNegativePi_Method1-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; + if(pTra.hasTOF()){ + histos.fill(HIST("hSuccessCorrelationProton"), positiveSuccessMethod0, positiveSuccessMethod1); + histos.fill(HIST("hSuccessCorrelationPion"), positiveSuccessMethod0Pi, positiveSuccessMethod1Pi); + } + if(nTra.hasTOF()){ + histos.fill(HIST("hSuccessCorrelationProton"), negativeSuccessMethod0, negativeSuccessMethod1); + histos.fill(HIST("hSuccessCorrelationPion"), negativeSuccessMethod0Pi, negativeSuccessMethod1Pi); + } + } + + if (pTra.hasTOF() && pTra.hasITS() && timePositivePr > 0) { deltaTimePositiveLambdaPr = (pTra.tofSignal() - pTra.tofEvTime()) - (timeLambda + timePositivePr); deltaTimePositiveLambdaPi = (pTra.tofSignal() - pTra.tofEvTime()) - (timeLambda + timePositivePi); deltaTimePositiveK0ShortPi = (pTra.tofSignal() - pTra.tofEvTime()) - (timeK0Short + timePositivePi); } - if (nTra.hasTOF() && timeNegativePr > 0) { + if (nTra.hasTOF() && nTra.hasITS() && timeNegativePr > 0) { deltaTimeNegativeLambdaPr = (nTra.tofSignal() - nTra.tofEvTime()) - (timeLambda + timeNegativePr); deltaTimeNegativeLambdaPi = (nTra.tofSignal() - nTra.tofEvTime()) - (timeLambda + timeNegativePi); deltaTimeNegativeK0ShortPi = (nTra.tofSignal() - nTra.tofEvTime()) - (timeK0Short + timeNegativePi); @@ -812,7 +997,7 @@ struct strangenesstofpid { float deltaDecayTimeLambda = -10e+4; float deltaDecayTimeAntiLambda = -10e+4; float deltaDecayTimeK0Short = -10e+4; - if (nTra.hasTOF() && pTra.hasTOF() > 0 && timePositivePr > 0 && timeNegativePr > 0) { // does not depend on event time + if (nTra.hasTOF() && pTra.hasTOF() && timePositivePr > 0 && timeNegativePr > 0) { // does not depend on event time deltaDecayTimeLambda = (pTra.tofSignal() - timePositivePr) - (nTra.tofSignal() - timeNegativePi); deltaDecayTimeAntiLambda = (pTra.tofSignal() - timePositivePi) - (nTra.tofSignal() - timeNegativePr); deltaDecayTimeK0Short = (pTra.tofSignal() - timePositivePi) - (nTra.tofSignal() - timeNegativePi); @@ -873,13 +1058,13 @@ struct strangenesstofpid { negativeCosine = positiveCosine = 1.0f; } - if (pTra.hasTOF()) { + if (pTra.hasTOF() && pTra.hasITS()) { if (v0.v0cosPA() > v0Group.qaCosPA && v0.dcaV0daughters() < v0Group.qaDCADau) { if (std::abs(v0.mLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && ((v0pdg == 0) || (v0pdg == 3122))) { histos.fill(HIST("h2dDeltaTimePositiveLambdaPr"), v0.p(), v0.eta(), deltaTimePositiveLambdaPr); if (calculationMethod.value == 2 && std::abs(timePositivePr_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon && std::abs(timePositivePr_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_posLaPr"), positiveP, v0.positiveeta(), (timePositivePr_Method0 - timePositivePr_Method1) * positiveCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_posLaPr"), positiveP, v0.positiveeta(), (timePositivePr_Method1 / timePositivePr_Method0) * positiveCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_posLaPr"), positiveP, (timePositivePr_Method0 - timePositivePr_Method1) * positiveCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_posLaPr"), positiveP, (timePositivePr_Method1 / timePositivePr_Method0) * positiveCosine); } if (doQANSigma) histos.fill(HIST("h2dNSigmaPositiveLambdaPr"), v0.p(), nSigmaPositiveLambdaPr); @@ -887,8 +1072,8 @@ struct strangenesstofpid { if (std::abs(v0.mAntiLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma && ((v0pdg == 0) || (v0pdg == -3122))) { histos.fill(HIST("h2dDeltaTimePositiveLambdaPi"), v0.p(), v0.eta(), deltaTimePositiveLambdaPi); if (calculationMethod.value == 2 && std::abs(timePositivePi_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon && std::abs(timePositivePi_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_posLaPi"), positiveP, v0.positiveeta(), (timePositivePi_Method0 - timePositivePi_Method1) * positiveCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_posLaPi"), positiveP, v0.positiveeta(), (timePositivePi_Method1 / timePositivePi_Method0) * positiveCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_posLaPi"), positiveP, (timePositivePi_Method0 - timePositivePi_Method1) * positiveCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_posLaPi"), positiveP, (timePositivePi_Method1 / timePositivePi_Method0) * positiveCosine); } if (doQANSigma) histos.fill(HIST("h2dNSigmaPositiveLambdaPi"), v0.p(), nSigmaPositiveLambdaPi); @@ -896,8 +1081,8 @@ struct strangenesstofpid { if (std::abs(v0.mK0Short() - 0.497) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && ((v0pdg == 0) || (v0pdg == 310))) { histos.fill(HIST("h2dDeltaTimePositiveK0ShortPi"), v0.p(), v0.eta(), deltaTimePositiveK0ShortPi); if (calculationMethod.value == 2 && std::abs(timePositivePi_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon && std::abs(timePositivePi_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_posK0Pi"), positiveP, v0.positiveeta(), (timePositivePi_Method0 - timePositivePi_Method1) * positiveCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_posK0Pi"), positiveP, v0.positiveeta(), (timePositivePi_Method1 / timePositivePi_Method0) * positiveCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_posK0Pi"), positiveP, (timePositivePi_Method0 - timePositivePi_Method1) * positiveCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_posK0Pi"), positiveP, (timePositivePi_Method1 / timePositivePi_Method0) * positiveCosine); } if (doQANSigma) histos.fill(HIST("h2dNSigmaPositiveK0ShortPi"), v0.p(), nSigmaPositiveK0ShortPi); @@ -905,13 +1090,13 @@ struct strangenesstofpid { } } - if (nTra.hasTOF()) { + if (nTra.hasTOF() && nTra.hasITS()) { if (v0.v0cosPA() > v0Group.qaCosPA && v0.dcaV0daughters() < v0Group.qaDCADau) { if (std::abs(v0.mLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && ((v0pdg == 0) || (v0pdg == 3122))) { histos.fill(HIST("h2dDeltaTimeNegativeLambdaPi"), v0.p(), v0.eta(), deltaTimeNegativeLambdaPi); if (calculationMethod.value == 2 && std::abs(timeNegativePi_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon && std::abs(timeNegativePi_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_negLaPi"), negativeP, v0.negativeeta(), (timeNegativePi_Method0 - timeNegativePi_Method1) * negativeCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_negLaPi"), negativeP, v0.negativeeta(), (timeNegativePi_Method1 / timeNegativePi_Method0) * negativeCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_negLaPi"), negativeP, (timeNegativePi_Method0 - timeNegativePi_Method1) * negativeCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_negLaPi"), negativeP, (timeNegativePi_Method1 / timeNegativePi_Method0) * negativeCosine); } if (doQANSigma) histos.fill(HIST("h2dNSigmaNegativeLambdaPi"), v0.p(), nSigmaNegativeLambdaPi); @@ -919,8 +1104,8 @@ struct strangenesstofpid { if (std::abs(v0.mAntiLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma && ((v0pdg == 0) || (v0pdg == -3122))) { histos.fill(HIST("h2dDeltaTimeNegativeLambdaPr"), v0.p(), v0.eta(), deltaTimeNegativeLambdaPr); if (calculationMethod.value == 2 && std::abs(timeNegativePr_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon && std::abs(timeNegativePr_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_negLaPr"), negativeP, v0.negativeeta(), (timeNegativePr_Method0 - timeNegativePr_Method1) * negativeCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_negLaPr"), negativeP, v0.negativeeta(), (timeNegativePr_Method1 / timeNegativePr_Method0) * negativeCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_negLaPr"), negativeP, (timeNegativePr_Method0 - timeNegativePr_Method1) * negativeCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_negLaPr"), negativeP, (timeNegativePr_Method1 / timeNegativePr_Method0) * negativeCosine); } if (doQANSigma) histos.fill(HIST("h2dNSigmaNegativeLambdaPr"), v0.p(), nSigmaNegativeLambdaPr); @@ -928,8 +1113,8 @@ struct strangenesstofpid { if (std::abs(v0.mK0Short() - 0.497) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && ((v0pdg == 0) || (v0pdg == 310))) { histos.fill(HIST("h2dDeltaTimeNegativeK0ShortPi"), v0.p(), v0.eta(), deltaTimeNegativeK0ShortPi); if (calculationMethod.value == 2 && std::abs(timeNegativePi_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon && std::abs(timeNegativePi_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_negK0Pi"), negativeP, v0.negativeeta(), (timeNegativePi_Method0 - timeNegativePi_Method1) * negativeCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_negK0Pi"), negativeP, v0.negativeeta(), (timeNegativePi_Method1 / timeNegativePi_Method0) * negativeCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_negK0Pi"), negativeP, (timeNegativePi_Method0 - timeNegativePi_Method1) * negativeCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_negK0Pi"), negativeP, (timeNegativePi_Method1 / timeNegativePi_Method0) * negativeCosine); } if (doQANSigma) histos.fill(HIST("h2dNSigmaNegativeK0ShortPi"), v0.p(), nSigmaNegativeK0ShortPi); @@ -945,10 +1130,10 @@ struct strangenesstofpid { void processCascadeCandidate(TCollision const& collision, TCascade const& cascade, TTrack const& pTra, TTrack const& nTra, TTrack const& bTra, int cascpdg) { // initialize from positions and momenta as needed - o2::track::TrackPar posTrack = o2::track::TrackPar({cascade.xlambda(), cascade.ylambda(), cascade.zlambda()}, {cascade.pxpos(), cascade.pypos(), cascade.pzpos()}, +1); - o2::track::TrackPar negTrack = o2::track::TrackPar({cascade.xlambda(), cascade.ylambda(), cascade.zlambda()}, {cascade.pxneg(), cascade.pyneg(), cascade.pzneg()}, -1); - o2::track::TrackPar bachTrack = o2::track::TrackPar({cascade.x(), cascade.y(), cascade.z()}, {cascade.pxbach(), cascade.pybach(), cascade.pzbach()}, cascade.sign()); - o2::track::TrackPar cascTrack = o2::track::TrackPar({cascade.x(), cascade.y(), cascade.z()}, {cascade.px(), cascade.py(), cascade.pz()}, cascade.sign()); + o2::track::TrackPar posTrack = o2::track::TrackPar({cascade.xlambda(), cascade.ylambda(), cascade.zlambda()}, {cascade.pxpos(), cascade.pypos(), cascade.pzpos()}, +1, false); + o2::track::TrackPar negTrack = o2::track::TrackPar({cascade.xlambda(), cascade.ylambda(), cascade.zlambda()}, {cascade.pxneg(), cascade.pyneg(), cascade.pzneg()}, -1, false); + o2::track::TrackPar bachTrack = o2::track::TrackPar({cascade.x(), cascade.y(), cascade.z()}, {cascade.pxbach(), cascade.pybach(), cascade.pzbach()}, cascade.sign(), false); + o2::track::TrackPar cascTrack = o2::track::TrackPar({cascade.x(), cascade.y(), cascade.z()}, {cascade.px(), cascade.py(), cascade.pz()}, cascade.sign(), false); float positiveP = std::hypot(cascade.pxpos(), cascade.pypos(), cascade.pzpos()); float negativeP = std::hypot(cascade.pxneg(), cascade.pyneg(), cascade.pzneg()); @@ -1024,47 +1209,71 @@ struct strangenesstofpid { float lengthNegative = findInterceptLength(negTrack, d_bz); // FIXME: tofPosition ok? adjust? float lengthBachelor = findInterceptLength(bachTrack, d_bz); // FIXME: tofPosition ok? adjust? - if (lengthPositive > 0) { + if (lengthPositive > 0 && pTra.hasTOF() && pTra.hasITS()) { posFlightPi_Method0 = lengthPositive / velocityPositivePi; posFlightPr_Method0 = lengthPositive / velocityPositivePr; } - if (lengthNegative > 0) { + if (lengthNegative > 0 && nTra.hasTOF() && nTra.hasITS()) { negFlightPi_Method0 = lengthNegative / velocityNegativePi; negFlightPr_Method0 = lengthNegative / velocityNegativePr; } - if (lengthBachelor > 0) { + if (lengthBachelor > 0 && bTra.hasTOF() && bTra.hasITS()) { bachFlightPi_Method0 = lengthBachelor / velocityBachelorPi; bachFlightKa_Method0 = lengthBachelor / velocityBachelorKa; } } if (calculationMethod.value > 0) { - if (pTra.hasTOF()) { // calculate if signal present, otherwise skip - o2::track::TrackPar posTrackAsProton(posTrack); - posTrackAsProton.setPID(o2::track::PID::Proton); - calculateTOF(posTrackAsProton, posFlightPr_Method1); - - o2::track::TrackPar posTrackAsPion(posTrack); - posTrackAsPion.setPID(o2::track::PID::Pion); - calculateTOF(posTrackAsPion, posFlightPi_Method1); + if (pTra.hasTOF() && pTra.hasITS()) { // calculate if signal present, otherwise skip + if(posTrack.getP() o2::aod::cascdata::kEpsilon && std::abs(posFlightPr_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_posXiPr"), positiveP, cascade.positiveeta(), (posFlightPr_Method0 - posFlightPr_Method1) * positiveCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_posXiPr"), positiveP, cascade.positiveeta(), (posFlightPr_Method1 / posFlightPr_Method0) * positiveCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_posXiPr"), positiveP, (posFlightPr_Method0 - posFlightPr_Method1) * positiveCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_posXiPr"), positiveP, (posFlightPr_Method1 / posFlightPr_Method0) * positiveCosine); } if (std::abs(negFlightPi_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(negFlightPi_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_negXiPi"), negativeP, cascade.negativeeta(), (negFlightPi_Method0 - negFlightPi_Method1) * negativeCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_negXiPi"), negativeP, cascade.negativeeta(), (negFlightPi_Method1 / negFlightPi_Method0) * negativeCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_negXiPi"), negativeP, (negFlightPi_Method0 - negFlightPi_Method1) * negativeCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_negXiPi"), negativeP, (negFlightPi_Method1 / negFlightPi_Method0) * negativeCosine); } if (std::abs(bachFlightPi_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(bachFlightPi_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_bachXiPi"), bachelorP, cascade.bacheloreta(), (bachFlightPi_Method0 - bachFlightPi_Method1) * bachelorCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_bachXiPi"), bachelorP, cascade.bacheloreta(), (bachFlightPi_Method1 / bachFlightPi_Method0) * bachelorCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_bachXiPi"), bachelorP, (bachFlightPi_Method0 - bachFlightPi_Method1) * bachelorCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_bachXiPi"), bachelorP, (bachFlightPi_Method1 / bachFlightPi_Method0) * bachelorCosine); } } if (doQANSigma) { @@ -1195,16 +1404,16 @@ struct strangenesstofpid { histos.fill(HIST("h2dbachDeltaTimeAsOmKa"), cascade.p(), cascade.eta(), bachDeltaTimeAsOmKa); if (calculationMethod.value == 2) { if (std::abs(posFlightPr_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(posFlightPr_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_posOmPr"), positiveP, cascade.positiveeta(), (posFlightPr_Method0 - posFlightPr_Method1) * positiveCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_posOmPr"), positiveP, cascade.positiveeta(), (posFlightPr_Method1 / posFlightPr_Method0) * positiveCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_posOmPr"), positiveP, (posFlightPr_Method0 - posFlightPr_Method1) * positiveCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_posOmPr"), positiveP, (posFlightPr_Method1 / posFlightPr_Method0) * positiveCosine); } if (std::abs(negFlightPi_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(negFlightPi_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_negOmPi"), negativeP, cascade.negativeeta(), (negFlightPi_Method0 - negFlightPi_Method1) * negativeCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_negOmPi"), negativeP, cascade.negativeeta(), (negFlightPi_Method1 / negFlightPi_Method0) * negativeCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_negOmPi"), negativeP, (negFlightPi_Method0 - negFlightPi_Method1) * negativeCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_negOmPi"), negativeP, (negFlightPi_Method1 / negFlightPi_Method0) * negativeCosine); } if (std::abs(bachFlightKa_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(bachFlightKa_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_bachOmKa"), bachelorP, cascade.bacheloreta(), (bachFlightKa_Method0 - bachFlightKa_Method1) * bachelorCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_bachOmKa"), bachelorP, cascade.bacheloreta(), (bachFlightKa_Method1 / bachFlightKa_Method0) * bachelorCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_bachOmKa"), bachelorP, (bachFlightKa_Method0 - bachFlightKa_Method1) * bachelorCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_bachOmKa"), bachelorP, (bachFlightKa_Method1 / bachFlightKa_Method0) * bachelorCosine); } } if (doQANSigma) { From c2a85e2905db8a3fae01e7cc9f2bb7afc0443dfa Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Sun, 31 Aug 2025 09:42:00 +0200 Subject: [PATCH 2/8] Improvements to eloss estimate mode --- .../Strangeness/strangenesstofpid.cxx | 375 +++++++++--------- 1 file changed, 187 insertions(+), 188 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 0c5af3817e2..0ae0ec8ad27 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -99,22 +99,32 @@ struct strangenesstofpid { Configurable calculationMethod{"calculationMethod", 0, "algorithm for TOF calculation. 0: fast analytical withouot eloss, 1: O2 Propagator + trackLTIntegral (slow), 2: both methods and do comparison studies (slow)"}; Configurable calculateV0s{"calculateV0s", -1, "calculate V0-related TOF PID (0: no, 1: yes, -1: auto)"}; Configurable calculateCascades{"calculateCascades", -1, "calculate cascade-related TOF PID (0: no, 1: yes, -1: auto)"}; - Configurable correctELossInclination{"correctELossInclination", true, "factor out inclination when doing effective e-loss correction (0: no, 1: yes)"}; - Configurable numberOfAlphaRotations{"numberOfAlphaRotations", 6, "Max number of alpha rotations to attempt before converging"}; - // regulate e-loss calculation to save CPU - Configurable maxPionMomentumForEloss{"maxPionMomentumForEloss",1.0f, "above this momentum, do fast analytical TOF calculation for pions"}; - Configurable maxKaonMomentumForEloss{"maxKaonMomentumForEloss",1.5f, "above this momentum, do fast analytical TOF calculation for kaons"}; - Configurable maxProtonMomentumForEloss{"maxProtonMomentumForEloss",2.f, "above this momentum, do fast analytical TOF calculation for protons"}; +// Operation and minimisation criteria + struct : ConfigurableGroup { + Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; + Configurable tofPosition{"tofPosition", 377.934f, "TOF effective (inscribed) radius"}; + + Configurable correctELossInclination{"correctELossInclination", false, "factor out inclination when doing effective e-loss correction (0: no, 1: yes)"}; + Configurable numberOfStepsFirstStage{"numberOfStepsFirstStage", 500, "Max number of alpha rotations to attempt in first stage"}; + Configurable stepSizeFirstStage{"stepSizeFirstStage", 2.0f, "Max number of alpha rotations to attempt in first stage"}; + Configurable firstApproximationThreshold{"firstApproximationThreshold",4.0f, "be satisfied if first approach to TOF radius is OK within this threshold (cm)"}; + + // regulate e-loss calculation to save CPU + Configurable maxPionMomentumForEloss{"maxPionMomentumForEloss",1.5f, "above this momentum, do fast analytical TOF calculation for pions"}; + Configurable maxKaonMomentumForEloss{"maxKaonMomentumForEloss",2.0f, "above this momentum, do fast analytical TOF calculation for kaons"}; + Configurable maxProtonMomentumForEloss{"maxProtonMomentumForEloss",2.5f, "above this momentum, do fast analytical TOF calculation for protons"}; + + Configurable rejectKaonMomentumForEloss{"rejectKaonMomentumForEloss",0.2f, "below this momentum, reject kaon hypothesis (won't reach TOF)"}; + Configurable rejectProtonMomentumForEloss{"rejectProtonMomentumForEloss",0.2f, "below this momentum, reject proton hypothesis (won't reach TOF)"}; + + Configurable tpcNsigmaThreshold{"tpcNsigmaThreshold", 6.0f, "require TPC compatibility to attempt eloss propagation (otherwise, don't calculate)"}; + } propagationConfiguration; - // Operation and minimisation criteria - Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; - Configurable tofPosition{"tofPosition", 377.934f, "TOF effective (inscribed) radius"}; Configurable doQA{"doQA", true, "create QA histos"}; Configurable doNSigmas{"doNSigmas", false, "calculate TOF N-sigma"}; Configurable doQANSigma{"doQANSigma", true, "create QA of Nsigma histos"}; - // configurables related to V0s struct : ConfigurableGroup { std::string prefix = "v0Calibration"; @@ -309,11 +319,11 @@ struct strangenesstofpid { // Detector segmentation loop float segmentAngle = 20.0f / 180.0f * TMath::Pi(); float theta = static_cast(iSeg) * 20.0f / 180.0f * TMath::Pi(); - float halfWidth = tofPosition * TMath::Tan(0.5f * segmentAngle); - float x1 = TMath::Cos(theta) * (-halfWidth) + TMath::Sin(theta) * tofPosition; - float y1 = -TMath::Sin(theta) * (-halfWidth) + TMath::Cos(theta) * tofPosition; - float x2 = TMath::Cos(theta) * (+halfWidth) + TMath::Sin(theta) * tofPosition; - float y2 = -TMath::Sin(theta) * (+halfWidth) + TMath::Cos(theta) * tofPosition; + float halfWidth = propagationConfiguration.tofPosition * TMath::Tan(0.5f * segmentAngle); + float x1 = TMath::Cos(theta) * (-halfWidth) + TMath::Sin(theta) * propagationConfiguration.tofPosition; + float y1 = -TMath::Sin(theta) * (-halfWidth) + TMath::Cos(theta) * propagationConfiguration.tofPosition; + float x2 = TMath::Cos(theta) * (+halfWidth) + TMath::Sin(theta) * propagationConfiguration.tofPosition; + float y2 = -TMath::Sin(theta) * (+halfWidth) + TMath::Cos(theta) * propagationConfiguration.tofPosition; float thisLength = trackLengthToSegment(track, x1, y1, x2, y2, magneticField); if (thisLength < length && thisLength > 0){ length = thisLength; @@ -344,12 +354,18 @@ struct strangenesstofpid { { time = -1e+6; + if(track.getPID() == o2::track::PID::Proton && track.getP() < propagationConfiguration.rejectProtonMomentumForEloss.value){ + return; // don't attempt to calculate below-threshold protons (will stop anyway) + } + if(track.getPID() == o2::track::PID::Kaon && track.getP() < propagationConfiguration.rejectKaonMomentumForEloss.value){ + return; // don't attempt to calculate below-threshold kaons (will stop anyway) + } + o2::track::TrackLTIntegral ltIntegral; float trackX = -100; static constexpr float MAX_SIN_PHI = 0.85f; static constexpr float MAX_STEP = 2.0f; - static constexpr float MAX_STEP_LABR = 2.0f; static constexpr float MAX_STEP_FINAL_STAGE = 0.5f; static constexpr float MAX_FINAL_X = 390.0f; // maximum extra X on top of TOF X for correcting value @@ -363,47 +379,28 @@ struct strangenesstofpid { float segmentedRstart = segmentedRadius(xyz[0], xyz[1]); bool firstPropag; - for(int iRot = 0; iRot < numberOfAlphaRotations.value; iRot++){ + for(int iRot = 0; iRot < propagationConfiguration.numberOfStepsFirstStage.value; iRot++){ track.rotateParam(track.getPhi()); // start rotated float currentX = track.getX(); float tofX = currentX; - bool getXatLabRok = track.getXatLabR(tofPosition, tofX, d_bz, o2::track::DirOutward); - if(std::abs(tofX-currentX)<10.0f){ + bool getXatLabRok = track.getXatLabR(propagationConfiguration.tofPosition, tofX, d_bz, o2::track::DirOutward); + if(std::abs(tofX-currentX)propagateToX(track, nextX, d_bz, MAX_SIN_PHI, MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrLUT, <Integral); } - - // bool firstPropag = o2::base::Propagator::Instance()->propagateToX(track, trackX, d_bz, MAX_SIN_PHI, MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrLUT, <Integral); - - // if(!firstPropag){ - - // float attemptPartial = tofPosition*(1.0f - 1.0f/static_cast(iRot+1.333)); - // track.getPxPyPzGlo(pxpypz); - // track.rotateParam(std::atan2(pxpypz[1], pxpypz[0])); - // trackOK = track.getXatLabR(attemptPartial, trackX, d_bz, o2::track::DirOutward); - // firstPropag = o2::base::Propagator::Instance()->propagateToX(track, trackX, d_bz, MAX_SIN_PHI, MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrLUT, <Integral); - // track.getXYZGlo(xyz); - // if(firstPropag && std::abs(segmentedRadius(xyz[0], xyz[1])-tofPosition)<10.0f){ - // // close enough, stop - // histos.fill(HIST("hAlphaRotations"), iRot+1); // for debugging purposes - // break; //stop 'for' if successful - // } - // } - // } - // } // mark start position of next step track.getXYZGlo(xyz); float snp = track.getSnp(); float segmentedR = segmentedRadius(xyz[0], xyz[1]); float segmentedRintermediate = segmentedR; - histos.fill(HIST("hSegRadiusFirstPropagVsStart"), segmentedRstart, segmentedR); // for debugging purposes float currentTime = ltIntegral.getTOF(track.getPID()); if (calculationMethod.value == 2) { + histos.fill(HIST("hSegRadiusFirstPropagVsStart"), segmentedRstart, segmentedR); // for debugging purposes histos.fill(HIST("hSnp"), track.getSnp()); // for debugging purposes histos.fill(HIST("hTOFPosition"), xyz[0], xyz[1]); // for debugging purposes histos.fill(HIST("hSegRadius"), segmentedR); // for debugging purposes @@ -439,19 +436,19 @@ struct strangenesstofpid { // re-evaluate - did we cross? if yes break float previousX = xyz[0], previousY = xyz[1]; track.getXYZGlo(xyz); - if (segmentedRadius(xyz[0], xyz[1]) > tofPosition) { + if (segmentedRadius(xyz[0], xyz[1]) > propagationConfiguration.tofPosition) { // crossed boundary -> do proportional scaling with how much we actually crossed the boundary float segmentedRFinal = segmentedRadius(xyz[0], xyz[1]); float timeFinal = ltIntegral.getTOF(track.getPID()); - float fraction = (tofPosition - segmentedR) / (segmentedRFinal - segmentedR + 1e-6); // proportional fraction + float fraction = (propagationConfiguration.tofPosition - segmentedR) / (segmentedRFinal - segmentedR + 1e-6); // proportional fraction time = currentTime + (timeFinal - currentTime) * fraction; if (calculationMethod.value == 2) { histos.fill(HIST("hTOFPositionFinal"), previousX + fraction * (xyz[0] - previousX), previousY + fraction * (xyz[1] - previousY)); // for debugging purposes histos.fill(HIST("hSegRadiusFinal"), segmentedRadius(previousX + fraction * (xyz[0] - previousX), previousY + fraction * (xyz[1] - previousY))); // for debugging purposes histos.fill(HIST("hSnpFinal"), track.getSnp()); // for debugging purposes histos.fill(HIST("hSegRadiusFinalVsFirstPropag"), segmentedRintermediate, segmentedRadius(previousX + fraction * (xyz[0] - previousX), previousY + fraction * (xyz[1] - previousY))); // for debugging purposes + histos.fill(HIST("hRefinedPropagationSteps"), propagationSteps, 1.0f); // for debugging purposes } - histos.fill(HIST("hPropagationSteps"), propagationSteps, 1.0f); // for debugging purposes return; // get out of the entire function and return (don't just break) } @@ -460,57 +457,11 @@ struct strangenesstofpid { currentTime = ltIntegral.getTOF(track.getPID()); propagationSteps++; } - histos.fill(HIST("hPropagationSteps"), propagationSteps, 0.0f); // for debugging purposes - track.getXYZGlo(xyz); - histos.fill(HIST("hSegRadiusGotLost"), segmentedRadius(xyz[0], xyz[1])); // for debugging purposes - - // newton's method quantities - // float deltaX = 1.0f; // size of X change to calculate derivative - // float deltaY = 0.0f; // estimated change in segmented radius - // float targetPrecision = 0.25; // precision expected in finding TOF - // float slowFactor = 0.75f; // regulate convergence - // float nextX = track.getX(); // - // // LOGF(info, "started at segmented radius %.1f", segmentedR); - // int propagationSteps = 0; - // while(propagationSteps < 1000){ - // track.rotateParam(track.getPhi()); - // float trackX = track.getX(); - // track.getXYZGlo(xyz); - // float segmentedR1 = std::abs(segmentedRadius(xyz[0], xyz[1])-tofPosition); - // bool trackOKextra = o2::base::Propagator::Instance()->propagateToX(track, trackX+deltaX, d_bz, MAX_SIN_PHI, MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrLUT, <Integral); - // if (!trackOKextra) { - // // LOGF(info, "failed propagation from %.3f to %.3f, this has momentum of %.3f and is at segRad %.3f", trackX, trackX+deltaX, track.getP(), segmentedR1); - // track.getXYZGlo(xyz); - // histos.fill(HIST("hTOFPositionStopped"), xyz[0], xyz[1]); // for debugging purposes - // histos.fill(HIST("hSnpStopped"), snp); // for debugging purposes - // histos.fill(HIST("hSegRadiusStopped"), segmentedRadius(xyz[0], xyz[1])); // for debugging purposes - // histos.fill(HIST("hSegRadiusStoppedVsFirstPropag"), segmentedRintermediate, segmentedRadius(xyz[0], xyz[1])); // for debugging purposes - // return; - // } - // track.getXYZGlo(xyz); - // float segmentedR2 = std::abs(segmentedRadius(xyz[0], xyz[1])-tofPosition); - // deltaY = (segmentedR2 - segmentedR1); - // if(std::abs(deltaY)<0.1f){ - // deltaY=0.1f; // don't exaggerate in case the derivative makes this relatively unstable - // } - - // nextX = trackX - slowFactor*(segmentedR2)*deltaX/deltaY; - // // LOGF(info, "step %i segRad1 %.2f SegRad 2 %.2f current X %.2f next X %.2f, bool %i", propagationSteps, segmentedR1, segmentedR1, trackX, nextX, trackOKextra); - // trackOKextra = o2::base::Propagator::Instance()->propagateToX(track, nextX, d_bz, MAX_SIN_PHI, MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrLUT, <Integral); - - // track.getXYZGlo(xyz); - // if(std::abs(segmentedRadius(xyz[0], xyz[1])-tofPosition) -990) { - d_bz = d_bz_input; + if (propagationConfiguration.d_bz_input > -990) { + d_bz = propagationConfiguration.d_bz_input; o2::parameters::GRPMagField grpmag; if (fabs(d_bz) > 1e-5) { grpmag.setL3Current(30000.f / (d_bz / 5.0f)); @@ -899,14 +855,14 @@ struct strangenesstofpid { if (calculationMethod.value > 0) { // method to calculate the time and length via Propagator TrackLTIntegral if (pTra.hasTOF() && pTra.hasITS()) { // calculate if signal present, otherwise skip - if(posTrack.getP()o2::aod::v0data::kEpsilon; - bool negativeSuccessMethod0 = std::abs(timeNegativePr_Method0-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; - bool positiveSuccessMethod1 = std::abs(timePositivePr_Method1-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; - bool negativeSuccessMethod1 = std::abs(timeNegativePr_Method1-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; + bool positiveSuccessMethod0Pr = std::abs(timePositivePr_Method0-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; + bool negativeSuccessMethod0Pr = std::abs(timeNegativePr_Method0-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; + bool positiveSuccessMethod1Pr = std::abs(timePositivePr_Method1-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; + bool negativeSuccessMethod1Pr = std::abs(timeNegativePr_Method1-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; bool positiveSuccessMethod0Pi = std::abs(timePositivePi_Method0-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; bool negativeSuccessMethod0Pi = std::abs(timeNegativePi_Method0-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; bool positiveSuccessMethod1Pi = std::abs(timePositivePi_Method1-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; bool negativeSuccessMethod1Pi = std::abs(timeNegativePi_Method1-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; + + int encodedPositiveSuccessPi = positiveSuccessMethod0Pi + 2*positiveSuccessMethod1Pi; + int encodedPositiveSuccessPr = positiveSuccessMethod0Pr + 2*positiveSuccessMethod1Pr; + int encodedNegativeSuccessPi = negativeSuccessMethod0Pi + 2*negativeSuccessMethod1Pi; + int encodedNegativeSuccessPr = negativeSuccessMethod0Pr + 2*negativeSuccessMethod1Pr; + if(pTra.hasTOF()){ - histos.fill(HIST("hSuccessCorrelationProton"), positiveSuccessMethod0, positiveSuccessMethod1); - histos.fill(HIST("hSuccessCorrelationPion"), positiveSuccessMethod0Pi, positiveSuccessMethod1Pi); + histos.fill(HIST("h2dSucessRateProton"), positiveP, encodedPositiveSuccessPr); + histos.fill(HIST("h2dSucessRatePion"), positiveP, encodedPositiveSuccessPi); } if(nTra.hasTOF()){ - histos.fill(HIST("hSuccessCorrelationProton"), negativeSuccessMethod0, negativeSuccessMethod1); - histos.fill(HIST("hSuccessCorrelationPion"), negativeSuccessMethod0Pi, negativeSuccessMethod1Pi); + histos.fill(HIST("h2dSucessRateProton"), negativeP, encodedNegativeSuccessPr); + histos.fill(HIST("h2dSucessRatePion"), negativeP, encodedNegativeSuccessPi); } } @@ -1054,7 +1016,7 @@ struct strangenesstofpid { // length factor due to eta (to offset e-loss) float positiveCosine = 1.0f / sqrt(1.0f + posTrack.getTgl() * posTrack.getTgl()); float negativeCosine = 1.0f / sqrt(1.0f + negTrack.getTgl() * negTrack.getTgl()); - if (correctELossInclination.value == false) { + if (propagationConfiguration.correctELossInclination.value == false) { negativeCosine = positiveCosine = 1.0f; } @@ -1063,8 +1025,8 @@ struct strangenesstofpid { if (std::abs(v0.mLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && ((v0pdg == 0) || (v0pdg == 3122))) { histos.fill(HIST("h2dDeltaTimePositiveLambdaPr"), v0.p(), v0.eta(), deltaTimePositiveLambdaPr); if (calculationMethod.value == 2 && std::abs(timePositivePr_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon && std::abs(timePositivePr_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_posLaPr"), positiveP, (timePositivePr_Method0 - timePositivePr_Method1) * positiveCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_posLaPr"), positiveP, (timePositivePr_Method1 / timePositivePr_Method0) * positiveCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_posLaPr"), positiveP, v0.positiveeta(), (timePositivePr_Method0 - timePositivePr_Method1) * positiveCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_posLaPr"), positiveP, v0.positiveeta(), (timePositivePr_Method1 / timePositivePr_Method0) * positiveCosine); } if (doQANSigma) histos.fill(HIST("h2dNSigmaPositiveLambdaPr"), v0.p(), nSigmaPositiveLambdaPr); @@ -1072,8 +1034,8 @@ struct strangenesstofpid { if (std::abs(v0.mAntiLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma && ((v0pdg == 0) || (v0pdg == -3122))) { histos.fill(HIST("h2dDeltaTimePositiveLambdaPi"), v0.p(), v0.eta(), deltaTimePositiveLambdaPi); if (calculationMethod.value == 2 && std::abs(timePositivePi_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon && std::abs(timePositivePi_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_posLaPi"), positiveP, (timePositivePi_Method0 - timePositivePi_Method1) * positiveCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_posLaPi"), positiveP, (timePositivePi_Method1 / timePositivePi_Method0) * positiveCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_posLaPi"), positiveP, v0.positiveeta(), (timePositivePi_Method0 - timePositivePi_Method1) * positiveCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_posLaPi"), positiveP, v0.positiveeta(), (timePositivePi_Method1 / timePositivePi_Method0) * positiveCosine); } if (doQANSigma) histos.fill(HIST("h2dNSigmaPositiveLambdaPi"), v0.p(), nSigmaPositiveLambdaPi); @@ -1081,8 +1043,8 @@ struct strangenesstofpid { if (std::abs(v0.mK0Short() - 0.497) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && ((v0pdg == 0) || (v0pdg == 310))) { histos.fill(HIST("h2dDeltaTimePositiveK0ShortPi"), v0.p(), v0.eta(), deltaTimePositiveK0ShortPi); if (calculationMethod.value == 2 && std::abs(timePositivePi_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon && std::abs(timePositivePi_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_posK0Pi"), positiveP, (timePositivePi_Method0 - timePositivePi_Method1) * positiveCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_posK0Pi"), positiveP, (timePositivePi_Method1 / timePositivePi_Method0) * positiveCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_posK0Pi"), positiveP, v0.positiveeta(), (timePositivePi_Method0 - timePositivePi_Method1) * positiveCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_posK0Pi"), positiveP, v0.positiveeta(), (timePositivePi_Method1 / timePositivePi_Method0) * positiveCosine); } if (doQANSigma) histos.fill(HIST("h2dNSigmaPositiveK0ShortPi"), v0.p(), nSigmaPositiveK0ShortPi); @@ -1095,8 +1057,8 @@ struct strangenesstofpid { if (std::abs(v0.mLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && ((v0pdg == 0) || (v0pdg == 3122))) { histos.fill(HIST("h2dDeltaTimeNegativeLambdaPi"), v0.p(), v0.eta(), deltaTimeNegativeLambdaPi); if (calculationMethod.value == 2 && std::abs(timeNegativePi_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon && std::abs(timeNegativePi_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_negLaPi"), negativeP, (timeNegativePi_Method0 - timeNegativePi_Method1) * negativeCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_negLaPi"), negativeP, (timeNegativePi_Method1 / timeNegativePi_Method0) * negativeCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_negLaPi"), negativeP, v0.negativeeta(), (timeNegativePi_Method0 - timeNegativePi_Method1) * negativeCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_negLaPi"), negativeP, v0.negativeeta(), (timeNegativePi_Method1 / timeNegativePi_Method0)); } if (doQANSigma) histos.fill(HIST("h2dNSigmaNegativeLambdaPi"), v0.p(), nSigmaNegativeLambdaPi); @@ -1104,8 +1066,8 @@ struct strangenesstofpid { if (std::abs(v0.mAntiLambda() - 1.115683) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPr()) < v0Group.qaTPCNSigma && ((v0pdg == 0) || (v0pdg == -3122))) { histos.fill(HIST("h2dDeltaTimeNegativeLambdaPr"), v0.p(), v0.eta(), deltaTimeNegativeLambdaPr); if (calculationMethod.value == 2 && std::abs(timeNegativePr_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon && std::abs(timeNegativePr_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_negLaPr"), negativeP, (timeNegativePr_Method0 - timeNegativePr_Method1) * negativeCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_negLaPr"), negativeP, (timeNegativePr_Method1 / timeNegativePr_Method0) * negativeCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_negLaPr"), negativeP, v0.negativeeta(), (timeNegativePr_Method0 - timeNegativePr_Method1) * negativeCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_negLaPr"), negativeP, v0.negativeeta(), (timeNegativePr_Method1 / timeNegativePr_Method0)); } if (doQANSigma) histos.fill(HIST("h2dNSigmaNegativeLambdaPr"), v0.p(), nSigmaNegativeLambdaPr); @@ -1113,8 +1075,8 @@ struct strangenesstofpid { if (std::abs(v0.mK0Short() - 0.497) < v0Group.qaMassWindow && fabs(pTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && fabs(nTra.tpcNSigmaPi()) < v0Group.qaTPCNSigma && ((v0pdg == 0) || (v0pdg == 310))) { histos.fill(HIST("h2dDeltaTimeNegativeK0ShortPi"), v0.p(), v0.eta(), deltaTimeNegativeK0ShortPi); if (calculationMethod.value == 2 && std::abs(timeNegativePi_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon && std::abs(timeNegativePi_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_negK0Pi"), negativeP, (timeNegativePi_Method0 - timeNegativePi_Method1) * negativeCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_negK0Pi"), negativeP, (timeNegativePi_Method1 / timeNegativePi_Method0) * negativeCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_negK0Pi"), negativeP, v0.negativeeta(), (timeNegativePi_Method0 - timeNegativePi_Method1) * negativeCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_negK0Pi"), negativeP, v0.negativeeta(), (timeNegativePi_Method1 / timeNegativePi_Method0)); } if (doQANSigma) histos.fill(HIST("h2dNSigmaNegativeK0ShortPi"), v0.p(), nSigmaNegativeK0ShortPi); @@ -1225,7 +1187,7 @@ struct strangenesstofpid { if (calculationMethod.value > 0) { if (pTra.hasTOF() && pTra.hasITS()) { // calculate if signal present, otherwise skip - if(posTrack.getP()o2::aod::cascdata::kEpsilon; + bool negativeSuccessMethod0Pr = std::abs(negFlightPr_Method0-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; + bool positiveSuccessMethod1Pr = std::abs(posFlightPr_Method1-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; + bool negativeSuccessMethod1Pr = std::abs(negFlightPr_Method1-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; + bool positiveSuccessMethod0Pi = std::abs(posFlightPi_Method0-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; + bool negativeSuccessMethod0Pi = std::abs(negFlightPi_Method0-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; + bool positiveSuccessMethod1Pi = std::abs(posFlightPi_Method1-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; + bool negativeSuccessMethod1Pi = std::abs(negFlightPi_Method1-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; + + bool bachelorSuccessMethod0Pi = std::abs(bachFlightPi_Method0-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; + bool bachelorSuccessMethod0Ka = std::abs(bachFlightKa_Method0-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; + bool bachelorSuccessMethod1Pi = std::abs(bachFlightPi_Method1-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; + bool bachelorSuccessMethod1Ka = std::abs(bachFlightKa_Method1-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; + + int encodedPositiveSuccessPi = positiveSuccessMethod0Pi + 2*positiveSuccessMethod1Pi; + int encodedPositiveSuccessPr = positiveSuccessMethod0Pr + 2*positiveSuccessMethod1Pr; + int encodedNegativeSuccessPi = negativeSuccessMethod0Pi + 2*negativeSuccessMethod1Pi; + int encodedNegativeSuccessPr = negativeSuccessMethod0Pr + 2*negativeSuccessMethod1Pr; + int encodedBachelorSuccessPi = bachelorSuccessMethod0Pi + 2*bachelorSuccessMethod1Pi; + int encodedBachelorSuccessKa = bachelorSuccessMethod0Ka + 2*bachelorSuccessMethod1Ka; + + if(pTra.hasTOF()){ + histos.fill(HIST("h2dSucessRateProton"), positiveP, encodedPositiveSuccessPr); + histos.fill(HIST("h2dSucessRatePion"), positiveP, encodedPositiveSuccessPi); + } + if(nTra.hasTOF()){ + histos.fill(HIST("h2dSucessRateProton"), negativeP, encodedNegativeSuccessPr); + histos.fill(HIST("h2dSucessRatePion"), negativeP, encodedNegativeSuccessPi); + } + if(bTra.hasTOF()){ + histos.fill(HIST("h2dSucessRateKaon"), bachelorP, encodedBachelorSuccessKa); + histos.fill(HIST("h2dSucessRatePion"), bachelorP, encodedBachelorSuccessPi); + } + } + // initialize delta-times (actual PID variables) float posDeltaTimeAsXiPi = o2::aod::cascdata::kNoTOFValue, posDeltaTimeAsXiPr = o2::aod::cascdata::kNoTOFValue; float negDeltaTimeAsXiPi = o2::aod::cascdata::kNoTOFValue, negDeltaTimeAsXiPr = o2::aod::cascdata::kNoTOFValue; @@ -1368,7 +1367,7 @@ struct strangenesstofpid { float positiveCosine = 1.0f / sqrt(1.0f + posTrack.getTgl() * posTrack.getTgl()); float negativeCosine = 1.0f / sqrt(1.0f + negTrack.getTgl() * negTrack.getTgl()); float bachelorCosine = 1.0f / sqrt(1.0f + bachTrack.getTgl() * bachTrack.getTgl()); - if (correctELossInclination.value == false) { + if (propagationConfiguration.correctELossInclination.value == false) { negativeCosine = positiveCosine = bachelorCosine = 1.0f; } @@ -1380,16 +1379,16 @@ struct strangenesstofpid { histos.fill(HIST("h2dbachDeltaTimeAsXiPi"), cascade.p(), cascade.eta(), bachDeltaTimeAsXiPi); if (calculationMethod.value == 2) { if (std::abs(posFlightPr_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(posFlightPr_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_posXiPr"), positiveP, (posFlightPr_Method0 - posFlightPr_Method1) * positiveCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_posXiPr"), positiveP, (posFlightPr_Method1 / posFlightPr_Method0) * positiveCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_posXiPr"), positiveP, cascade.positiveeta(), (posFlightPr_Method0 - posFlightPr_Method1) * positiveCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_posXiPr"), positiveP, cascade.positiveeta(), (posFlightPr_Method1 / posFlightPr_Method0)); } if (std::abs(negFlightPi_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(negFlightPi_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_negXiPi"), negativeP, (negFlightPi_Method0 - negFlightPi_Method1) * negativeCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_negXiPi"), negativeP, (negFlightPi_Method1 / negFlightPi_Method0) * negativeCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_negXiPi"), negativeP, cascade.negativeeta(), (negFlightPi_Method0 - negFlightPi_Method1) * negativeCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_negXiPi"), negativeP, cascade.negativeeta(), (negFlightPi_Method1 / negFlightPi_Method0)); } if (std::abs(bachFlightPi_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(bachFlightPi_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_bachXiPi"), bachelorP, (bachFlightPi_Method0 - bachFlightPi_Method1) * bachelorCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_bachXiPi"), bachelorP, (bachFlightPi_Method1 / bachFlightPi_Method0) * bachelorCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_bachXiPi"), bachelorP, cascade.bacheloreta(), (bachFlightPi_Method0 - bachFlightPi_Method1) * bachelorCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_bachXiPi"), bachelorP, cascade.bacheloreta(), (bachFlightPi_Method1 / bachFlightPi_Method0)); } } if (doQANSigma) { @@ -1404,16 +1403,16 @@ struct strangenesstofpid { histos.fill(HIST("h2dbachDeltaTimeAsOmKa"), cascade.p(), cascade.eta(), bachDeltaTimeAsOmKa); if (calculationMethod.value == 2) { if (std::abs(posFlightPr_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(posFlightPr_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_posOmPr"), positiveP, (posFlightPr_Method0 - posFlightPr_Method1) * positiveCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_posOmPr"), positiveP, (posFlightPr_Method1 / posFlightPr_Method0) * positiveCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_posOmPr"), positiveP, cascade.positiveeta(), (posFlightPr_Method0 - posFlightPr_Method1) * positiveCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_posOmPr"), positiveP, cascade.positiveeta(), (posFlightPr_Method1 / posFlightPr_Method0)); } if (std::abs(negFlightPi_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(negFlightPi_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_negOmPi"), negativeP, (negFlightPi_Method0 - negFlightPi_Method1) * negativeCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_negOmPi"), negativeP, (negFlightPi_Method1 / negFlightPi_Method0) * negativeCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_negOmPi"), negativeP, cascade.negativeeta(), (negFlightPi_Method0 - negFlightPi_Method1) * negativeCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_negOmPi"), negativeP, cascade.negativeeta(), (negFlightPi_Method1 / negFlightPi_Method0)); } if (std::abs(bachFlightKa_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(bachFlightKa_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { - histos.fill(HIST("hDeltaTimeMethodsVsP_bachOmKa"), bachelorP, (bachFlightKa_Method0 - bachFlightKa_Method1) * bachelorCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_bachOmKa"), bachelorP, (bachFlightKa_Method1 / bachFlightKa_Method0) * bachelorCosine); + histos.fill(HIST("hDeltaTimeMethodsVsP_bachOmKa"), bachelorP, cascade.bacheloreta(), (bachFlightKa_Method0 - bachFlightKa_Method1) * bachelorCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_bachOmKa"), bachelorP, cascade.bacheloreta(), (bachFlightKa_Method1 / bachFlightKa_Method0)); } } if (doQANSigma) { @@ -1430,15 +1429,15 @@ struct strangenesstofpid { if (calculationMethod.value == 2) { if (std::abs(posFlightPi_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(posFlightPi_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { histos.fill(HIST("hDeltaTimeMethodsVsP_posXiPi"), positiveP, cascade.positiveeta(), (posFlightPi_Method0 - posFlightPi_Method1) * positiveCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_posXiPi"), positiveP, cascade.positiveeta(), (posFlightPi_Method1 / posFlightPi_Method1) * positiveCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_posXiPi"), positiveP, cascade.positiveeta(), (posFlightPi_Method1 / posFlightPi_Method1)); } if (std::abs(negFlightPr_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(negFlightPr_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { histos.fill(HIST("hDeltaTimeMethodsVsP_negXiPr"), negativeP, cascade.negativeeta(), (negFlightPr_Method0 - negFlightPr_Method1) * negativeCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_negXiPr"), negativeP, cascade.negativeeta(), (negFlightPr_Method1 / negFlightPr_Method0) * negativeCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_negXiPr"), negativeP, cascade.negativeeta(), (negFlightPr_Method1 / negFlightPr_Method0)); } if (std::abs(bachFlightPi_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(bachFlightPi_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { histos.fill(HIST("hDeltaTimeMethodsVsP_bachXiPi"), bachelorP, cascade.bacheloreta(), (bachFlightPi_Method0 - bachFlightPi_Method1) * bachelorCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_bachXiPi"), bachelorP, cascade.bacheloreta(), (bachFlightPi_Method1 / bachFlightPi_Method0) * bachelorCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_bachXiPi"), bachelorP, cascade.bacheloreta(), (bachFlightPi_Method1 / bachFlightPi_Method0)); } } if (doQANSigma) { @@ -1454,15 +1453,15 @@ struct strangenesstofpid { if (calculationMethod.value == 2) { if (std::abs(posFlightPi_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(posFlightPi_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { histos.fill(HIST("hDeltaTimeMethodsVsP_posOmPi"), positiveP, cascade.positiveeta(), (posFlightPi_Method0 - posFlightPi_Method1) * positiveCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_posOmPi"), positiveP, cascade.positiveeta(), (posFlightPi_Method1 / posFlightPi_Method1) * positiveCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_posOmPi"), positiveP, cascade.positiveeta(), (posFlightPi_Method1 / posFlightPi_Method1)); } if (std::abs(negFlightPr_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(negFlightPr_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { histos.fill(HIST("hDeltaTimeMethodsVsP_negOmPr"), negativeP, cascade.negativeeta(), (negFlightPr_Method0 - negFlightPr_Method1) * negativeCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_negOmPr"), negativeP, cascade.negativeeta(), (negFlightPr_Method1 / negFlightPr_Method0) * negativeCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_negOmPr"), negativeP, cascade.negativeeta(), (negFlightPr_Method1 / negFlightPr_Method0)); } if (std::abs(bachFlightKa_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon && std::abs(bachFlightKa_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon) { histos.fill(HIST("hDeltaTimeMethodsVsP_bachOmKa"), bachelorP, cascade.bacheloreta(), (bachFlightKa_Method0 - bachFlightKa_Method1) * bachelorCosine); - histos.fill(HIST("hRatioTimeMethodsVsP_bachOmKa"), bachelorP, cascade.bacheloreta(), (bachFlightKa_Method1 / bachFlightKa_Method1) * bachelorCosine); + histos.fill(HIST("hRatioTimeMethodsVsP_bachOmKa"), bachelorP, cascade.bacheloreta(), (bachFlightKa_Method1 / bachFlightKa_Method1)); } } if (doQANSigma) { From fe13016e874bea5c1db670528105dc1674b1a0d3 Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Sun, 31 Aug 2025 09:53:47 +0200 Subject: [PATCH 3/8] Fix axis mistake --- .../Strangeness/strangenesstofpid.cxx | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 0ae0ec8ad27..aee046702ac 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -626,24 +626,24 @@ struct strangenesstofpid { histos.add("hDeltaTimeMethodsVsP_negOmPr", "hDeltaTimeMethodsVsP_negOmPr", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); histos.add("hDeltaTimeMethodsVsP_bachOmKa", "hDeltaTimeMethodsVsP_bachOmKa", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - histos.add("hRatioTimeMethodsVsP_posLaPr", "hRatioTimeMethodsVsP_posLaPr", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - histos.add("hRatioTimeMethodsVsP_posLaPi", "hRatioTimeMethodsVsP_posLaPi", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - histos.add("hRatioTimeMethodsVsP_posK0Pi", "hRatioTimeMethodsVsP_posK0Pi", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - histos.add("hRatioTimeMethodsVsP_negLaPr", "hRatioTimeMethodsVsP_negLaPr", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - histos.add("hRatioTimeMethodsVsP_negLaPi", "hRatioTimeMethodsVsP_negLaPi", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - histos.add("hRatioTimeMethodsVsP_negK0Pi", "hRatioTimeMethodsVsP_negK0Pi", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - - histos.add("hRatioTimeMethodsVsP_posXiPi", "hRatioTimeMethodsVsP_posXiPi", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - histos.add("hRatioTimeMethodsVsP_posXiPr", "hRatioTimeMethodsVsP_posXiPr", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - histos.add("hRatioTimeMethodsVsP_negXiPi", "hRatioTimeMethodsVsP_negXiPi", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - histos.add("hRatioTimeMethodsVsP_negXiPr", "hRatioTimeMethodsVsP_negXiPr", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - histos.add("hRatioTimeMethodsVsP_bachXiPi", "hRatioTimeMethodsVsP_bachXiPi", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - - histos.add("hRatioTimeMethodsVsP_posOmPi", "hRatioTimeMethodsVsP_posOmPi", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - histos.add("hRatioTimeMethodsVsP_posOmPr", "hRatioTimeMethodsVsP_posOmPr", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - histos.add("hRatioTimeMethodsVsP_negOmPi", "hRatioTimeMethodsVsP_negOmPi", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - histos.add("hRatioTimeMethodsVsP_negOmPr", "hRatioTimeMethodsVsP_negOmPr", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); - histos.add("hRatioTimeMethodsVsP_bachOmKa", "hRatioTimeMethodsVsP_bachOmKa", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); + histos.add("hRatioTimeMethodsVsP_posLaPr", "hRatioTimeMethodsVsP_posLaPr", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); + histos.add("hRatioTimeMethodsVsP_posLaPi", "hRatioTimeMethodsVsP_posLaPi", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); + histos.add("hRatioTimeMethodsVsP_posK0Pi", "hRatioTimeMethodsVsP_posK0Pi", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); + histos.add("hRatioTimeMethodsVsP_negLaPr", "hRatioTimeMethodsVsP_negLaPr", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); + histos.add("hRatioTimeMethodsVsP_negLaPi", "hRatioTimeMethodsVsP_negLaPi", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); + histos.add("hRatioTimeMethodsVsP_negK0Pi", "hRatioTimeMethodsVsP_negK0Pi", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); + + histos.add("hRatioTimeMethodsVsP_posXiPi", "hRatioTimeMethodsVsP_posXiPi", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); + histos.add("hRatioTimeMethodsVsP_posXiPr", "hRatioTimeMethodsVsP_posXiPr", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); + histos.add("hRatioTimeMethodsVsP_negXiPi", "hRatioTimeMethodsVsP_negXiPi", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); + histos.add("hRatioTimeMethodsVsP_negXiPr", "hRatioTimeMethodsVsP_negXiPr", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); + histos.add("hRatioTimeMethodsVsP_bachXiPi", "hRatioTimeMethodsVsP_bachXiPi", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); + + histos.add("hRatioTimeMethodsVsP_posOmPi", "hRatioTimeMethodsVsP_posOmPi", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); + histos.add("hRatioTimeMethodsVsP_posOmPr", "hRatioTimeMethodsVsP_posOmPr", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); + histos.add("hRatioTimeMethodsVsP_negOmPi", "hRatioTimeMethodsVsP_negOmPi", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); + histos.add("hRatioTimeMethodsVsP_negOmPr", "hRatioTimeMethodsVsP_negOmPr", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); + histos.add("hRatioTimeMethodsVsP_bachOmKa", "hRatioTimeMethodsVsP_bachOmKa", kTH3F, {axisSmallP, axisEta, axisRatioMethods}); } // list memory consumption at start if running in modes with more output From d5fdc2131ce9c960dfd5ee17097ffbe89b870a22 Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Sun, 31 Aug 2025 10:19:37 +0200 Subject: [PATCH 4/8] Minor adjustments --- PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index aee046702ac..0210adcae8a 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -107,6 +107,7 @@ struct strangenesstofpid { Configurable correctELossInclination{"correctELossInclination", false, "factor out inclination when doing effective e-loss correction (0: no, 1: yes)"}; Configurable numberOfStepsFirstStage{"numberOfStepsFirstStage", 500, "Max number of alpha rotations to attempt in first stage"}; + Configurable numberOfStepsFirstStage{"numberOfStepsSecondStage", 500, "Max number of steps rotations to attempt in second stage"}; Configurable stepSizeFirstStage{"stepSizeFirstStage", 2.0f, "Max number of alpha rotations to attempt in first stage"}; Configurable firstApproximationThreshold{"firstApproximationThreshold",4.0f, "be satisfied if first approach to TOF radius is OK within this threshold (cm)"}; @@ -367,7 +368,7 @@ struct strangenesstofpid { static constexpr float MAX_SIN_PHI = 0.85f; static constexpr float MAX_STEP = 2.0f; static constexpr float MAX_STEP_FINAL_STAGE = 0.5f; - static constexpr float MAX_FINAL_X = 390.0f; // maximum extra X on top of TOF X for correcting value + static constexpr float MAX_FINAL_X = 450.0f; // maximum extra X on top of TOF X for correcting value //____________________________________________________________ // stage 1: propagate to TOF-inscribed circle at tofPosition @@ -415,7 +416,7 @@ struct strangenesstofpid { float trackXextra = track.getX(); bool trackOKextra = true; int propagationSteps = 0; - while (trackXextra < MAX_FINAL_X && propagationSteps < 1000) { + while (trackXextra < MAX_FINAL_X && propagationSteps < propagationConfiguration.numberOfStepsSecondStage.value) { // continue with alpha aligned with pT track.getPxPyPzGlo(pxpypz); track.rotateParam(std::atan2(pxpypz[1], pxpypz[0])); @@ -1060,6 +1061,8 @@ struct strangenesstofpid { histos.fill(HIST("hDeltaTimeMethodsVsP_negLaPi"), negativeP, v0.negativeeta(), (timeNegativePi_Method0 - timeNegativePi_Method1) * negativeCosine); histos.fill(HIST("hRatioTimeMethodsVsP_negLaPi"), negativeP, v0.negativeeta(), (timeNegativePi_Method1 / timeNegativePi_Method0)); } + // delta lambda decay time + histos.fill(HIST("h2dLambdaDeltaDecayTime"), v0.p(), deltaDecayTimeLambda); if (doQANSigma) histos.fill(HIST("h2dNSigmaNegativeLambdaPi"), v0.p(), nSigmaNegativeLambdaPi); } @@ -1083,8 +1086,6 @@ struct strangenesstofpid { } } } - // delta lambda decay time - histos.fill(HIST("h2dLambdaDeltaDecayTime"), v0.p(), deltaDecayTimeLambda); } } From 297c41ebcc689d56ee098f0911fe90a9dfa58056 Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Sun, 31 Aug 2025 10:42:03 +0200 Subject: [PATCH 5/8] Minor fixes --- PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 0210adcae8a..84427ddf858 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -107,7 +107,7 @@ struct strangenesstofpid { Configurable correctELossInclination{"correctELossInclination", false, "factor out inclination when doing effective e-loss correction (0: no, 1: yes)"}; Configurable numberOfStepsFirstStage{"numberOfStepsFirstStage", 500, "Max number of alpha rotations to attempt in first stage"}; - Configurable numberOfStepsFirstStage{"numberOfStepsSecondStage", 500, "Max number of steps rotations to attempt in second stage"}; + Configurable numberOfStepsSecondStage{"numberOfStepsSecondStage", 500, "Max number of steps rotations to attempt in second stage"}; Configurable stepSizeFirstStage{"stepSizeFirstStage", 2.0f, "Max number of alpha rotations to attempt in first stage"}; Configurable firstApproximationThreshold{"firstApproximationThreshold",4.0f, "be satisfied if first approach to TOF radius is OK within this threshold (cm)"}; @@ -387,7 +387,9 @@ struct strangenesstofpid { bool getXatLabRok = track.getXatLabR(propagationConfiguration.tofPosition, tofX, d_bz, o2::track::DirOutward); if(std::abs(tofX-currentX) Date: Sun, 31 Aug 2025 17:10:09 +0200 Subject: [PATCH 6/8] Latest developments --- .../Strangeness/strangenesstofpid.cxx | 6 +- PWGLF/Tasks/QC/strangepidqa.cxx | 471 ++++++++---------- 2 files changed, 214 insertions(+), 263 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 84427ddf858..3435e8a94d0 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -122,9 +122,9 @@ struct strangenesstofpid { Configurable tpcNsigmaThreshold{"tpcNsigmaThreshold", 6.0f, "require TPC compatibility to attempt eloss propagation (otherwise, don't calculate)"}; } propagationConfiguration; - Configurable doQA{"doQA", true, "create QA histos"}; - Configurable doNSigmas{"doNSigmas", false, "calculate TOF N-sigma"}; - Configurable doQANSigma{"doQANSigma", true, "create QA of Nsigma histos"}; + Configurable doQA{"doQA", false, "create QA histos"}; + Configurable doNSigmas{"doNSigmas", true, "calculate TOF N-sigma"}; + Configurable doQANSigma{"doQANSigma", false, "create QA of Nsigma histos"}; // configurables related to V0s struct : ConfigurableGroup { diff --git a/PWGLF/Tasks/QC/strangepidqa.cxx b/PWGLF/Tasks/QC/strangepidqa.cxx index 2dd9c58b4e7..514a9a783a6 100644 --- a/PWGLF/Tasks/QC/strangepidqa.cxx +++ b/PWGLF/Tasks/QC/strangepidqa.cxx @@ -51,22 +51,16 @@ struct strangepidqa { ConfigurableAxis vertexZ{"vertexZ", {30, -15.0f, 15.0f}, ""}; // base properties - ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "p_{T} (GeV/c)"}; + ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f}, "p_{T} (GeV/c)"}; ConfigurableAxis axisRadius{"axisRadius", {200, 0.0f, 100.0f}, "V0 radius (cm)"}; ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 50.0f, 70.0f, 100.0f}, "FT0C centrality"}; - AxisSpec massAxisXi = {200, 1.222f, 1.422f, "Inv. Mass (GeV/c^{2})"}; - AxisSpec massAxisOmega = {200, 1.572f, 1.772f, "Inv. Mass (GeV/c^{2})"}; - // Invariant Mass ConfigurableAxis axisK0ShortMass{"axisK0ShortMass", {200, 0.497f - 0.050f, 0.497f + 0.050f}, "M_{K0s} (GeV/c^{2})"}; ConfigurableAxis axisLambdaMass{"axisLambdaMass", {200, 1.08f, 1.16f}, "M_{#Lambda} (GeV/c^{2})"}; - - // time axes - ConfigurableAxis axisDeltaTime{"axisDeltaTime", {200, -1000.0f, +1000.0f}, "#Delta time (ps)"}; - ConfigurableAxis axisTime{"axisTime", {200, 0.0f, +20000.0f}, "T (ps)"}; - ConfigurableAxis axisBeta{"axisBeta", {1200, 0.0f, +1.2f}, "#Beta"}; + AxisSpec massAxisXi = {200, 1.222f, 1.422f, "Inv. Mass (GeV/c^{2})"}; + AxisSpec massAxisOmega = {200, 1.572f, 1.772f, "Inv. Mass (GeV/c^{2})"}; // Length axis ConfigurableAxis axisLength{"axisLength", {600, 0.0f, +600.0f}, "track Length (cm)"}; @@ -74,24 +68,8 @@ struct strangepidqa { // TOF cut axis ConfigurableAxis axisTOFCut{"axisTOFCut", {100, 0.0f, +10000.0f}, "TOF compat. cut (ps)"}; - // TOF selection matters - Configurable requireTOFsignalPion{"requireTOFsignalPion", true, "require that pion prongs have TOF"}; - Configurable requireTOFsignalProton{"requireTOFsignalProton", true, "require that proton prongs have TOF"}; - Configurable requireTOFEventTimePion{"requireTOFEventTimePion", true, "require that pion prongs have TOF event time"}; - Configurable requireTOFEventTimeProton{"requireTOFEventTimeProton", true, "require that proton prongs have TOF event time"}; - - Configurable maxDeltaTimeProton{"maxDeltaTimeProton", 1e+9, "check maximum allowed time"}; - Configurable maxDeltaTimePion{"maxDeltaTimePion", 1e+9, "check maximum allowed time"}; - Configurable maxDeltaTimeDecay{"maxDeltaTimeDecay", 1e+9, "check maximum allowed delta-time-decay"}; - - Configurable minCentrality{"minCentrality", 60, "max value of centrality allowed"}; - Configurable maxCentrality{"maxCentrality", 100, "max value of centrality allowed"}; - - Configurable minV0Radius{"minV0Radius", 1.5, "min radius"}; - Configurable minCosPA{"minCosPA", .98, "min cosPA"}; - - Configurable minPtV0{"minPtV0", 1.0, "min pT for integrated mass histograms"}; - Configurable maxPtV0{"maxPtV0", 3.0, "max pT for integrated mass histograms"}; + // nsigma axis + ConfigurableAxis axisNSigma{"axisNSigma", {60, -3.0f, +3.0f}, "NSigma"}; //*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+* // Selection criteria for cascade analysis @@ -112,14 +90,9 @@ struct strangepidqa { Configurable tpcNsigmaBachelor{"tpcNsigmaBachelor", 4, "TPC NSigma bachelor (>10 is no cut)"}; Configurable tpcNsigmaProton{"tpcNsigmaProton", 4, "TPC NSigma proton <- lambda (>10 is no cut)"}; Configurable tpcNsigmaPion{"tpcNsigmaPion", 4, "TPC NSigma pion <- lambda (>10 is no cut)"}; - - Configurable tofNsigmaXiLaPr{"tpcNsigmaXiLaPr", 1e+5, "TOF NSigma proton <- lambda <- Xi (>10 is no cut)"}; - Configurable tofNsigmaXiLaPi{"tpcNsigmaXiLaPi", 1e+5, "TOF NSigma pion <- lambda <- Xi (>10 is no cut)"}; - Configurable tofNsigmaXiPi{"tpcNsigmaXiPi", 1e+5, "TOF NSigma pion <- Xi (>10 is no cut)"}; - Configurable tofNsigmaOmLaPr{"tpcNsigmaOmLaPr", 1e+5, "TOF NSigma proton <- lambda <- Omega (>10 is no cut)"}; - Configurable tofNsigmaOmLaPi{"tpcNsigmaOmLaPi", 1e+5, "TOF NSigma pion <- lambda <- Omega (>10 is no cut)"}; - Configurable tofNsigmaOmKa{"tpcNsigmaOmKa", 1e+5, "TOF NSigma Kaon <- Omega (>10 is no cut)"}; - + //*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+* + // Direct test configurables + Configurable massWindowForNSigmaPlots{"massWindowForNSigmaPlots", 0.005f, "mass window for Nsigma comparison plots"}; Configurable tofNsigmaCompatibility{"tofNsigmaCompatibility", 4, "compatibility check for V0s"}; Configurable tofNsigmaCompatibilityCascades{"tofNsigmaCompatibilityCascades", 4, "compatibility check for cascades"}; //*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+* @@ -129,97 +102,6 @@ struct strangepidqa { // Event counter histos.add("hEventCentrality", "hEventCentrality", kTH1F, {{100, 0.0f, 100.0f}}); - // Presence of negative and positive signals and event time - auto hPositiveStatus = histos.add("hPositiveStatus", "hPositiveStatus", kTH1F, {{4, -0.5f, 3.5f}}); - auto hNegativeStatus = histos.add("hNegativeStatus", "hNegativeStatus", kTH1F, {{4, -0.5f, 3.5f}}); - auto hPositiveStatusReachedTOF = histos.add("hPositiveStatusReachedTOF", "hPositiveStatusReachedTOF", kTH1F, {{4, -0.5f, 3.5f}}); - auto hNegativeStatusReachedTOF = histos.add("hNegativeStatusReachedTOF", "hNegativeStatusReachedTOF", kTH1F, {{4, -0.5f, 3.5f}}); - hPositiveStatus->GetXaxis()->SetBinLabel(1, "All positive"); - hPositiveStatus->GetXaxis()->SetBinLabel(2, "Has only TOF sig"); - hPositiveStatus->GetXaxis()->SetBinLabel(3, "Has only TOF ev time"); - hPositiveStatus->GetXaxis()->SetBinLabel(4, "Has full time info"); - hNegativeStatus->GetXaxis()->SetBinLabel(1, "All negative"); - hNegativeStatus->GetXaxis()->SetBinLabel(2, "Has only TOF sig"); - hNegativeStatus->GetXaxis()->SetBinLabel(3, "Has only TOF ev time"); - hNegativeStatus->GetXaxis()->SetBinLabel(4, "Has full time info"); - - hPositiveStatusReachedTOF->GetXaxis()->SetBinLabel(1, "All positive"); - hPositiveStatusReachedTOF->GetXaxis()->SetBinLabel(2, "Has only TOF sig"); - hPositiveStatusReachedTOF->GetXaxis()->SetBinLabel(3, "Has only TOF ev time"); - hPositiveStatusReachedTOF->GetXaxis()->SetBinLabel(4, "Has full time info"); - hNegativeStatusReachedTOF->GetXaxis()->SetBinLabel(1, "All negative"); - hNegativeStatusReachedTOF->GetXaxis()->SetBinLabel(2, "Has only TOF sig"); - hNegativeStatusReachedTOF->GetXaxis()->SetBinLabel(3, "Has only TOF ev time"); - hNegativeStatusReachedTOF->GetXaxis()->SetBinLabel(4, "Has full time info"); - - // V0 Radius - histos.add("hLambdaMass", "hLambdaMass", {HistType::kTH1F, {axisLambdaMass}}); - histos.add("hAssocLambdaMass", "hAssocLambdaMass", {HistType::kTH1F, {axisLambdaMass}}); - histos.add("hAssocLambdaMassGoodTime", "hAssocLambdaMassGoodTime", {HistType::kTH1F, {axisLambdaMass}}); - histos.add("hAssocLambdaMassBadTime", "hAssocLambdaMassBadTime", {HistType::kTH1F, {axisLambdaMass}}); - - // V0 Radius - histos.add("h2dLambdaRadiusVsPt", "hLambdaRadiusVsPt", {HistType::kTH2F, {axisPt, axisRadius}}); - - // Invariant Mass - histos.add("h2dLambdaMassVsPt", "hLambdaMassVsPt", {HistType::kTH2F, {axisPt, axisLambdaMass}}); - - // Invariant Mass - histos.add("h2dLambdaMassVsTOFCut", "h2dLambdaMassVsTOFCut", {HistType::kTH2F, {axisLambdaMass, axisTOFCut}}); - histos.add("h2dLambdaMassVsTOFCutWithSignals", "h2dLambdaMassVsTOFCutWithSignals", {HistType::kTH2F, {axisLambdaMass, axisTOFCut}}); - histos.add("h2dLambdaMassVsTOFCutMeson", "h2dLambdaMassVsTOFCutMeson", {HistType::kTH2F, {axisLambdaMass, axisTOFCut}}); - histos.add("h2dLambdaMassVsTOFCutMesonWithSignals", "h2dLambdaMassVsTOFCutMesonWithSignals", {HistType::kTH2F, {axisLambdaMass, axisTOFCut}}); - - // Invariant Mass with TOF selections - histos.add("hLambdaMass_ProtonTOF", "hLambdaMass_ProtonTOF", {HistType::kTH1F, {axisLambdaMass}}); - histos.add("hLambdaMass_PionTOF", "hLambdaMass_PionTOF", {HistType::kTH1F, {axisLambdaMass}}); - histos.add("hLambdaMass_AllTOF", "hLambdaMass_AllTOF", {HistType::kTH1F, {axisLambdaMass}}); - histos.add("hLambdaMass_DeltaDecayTime", "hLambdaMass_DeltaDecayTime", {HistType::kTH1F, {axisLambdaMass}}); - histos.add("h2dLambdaMassVsPt_ProtonTOF", "hLambdaMassVsPtProtonTOF", {HistType::kTH2F, {axisPt, axisLambdaMass}}); - histos.add("h2dLambdaMassVsPt_PionTOF", "hLambdaMassVsPtPionTOF", {HistType::kTH2F, {axisPt, axisLambdaMass}}); - histos.add("h2dLambdaMassVsPt_AllTOF", "hLambdaMassVsPtAllTOF", {HistType::kTH2F, {axisPt, axisLambdaMass}}); - histos.add("h2dLambdaMassVsPt_DeltaDecayTime", "hLambdaMassVsPtDeltaDecayTime", {HistType::kTH2F, {axisPt, axisLambdaMass}}); - - // Invariant Mass with TOF selections - histos.add("hLambdaMass_InvertProtonTOF", "hLambdaMass_InvertProtonTOF", {HistType::kTH1F, {axisLambdaMass}}); - histos.add("hLambdaMass_InvertPionTOF", "hLambdaMass_InvertPionTOF", {HistType::kTH1F, {axisLambdaMass}}); - histos.add("hLambdaMass_InvertAllTOF", "hLambdaMass_InvertAllTOF", {HistType::kTH1F, {axisLambdaMass}}); - histos.add("h2dLambdaMassVsPt_InvertProtonTOF", "hLambdaMassVsPtInvertProtonTOF", {HistType::kTH2F, {axisPt, axisLambdaMass}}); - histos.add("h2dLambdaMassVsPt_InvertPionTOF", "hLambdaMassVsPtInvertPionTOF", {HistType::kTH2F, {axisPt, axisLambdaMass}}); - histos.add("h2dLambdaMassVsPt_InvertAllTOF", "hLambdaMassVsPtInvertAllTOF", {HistType::kTH2F, {axisPt, axisLambdaMass}}); - - // radius vs prong length - histos.add("h2dProtonLengthVsRadius", "h2dProtonLengthVsRadius", {HistType::kTH2F, {axisRadius, axisLength}}); - histos.add("h2dPionLengthVsRadius", "h2dPionLengthVsRadius", {HistType::kTH2F, {axisRadius, axisLength}}); - - // recalculated vs topv lengths - histos.add("h2dProtonLengthVsLengthToPV", "h2dProtonLengthVsRadiusToPV", {HistType::kTH2F, {axisRadius, axisRadius}}); - histos.add("h2dPionLengthVsLengthToPV", "h2dPionLengthVsLengthToPV", {HistType::kTH2F, {axisRadius, axisRadius}}); - - // TOF PID testing for prongs - histos.add("h2dProtonDeltaTimeVsPt", "h2dProtonDeltaTimeVsPt", {HistType::kTH2F, {axisPt, axisDeltaTime}}); - histos.add("h2dProtonDeltaTimeVsRadius", "h2dProtonDeltaTimeVsRadius", {HistType::kTH2F, {axisRadius, axisDeltaTime}}); - histos.add("h2dPionDeltaTimeVsPt", "h2dPionDeltaTimeVsPt", {HistType::kTH2F, {axisPt, axisDeltaTime}}); - histos.add("h2dPionDeltaTimeVsRadius", "h2dPionDeltaTimeVsRadius", {HistType::kTH2F, {axisRadius, axisDeltaTime}}); - - // TOF PID testing for prongs - histos.add("h2dProtonDeltaTimeVsPt_MassSelected", "h2dProtonDeltaTimeVsPt_MassSelected", {HistType::kTH2F, {axisPt, axisDeltaTime}}); - histos.add("h2dProtonDeltaTimeVsRadius_MassSelected", "h2dProtonDeltaTimeVsRadius_MassSelected", {HistType::kTH2F, {axisRadius, axisDeltaTime}}); - histos.add("h2dPionDeltaTimeVsPt_MassSelected", "h2dPionDeltaTimeVsPt_MassSelected", {HistType::kTH2F, {axisPt, axisDeltaTime}}); - histos.add("h2dPionDeltaTimeVsRadius_MassSelected", "h2dPionDeltaTimeVsRadius_MassSelected", {HistType::kTH2F, {axisRadius, axisDeltaTime}}); - - // delta lambda decay time - histos.add("h2dLambdaDeltaDecayTime", "h2dLambdaDeltaDecayTime", {HistType::kTH2F, {axisPt, axisDeltaTime}}); - histos.add("h2dLambdaDeltaDecayTime_MassSelected", "h2dLambdaDeltaDecayTime_MassSelected", {HistType::kTH2F, {axisPt, axisDeltaTime}}); - - // beta plots - histos.add("h2dLambdaBeta", "h2dLambdaBeta", {HistType::kTH2F, {axisPt, axisBeta}}); - histos.add("h2dLambdaBeta_MassSelected", "h2dLambdaBeta_MassSelected", {HistType::kTH2F, {axisPt, axisBeta}}); - - // length vs time for prongs / debug - histos.add("h2dTimeVsLengthProtonProng", "h2dTimeVsLengthProtonProng", {HistType::kTH2F, {axisLength, axisTime}}); - histos.add("h2dTimeVsLengthPionProng", "h2dTimeVsLengthPionProng", {HistType::kTH2F, {axisLength, axisTime}}); - histos.add("h1dMassK0Short", "h1dMassK0Short", {HistType::kTH1F, {axisK0ShortMass}}); histos.add("h1dMassLambda", "h1dMassLambda", {HistType::kTH1F, {axisLambdaMass}}); histos.add("h1dMassAntiLambda", "h1dMassAntiLambda", {HistType::kTH1F, {axisLambdaMass}}); @@ -230,39 +112,21 @@ struct strangepidqa { histos.add("h3dMassK0Short", "h3dMassK0Short", {HistType::kTH3F, {centAxis, axisPt, axisK0ShortMass}}); histos.add("h3dMassLambda", "h3dMassLambda", {HistType::kTH3F, {centAxis, axisPt, axisLambdaMass}}); histos.add("h3dMassAntiLambda", "h3dMassAntiLambda", {HistType::kTH3F, {centAxis, axisPt, axisLambdaMass}}); - histos.add("h3dMassCompatibleK0Short", "h3dMassCompatibleK0Short", {HistType::kTH3F, {centAxis, axisPt, axisK0ShortMass}}); histos.add("h3dMassCompatibleLambda", "h3dMassCompatibleLambda", {HistType::kTH3F, {centAxis, axisPt, axisLambdaMass}}); histos.add("h3dMassCompatibleAntiLambda", "h3dMassCompatibleAntiLambda", {HistType::kTH3F, {centAxis, axisPt, axisLambdaMass}}); - // --- ASSOCIATED --- - // V0 Radius - if (doprocessSim) { - histos.add("h2dAssocLambdaRadiusVsPt", "hLambdaRadiusVsPt", {HistType::kTH2F, {axisPt, axisRadius}}); + // cross-check if compatibility requested with primary TOF instead (requires non-derived) + histos.add("h3dPrimaryTOFMassCompatibleK0Short", "h3dPrimaryTOFMassCompatibleK0Short", {HistType::kTH3F, {centAxis, axisPt, axisK0ShortMass}}); + histos.add("h3dPrimaryTOFMassCompatibleLambda", "h3dPrimaryTOFMassCompatibleLambda", {HistType::kTH3F, {centAxis, axisPt, axisLambdaMass}}); + histos.add("h3dPrimaryTOFMassCompatibleAntiLambda", "h3dPrimaryTOFMassCompatibleAntiLambda", {HistType::kTH3F, {centAxis, axisPt, axisLambdaMass}}); - // Invariant Mass - histos.add("h2dAssocLambdaMassVsPt", "hLambdaMassVsPt", {HistType::kTH2F, {axisPt, axisLambdaMass}}); - - // radius vs prong length - histos.add("h2dAssocProtonLengthVsRadius", "h2dAssocProtonLengthVsRadius", {HistType::kTH2F, {axisRadius, axisLength}}); - histos.add("h2dAssocPionLengthVsRadius", "h2dAssocPionLengthVsRadius", {HistType::kTH2F, {axisRadius, axisLength}}); - - // recalculated vs topv lengths - histos.add("h2dAssocProtonLengthVsLengthToPV", "h2dAssocProtonLengthVsRadiusToPV", {HistType::kTH2F, {axisRadius, axisRadius}}); - histos.add("h2dAssocPionLengthVsLengthToPV", "h2dAssocPionLengthVsLengthToPV", {HistType::kTH2F, {axisRadius, axisRadius}}); - - // TOF PID testing for prongs - histos.add("h2dAssocProtonDeltaTimeVsPt", "h2dAssocProtonDeltaTimeVsPt", {HistType::kTH2F, {axisPt, axisDeltaTime}}); - histos.add("h2dAssocProtonDeltaTimeVsRadius", "h2dAssocProtonDeltaTimeVsRadius", {HistType::kTH2F, {axisRadius, axisDeltaTime}}); - histos.add("h2dAssocPionDeltaTimeVsPt", "h2dAssocPionDeltaTimeVsPt", {HistType::kTH2F, {axisPt, axisDeltaTime}}); - histos.add("h2dAssocPionDeltaTimeVsRadius", "h2dAssocPionDeltaTimeVsRadius", {HistType::kTH2F, {axisRadius, axisDeltaTime}}); - - // delta lambda decay time - histos.add("h2dAssocLambdaDeltaDecayTime", "h2dAssocLambdaDeltaDecayTime", {HistType::kTH2F, {axisPt, axisDeltaTime}}); - histos.add("h2dAssocLambdaDeltaDecayTime_MassSelected", "h2dAssocLambdaDeltaDecayTime_MassSelected", {HistType::kTH2F, {axisPt, axisDeltaTime}}); - } + // plot Nsigma: primary vs secondary TOF vs pT (use narrow window around mass) + histos.add("h3dNSigmasLaPr", "h3dNSigmasLaPr", {HistType::kTH3F, {axisNSigma, axisNSigma, axisPt}}); + histos.add("h3dNSigmasLaPi", "h3dNSigmasLaPi", {HistType::kTH3F, {axisNSigma, axisNSigma, axisPt}}); + histos.add("h3dNSigmasK0Pi", "h3dNSigmasK0Pi", {HistType::kTH3F, {axisNSigma, axisNSigma, axisPt}}); - if (doprocessCascades) { + if (doprocessCascades || doprocessCascadesNonDerived) { histos.add("h1dMassXiMinus", "h1dMassXiMinus", {HistType::kTH1F, {massAxisXi}}); histos.add("h1dMassXiPlus", "h1dMassXiPlus", {HistType::kTH1F, {massAxisXi}}); histos.add("h1dMassOmegaMinus", "h1dMassOmegaMinus", {HistType::kTH1F, {massAxisOmega}}); @@ -276,19 +140,30 @@ struct strangepidqa { histos.add("h3dMassXiPlus", "h3dMassXiPlus", {HistType::kTH3F, {centAxis, axisPt, massAxisXi}}); histos.add("h3dMassOmegaMinus", "h3dMassOmegaMinus", {HistType::kTH3F, {centAxis, axisPt, massAxisOmega}}); histos.add("h3dMassOmegaPlus", "h3dMassOmegaPlus", {HistType::kTH3F, {centAxis, axisPt, massAxisOmega}}); - histos.add("h3dMassCompatibleXiMinus", "h3dMassCompatibleXiMinus", {HistType::kTH3F, {centAxis, axisPt, massAxisXi}}); histos.add("h3dMassCompatibleXiPlus", "h3dMassCompatibleXiPlus", {HistType::kTH3F, {centAxis, axisPt, massAxisXi}}); histos.add("h3dMassCompatibleOmegaMinus", "h3dMassCompatibleOmegaMinus", {HistType::kTH3F, {centAxis, axisPt, massAxisOmega}}); histos.add("h3dMassCompatibleOmegaPlus", "h3dMassCompatibleOmegaPlus", {HistType::kTH3F, {centAxis, axisPt, massAxisOmega}}); + + // cross-check if compatibility requested with primary TOF instead (requires non-derived) + histos.add("h3dPrimaryTOFMassCompatibleXiMinus", "h3dPrimaryTOFMassCompatibleXiMinus", {HistType::kTH3F, {centAxis, axisPt, massAxisXi}}); + histos.add("h3dPrimaryTOFMassCompatibleXiPlus", "h3dPrimaryTOFMassCompatibleXiPlus", {HistType::kTH3F, {centAxis, axisPt, massAxisXi}}); + histos.add("h3dPrimaryTOFMassCompatibleOmegaMinus", "h3dPrimaryTOFMassCompatibleOmegaMinus", {HistType::kTH3F, {centAxis, axisPt, massAxisOmega}}); + histos.add("h3dPrimaryTOFMassCompatibleOmegaPlus", "h3dPrimaryTOFMassCompatibleOmegaPlus", {HistType::kTH3F, {centAxis, axisPt, massAxisOmega}}); + + // plot Nsigma: primary vs secondary TOF vs pT (use narrow window around mass) + histos.add("h3dNSigmasXiLaPr", "h3dNSigmasXiLaPr", {HistType::kTH3F, {axisNSigma, axisNSigma, axisPt}}); + histos.add("h3dNSigmasXiLaPi", "h3dNSigmasXiLaPi", {HistType::kTH3F, {axisNSigma, axisNSigma, axisPt}}); + histos.add("h3dNSigmasXiPi", "h3dNSigmasXiPi", {HistType::kTH3F, {axisNSigma, axisNSigma, axisPt}}); + + histos.add("h3dNSigmasOmLaPr", "h3dNSigmasOmLaPr", {HistType::kTH3F, {axisNSigma, axisNSigma, axisPt}}); + histos.add("h3dNSigmasOmLaPi", "h3dNSigmasOmLaPi", {HistType::kTH3F, {axisNSigma, axisNSigma, axisPt}}); + histos.add("h3dNSigmasOmKa", "h3dNSigmasOmKa", {HistType::kTH3F, {axisNSigma, axisNSigma, axisPt}}); } } void processReal(soa::Join::iterator const& coll, soa::Join const& v0s, soa::Join const&) { - if (coll.centFT0C() > maxCentrality || coll.centFT0C() < minCentrality) - return; - for (auto& lambda : v0s) { // selecting photons from Sigma0 if (TMath::Abs(lambda.eta()) > 0.5) @@ -326,127 +201,157 @@ struct strangepidqa { histos.fill(HIST("h1dMassCompatibleK0Short"), lambda.mK0Short()); } } + } + } - histos.fill(HIST("h2dLambdaMassVsTOFCut"), lambda.mLambda(), TMath::Abs(lambda.posTOFDeltaTLaPr())); - histos.fill(HIST("h2dLambdaMassVsTOFCutMeson"), lambda.mLambda(), TMath::Abs(lambda.negTOFDeltaTLaPi())); - - if (lambda.v0radius() < minV0Radius) - continue; - - histos.fill(HIST("h2dLambdaDeltaDecayTime"), lambda.pt(), lambda.deltaDecayTimeLambda()); - if (TMath::Abs(lambda.mLambda() - 1.115683) < 0.01 && lambda.v0cosPA() > minCosPA) { - histos.fill(HIST("h2dLambdaDeltaDecayTime_MassSelected"), lambda.pt(), lambda.deltaDecayTimeLambda()); - } - - if (lambda.pt() > minPtV0 && lambda.pt() < maxPtV0) - histos.fill(HIST("hLambdaMass"), lambda.mLambda()); + // ____________________________________________________________________________ + // QA TOF NSigma quantities + Filter preFilter = + nabs(aod::cascdata::dcapostopv) > v0setting_dcapostopv&& nabs(aod::cascdata::dcanegtopv) > v0setting_dcanegtopv&& nabs(aod::cascdata::dcabachtopv) > cascadesetting_dcabachtopv&& aod::cascdata::dcaV0daughters < v0setting_dcav0dau&& aod::cascdata::dcacascdaughters < cascadesetting_dcacascdau; - histos.fill(HIST("h2dLambdaRadiusVsPt"), lambda.pt(), lambda.v0radius()); - histos.fill(HIST("h2dLambdaMassVsPt"), lambda.pt(), lambda.mLambda()); + void processCascades(soa::Join const& collisions, soa::Filtered> const& Cascades, soa::Join const&) + { + for (auto& casc : Cascades) { + auto col = collisions.rawIteratorAt(casc.straCollisionId()); + + // major selections here + if (casc.v0radius() > v0setting_radius && + casc.cascradius() > cascadesetting_cascradius && + casc.v0cosPA(col.posX(), col.posY(), col.posZ()) > v0setting_cospa && + casc.casccosPA(col.posX(), col.posY(), col.posZ()) > cascadesetting_cospa && + casc.dcav0topv(col.posX(), col.posY(), col.posZ()) > cascadesetting_mindcav0topv && + TMath::Abs(casc.mLambda() - 1.115683) < cascadesetting_v0masswindow) { - histos.fill(HIST("h2dProtonDeltaTimeVsPt"), lambda.pt(), lambda.posTOFDeltaTLaPr()); - histos.fill(HIST("h2dProtonDeltaTimeVsRadius"), lambda.v0radius(), lambda.posTOFDeltaTLaPr()); - histos.fill(HIST("h2dPionDeltaTimeVsPt"), lambda.pt(), lambda.negTOFDeltaTLaPi()); - histos.fill(HIST("h2dPionDeltaTimeVsRadius"), lambda.v0radius(), lambda.negTOFDeltaTLaPi()); - histos.fill(HIST("h2dLambdaBeta"), lambda.p(), lambda.tofBetaLambda()); + auto negExtra = casc.negTrackExtra_as>(); + auto posExtra = casc.posTrackExtra_as>(); + auto bachExtra = casc.bachTrackExtra_as>(); - if (TMath::Abs(lambda.mLambda() - 1.115683) < 0.01 && lambda.v0cosPA() > minCosPA) { - histos.fill(HIST("h2dProtonDeltaTimeVsPt_MassSelected"), lambda.pt(), lambda.posTOFDeltaTLaPr()); - histos.fill(HIST("h2dProtonDeltaTimeVsRadius_MassSelected"), lambda.v0radius(), lambda.posTOFDeltaTLaPr()); - histos.fill(HIST("h2dPionDeltaTimeVsPt_MassSelected"), lambda.pt(), lambda.negTOFDeltaTLaPi()); - histos.fill(HIST("h2dPionDeltaTimeVsRadius_MassSelected"), lambda.v0radius(), lambda.negTOFDeltaTLaPi()); - histos.fill(HIST("h2dLambdaBeta_MassSelected"), lambda.p(), lambda.tofBetaLambda()); - } + if (negExtra.tpcCrossedRows() < tpcCrossedRows || posExtra.tpcCrossedRows() < tpcCrossedRows || bachExtra.tpcCrossedRows() < tpcCrossedRows) + continue; - // Standard selection of time - if (TMath::Abs(lambda.deltaDecayTimeLambda()) < maxDeltaTimeDecay) { - histos.fill(HIST("h2dLambdaMassVsPt_DeltaDecayTime"), lambda.pt(), lambda.mLambda()); - if (lambda.pt() > minPtV0 && lambda.pt() < maxPtV0) - histos.fill(HIST("hLambdaMass_DeltaDecayTime"), lambda.mLambda()); - } + if (casc.sign() < 0) { + if (TMath::Abs(posExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(bachExtra.tpcNSigmaPi()) < tpcNsigmaBachelor) { + histos.fill(HIST("h3dMassXiMinus"), col.centFT0C(), casc.pt(), casc.mXi()); + histos.fill(HIST("h1dMassXiMinus"), casc.mXi()); + if (casc.tofXiCompatibility(tofNsigmaCompatibilityCascades.value)) { + histos.fill(HIST("h3dMassCompatibleXiMinus"), col.centFT0C(), casc.pt(), casc.mXi()); + histos.fill(HIST("h1dMassCompatibleXiMinus"), casc.mXi()); + } + } + if (TMath::Abs(posExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(bachExtra.tpcNSigmaKa()) < tpcNsigmaBachelor) { + histos.fill(HIST("h3dMassOmegaMinus"), col.centFT0C(), casc.pt(), casc.mOmega()); + histos.fill(HIST("h1dMassOmegaMinus"), casc.mOmega()); + if (casc.tofOmegaCompatibility(tofNsigmaCompatibilityCascades.value)) { + histos.fill(HIST("h3dMassCompatibleOmegaMinus"), col.centFT0C(), casc.pt(), casc.mOmega()); + histos.fill(HIST("h1dMassCompatibleOmegaMinus"), casc.mOmega()); + } + } + } else { + if (TMath::Abs(posExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(negExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(bachExtra.tpcNSigmaPi()) < tpcNsigmaBachelor) { + histos.fill(HIST("h3dMassXiPlus"), col.centFT0C(), casc.pt(), casc.mXi()); + histos.fill(HIST("h1dMassXiPlus"), casc.mXi()); + if (casc.tofXiCompatibility(tofNsigmaCompatibilityCascades.value)) { + histos.fill(HIST("h3dMassCompatibleXiPlus"), col.centFT0C(), casc.pt(), casc.mXi()); + histos.fill(HIST("h1dMassCompatibleXiPlus"), casc.mXi()); + } + } - if (TMath::Abs(lambda.posTOFDeltaTLaPr()) < maxDeltaTimeProton) { - histos.fill(HIST("h2dLambdaMassVsPt_ProtonTOF"), lambda.pt(), lambda.mLambda()); - if (lambda.pt() > minPtV0 && lambda.pt() < maxPtV0) - histos.fill(HIST("hLambdaMass_ProtonTOF"), lambda.mLambda()); - } - if (TMath::Abs(lambda.negTOFDeltaTLaPi()) < maxDeltaTimeProton) { - histos.fill(HIST("h2dLambdaMassVsPt_PionTOF"), lambda.pt(), lambda.mLambda()); - if (lambda.pt() > minPtV0 && lambda.pt() < maxPtV0) - histos.fill(HIST("hLambdaMass_PionTOF"), lambda.mLambda()); - if (TMath::Abs(lambda.posTOFDeltaTLaPr()) < maxDeltaTimeProton) { - histos.fill(HIST("h2dLambdaMassVsPt_AllTOF"), lambda.pt(), lambda.mLambda()); - if (lambda.pt() > minPtV0 && lambda.pt() < maxPtV0) - histos.fill(HIST("hLambdaMass_AllTOF"), lambda.mLambda()); - } - } - // Inversion of time selection for debug - // if(TMath::Abs(lambda.deltaDecayTimeLambda())>maxDeltaTimeDecay && TMath::Abs(lambda.deltaDecayTimeLambda()) < 5e+4){ - // histos.fill(HIST("h2dLambdaMassVsPt_DeltaDecayTime"), lambda.pt(), lambda.mLambda()); - // if(lambda.pt()>minPtV0 && lambda.pt() < maxPtV0) histos.fill(HIST("hLambdaMass_DeltaDecayTime"), lambda.mLambda()); - // } - - if (TMath::Abs(lambda.posTOFDeltaTLaPr()) > maxDeltaTimeProton && TMath::Abs(lambda.posTOFDeltaTLaPr()) < 5e+4) { - histos.fill(HIST("h2dLambdaMassVsPt_InvertProtonTOF"), lambda.pt(), lambda.mLambda()); - if (lambda.pt() > minPtV0 && lambda.pt() < maxPtV0) - histos.fill(HIST("hLambdaMass_InvertProtonTOF"), lambda.mLambda()); - } - if (TMath::Abs(lambda.negTOFDeltaTLaPi()) > maxDeltaTimeProton && TMath::Abs(lambda.negTOFDeltaTLaPi()) < 5e+4) { - histos.fill(HIST("h2dLambdaMassVsPt_InvertPionTOF"), lambda.pt(), lambda.mLambda()); - if (lambda.pt() > minPtV0 && lambda.pt() < maxPtV0) - histos.fill(HIST("hLambdaMass_InvertPionTOF"), lambda.mLambda()); - if (TMath::Abs(lambda.posTOFDeltaTLaPr()) > maxDeltaTimeProton && TMath::Abs(lambda.posTOFDeltaTLaPr()) < 5e+4) { - histos.fill(HIST("h2dLambdaMassVsPt_InvertAllTOF"), lambda.pt(), lambda.mLambda()); - if (lambda.pt() > minPtV0 && lambda.pt() < maxPtV0) - histos.fill(HIST("hLambdaMass_InvertAllTOF"), lambda.mLambda()); + if (TMath::Abs(posExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(negExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(bachExtra.tpcNSigmaKa()) < tpcNsigmaBachelor) { + histos.fill(HIST("h3dMassOmegaPlus"), col.centFT0C(), casc.pt(), casc.mOmega()); + histos.fill(HIST("h1dMassOmegaPlus"), casc.mOmega()); + if (casc.tofOmegaCompatibility(tofNsigmaCompatibilityCascades.value)) { + histos.fill(HIST("h3dMassCompatibleOmegaPlus"), col.centFT0C(), casc.pt(), casc.mOmega()); + histos.fill(HIST("h1dMassCompatibleOmegaPlus"), casc.mOmega()); + } + } } } } } - void processSim(aod::StraCollision const&, soa::Join const& v0s) + void processRealNonDerived(soa::Join const& collisions, soa::Join const& v0s, soa::Join const&) { - for (auto& lambda : v0s) { // selecting photons from Sigma0 - if (lambda.pdgCode() != 3122) - continue; - if (!lambda.isPhysicalPrimary()) - continue; - if (lambda.pdgCodePositive() != 2212) - continue; - if (lambda.pdgCodeNegative() != -211) + for(auto const& col : collisions){ + histos.fill(HIST("hEventCentrality"), col.centFT0C()); + } + + for (auto& lambda : v0s) { + auto coll = collisions.rawIteratorAt(lambda.collisionId()); + + if (TMath::Abs(lambda.eta()) > 0.5) continue; - histos.fill(HIST("hAssocLambdaMass"), lambda.mLambda()); + auto negExtra = lambda.negTrack_as>(); + auto posExtra = lambda.posTrack_as>(); - histos.fill(HIST("h2dAssocLambdaRadiusVsPt"), lambda.pt(), lambda.v0radius()); - histos.fill(HIST("h2dAssocLambdaMassVsPt"), lambda.pt(), lambda.mLambda()); + bool primaryTOFcompatible_Lambda = + (!posExtra.hasTOF() || (posExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)) && + (!negExtra.hasTOF() || (negExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)); - histos.fill(HIST("h2dAssocProtonDeltaTimeVsPt"), lambda.pt(), lambda.posTOFDeltaTLaPr()); - histos.fill(HIST("h2dAssocProtonDeltaTimeVsRadius"), lambda.v0radius(), lambda.posTOFDeltaTLaPr()); - histos.fill(HIST("h2dAssocPionDeltaTimeVsPt"), lambda.pt(), lambda.negTOFDeltaTLaPi()); - histos.fill(HIST("h2dAssocPionDeltaTimeVsRadius"), lambda.v0radius(), lambda.negTOFDeltaTLaPi()); + bool primaryTOFcompatible_AntiLambda = + (!posExtra.hasTOF() || (posExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && + (!negExtra.hasTOF() || (negExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)); - // delta lambda decay time - histos.fill(HIST("h2dAssocLambdaDeltaDecayTime"), lambda.pt(), lambda.deltaDecayTimeLambda()); - } - } + bool primaryTOFcompatible_K0Short = + (!posExtra.hasTOF() || (posExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && + (!negExtra.hasTOF() || (negExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)); - // ____________________________________________________________________________ - // QA TOF NSigma quantities + if (TMath::Abs(posExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPi()) < tpcNsigmaPion) { + // lambda case + histos.fill(HIST("h3dMassLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); + histos.fill(HIST("h1dMassLambda"), lambda.mLambda()); + if (lambda.tofLambdaCompatibility(tofNsigmaCompatibility.value)) { + histos.fill(HIST("h3dMassCompatibleLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); + histos.fill(HIST("h1dMassCompatibleLambda"), lambda.mLambda()); + } + if (primaryTOFcompatible_Lambda){ + histos.fill(HIST("h3dPrimaryTOFMassCompatibleLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); + } + if(std::abs(lambda.mLambda()-o2::constants::physics::MassLambda)> negCasc = aod::cascdata::sign < 0; - Partition> posCasc = aod::cascdata::sign > 0; + if (TMath::Abs(posExtra.tpcNSigmaPi()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPr()) < tpcNsigmaPion) { + // lambda case + histos.fill(HIST("h3dMassAntiLambda"), coll.centFT0C(), lambda.pt(), lambda.mAntiLambda()); + histos.fill(HIST("h1dMassAntiLambda"), lambda.mAntiLambda()); + if (lambda.tofAntiLambdaCompatibility(tofNsigmaCompatibility.value)) { + histos.fill(HIST("h3dMassCompatibleAntiLambda"), coll.centFT0C(), lambda.pt(), lambda.mAntiLambda()); + histos.fill(HIST("h1dMassCompatibleAntiLambda"), lambda.mAntiLambda()); + } + if (primaryTOFcompatible_AntiLambda){ + histos.fill(HIST("h3dPrimaryTOFMassCompatibleAntiLambda"), coll.centFT0C(), lambda.pt(), lambda.mAntiLambda()); + } + } - Filter preFilter = - nabs(aod::cascdata::dcapostopv) > v0setting_dcapostopv&& nabs(aod::cascdata::dcanegtopv) > v0setting_dcanegtopv&& nabs(aod::cascdata::dcabachtopv) > cascadesetting_dcabachtopv&& aod::cascdata::dcaV0daughters < v0setting_dcav0dau&& aod::cascdata::dcacascdaughters < cascadesetting_dcacascdau; + if (TMath::Abs(posExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(negExtra.tpcNSigmaPr()) < tpcNsigmaPion) { + // lambda case + histos.fill(HIST("h3dMassK0Short"), coll.centFT0C(), lambda.pt(), lambda.mK0Short()); + histos.fill(HIST("h1dMassK0Short"), lambda.mK0Short()); + if (lambda.tofK0ShortCompatibility(tofNsigmaCompatibility.value)) { + histos.fill(HIST("h3dMassCompatibleK0Short"), coll.centFT0C(), lambda.pt(), lambda.mK0Short()); + histos.fill(HIST("h1dMassCompatibleK0Short"), lambda.mK0Short()); + } + if (primaryTOFcompatible_K0Short){ + histos.fill(HIST("h3dPrimaryTOFMassCompatibleK0Short"), coll.centFT0C(), lambda.pt(), lambda.mK0Short()); + } + if(std::abs(lambda.mK0Short()-o2::constants::physics::MassK0Short)::iterator const& col, soa::Filtered> const& Cascades, soa::Join const&) + // to test original data (not derived) as well, compare with primary TOF Nsigmas + // don't do grouping, faster to simply stream through + void processCascadesNonDerived(soa::Join const& collisions, soa::Filtered> const& Cascades, soa::Join const&) { - histos.fill(HIST("hEventCentrality"), col.centFT0C()); - if (col.centFT0C() > maxCentrality || col.centFT0C() < minCentrality) - return; - for (auto& casc : Cascades) { + auto col = collisions.rawIteratorAt(casc.collisionId()); + // major selections here if (casc.v0radius() > v0setting_radius && casc.cascradius() > cascadesetting_cascradius && @@ -455,12 +360,33 @@ struct strangepidqa { casc.dcav0topv(col.posX(), col.posY(), col.posZ()) > cascadesetting_mindcav0topv && TMath::Abs(casc.mLambda() - 1.115683) < cascadesetting_v0masswindow) { - auto negExtra = casc.negTrackExtra_as>(); - auto posExtra = casc.posTrackExtra_as>(); - auto bachExtra = casc.bachTrackExtra_as>(); + auto negExtra = casc.negTrack_as>(); + auto posExtra = casc.posTrack_as>(); + auto bachExtra = casc.bachelor_as>(); - if (negExtra.tpcCrossedRows() < tpcCrossedRows || posExtra.tpcCrossedRows() < tpcCrossedRows || bachExtra.tpcCrossedRows() < tpcCrossedRows) + if (negExtra.tpcNClsCrossedRows() < tpcCrossedRows || posExtra.tpcNClsCrossedRows() < tpcCrossedRows || bachExtra.tpcNClsCrossedRows() < tpcCrossedRows){ continue; + } + + bool primaryTOFcompatible_XiMinus = + (!posExtra.hasTOF() || (posExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)) && + (!negExtra.hasTOF() || (negExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && + (!bachExtra.hasTOF() || (bachExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)); + + bool primaryTOFcompatible_XiPlus = + (!posExtra.hasTOF() || (posExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && + (!negExtra.hasTOF() || (negExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)) && + (!bachExtra.hasTOF() || (bachExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)); + + bool primaryTOFcompatible_OmegaMinus = + (!posExtra.hasTOF() || (posExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)) && + (!negExtra.hasTOF() || (negExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && + (!bachExtra.hasTOF() || (bachExtra.tofNSigmaKa() < tofNsigmaCompatibilityCascades.value)); + + bool primaryTOFcompatible_OmegaPlus = + (!posExtra.hasTOF() || (posExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && + (!negExtra.hasTOF() || (negExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)) && + (!bachExtra.hasTOF() || (bachExtra.tofNSigmaKa() < tofNsigmaCompatibilityCascades.value)); if (casc.sign() < 0) { if (TMath::Abs(posExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(bachExtra.tpcNSigmaPi()) < tpcNsigmaBachelor) { @@ -470,6 +396,14 @@ struct strangepidqa { histos.fill(HIST("h3dMassCompatibleXiMinus"), col.centFT0C(), casc.pt(), casc.mXi()); histos.fill(HIST("h1dMassCompatibleXiMinus"), casc.mXi()); } + if (primaryTOFcompatible_XiMinus){ + histos.fill(HIST("h3dPrimaryTOFMassCompatibleXiMinus"), col.centFT0C(), casc.pt(), casc.mXi()); + } + if(std::abs(casc.mXi()-o2::constants::physics::MassXiMinus) Date: Sun, 31 Aug 2025 17:33:02 +0200 Subject: [PATCH 7/8] Please consider the following formatting changes (#467) --- .../Strangeness/strangenesstofpid.cxx | 222 +++++++++--------- PWGLF/Tasks/QC/strangepidqa.cxx | 88 +++---- 2 files changed, 155 insertions(+), 155 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 3435e8a94d0..301e73c12ca 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -100,8 +100,8 @@ struct strangenesstofpid { Configurable calculateV0s{"calculateV0s", -1, "calculate V0-related TOF PID (0: no, 1: yes, -1: auto)"}; Configurable calculateCascades{"calculateCascades", -1, "calculate cascade-related TOF PID (0: no, 1: yes, -1: auto)"}; -// Operation and minimisation criteria - struct : ConfigurableGroup { + // Operation and minimisation criteria + struct : ConfigurableGroup { Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; Configurable tofPosition{"tofPosition", 377.934f, "TOF effective (inscribed) radius"}; @@ -109,18 +109,18 @@ struct strangenesstofpid { Configurable numberOfStepsFirstStage{"numberOfStepsFirstStage", 500, "Max number of alpha rotations to attempt in first stage"}; Configurable numberOfStepsSecondStage{"numberOfStepsSecondStage", 500, "Max number of steps rotations to attempt in second stage"}; Configurable stepSizeFirstStage{"stepSizeFirstStage", 2.0f, "Max number of alpha rotations to attempt in first stage"}; - Configurable firstApproximationThreshold{"firstApproximationThreshold",4.0f, "be satisfied if first approach to TOF radius is OK within this threshold (cm)"}; + Configurable firstApproximationThreshold{"firstApproximationThreshold", 4.0f, "be satisfied if first approach to TOF radius is OK within this threshold (cm)"}; // regulate e-loss calculation to save CPU - Configurable maxPionMomentumForEloss{"maxPionMomentumForEloss",1.5f, "above this momentum, do fast analytical TOF calculation for pions"}; - Configurable maxKaonMomentumForEloss{"maxKaonMomentumForEloss",2.0f, "above this momentum, do fast analytical TOF calculation for kaons"}; - Configurable maxProtonMomentumForEloss{"maxProtonMomentumForEloss",2.5f, "above this momentum, do fast analytical TOF calculation for protons"}; - - Configurable rejectKaonMomentumForEloss{"rejectKaonMomentumForEloss",0.2f, "below this momentum, reject kaon hypothesis (won't reach TOF)"}; - Configurable rejectProtonMomentumForEloss{"rejectProtonMomentumForEloss",0.2f, "below this momentum, reject proton hypothesis (won't reach TOF)"}; + Configurable maxPionMomentumForEloss{"maxPionMomentumForEloss", 1.5f, "above this momentum, do fast analytical TOF calculation for pions"}; + Configurable maxKaonMomentumForEloss{"maxKaonMomentumForEloss", 2.0f, "above this momentum, do fast analytical TOF calculation for kaons"}; + Configurable maxProtonMomentumForEloss{"maxProtonMomentumForEloss", 2.5f, "above this momentum, do fast analytical TOF calculation for protons"}; + + Configurable rejectKaonMomentumForEloss{"rejectKaonMomentumForEloss", 0.2f, "below this momentum, reject kaon hypothesis (won't reach TOF)"}; + Configurable rejectProtonMomentumForEloss{"rejectProtonMomentumForEloss", 0.2f, "below this momentum, reject proton hypothesis (won't reach TOF)"}; Configurable tpcNsigmaThreshold{"tpcNsigmaThreshold", 6.0f, "require TPC compatibility to attempt eloss propagation (otherwise, don't calculate)"}; - } propagationConfiguration; + } propagationConfiguration; Configurable doQA{"doQA", false, "create QA histos"}; Configurable doNSigmas{"doNSigmas", true, "calculate TOF N-sigma"}; @@ -326,7 +326,7 @@ struct strangenesstofpid { float x2 = TMath::Cos(theta) * (+halfWidth) + TMath::Sin(theta) * propagationConfiguration.tofPosition; float y2 = -TMath::Sin(theta) * (+halfWidth) + TMath::Cos(theta) * propagationConfiguration.tofPosition; float thisLength = trackLengthToSegment(track, x1, y1, x2, y2, magneticField); - if (thisLength < length && thisLength > 0){ + if (thisLength < length && thisLength > 0) { length = thisLength; } } @@ -355,10 +355,10 @@ struct strangenesstofpid { { time = -1e+6; - if(track.getPID() == o2::track::PID::Proton && track.getP() < propagationConfiguration.rejectProtonMomentumForEloss.value){ + if (track.getPID() == o2::track::PID::Proton && track.getP() < propagationConfiguration.rejectProtonMomentumForEloss.value) { return; // don't attempt to calculate below-threshold protons (will stop anyway) } - if(track.getPID() == o2::track::PID::Kaon && track.getP() < propagationConfiguration.rejectKaonMomentumForEloss.value){ + if (track.getPID() == o2::track::PID::Kaon && track.getP() < propagationConfiguration.rejectKaonMomentumForEloss.value) { return; // don't attempt to calculate below-threshold kaons (will stop anyway) } @@ -380,19 +380,19 @@ struct strangenesstofpid { float segmentedRstart = segmentedRadius(xyz[0], xyz[1]); bool firstPropag; - for(int iRot = 0; iRot < propagationConfiguration.numberOfStepsFirstStage.value; iRot++){ + for (int iRot = 0; iRot < propagationConfiguration.numberOfStepsFirstStage.value; iRot++) { track.rotateParam(track.getPhi()); // start rotated float currentX = track.getX(); float tofX = currentX; bool getXatLabRok = track.getXatLabR(propagationConfiguration.tofPosition, tofX, d_bz, o2::track::DirOutward); - if(std::abs(tofX-currentX)propagateToX(track, nextX, d_bz, MAX_SIN_PHI, MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrLUT, <Integral); } @@ -404,13 +404,13 @@ struct strangenesstofpid { float currentTime = ltIntegral.getTOF(track.getPID()); if (calculationMethod.value == 2) { histos.fill(HIST("hSegRadiusFirstPropagVsStart"), segmentedRstart, segmentedR); // for debugging purposes - histos.fill(HIST("hSnp"), track.getSnp()); // for debugging purposes - histos.fill(HIST("hTOFPosition"), xyz[0], xyz[1]); // for debugging purposes - histos.fill(HIST("hSegRadius"), segmentedR); // for debugging purposes - if(!firstPropag){ + histos.fill(HIST("hSnp"), track.getSnp()); // for debugging purposes + histos.fill(HIST("hTOFPosition"), xyz[0], xyz[1]); // for debugging purposes + histos.fill(HIST("hSegRadius"), segmentedR); // for debugging purposes + if (!firstPropag) { histos.fill(HIST("hTOFPositionFirstPropagFail"), xyz[0], xyz[1]); // for debugging purposes - histos.fill(HIST("hSegRadiusFirstPropagFail"), segmentedR); // for debugging purposes - histos.fill(HIST("hSnpFirstPropagFail"), track.getSnp()); // for debugging purposes + histos.fill(HIST("hSegRadiusFirstPropagFail"), segmentedR); // for debugging purposes + histos.fill(HIST("hSnpFirstPropagFail"), track.getSnp()); // for debugging purposes } } @@ -427,9 +427,9 @@ struct strangenesstofpid { if (!trackOKextra) { if (calculationMethod.value == 2) { track.getXYZGlo(xyz); - histos.fill(HIST("hTOFPositionStopped"), xyz[0], xyz[1]); // for debugging purposes - histos.fill(HIST("hSnpStopped"), snp); // for debugging purposes - histos.fill(HIST("hSegRadiusStopped"), segmentedRadius(xyz[0], xyz[1])); // for debugging purposes + histos.fill(HIST("hTOFPositionStopped"), xyz[0], xyz[1]); // for debugging purposes + histos.fill(HIST("hSnpStopped"), snp); // for debugging purposes + histos.fill(HIST("hSegRadiusStopped"), segmentedRadius(xyz[0], xyz[1])); // for debugging purposes histos.fill(HIST("hSegRadiusStoppedVsFirstPropag"), segmentedRintermediate, segmentedRadius(xyz[0], xyz[1])); // for debugging purposes } time = -1e+6; @@ -446,11 +446,11 @@ struct strangenesstofpid { float fraction = (propagationConfiguration.tofPosition - segmentedR) / (segmentedRFinal - segmentedR + 1e-6); // proportional fraction time = currentTime + (timeFinal - currentTime) * fraction; if (calculationMethod.value == 2) { - histos.fill(HIST("hTOFPositionFinal"), previousX + fraction * (xyz[0] - previousX), previousY + fraction * (xyz[1] - previousY)); // for debugging purposes - histos.fill(HIST("hSegRadiusFinal"), segmentedRadius(previousX + fraction * (xyz[0] - previousX), previousY + fraction * (xyz[1] - previousY))); // for debugging purposes - histos.fill(HIST("hSnpFinal"), track.getSnp()); // for debugging purposes + histos.fill(HIST("hTOFPositionFinal"), previousX + fraction * (xyz[0] - previousX), previousY + fraction * (xyz[1] - previousY)); // for debugging purposes + histos.fill(HIST("hSegRadiusFinal"), segmentedRadius(previousX + fraction * (xyz[0] - previousX), previousY + fraction * (xyz[1] - previousY))); // for debugging purposes + histos.fill(HIST("hSnpFinal"), track.getSnp()); // for debugging purposes histos.fill(HIST("hSegRadiusFinalVsFirstPropag"), segmentedRintermediate, segmentedRadius(previousX + fraction * (xyz[0] - previousX), previousY + fraction * (xyz[1] - previousY))); // for debugging purposes - histos.fill(HIST("hRefinedPropagationSteps"), propagationSteps, 1.0f); // for debugging purposes + histos.fill(HIST("hRefinedPropagationSteps"), propagationSteps, 1.0f); // for debugging purposes } return; // get out of the entire function and return (don't just break) } @@ -573,13 +573,13 @@ struct strangenesstofpid { //_____________________________________________________________________ // histograms for debugging modes 0 vs 1 - // encoded success rates in each hypothesis and method vs prong p - histos.add("h2dSucessRatePion", "h2dSucessRatePion", kTH2F, {axisSmallP, {4,-0.5f, 3.5f}}); - histos.add("h2dSucessRateKaon", "h2dSucessRateKaon", kTH2F, {axisSmallP, {4,-0.5f, 3.5f}}); - histos.add("h2dSucessRateProton", "h2dSucessRateProton", kTH2F, {axisSmallP, {4,-0.5f, 3.5f}}); + // encoded success rates in each hypothesis and method vs prong p + histos.add("h2dSucessRatePion", "h2dSucessRatePion", kTH2F, {axisSmallP, {4, -0.5f, 3.5f}}); + histos.add("h2dSucessRateKaon", "h2dSucessRateKaon", kTH2F, {axisSmallP, {4, -0.5f, 3.5f}}); + histos.add("h2dSucessRateProton", "h2dSucessRateProton", kTH2F, {axisSmallP, {4, -0.5f, 3.5f}}); histos.add("hInitialPropagationSteps", "hInitialPropagationSteps", kTH1F, {{500, -0.5f, 499.5f}}); - histos.add("hRefinedPropagationSteps", "hRefinedPropagationSteps", kTH2F, {{1000, -0.5f, 999.5f}, {2,-0.5f, 1.5f}}); + histos.add("hRefinedPropagationSteps", "hRefinedPropagationSteps", kTH2F, {{1000, -0.5f, 999.5f}, {2, -0.5f, 1.5f}}); // base ArcDebug: comparison between times of arrival in different methods histos.add("hArcDebug", "hArcDebug", kTH2F, {axisTime, axisTime}); @@ -599,15 +599,15 @@ struct strangenesstofpid { histos.add("hSnpStopped", "hSnpStopped", kTH1F, {axisSnp}); // segmented radius: positions - histos.add("hSegRadius", "hSegRadius", kTH1F, {{400,0.0f, 400.0f}}); - histos.add("hSegRadiusFirstPropagFail", "hSegRadiusFirstPropagFail", kTH1F, {{400,0.0f, 400.0f}}); - histos.add("hSegRadiusFinal", "hSegRadiusFinal", kTH1F, {{400,0.0f, 400.0f}}); - histos.add("hSegRadiusStopped", "hSegRadiusStopped", kTH1F, {{400,0.0f, 400.0f}}); - histos.add("hSegRadiusGotLost", "hSegRadiusGotLost", kTH1F, {{400,0.0f, 400.0f}}); + histos.add("hSegRadius", "hSegRadius", kTH1F, {{400, 0.0f, 400.0f}}); + histos.add("hSegRadiusFirstPropagFail", "hSegRadiusFirstPropagFail", kTH1F, {{400, 0.0f, 400.0f}}); + histos.add("hSegRadiusFinal", "hSegRadiusFinal", kTH1F, {{400, 0.0f, 400.0f}}); + histos.add("hSegRadiusStopped", "hSegRadiusStopped", kTH1F, {{400, 0.0f, 400.0f}}); + histos.add("hSegRadiusGotLost", "hSegRadiusGotLost", kTH1F, {{400, 0.0f, 400.0f}}); - histos.add("hSegRadiusFirstPropagVsStart", "hSegRadiusFirstPropagVsStart", kTH2F, {{400,0.0f, 400.0f}, {400,0.0f, 400.0f}}); - histos.add("hSegRadiusStoppedVsFirstPropag", "hSegRadiusStoppedVsFirstPropag", kTH2F, {{400,0.0f, 400.0f}, {400,0.0f, 400.0f}}); - histos.add("hSegRadiusFinalVsFirstPropag", "hSegRadiusFinalVsFirstPropag", kTH2F, {{400,0.0f, 400.0f}, {400,0.0f, 400.0f}}); + histos.add("hSegRadiusFirstPropagVsStart", "hSegRadiusFirstPropagVsStart", kTH2F, {{400, 0.0f, 400.0f}, {400, 0.0f, 400.0f}}); + histos.add("hSegRadiusStoppedVsFirstPropag", "hSegRadiusStoppedVsFirstPropag", kTH2F, {{400, 0.0f, 400.0f}, {400, 0.0f, 400.0f}}); + histos.add("hSegRadiusFinalVsFirstPropag", "hSegRadiusFinalVsFirstPropag", kTH2F, {{400, 0.0f, 400.0f}, {400, 0.0f, 400.0f}}); // Delta-times of each method for the various species histos.add("hDeltaTimeMethodsVsP_posLaPr", "hDeltaTimeMethodsVsP_posLaPr", kTH3F, {axisSmallP, axisEta, axisDeltaTime}); @@ -842,14 +842,14 @@ struct strangenesstofpid { if (pTra.hasTOF() && pTra.hasITS()) { float lengthPositive = findInterceptLength(posTrack, d_bz); // FIXME: tofPosition ok? adjust? - if(lengthPositive > 0){ + if (lengthPositive > 0) { timePositivePr_Method0 = lengthPositive / velocityPositivePr; timePositivePi_Method0 = lengthPositive / velocityPositivePi; } } if (nTra.hasTOF() && nTra.hasITS()) { float lengthNegative = findInterceptLength(negTrack, d_bz); // FIXME: tofPosition ok? adjust? - if (lengthNegative > 0){ + if (lengthNegative > 0) { timeNegativePr_Method0 = lengthNegative / velocityNegativePr; timeNegativePi_Method0 = lengthNegative / velocityNegativePi; } @@ -858,35 +858,35 @@ struct strangenesstofpid { if (calculationMethod.value > 0) { // method to calculate the time and length via Propagator TrackLTIntegral if (pTra.hasTOF() && pTra.hasITS()) { // calculate if signal present, otherwise skip - if(posTrack.getP()o2::aod::v0data::kEpsilon; - bool negativeSuccessMethod0Pr = std::abs(timeNegativePr_Method0-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; - bool positiveSuccessMethod1Pr = std::abs(timePositivePr_Method1-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; - bool negativeSuccessMethod1Pr = std::abs(timeNegativePr_Method1-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; - bool positiveSuccessMethod0Pi = std::abs(timePositivePi_Method0-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; - bool negativeSuccessMethod0Pi = std::abs(timeNegativePi_Method0-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; - bool positiveSuccessMethod1Pi = std::abs(timePositivePi_Method1-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; - bool negativeSuccessMethod1Pi = std::abs(timeNegativePi_Method1-o2::aod::v0data::kNoTOFValue)>o2::aod::v0data::kEpsilon; - - int encodedPositiveSuccessPi = positiveSuccessMethod0Pi + 2*positiveSuccessMethod1Pi; - int encodedPositiveSuccessPr = positiveSuccessMethod0Pr + 2*positiveSuccessMethod1Pr; - int encodedNegativeSuccessPi = negativeSuccessMethod0Pi + 2*negativeSuccessMethod1Pi; - int encodedNegativeSuccessPr = negativeSuccessMethod0Pr + 2*negativeSuccessMethod1Pr; - - if(pTra.hasTOF()){ + if (calculationMethod.value == 2) { + // do analysis of successes and failures + bool positiveSuccessMethod0Pr = std::abs(timePositivePr_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon; + bool negativeSuccessMethod0Pr = std::abs(timeNegativePr_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon; + bool positiveSuccessMethod1Pr = std::abs(timePositivePr_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon; + bool negativeSuccessMethod1Pr = std::abs(timeNegativePr_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon; + bool positiveSuccessMethod0Pi = std::abs(timePositivePi_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon; + bool negativeSuccessMethod0Pi = std::abs(timeNegativePi_Method0 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon; + bool positiveSuccessMethod1Pi = std::abs(timePositivePi_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon; + bool negativeSuccessMethod1Pi = std::abs(timeNegativePi_Method1 - o2::aod::v0data::kNoTOFValue) > o2::aod::v0data::kEpsilon; + + int encodedPositiveSuccessPi = positiveSuccessMethod0Pi + 2 * positiveSuccessMethod1Pi; + int encodedPositiveSuccessPr = positiveSuccessMethod0Pr + 2 * positiveSuccessMethod1Pr; + int encodedNegativeSuccessPi = negativeSuccessMethod0Pi + 2 * negativeSuccessMethod1Pi; + int encodedNegativeSuccessPr = negativeSuccessMethod0Pr + 2 * negativeSuccessMethod1Pr; + + if (pTra.hasTOF()) { histos.fill(HIST("h2dSucessRateProton"), positiveP, encodedPositiveSuccessPr); histos.fill(HIST("h2dSucessRatePion"), positiveP, encodedPositiveSuccessPi); } - if(nTra.hasTOF()){ + if (nTra.hasTOF()) { histos.fill(HIST("h2dSucessRateProton"), negativeP, encodedNegativeSuccessPr); histos.fill(HIST("h2dSucessRatePion"), negativeP, encodedNegativeSuccessPi); } @@ -1190,54 +1190,54 @@ struct strangenesstofpid { if (calculationMethod.value > 0) { if (pTra.hasTOF() && pTra.hasITS()) { // calculate if signal present, otherwise skip - if(posTrack.getP()o2::aod::cascdata::kEpsilon; - bool negativeSuccessMethod0Pr = std::abs(negFlightPr_Method0-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; - bool positiveSuccessMethod1Pr = std::abs(posFlightPr_Method1-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; - bool negativeSuccessMethod1Pr = std::abs(negFlightPr_Method1-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; - bool positiveSuccessMethod0Pi = std::abs(posFlightPi_Method0-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; - bool negativeSuccessMethod0Pi = std::abs(negFlightPi_Method0-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; - bool positiveSuccessMethod1Pi = std::abs(posFlightPi_Method1-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; - bool negativeSuccessMethod1Pi = std::abs(negFlightPi_Method1-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; - - bool bachelorSuccessMethod0Pi = std::abs(bachFlightPi_Method0-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; - bool bachelorSuccessMethod0Ka = std::abs(bachFlightKa_Method0-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; - bool bachelorSuccessMethod1Pi = std::abs(bachFlightPi_Method1-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; - bool bachelorSuccessMethod1Ka = std::abs(bachFlightKa_Method1-o2::aod::cascdata::kNoTOFValue)>o2::aod::cascdata::kEpsilon; - - int encodedPositiveSuccessPi = positiveSuccessMethod0Pi + 2*positiveSuccessMethod1Pi; - int encodedPositiveSuccessPr = positiveSuccessMethod0Pr + 2*positiveSuccessMethod1Pr; - int encodedNegativeSuccessPi = negativeSuccessMethod0Pi + 2*negativeSuccessMethod1Pi; - int encodedNegativeSuccessPr = negativeSuccessMethod0Pr + 2*negativeSuccessMethod1Pr; - int encodedBachelorSuccessPi = bachelorSuccessMethod0Pi + 2*bachelorSuccessMethod1Pi; - int encodedBachelorSuccessKa = bachelorSuccessMethod0Ka + 2*bachelorSuccessMethod1Ka; - - if(pTra.hasTOF()){ + if (calculationMethod.value == 2) { + // do analysis of successes and failures + bool positiveSuccessMethod0Pr = std::abs(posFlightPr_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon; + bool negativeSuccessMethod0Pr = std::abs(negFlightPr_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon; + bool positiveSuccessMethod1Pr = std::abs(posFlightPr_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon; + bool negativeSuccessMethod1Pr = std::abs(negFlightPr_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon; + bool positiveSuccessMethod0Pi = std::abs(posFlightPi_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon; + bool negativeSuccessMethod0Pi = std::abs(negFlightPi_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon; + bool positiveSuccessMethod1Pi = std::abs(posFlightPi_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon; + bool negativeSuccessMethod1Pi = std::abs(negFlightPi_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon; + + bool bachelorSuccessMethod0Pi = std::abs(bachFlightPi_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon; + bool bachelorSuccessMethod0Ka = std::abs(bachFlightKa_Method0 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon; + bool bachelorSuccessMethod1Pi = std::abs(bachFlightPi_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon; + bool bachelorSuccessMethod1Ka = std::abs(bachFlightKa_Method1 - o2::aod::cascdata::kNoTOFValue) > o2::aod::cascdata::kEpsilon; + + int encodedPositiveSuccessPi = positiveSuccessMethod0Pi + 2 * positiveSuccessMethod1Pi; + int encodedPositiveSuccessPr = positiveSuccessMethod0Pr + 2 * positiveSuccessMethod1Pr; + int encodedNegativeSuccessPi = negativeSuccessMethod0Pi + 2 * negativeSuccessMethod1Pi; + int encodedNegativeSuccessPr = negativeSuccessMethod0Pr + 2 * negativeSuccessMethod1Pr; + int encodedBachelorSuccessPi = bachelorSuccessMethod0Pi + 2 * bachelorSuccessMethod1Pi; + int encodedBachelorSuccessKa = bachelorSuccessMethod0Ka + 2 * bachelorSuccessMethod1Ka; + + if (pTra.hasTOF()) { histos.fill(HIST("h2dSucessRateProton"), positiveP, encodedPositiveSuccessPr); histos.fill(HIST("h2dSucessRatePion"), positiveP, encodedPositiveSuccessPi); } - if(nTra.hasTOF()){ + if (nTra.hasTOF()) { histos.fill(HIST("h2dSucessRateProton"), negativeP, encodedNegativeSuccessPr); histos.fill(HIST("h2dSucessRatePion"), negativeP, encodedNegativeSuccessPi); } - if(bTra.hasTOF()){ + if (bTra.hasTOF()) { histos.fill(HIST("h2dSucessRateKaon"), bachelorP, encodedBachelorSuccessKa); histos.fill(HIST("h2dSucessRatePion"), bachelorP, encodedBachelorSuccessPi); } diff --git a/PWGLF/Tasks/QC/strangepidqa.cxx b/PWGLF/Tasks/QC/strangepidqa.cxx index 514a9a783a6..08e502b87f5 100644 --- a/PWGLF/Tasks/QC/strangepidqa.cxx +++ b/PWGLF/Tasks/QC/strangepidqa.cxx @@ -68,7 +68,7 @@ struct strangepidqa { // TOF cut axis ConfigurableAxis axisTOFCut{"axisTOFCut", {100, 0.0f, +10000.0f}, "TOF compat. cut (ps)"}; - // nsigma axis + // nsigma axis ConfigurableAxis axisNSigma{"axisNSigma", {60, -3.0f, +3.0f}, "NSigma"}; //*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+* @@ -155,7 +155,7 @@ struct strangepidqa { histos.add("h3dNSigmasXiLaPr", "h3dNSigmasXiLaPr", {HistType::kTH3F, {axisNSigma, axisNSigma, axisPt}}); histos.add("h3dNSigmasXiLaPi", "h3dNSigmasXiLaPi", {HistType::kTH3F, {axisNSigma, axisNSigma, axisPt}}); histos.add("h3dNSigmasXiPi", "h3dNSigmasXiPi", {HistType::kTH3F, {axisNSigma, axisNSigma, axisPt}}); - + histos.add("h3dNSigmasOmLaPr", "h3dNSigmasOmLaPr", {HistType::kTH3F, {axisNSigma, axisNSigma, axisPt}}); histos.add("h3dNSigmasOmLaPi", "h3dNSigmasOmLaPi", {HistType::kTH3F, {axisNSigma, axisNSigma, axisPt}}); histos.add("h3dNSigmasOmKa", "h3dNSigmasOmKa", {HistType::kTH3F, {axisNSigma, axisNSigma, axisPt}}); @@ -213,7 +213,7 @@ struct strangepidqa { { for (auto& casc : Cascades) { auto col = collisions.rawIteratorAt(casc.straCollisionId()); - + // major selections here if (casc.v0radius() > v0setting_radius && casc.cascradius() > cascadesetting_cascradius && @@ -271,11 +271,11 @@ struct strangepidqa { void processRealNonDerived(soa::Join const& collisions, soa::Join const& v0s, soa::Join const&) { - for(auto const& col : collisions){ + for (auto const& col : collisions) { histos.fill(HIST("hEventCentrality"), col.centFT0C()); } - for (auto& lambda : v0s) { + for (auto& lambda : v0s) { auto coll = collisions.rawIteratorAt(lambda.collisionId()); if (TMath::Abs(lambda.eta()) > 0.5) @@ -284,17 +284,17 @@ struct strangepidqa { auto negExtra = lambda.negTrack_as>(); auto posExtra = lambda.posTrack_as>(); - bool primaryTOFcompatible_Lambda = - (!posExtra.hasTOF() || (posExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)) && - (!negExtra.hasTOF() || (negExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)); + bool primaryTOFcompatible_Lambda = + (!posExtra.hasTOF() || (posExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)) && + (!negExtra.hasTOF() || (negExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)); - bool primaryTOFcompatible_AntiLambda = - (!posExtra.hasTOF() || (posExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && - (!negExtra.hasTOF() || (negExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)); + bool primaryTOFcompatible_AntiLambda = + (!posExtra.hasTOF() || (posExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && + (!negExtra.hasTOF() || (negExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)); - bool primaryTOFcompatible_K0Short = - (!posExtra.hasTOF() || (posExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && - (!negExtra.hasTOF() || (negExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)); + bool primaryTOFcompatible_K0Short = + (!posExtra.hasTOF() || (posExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && + (!negExtra.hasTOF() || (negExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)); if (TMath::Abs(posExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPi()) < tpcNsigmaPion) { // lambda case @@ -304,10 +304,10 @@ struct strangepidqa { histos.fill(HIST("h3dMassCompatibleLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); histos.fill(HIST("h1dMassCompatibleLambda"), lambda.mLambda()); } - if (primaryTOFcompatible_Lambda){ + if (primaryTOFcompatible_Lambda) { histos.fill(HIST("h3dPrimaryTOFMassCompatibleLambda"), coll.centFT0C(), lambda.pt(), lambda.mLambda()); } - if(std::abs(lambda.mLambda()-o2::constants::physics::MassLambda) const& collisions, soa::Filtered> const& Cascades, soa::Join const&) { for (auto& casc : Cascades) { @@ -364,29 +364,29 @@ struct strangepidqa { auto posExtra = casc.posTrack_as>(); auto bachExtra = casc.bachelor_as>(); - if (negExtra.tpcNClsCrossedRows() < tpcCrossedRows || posExtra.tpcNClsCrossedRows() < tpcCrossedRows || bachExtra.tpcNClsCrossedRows() < tpcCrossedRows){ + if (negExtra.tpcNClsCrossedRows() < tpcCrossedRows || posExtra.tpcNClsCrossedRows() < tpcCrossedRows || bachExtra.tpcNClsCrossedRows() < tpcCrossedRows) { continue; } - bool primaryTOFcompatible_XiMinus = - (!posExtra.hasTOF() || (posExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)) && - (!negExtra.hasTOF() || (negExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && - (!bachExtra.hasTOF() || (bachExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)); + bool primaryTOFcompatible_XiMinus = + (!posExtra.hasTOF() || (posExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)) && + (!negExtra.hasTOF() || (negExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && + (!bachExtra.hasTOF() || (bachExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)); - bool primaryTOFcompatible_XiPlus = - (!posExtra.hasTOF() || (posExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && - (!negExtra.hasTOF() || (negExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)) && - (!bachExtra.hasTOF() || (bachExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)); + bool primaryTOFcompatible_XiPlus = + (!posExtra.hasTOF() || (posExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && + (!negExtra.hasTOF() || (negExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)) && + (!bachExtra.hasTOF() || (bachExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)); - bool primaryTOFcompatible_OmegaMinus = - (!posExtra.hasTOF() || (posExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)) && - (!negExtra.hasTOF() || (negExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && - (!bachExtra.hasTOF() || (bachExtra.tofNSigmaKa() < tofNsigmaCompatibilityCascades.value)); + bool primaryTOFcompatible_OmegaMinus = + (!posExtra.hasTOF() || (posExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)) && + (!negExtra.hasTOF() || (negExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && + (!bachExtra.hasTOF() || (bachExtra.tofNSigmaKa() < tofNsigmaCompatibilityCascades.value)); - bool primaryTOFcompatible_OmegaPlus = - (!posExtra.hasTOF() || (posExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && - (!negExtra.hasTOF() || (negExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)) && - (!bachExtra.hasTOF() || (bachExtra.tofNSigmaKa() < tofNsigmaCompatibilityCascades.value)); + bool primaryTOFcompatible_OmegaPlus = + (!posExtra.hasTOF() || (posExtra.tofNSigmaPi() < tofNsigmaCompatibilityCascades.value)) && + (!negExtra.hasTOF() || (negExtra.tofNSigmaPr() < tofNsigmaCompatibilityCascades.value)) && + (!bachExtra.hasTOF() || (bachExtra.tofNSigmaKa() < tofNsigmaCompatibilityCascades.value)); if (casc.sign() < 0) { if (TMath::Abs(posExtra.tpcNSigmaPr()) < tpcNsigmaProton && TMath::Abs(negExtra.tpcNSigmaPi()) < tpcNsigmaPion && TMath::Abs(bachExtra.tpcNSigmaPi()) < tpcNsigmaBachelor) { @@ -396,10 +396,10 @@ struct strangepidqa { histos.fill(HIST("h3dMassCompatibleXiMinus"), col.centFT0C(), casc.pt(), casc.mXi()); histos.fill(HIST("h1dMassCompatibleXiMinus"), casc.mXi()); } - if (primaryTOFcompatible_XiMinus){ + if (primaryTOFcompatible_XiMinus) { histos.fill(HIST("h3dPrimaryTOFMassCompatibleXiMinus"), col.centFT0C(), casc.pt(), casc.mXi()); } - if(std::abs(casc.mXi()-o2::constants::physics::MassXiMinus) Date: Sun, 31 Aug 2025 18:40:42 +0200 Subject: [PATCH 8/8] Fix unused vars --- PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 301e73c12ca..f74a6d95d1d 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -364,7 +364,6 @@ struct strangenesstofpid { o2::track::TrackLTIntegral ltIntegral; - float trackX = -100; static constexpr float MAX_SIN_PHI = 0.85f; static constexpr float MAX_STEP = 2.0f; static constexpr float MAX_STEP_FINAL_STAGE = 0.5f; @@ -379,12 +378,12 @@ struct strangenesstofpid { track.getXYZGlo(xyz); float segmentedRstart = segmentedRadius(xyz[0], xyz[1]); - bool firstPropag; + bool firstPropag = true; for (int iRot = 0; iRot < propagationConfiguration.numberOfStepsFirstStage.value; iRot++) { track.rotateParam(track.getPhi()); // start rotated float currentX = track.getX(); float tofX = currentX; - bool getXatLabRok = track.getXatLabR(propagationConfiguration.tofPosition, tofX, d_bz, o2::track::DirOutward); + track.getXatLabR(propagationConfiguration.tofPosition, tofX, d_bz, o2::track::DirOutward); if (std::abs(tofX - currentX) < propagationConfiguration.firstApproximationThreshold.value) { // signal conclusion if (calculationMethod.value == 2) { @@ -415,10 +414,11 @@ struct strangenesstofpid { } // correct for TOF segmentation - float trackXextra = track.getX(); bool trackOKextra = true; + float trackXextra = track.getX(); int propagationSteps = 0; - while (trackXextra < MAX_FINAL_X && propagationSteps < propagationConfiguration.numberOfStepsSecondStage.value) { + int maxPropagationSteps = propagationConfiguration.numberOfStepsSecondStage.value; + while ((trackXextra < MAX_FINAL_X) && (propagationSteps < maxPropagationSteps)) { // continue with alpha aligned with pT track.getPxPyPzGlo(pxpypz); track.rotateParam(std::atan2(pxpypz[1], pxpypz[0]));