diff --git a/PWGCF/Flow/Tasks/flowEseTask.cxx b/PWGCF/Flow/Tasks/flowEseTask.cxx index 74dc98bd528..09f852403bf 100644 --- a/PWGCF/Flow/Tasks/flowEseTask.cxx +++ b/PWGCF/Flow/Tasks/flowEseTask.cxx @@ -104,7 +104,7 @@ struct FlowEseTask { Configurable cfgV0EtaMax{"cfgV0EtaMax", 0.5, "maximum rapidity"}; Configurable cfgV0LifeTime{"cfgV0LifeTime", 30., "maximum lambda lifetime"}; - Configurable cfgQAv0{"cfgQAv0", true, "QA plot"}; + Configurable cfgQAv0{"cfgQAv0", false, "QA plot"}; Configurable cfgDaughTPCnclsMin{"cfgDaughTPCnclsMin", 70, "minimum fired crossed rows"}; Configurable cfgDaughPIDCutsTPCPr{"cfgDaughPIDCutsTPCPr", 5, "proton nsigma for TPC"}; @@ -125,7 +125,7 @@ struct FlowEseTask { Configurable cfgUSESP{"cfgUSESP", false, "cfg for sp"}; Configurable cfgPhiDepSig{"cfgPhiDepSig", 0.2, "cfg for significance on phi dependent study"}; - Configurable cfgShiftCorr{"cfgShiftCorr", true, "additional shift correction"}; + Configurable cfgShiftCorr{"cfgShiftCorr", false, "additional shift correction"}; Configurable cfgShiftCorrDef{"cfgShiftCorrDef", false, "additional shift correction definition"}; Configurable cfgShiftPath{"cfgShiftPath", "Users/j/junlee/Qvector/QvecCalib/Shift", "Path for Shift"}; @@ -511,6 +511,18 @@ struct FlowEseTask { return true; } + double safeATan2(double y, double x) + { + if (x != 0) + return std::atan2(y, x); + if (y == 0) + return 0; + if (y > 0) + return o2::constants::math::PIHalf; + else + return -o2::constants::math::PIHalf; + } + template void fillShiftCorrection(TCollision const& collision, int nmode) { @@ -668,7 +680,7 @@ struct FlowEseTask { qvecRefAInd = refAId * 4 + 3 + (nmode - 2) * cfgNQvec * 4; qvecRefBInd = refBId * 4 + 3 + (nmode - 2) * cfgNQvec * 4; - for (const auto& v0 : V0s) { + for (auto& v0 : V0s) { // o2-linter: disable=const-ref-in-for-loop(need to modify v0) auto postrack = v0.template posTrack_as(); auto negtrack = v0.template negTrack_as(); @@ -717,7 +729,7 @@ struct FlowEseTask { protonBoostedVec = boost(protonVec); angle = protonBoostedVec.Pz() / protonBoostedVec.P(); - psi = std::atan2(collision.qvecIm()[qvecDetInd], collision.qvecRe()[qvecDetInd]) / static_cast(nmode); + psi = safeATan2(collision.qvecIm()[qvecDetInd], collision.qvecRe()[qvecDetInd]) / static_cast(nmode); relphi = TVector2::Phi_0_2pi(static_cast(nmode) * (LambdaVec.Phi() - psi)); if (cfgShiftCorr) { @@ -975,8 +987,6 @@ struct FlowEseTask { if (!eventSelected(collision)) { return; } - histos.fill(HIST("QA/CentDist"), centrality, 1.0); - histos.fill(HIST("QA/PVzDist"), collision.posZ(), 1.0); if (cfgShiftCorr) { auto bc = collision.bc_as(); @@ -1062,7 +1072,7 @@ struct FlowEseTask { continue; if (std::abs(mcParticle.eta()) > kEtaAcceptance) // main acceptance continue; - histos.fill(HIST("hSparseMCGenWeight"), centclass, RecoDecay::constrainAngle(deltaPhi), std::pow(std::cos(2.0 * RecoDecay::constrainAngle(deltaPhi)), 2.0), mcParticle.pt(), mcParticle.eta()); + histos.fill(HIST("hSparseMCGenWeight"), centclass, RecoDecay::constrainAngle(deltaPhi, 0, 2), std::pow(std::cos(2.0 * RecoDecay::constrainAngle(deltaPhi, 0, 2)), 2.0), mcParticle.pt(), mcParticle.eta()); nCh++; bool validGlobal = false; bool validAny = false; @@ -1079,11 +1089,11 @@ struct FlowEseTask { } // if valid global, fill if (validGlobal) { - histos.fill(HIST("hSparseMCRecWeight"), centclass, RecoDecay::constrainAngle(deltaPhi), std::pow(std::cos(2.0 * RecoDecay::constrainAngle(deltaPhi)), 2.0), mcParticle.pt(), mcParticle.eta()); + histos.fill(HIST("hSparseMCRecWeight"), centclass, RecoDecay::constrainAngle(deltaPhi, 0, 2), std::pow(std::cos(2.0 * RecoDecay::constrainAngle(deltaPhi, 0, 2)), 2.0), mcParticle.pt(), mcParticle.eta()); } if (validAny) { - histos.fill(HIST("hSparseMCRecAllTrackWeight"), centclass, RecoDecay::constrainAngle(deltaPhi), std::pow(std::cos(2.0 * RecoDecay::constrainAngle(deltaPhi)), 2.0), mcParticle.pt(), mcParticle.eta()); - histos.fill(HIST("hEventPlaneAngleRec"), RecoDecay::constrainAngle(deltaPhi)); + histos.fill(HIST("hSparseMCRecAllTrackWeight"), centclass, RecoDecay::constrainAngle(deltaPhi, 0, 2), std::pow(std::cos(2.0 * RecoDecay::constrainAngle(deltaPhi, 0, 2)), 2.0), mcParticle.pt(), mcParticle.eta()); + histos.fill(HIST("hEventPlaneAngleRec"), RecoDecay::constrainAngle(deltaPhi, 0, 2)); } // if any track present, fill }