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)