diff --git a/PWGLF/TableProducer/cascadebuilder.cxx b/PWGLF/TableProducer/cascadebuilder.cxx index 4f1aef0449f..4521d9680ad 100644 --- a/PWGLF/TableProducer/cascadebuilder.cxx +++ b/PWGLF/TableProducer/cascadebuilder.cxx @@ -188,9 +188,9 @@ struct cascadeBuilder { ConfigurableAxis axisTopoVarDCAToPV{"axisTopoVarDCAToPV", {200, -1, 1.0}, "single track DCA to PV (cm)"}; ConfigurableAxis axisTopoVarDCAV0ToPV{"axisTopoVarDCAV0ToPV", {200, 0, 5.0}, "V0 DCA to PV (cm)"}; - // round some V0 core variables up to a certain level of precision if requested + // round some V0 core variables up to a certain level of precision if requested // useful to keep derived data sizes under control - // variables that are rounded include the DCAs but not the CosPA (precision needed) + // variables that are rounded include the DCAs but not the CosPA (precision needed) Configurable roundDCAVariables{"roundDCAVariables", false, "round topological variables"}; Configurable precisionDCAs{"precisionDCAs", 0.01f, "precision to keep the DCAs with"}; @@ -279,21 +279,23 @@ struct cascadeBuilder { {"hNegativeITSClusters", "hNegativeITSClusters", {HistType::kTH1D, {{10, -0.5f, 9.5f}}}}, {"hBachelorITSClusters", "hBachelorITSClusters", {HistType::kTH1D, {{10, -0.5f, 9.5f}}}}}}; - float roundToPrecision( float number, float step = 0.01){ + float roundToPrecision(float number, float step = 0.01) + { // this function rounds a certain number in an axis that is quantized by // the variable 'step'; the rounded number is placed halfway between // n*step and (n+1)*step such that analysis can be done with absolutely // no issue with precision 'step'. - return step*static_cast(static_cast((number)/step))+TMath::Sign(1.0f,number)*(0.5f)*step; + return step * static_cast(static_cast((number) / step)) + TMath::Sign(1.0f, number) * (0.5f) * step; } - void roundCascadeCandidateVariables(){ - // Do not round actual cascade (pseudo-)track DCAs -> consider they may be tracked, high precision - cascadecandidate.dcacascdau = roundToPrecision ( cascadecandidate.dcacascdau , precisionDCAs); - cascadecandidate.v0dcadau = roundToPrecision ( cascadecandidate.v0dcadau , precisionDCAs); - cascadecandidate.v0dcanegtopv = roundToPrecision ( cascadecandidate.v0dcanegtopv , precisionDCAs); - cascadecandidate.v0dcapostopv = roundToPrecision ( cascadecandidate.v0dcapostopv , precisionDCAs); - cascadecandidate.bachDCAxy = roundToPrecision ( cascadecandidate.bachDCAxy , precisionDCAs); + void roundCascadeCandidateVariables() + { + // Do not round actual cascade (pseudo-)track DCAs -> consider they may be tracked, high precision + cascadecandidate.dcacascdau = roundToPrecision(cascadecandidate.dcacascdau, precisionDCAs); + cascadecandidate.v0dcadau = roundToPrecision(cascadecandidate.v0dcadau, precisionDCAs); + cascadecandidate.v0dcanegtopv = roundToPrecision(cascadecandidate.v0dcanegtopv, precisionDCAs); + cascadecandidate.v0dcapostopv = roundToPrecision(cascadecandidate.v0dcapostopv, precisionDCAs); + cascadecandidate.bachDCAxy = roundToPrecision(cascadecandidate.bachDCAxy, precisionDCAs); } void resetHistos() @@ -1311,8 +1313,8 @@ struct cascadeBuilder { continue; // doesn't pass cascade selections // round the DCA variables to a certain precision if asked - if ( roundDCAVariables ) - roundCascadeCandidateVariables(); + if (roundDCAVariables) + roundCascadeCandidateVariables(); cascidx(/*cascadecandidate.v0Id, */ cascade.globalIndex(), cascadecandidate.positiveId, cascadecandidate.negativeId, @@ -1374,8 +1376,8 @@ struct cascadeBuilder { continue; // doesn't pass cascade selections // round the DCA variables to a certain precision if asked - if ( roundDCAVariables ) - roundCascadeCandidateVariables(); + if (roundDCAVariables) + roundCascadeCandidateVariables(); registry.fill(HIST("hKFParticleStatistics"), 2.0f); @@ -1441,8 +1443,8 @@ struct cascadeBuilder { continue; // doesn't pass cascade selections // round the DCA variables to a certain precision if asked - if ( roundDCAVariables ) - roundCascadeCandidateVariables(); + if (roundDCAVariables) + roundCascadeCandidateVariables(); // fill regular tables (no strangeness tracking) cascidx(/*cascadecandidate.v0Id, */ cascade.globalIndex(), diff --git a/PWGLF/TableProducer/lambdakzerobuilder.cxx b/PWGLF/TableProducer/lambdakzerobuilder.cxx index 08dfbcf93b4..0cee635b5bd 100644 --- a/PWGLF/TableProducer/lambdakzerobuilder.cxx +++ b/PWGLF/TableProducer/lambdakzerobuilder.cxx @@ -147,9 +147,9 @@ struct lambdakzeroBuilder { Configurable mVtxPath{"mVtxPath", "GLO/Calib/MeanVertex", "Path of the mean vertex file"}; Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - // round some V0 core variables up to a certain level of precision if requested + // round some V0 core variables up to a certain level of precision if requested // useful to keep derived data sizes under control - // variables that are rounded include the DCAs but not the CosPA (precision needed) + // variables that are rounded include the DCAs but not the CosPA (precision needed) Configurable roundDCAVariables{"roundDCAVariables", false, "round topological variables"}; Configurable precisionDCAs{"precisionDCAs", 0.01f, "precision to keep the DCAs with"}; @@ -244,19 +244,21 @@ struct lambdakzeroBuilder { return std::sqrt((std::pow((pvY - Y) * Pz - (pvZ - Z) * Py, 2) + std::pow((pvX - X) * Pz - (pvZ - Z) * Px, 2) + std::pow((pvX - X) * Py - (pvY - Y) * Px, 2)) / (Px * Px + Py * Py + Pz * Pz)); } - float roundToPrecision( float number, float step = 0.01){ + float roundToPrecision(float number, float step = 0.01) + { // this function rounds a certain number in an axis that is quantized by // the variable 'step'; the rounded number is placed halfway between // n*step and (n+1)*step such that analysis can be done with absolutely // no issue with precision 'step'. - return step*static_cast(static_cast((number)/step))+TMath::Sign(1.0f,number)*(0.5f)*step; + return step * static_cast(static_cast((number) / step)) + TMath::Sign(1.0f, number) * (0.5f) * step; } - void roundV0CandidateVariables(){ - v0candidate.dcaV0dau = roundToPrecision ( v0candidate.dcaV0dau , precisionDCAs); - v0candidate.posDCAxy = roundToPrecision ( v0candidate.posDCAxy , precisionDCAs); - v0candidate.negDCAxy = roundToPrecision ( v0candidate.negDCAxy , precisionDCAs); - v0candidate.dcav0topv = roundToPrecision ( v0candidate.dcav0topv , precisionDCAs); + void roundV0CandidateVariables() + { + v0candidate.dcaV0dau = roundToPrecision(v0candidate.dcaV0dau, precisionDCAs); + v0candidate.posDCAxy = roundToPrecision(v0candidate.posDCAxy, precisionDCAs); + v0candidate.negDCAxy = roundToPrecision(v0candidate.negDCAxy, precisionDCAs); + v0candidate.dcav0topv = roundToPrecision(v0candidate.dcav0topv, precisionDCAs); } void resetHistos() @@ -817,8 +819,8 @@ struct lambdakzeroBuilder { } // round the DCA variables to a certain precision if asked - if ( roundDCAVariables ) - roundV0CandidateVariables(); + if (roundDCAVariables) + roundV0CandidateVariables(); // V0 logic reminder // 0: v0 saved for the only due to the cascade, 1: standalone v0, 3: standard v0 with photon-only test diff --git a/PWGLF/TableProducer/strangederivedbuilder.cxx b/PWGLF/TableProducer/strangederivedbuilder.cxx index 6a02a1a3c54..6c4a6c3b9df 100644 --- a/PWGLF/TableProducer/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/strangederivedbuilder.cxx @@ -124,9 +124,9 @@ struct strangederivedbuilder { Configurable fillEmptyCollisions{"fillEmptyCollisions", false, "fill collision entries without candidates"}; - // round Nsigma variables up to a certain level of precision if requested + // round Nsigma variables up to a certain level of precision if requested // useful to keep derived data sizes under control - // variables that are rounded include the DCAs but not the CosPA (precision needed) + // variables that are rounded include the DCAs but not the CosPA (precision needed) Configurable roundNSigmaVariables{"roundNSigmaVariables", false, "round NSigma variables"}; Configurable precisionNSigmas{"precisionNSigmas", 0.1f, "precision to keep NSigmas"}; @@ -138,12 +138,13 @@ struct strangederivedbuilder { int64_t currentCollIdx; - float roundToPrecision( float number, float step = 0.01){ + float roundToPrecision(float number, float step = 0.01) + { // this function rounds a certain number in an axis that is quantized by // the variable 'step'; the rounded number is placed halfway between // n*step and (n+1)*step such that analysis can be done with absolutely // no issue with precision 'step'. - return step*static_cast(static_cast((number)/step))+TMath::Sign(1.0f,number)*(0.5f)*step; + return step * static_cast(static_cast((number) / step)) + TMath::Sign(1.0f, number) * (0.5f) * step; } void init(InitContext& context) @@ -345,14 +346,14 @@ struct strangederivedbuilder { tr.tpcNClsFound(), tr.tpcNClsCrossedRows()); // round if requested - if( roundNSigmaVariables ){ - dauTrackTPCPIDs(tr.tpcSignal(), - roundToPrecision ( tr.tpcNSigmaEl(), precisionNSigmas ), - roundToPrecision ( tr.tpcNSigmaPi(), precisionNSigmas ), - roundToPrecision ( tr.tpcNSigmaKa(), precisionNSigmas ), - roundToPrecision ( tr.tpcNSigmaPr(), precisionNSigmas ), - roundToPrecision ( tr.tpcNSigmaHe(), precisionNSigmas )); - }else{ + if (roundNSigmaVariables) { + dauTrackTPCPIDs(tr.tpcSignal(), + roundToPrecision(tr.tpcNSigmaEl(), precisionNSigmas), + roundToPrecision(tr.tpcNSigmaPi(), precisionNSigmas), + roundToPrecision(tr.tpcNSigmaKa(), precisionNSigmas), + roundToPrecision(tr.tpcNSigmaPr(), precisionNSigmas), + roundToPrecision(tr.tpcNSigmaHe(), precisionNSigmas)); + } else { dauTrackTPCPIDs(tr.tpcSignal(), tr.tpcNSigmaEl(), tr.tpcNSigmaPi(), tr.tpcNSigmaKa(), tr.tpcNSigmaPr(), tr.tpcNSigmaHe());