diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index 17a637da4f4..574fafc5451 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -94,7 +94,7 @@ struct JetChargedV2 { Configurable nBinsFluct{"nBinsFluct", 1000, "number of bins for fluctuations axes"}; Configurable deltaPtMinMaxFluct{"deltaPtMinMaxFluct", 200, "maximum and minimum delta pt value for fluctuation axes"}; Configurable nBinsFluctCentrality{"nBinsFluctCentrality", 1100, "number of centrality bins for the fluctuation axes; reduce it (e.g. 110) to cut the memory of the fluctuation histograms"}; - Configurable nBinsDeltaPhi{"nBinsDeltaPhi", 100, "number of Delta phi bins for the fluctuation axes; 96 keeps the pi/4 in-/out-of-plane edges on bin boundaries"}; + Configurable nBinsDeltaPhi{"nBinsDeltaPhi", 96, "number of Delta phi bins for the fluctuation axes and the sparse; 96 keeps the pi/4 in-/out-of-plane edges exactly on bin boundaries"}; Configurable fillFluctH3{"fillFluctH3", false, "fill the 3D centrality-vs-deltaPt-vs-DeltaPhi fluctuation histograms (memory heavy); the direct 2D in-/out-of-plane histograms are always filled"}; Configurable fillQvecQA{"fillQvecQA", true, "fill the Q-vector QA histograms (histQvec*V#, 3D Qx-vs-Qy-vs-centrality, memory heavy); the event-plane QA histograms are always filled"}; @@ -124,20 +124,28 @@ struct JetChargedV2 { // subsample the sparse filling: 1 = every jet/cone, N = only every N-th. At full statistics the // sparse costs O(entries) * 40 B, so use e.g. 100 to keep the output at the MB level. Configurable sparseSubsample{"sparseSubsample", 1, "fill every N-th jet/cone into the THnSparse (1 = all)"}; - // binning of the THnSparse histograms: coarse defaults are safe for a full production, the finer - // binning used for local tests can be set from the command line (or from the train configuration) - // all THnSparse axes packed into one configurable to stay within the framework member limit: - // (nbins, min, max) triples, in the order pT (also used for rho*A), centrality, rho, Delta phi - Configurable> sparseAxes{"sparseAxes", {105, 0., 210., 55, 0., 110., 110, 0., 110., 60, 0., 6.2831853}, "sparse axes as (nbins, min, max) triples: pT, centrality, rho, Delta phi"}; - // remaining sparse axes packed into one configurable to stay within the framework member limit: - // (nbins, min, max) triples for delta pT, area and number of tracks - Configurable> sparseExtraAxes{"sparseExtraAxes", {100.f, -200.f, 200.f, 8.f, 0.f, 0.8f, 20.f, 0.f, 100.f}, "extra sparse axes as (nbins, min, max) triples: delta pT, area, N tracks"}; + // binning of the THnSparse histograms: by default every axis is booked with exactly the binning of + // the corresponding analysis histogram (jetPtAxisRhoAreaSub, centralityAxis, fluctDeltaPhiAxis, + // fluctDeltaPtAxis), so that the sparse can be analysed with the same bin set as the plots. The two + // configurables below are only an override for memory-limited productions; an empty vector means + // "same as the analysis histograms". + // (nbins, min, max) triples, in the order pT, centrality, Delta phi + Configurable> sparseAxes{"sparseAxes", {}, "override of the sparse binning as (nbins, min, max) triples: pT, centrality, Delta phi; empty = same binning as the analysis histograms"}; + // (nbins, min, max) triples for delta pT (random cones) and for area / number of tracks (jet QA) + Configurable> sparseExtraAxes{"sparseExtraAxes", {}, "override of the extra sparse axes as (nbins, min, max) triples: delta pT, area, N tracks; empty = analysis binning for delta pT and coarse QA binning for area / N tracks"}; + // In-plane / out-of-plane windows on |dphi - Psi2| folded into [0, 180] degrees: + // in-plane : |dphi-Psi2| < inPlaneMaxDeg (plus the symmetric back side) + // out-of-plane : inPlaneMaxDeg <= |dphi-Psi2| < outPlaneMaxDeg + // the defaults reproduce the usual 45-degree definition; use 60 / 120 for the 60-degree one + Configurable inPlaneMaxDeg{"inPlaneMaxDeg", 45., "in-plane: |dphi - Psi2| < this (and the back side), in degrees"}; + Configurable outPlaneMaxDeg{"outPlaneMaxDeg", 135., "out-of-plane: inPlaneMaxDeg <= |dphi - Psi2| < this, in degrees"}; Configurable doSumw2Sparse{"doSumw2Sparse", true, "Flag whether to set Sumw2() for the sparse histograms"}; - std::shared_ptr hJetQA; //! per-jet QA quantities (pT, eta, phi, area, nTracks, centrality) - std::shared_ptr hRhoMedian; //! per-jet information using the event-averaged (median) rho - std::shared_ptr hRhoLocal; //! per-jet information using the local rho of that jet - std::shared_ptr hFluctQA; //! per-random-cone QA quantities - std::shared_ptr hFluctQAwoLeadingJet; //! per-random-cone QA, leading jet removed from the cone + std::shared_ptr hJetQA; //! per-jet QA quantities (pT, eta, phi, area, nTracks, centrality) + std::shared_ptr hRhoMedian; //! per-jet information using the event-averaged (median) rho + std::shared_ptr hRhoLocal; //! per-jet information using the local rho of that jet + std::shared_ptr hRhoQA; //! both background-density definitions of the same jet (rho QA) + std::shared_ptr hFluctQAwoLeadingJet; //! per-random-cone QA, leading jet removed from the cone (local rho) + std::shared_ptr hFluctQAwoLeadingJetMedian; //! the same cones with the event-averaged rho int detId = 0; int refAId = 0; int refBId = 0; @@ -215,12 +223,27 @@ struct JetChargedV2 { detIdCheck = getDetId(epQvec.cfgDetCheckName); refAId = getDetId(epQvec.cfgRefAName); refBId = getDetId(epQvec.cfgRefBName); - if (detId == refAId || detId == refBId || refAId == refBId || detId == detIdCheck) { + if (detId < 0 || detIdCheck < 0 || refAId < 0 || refBId < 0) { + LOGF(fatal, "unknown detector name (signal='%s', check='%s', refA='%s', refB='%s')", + epQvec.cfgDetName.value.c_str(), epQvec.cfgDetCheckName.value.c_str(), + epQvec.cfgRefAName.value.c_str(), epQvec.cfgRefBName.value.c_str()); + } + // the signal detector must differ from the reference detectors; only the conflicting + // piece is changed, so that any detector (including FT0A) can be used for the event plane + if (detId == refAId || detId == refBId || refAId == refBId) { + LOGF(warn, "signal detector '%s' overlaps with the reference detectors '%s'/'%s': falling back to FT0C/TPCpos/TPCneg", + epQvec.cfgDetName.value.c_str(), epQvec.cfgRefAName.value.c_str(), epQvec.cfgRefBName.value.c_str()); detId = 0; - detIdCheck = 0; refAId = 4; refBId = 5; } + if (detId == detIdCheck) { + LOGF(warn, "cfgDetName and cfgDetCheckName are both '%s': using FT0C for the check detector", + epQvec.cfgDetName.value.c_str()); + detIdCheck = 0; + } + LOGF(info, "event plane from '%s' (id %d), check detector '%s' (id %d), references %d/%d", + epQvec.cfgDetName.value.c_str(), detId, epQvec.cfgDetCheckName.value.c_str(), detIdCheck, refAId, refBId); auto jetPtTemp = 0.0; jetPtBins.push_back(jetPtTemp); @@ -390,6 +413,13 @@ struct JetChargedV2 { registry.add("h2_rholocal_pt_outplane", "#varphi vs #it{p}_{T}; #it{p}_{T}; #rho(#varphi) ", {HistType::kTH2F, {{110, -10., 100}, {210, -10.0, 200.0}}}); registry.add("h2_averagerho_pt", "#varphi vs #it{p}_{T}; #it{p}_{T}; <#rho> ", {HistType::kTH2F, {{110, -10., 100}, {210, -10.0, 200.0}}}); + // event-level versions of the rho vs pT profile: the background density is an event property, + // so the activity axis should be the leading jet pT (one entry per event) rather than the pT of + // every single jet, which mixes the jet itself into the background and weights events by their + // jet multiplicity + registry.add("h2_averagerho_leadJetPt", "#it{#rho} vs leading jet #it{p}_{T}; #it{p}_{T,lead jet}^{raw} (GeV/#it{c}); <#it{#rho}> ", {HistType::kTH2F, {{200, 0., 200.}, {210, -10.0, 200.0}}}); + registry.add("h2_rholocalAtLeadJet_leadJetPt", "#it{#rho}(#varphi_{lead jet}) vs leading jet #it{p}_{T}; #it{p}_{T,lead jet}^{raw} (GeV/#it{c}); #it{#rho}(#varphi_{lead jet}) ", {HistType::kTH2F, {{200, 0., 200.}, {210, -10.0, 200.0}}}); + registry.add("h3_centrality_leadJetPt_rho", "centrality vs leading jet #it{p}_{T} vs #it{#rho}; centrality (%); #it{p}_{T,lead jet}^{raw} (GeV/#it{c}); #it{#rho} ", {HistType::kTH3F, {{110, 0., 110.}, {200, 0., 200.}, {110, 0., 110.}}}); registry.add("h2_averagerho_raw_pt", "#varphi vs #it{p}_{T}; #it{p}_{T} - <#rho>Area; <#rho> ", {HistType::kTH2F, {{110, -10., 100}, {210, -10.0, 200.0}}}); registry.add("h2_averagerho_pt_inplane", "#varphi vs #it{p}_{T}; #it{p}_{T}; <#rho> ", {HistType::kTH2F, {{110, -10., 100}, {210, -10.0, 200.0}}}); registry.add("h2_averagerho_pt_outplane", "#varphi vs #it{p}_{T}; #it{p}_{T}; <#rho> ", {HistType::kTH2F, {{110, -10., 100}, {210, -10.0, 200.0}}}); @@ -620,43 +650,85 @@ struct JetChargedV2 { registry.add("h2_track_eta_track_phi", "track eta vs. track phi; #eta; #phi; counts", {HistType::kTH2F, {trackEtaAxis, phiAxis}}); // optional sparse storage of the analysis ingredients (booked always, filled only on request, - // so that the output merging always sees the same object names) - // binning follows the existing 2D outputs of this task, so that the sparses can be compared + // so that the output merging always sees the same object names). + // The sparse only carries what has to be projected offline, and every axis repeats the binning of + // the corresponding analysis histogram: + // per-jet : centrality, background-subtracted pT, Delta phi (full 2 pi, folded offline) + // rho QA : centrality, pT, rho(median), rho(local), Delta phi, leading-constituent pT, area + // per-cone : centrality, delta pT, |Delta phi| (one sparse per background-density definition) + // so that any in-/out-of-plane window can be projected with the same bin set as the plots, and + // the loosest objects carry only the quantities that have to be projected offline. The jet QA + // quantities stay together in hJetQA, the two background densities of the same jet in hRhoQA; + // everything else is already in the regular histograms, which are always filled. + // an AxisSpec with a fixed number of bins always carries {min, max} in binEdges + auto sameBinning = [](const AxisSpec& ref, const char* title) { + return ref.nBins.has_value() ? AxisSpec{*ref.nBins, ref.binEdges[0], ref.binEdges[1], title} + : AxisSpec{ref.binEdges, title}; + }; + auto triple = [](const std::vector& v, int k, const char* title) { + return AxisSpec{static_cast(v[3 * k]), v[3 * k + 1], v[3 * k + 2], title}; + }; + const auto& axes = sparseAxes.value; - if (axes.size() < 12) { - LOGF(fatal, "sparseAxes needs 12 numbers (4 x (nbins, min, max)), got %d", static_cast(axes.size())); - } - // bin by bin with h2_rholocal_pt (rho 110 x pT 210), h2_phi_rholocal (phi 100 x rho 110) and - // h2_centrality_deltapT_RandomCornPhi_* (centrality 1100 x delta pT 1000) - const AxisSpec axisQAPt{static_cast(axes[0]), axes[1], axes[2], "#it{p}_{T,jet}^{raw} (GeV/#it{c})"}; - const AxisSpec axisQAEta{20, -1., 1., "#it{#eta}_{jet}"}; - const AxisSpec axisQAPhi{static_cast(axes[9]), axes[10], axes[11], "#it{#varphi}_{jet} (rad)"}; + const bool overrideAxes = !axes.empty(); + if (overrideAxes && axes.size() < 9) { + LOGF(fatal, "sparseAxes needs 9 numbers (3 x (nbins, min, max)), got %d", static_cast(axes.size())); + } const auto& extra = sparseExtraAxes.value; - if (extra.size() < 9) { + const bool overrideExtra = !extra.empty(); + if (overrideExtra && extra.size() < 9) { LOGF(fatal, "sparseExtraAxes needs 9 numbers (3 x (nbins, min, max)), got %d", static_cast(extra.size())); } - const AxisSpec axisQAArea{static_cast(extra[3]), extra[4], extra[5], "area"}; - const AxisSpec axisQANtracks{static_cast(extra[6]), extra[7], extra[8], "N_{tracks}^{jet}"}; - const AxisSpec axisQACent{static_cast(axes[3]), axes[4], axes[5], "centrality (%)"}; - hJetQA = registry.add("hJetQA", "per-jet QA", {HistType::kTHnSparseF, {{axisQAPt}, {axisQAEta}, {axisQAPhi}, {axisQAArea}, {axisQANtracks}, {axisQACent}}}, doSumw2Sparse); - - const AxisSpec axisRhoValue{static_cast(axes[6]), axes[7], axes[8], "#it{#rho} (GeV)"}; - const AxisSpec axisRhoArea{static_cast(axes[0]), axes[1], axes[2], "#it{#rho} #upoint A (GeV)"}; - const AxisSpec axisRhoDphi{static_cast(axes[9]), axes[10], axes[11], "#varphi - #Psi_{EP,2} (rad)"}; - hRhoMedian = registry.add("hRhoMedian", "per-jet information, event-averaged (median) rho", {HistType::kTHnSparseF, {{axisQACent}, {axisQAPt}, {axisRhoValue}, {axisRhoArea}, {axisRhoDphi}, {axisQAArea}}}, doSumw2Sparse); - hRhoLocal = registry.add("hRhoLocal", "per-jet information, local rho", {HistType::kTHnSparseF, {{axisQACent}, {axisQAPt}, {axisRhoValue}, {axisRhoArea}, {axisRhoDphi}, {axisQAArea}}}, doSumw2Sparse); - - const AxisSpec axisFluctDpt{static_cast(extra[0]), extra[1], extra[2], "#delta#it{p}_{T} (GeV/#it{c})"}; - const AxisSpec axisFluctAbsDphi{static_cast(axes[9]), axes[10], axes[11], "|#varphi_{cone} - #Psi_{EP,2}| (rad)"}; - const AxisSpec axisFluctArea{static_cast(extra[3]), extra[4], extra[5], "area_{cone}"}; - const AxisSpec axisFluctRho{static_cast(axes[6]), axes[7], axes[8], "#it{#rho}_{local}^{RC} (GeV)"}; - const AxisSpec axisFluctNtracks{static_cast(extra[6]), extra[7], extra[8], "N_{tracks}^{cone}"}; - hFluctQA = registry.add("hFluctQA", "per-random-cone QA", {HistType::kTHnSparseF, {{axisQACent}, {axisFluctDpt}, {axisFluctAbsDphi}, {axisFluctArea}, {axisFluctRho}, {axisFluctNtracks}}}, doSumw2Sparse); - hFluctQAwoLeadingJet = registry.add( - "hFluctQAwoLeadingJet", "per-random-cone QA, leading jet removed from the cone", - {HistType::kTHnSparseF, - {{axisQACent}, {axisFluctDpt}, {axisFluctAbsDphi}, {axisFluctArea}, {axisFluctRho}, {axisFluctNtracks}}}, - doSumw2Sparse); + + const AxisSpec axisQAPtRaw = overrideAxes ? triple(axes, 0, "#it{p}_{T,jet}^{raw} (GeV/#it{c})") + : sameBinning(jetPtAxisRhoAreaSub, "#it{p}_{T,jet}^{raw} (GeV/#it{c})"); + // the per-jet sparses store the background-subtracted pT, so that the spectra are exact + const AxisSpec axisQAPtCorr = overrideAxes ? triple(axes, 0, "#it{p}_{T,jet}^{raw} - #it{#rho}#upointA (GeV/#it{c})") + : sameBinning(jetPtAxisRhoAreaSub, "#it{p}_{T,jet}^{raw} - #it{#rho}#upointA (GeV/#it{c})"); + const AxisSpec axisQACent = overrideAxes ? triple(axes, 1, "centrality (%)") + : sameBinning(centralityAxis, "centrality (%)"); + const AxisSpec axisQADphi = overrideAxes ? triple(axes, 2, "#varphi - #Psi_{EP,2} (rad)") + : sameBinning(fluctDeltaPhiAxis, "#varphi - #Psi_{EP,2} (rad)"); + const AxisSpec axisFluctDpt = overrideExtra ? triple(extra, 0, "#delta#it{p}_{T}^{#it{#rho}(#varphi)} (GeV/#it{c})") + : sameBinning(fluctDeltaPtAxis, "#delta#it{p}_{T}^{#it{#rho}(#varphi)} (GeV/#it{c})"); + // the same cone with the event-averaged density: the unfolding and the raw checks use both + const AxisSpec axisFluctDptEvt = overrideExtra ? triple(extra, 0, "#delta#it{p}_{T}^{#it{#rho}} (GeV/#it{c})") + : sameBinning(fluctDeltaPtAxis, "#delta#it{p}_{T}^{#it{#rho}} (GeV/#it{c})"); + const AxisSpec axisFluctAbsDphi = overrideAxes ? triple(axes, 2, "|#varphi_{cone} - #Psi_{EP,2}| (rad)") + : sameBinning(fluctDeltaPhiAxis, "|#varphi_{cone} - #Psi_{EP,2}| (rad)"); + // jet QA axes (hJetQA only) + const AxisSpec axisQAEta = {20, -1., 1., "#it{#eta}_{jet}"}; + const AxisSpec axisQAPhi = overrideAxes ? triple(axes, 2, "#varphi_{jet} (rad)") + : sameBinning(fluctDeltaPhiAxis, "#varphi_{jet} (rad)"); + // leading-constituent pT: stored in the rho sparses, together with the background density + const AxisSpec axisQALeadTrkPt = {20, 0., 60., "#it{p}_{T,lead const.} (GeV/#it{c})"}; + const AxisSpec axisQAArea = overrideExtra ? triple(extra, 1, "area") : AxisSpec{8, 0., 0.8, "area"}; + const AxisSpec axisQANtracks = overrideExtra ? triple(extra, 2, "N_{tracks}") : AxisSpec{20, 0., 100., "N_{tracks}"}; + + LOGF(info, "THnSparse binning (%s): pT %ld [%.1f, %.1f], centrality %ld [%.1f, %.1f], delta phi %ld [%.2f, %.2f], delta pT %ld [%.1f, %.1f]", + (overrideAxes || overrideExtra) ? "overridden" : "same as the analysis histograms", + axisQAPtCorr.getNbins(), axisQAPtCorr.binEdges[0], axisQAPtCorr.binEdges[1], + axisQACent.getNbins(), axisQACent.binEdges[0], axisQACent.binEdges[1], + axisQADphi.getNbins(), axisQADphi.binEdges[0], axisQADphi.binEdges[1], + axisFluctDpt.getNbins(), axisFluctDpt.binEdges[0], axisFluctDpt.binEdges[1]); + + LOGF(info, "in-/out-of-plane windows: in-plane |dphi-Psi2| < %.1f deg (and the back side >= %.1f deg), out-of-plane the band in between", + inPlaneMaxDeg.value, outPlaneMaxDeg.value); + + hJetQA = registry.add("hJetQA", "per-jet QA", {HistType::kTHnSparseF, {{axisQAPtRaw}, {axisQAEta}, {axisQAPhi}, {axisQAArea}, {axisQANtracks}, {axisQACent}}}, doSumw2Sparse); + // analysis: centrality | background-subtracted pT | Delta phi; any in-/out-of-plane window is a + // projection of the Delta phi axis + hRhoMedian = registry.add("hRhoMedian", "per-jet information, event-averaged (median) rho", {HistType::kTHnSparseF, {{axisQACent}, {axisQAPtCorr}, {axisQADphi}}}, doSumw2Sparse); + hRhoLocal = registry.add("hRhoLocal", "per-jet information, local rho", {HistType::kTHnSparseF, {{axisQACent}, {axisQAPtCorr}, {axisQADphi}}}, doSumw2Sparse); + // rho QA: both background-density definitions of the same jet in one object, so that every rho QA + // plot (rho vs centrality / vs pT / vs Delta phi, the local-over-median ratio and the leading + // constituent pT) can be made offline + const AxisSpec axisQARhoMedian{210, -10., 200., "#it{#rho} (event median) (GeV)"}; + const AxisSpec axisQARhoLocal{210, -10., 200., "#it{#rho}(#varphi) (local) (GeV)"}; + hRhoQA = registry.add("hRhoQA", "per-jet background density, both definitions and QA quantities", {HistType::kTHnSparseF, {{axisQACent}, {axisQAPtRaw}, {axisQARhoMedian}, {axisQARhoLocal}, {axisQADphi}, {axisQALeadTrkPt}, {axisQAArea}}}, doSumw2Sparse); + // the two background-density definitions stay independent, as for the jets + hFluctQAwoLeadingJet = registry.add("hFluctQAwoLeadingJet", "per-random-cone QA, leading jet removed from the cone, local rho", {HistType::kTHnSparseF, {{axisQACent}, {axisFluctDpt}, {axisFluctAbsDphi}}}, doSumw2Sparse); + hFluctQAwoLeadingJetMedian = registry.add("hFluctQAwoLeadingJetMedian", "per-random-cone QA, leading jet removed from the cone, event-averaged rho", {HistType::kTHnSparseF, {{axisQACent}, {axisFluctDptEvt}, {axisFluctAbsDphi}}}, doSumw2Sparse); } Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); @@ -977,6 +1049,24 @@ struct JetChargedV2 { } } + // |dphi - Psi2| folded into [0, pi]; the argument may be given in [0, 2pi) or already folded + double foldedDphi(double dphi) + { + double a = std::fmod(std::fabs(dphi), o2::constants::math::TwoPI); + if (a > o2::constants::math::PI) { + a = o2::constants::math::TwoPI - a; + } + return a; + } + + // in-plane: |dphi-Psi2| < inPlaneMaxDeg or, on the back side, |dphi-Psi2| > 180 - inPlaneMaxDeg; + // out-of-plane is then the complementary band [inPlaneMaxDeg, outPlaneMaxDeg) + bool isInPlane(double dphi) + { + const double a = foldedDphi(dphi); + return a < inPlaneMaxDeg * o2::constants::math::Deg2Rad || a >= outPlaneMaxDeg * o2::constants::math::Deg2Rad; + } + // fill nTrk plot for fit rho(varphi) template void fillNtrkCheck(U const& tracks, J const& jets, TH1F* hPtsumSumptFitFill, double& leadingJetEta) @@ -1068,9 +1158,6 @@ struct JetChargedV2 { double ep3 = 0.; int cfgNmodA = 2; int cfgNmodB = 3; - int evtPlnAngleA = 7; - int evtPlnAngleB = 3; - int evtPlnAngleC = 5; for (uint i = 0; i < epQvec.cfgnMods->size(); i++) { int nmode = epQvec.cfgnMods->at(i); int detInd = detId * 4 + epQvec.cfgnTotalSystem * 4 * (nmode - 2); @@ -1181,7 +1268,7 @@ struct JetChargedV2 { // phiMinusPsi2 = jet.phi() - ep2; phiMinusPsi2 = RecoDecay::constrainAngle(jet.phi() - ep2, 0.0f); // same in-/out-of-plane definition as in processSigmaPtData (unfolded phi - Psi2) - if ((phiMinusPsi2 < o2::constants::math::PIQuarter) || (phiMinusPsi2 >= evtPlnAngleA * o2::constants::math::PIQuarter) || (phiMinusPsi2 >= evtPlnAngleB * o2::constants::math::PIQuarter && phiMinusPsi2 < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(phiMinusPsi2)) { registry.fill(HIST("h_mcp_jet_pt_in_plane_v2_rho"), jet.pt() - (rholocal * jet.area()), weight); registry.fill(HIST("h2_mcp_centrality_jet_pt_in_plane_v2_rho"), centrality, jet.pt() - (rholocal * jet.area()), weight); } else { @@ -1198,7 +1285,7 @@ struct JetChargedV2 { // phiMinusPsi3 = jet.phi() - ep3; phiMinusPsi3 = RecoDecay::constrainAngle(jet.phi() - ep3, -o2::constants::math::PI); float absDelta3 = std::abs(phiMinusPsi3); - if ((absDelta3 < o2::constants::math::PIQuarter) || (absDelta3 >= evtPlnAngleA * o2::constants::math::PIQuarter) || (absDelta3 >= evtPlnAngleB * o2::constants::math::PIQuarter && absDelta3 < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(absDelta3)) { registry.fill(HIST("h_mcp_jet_pt_in_plane_v3_rho"), jet.pt() - (rholocal * jet.area()), weight); registry.fill(HIST("h2_mcp_centrality_jet_pt_in_plane_v3_rho"), centrality, jet.pt() - (rholocal * jet.area()), weight); } else { @@ -1261,9 +1348,6 @@ struct JetChargedV2 { continue; } if (jetMCD.r() == round(selectedJetsRadius * 100.0f)) { - int evtPlnAngleA = 7; - int evtPlnAngleB = 3; - int evtPlnAngleC = 5; double phiMinusPsi2 = 0.0; // double phiMinusPsi2 = jetMCD.phi() - ep2; phiMinusPsi2 = RecoDecay::constrainAngle(jetMCD.phi() - ep2, -o2::constants::math::PI); @@ -1274,7 +1358,7 @@ struct JetChargedV2 { if (jetfindingutilities::isInEtaAcceptance(jetMCD, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { registry.fill(HIST("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_mcdetaconstraint"), corrBasejetpt, corrTagjetpt, weight); registry.fill(HIST("h2_jet_pt_mcd_jet_pt_diff_matchedgeo"), corrBasejetpt, dcorrpt / corrBasejetpt, weight); - if ((absDelta < o2::constants::math::PIQuarter) || (absDelta >= evtPlnAngleA * o2::constants::math::PIQuarter) || (absDelta >= evtPlnAngleB * o2::constants::math::PIQuarter && absDelta < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(absDelta)) { registry.fill(HIST("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_in_mcdetaconstraint"), corrBasejetpt, corrTagjetpt, weight); registry.fill(HIST("h2_jet_pt_mcd_jet_pt_diff_matchedgeo_in"), corrBasejetpt, dcorrpt / corrBasejetpt, weight); } else { @@ -1286,7 +1370,7 @@ struct JetChargedV2 { registry.fill(HIST("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_mcpetaconstraint"), corrBasejetpt, corrTagjetpt, weight); registry.fill(HIST("h2_jet_pt_mcp_jet_pt_diff_matchedgeo"), corrTagjetpt, dcorrpt / corrTagjetpt, weight); registry.fill(HIST("h2_jet_pt_mcp_jet_pt_ratio_matchedgeo"), corrTagjetpt, corrBasejetpt / corrTagjetpt, weight); - if ((absDelta < o2::constants::math::PIQuarter) || (absDelta >= evtPlnAngleA * o2::constants::math::PIQuarter) || (absDelta >= evtPlnAngleB * o2::constants::math::PIQuarter && absDelta < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(absDelta)) { registry.fill(HIST("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_in_mcpetaconstraint"), corrBasejetpt, corrTagjetpt, weight); registry.fill(HIST("h2_jet_pt_mcp_jet_pt_diff_matchedgeo_in"), corrTagjetpt, dcorrpt / corrTagjetpt, weight); registry.fill(HIST("h2_jet_pt_mcp_jet_pt_ratio_matchedgeo_in"), corrTagjetpt, corrBasejetpt / corrTagjetpt, weight); @@ -1326,9 +1410,6 @@ struct JetChargedV2 { } } if (jetMCD.r() == round(selectedJetsRadius * 100.0f)) { - int evtPlnAngleA = 7; - int evtPlnAngleB = 3; - int evtPlnAngleC = 5; double integralValue = getRhoLocalIntegral(fFitModulationRMFill, jetMCD.phi(), selectedJetsRadius, rhoFitRangeMargin); double rholocal = rho / (2 * selectedJetsRadius * tempparaA) * integralValue; double corrBasejetpt = jetMCD.pt() - (rholocal * jetMCD.area()); @@ -1348,7 +1429,7 @@ struct JetChargedV2 { if (jetfindingutilities::isInEtaAcceptance(jetMCD, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { registry.fill(HIST("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_incl_rhoareasubtracted_mcdetaconstraint"), corrBasejetpt, corrTagjetpt, weight); registry.fill(HIST("h2_jet_pt_mcd_jet_pt_diff_matchedgeo_incl_rhoareasubtracted"), corrBasejetpt, dcorrpt / corrBasejetpt, weight); - if ((absDelta < o2::constants::math::PIQuarter) || (absDelta >= evtPlnAngleA * o2::constants::math::PIQuarter) || (absDelta >= evtPlnAngleB * o2::constants::math::PIQuarter && absDelta < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(absDelta)) { registry.fill(HIST("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_in_rhoareasubtracted_mcdetaconstraint"), corrBasejetpt, corrTagjetpt, weight); registry.fill(HIST("h2_jet_pt_mcd_jet_pt_diff_matchedgeo_in_rhoareasubtracted"), corrBasejetpt, dcorrpt / corrBasejetpt, weight); } else { @@ -1360,7 +1441,7 @@ struct JetChargedV2 { registry.fill(HIST("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_incl_rhoareasubtracted_mcpetaconstraint"), corrBasejetpt, corrTagjetpt, weight); registry.fill(HIST("h2_jet_pt_mcp_jet_pt_diff_matchedgeo_incl_rhoareasubtracted"), corrTagjetpt, dcorrpt / corrTagjetpt, weight); registry.fill(HIST("h2_jet_pt_mcp_jet_pt_ratio_matchedgeo_incl_rhoareasubtracted"), corrTagjetpt, corrBasejetpt / corrTagjetpt, weight); - if ((absDelta < o2::constants::math::PIQuarter) || (absDelta >= evtPlnAngleA * o2::constants::math::PIQuarter) || (absDelta >= evtPlnAngleB * o2::constants::math::PIQuarter && absDelta < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(absDelta)) { registry.fill(HIST("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_in_rhoareasubtracted_mcpetaconstraint"), corrBasejetpt, corrTagjetpt, weight); registry.fill(HIST("h2_jet_pt_mcp_jet_pt_diff_matchedgeo_in_rhoareasubtracted"), corrTagjetpt, dcorrpt / corrTagjetpt, weight); registry.fill(HIST("h2_jet_pt_mcp_jet_pt_ratio_matchedgeo_in_rhoareasubtracted"), corrTagjetpt, corrBasejetpt / corrTagjetpt, weight); @@ -1492,7 +1573,8 @@ struct JetChargedV2 { for (uint i = 0; i < epQvec.cfgnMods->size(); i++) { int nmode = epQvec.cfgnMods->at(i); int detInd = detId * 4 + epQvec.cfgnTotalSystem * 4 * (nmode - 2); - int detIndFT0M = (detIdCheck + 2) * 4 + epQvec.cfgnTotalSystem * 4 * (nmode - 2); + const int detIdFT0M = 2; // fixed ordering of the q-vector table: FT0C=0, FT0A=1, FT0M=2, FV0A=3, TPCpos=4 ... + int detIndFT0M = detIdFT0M * 4 + epQvec.cfgnTotalSystem * 4 * (nmode - 2); int refAInd = refAId * 4 + epQvec.cfgnTotalSystem * 4 * (nmode - 2); int refBInd = refBId * 4 + epQvec.cfgnTotalSystem * 4 * (nmode - 2); @@ -1654,16 +1736,9 @@ struct JetChargedV2 { double ep3 = 0.; int cfgNmodA = 2; int cfgNmodB = 3; - // In-plane / out-of-plane windows, identical to the downstream QA and unfolding - // macros (analysisCode_headFiles.cpp::GetInOutPlane2D), which cut - // Delta phi = phi - Psi_2 in [0, 2pi) at pi/4, 3pi/4, 5pi/4 and 7pi/4: - // in-plane : [0, pi/4) U [3pi/4, 5pi/4) U [7pi/4, 2pi) - // out-of-plane : [pi/4, 3pi/4) U [5pi/4, 7pi/4) - // The same composite expression also gives the correct region for a folded - // |Delta phi| in [0, pi], namely [0, pi/4) U [3pi/4, pi]. - int evtPlnAngleA = 7; - int evtPlnAngleB = 3; - int evtPlnAngleC = 5; + // In-plane / out-of-plane windows, set by inPlaneMaxDeg / outPlaneMaxDeg (defaults 45 / 135 deg, + // i.e. the usual definition [0, pi/4) U [3pi/4, pi) in-plane and [pi/4, 3pi/4) out-of-plane for + // |Delta phi| folded into [0, pi]). Use 60 / 120 for the 60-degree definition. for (uint i = 0; i < epQvec.cfgnMods->size(); i++) { int nmode = epQvec.cfgnMods->at(i); int detInd = detId * 4 + epQvec.cfgnTotalSystem * 4 * (nmode - 2); @@ -1716,6 +1791,14 @@ struct JetChargedV2 { registry.fill(HIST("h_v3obs_centrality"), centrality, temppara[3]); registry.fill(HIST("h_evtnum_centrlity"), evtnum, centrality); + if (leadingJetPt > 0) { // event-level rho profiles, one entry per event + const double integralLeadJet = getRhoLocalIntegral(fFitModulationV2v3, leadingJetPhi, selectedJetsRadius, rhoFitRangeMargin); + const double rholocalLeadJet = integralLeadJet > 0 ? collision.rho() / (2 * selectedJetsRadius * temppara[0]) * integralLeadJet : collision.rho(); + registry.fill(HIST("h2_averagerho_leadJetPt"), leadingJetPt, collision.rho(), 1.0); + registry.fill(HIST("h2_rholocalAtLeadJet_leadJetPt"), leadingJetPt, rholocalLeadJet, 1.0); + registry.fill(HIST("h3_centrality_leadJetPt_rho"), centrality, leadingJetPt, collision.rho(), 1.0); + } + const int numOfFreePara = 3; // psi2/psi3 are fixed with FixParameter -> [0], [1], [3] are free int nBinsUsed = 0; double chi2 = 0.; @@ -1750,7 +1833,8 @@ struct JetChargedV2 { for (uint i = 0; i < epQvec.cfgnMods->size(); i++) { int nmode = epQvec.cfgnMods->at(i); int detInd = detId * 4 + epQvec.cfgnTotalSystem * 4 * (nmode - 2); - int detIndFT0M = 4 * epQvec.detCheck + epQvec.cfgnTotalSystem * 4 * (nmode - 2); + const int detIdFT0M = 2; // fixed ordering of the q-vector table: FT0C=0, FT0A=1, FT0M=2, FV0A=3, TPCpos=4 ... + int detIndFT0M = detIdFT0M * 4 + epQvec.cfgnTotalSystem * 4 * (nmode - 2); int bumpLow = 75; int bumpUp = 125; @@ -1838,12 +1922,27 @@ struct JetChargedV2 { registry.fill(HIST("h_jet_pt_inclusive_v2"), jet.pt() - (collision.rho() * jet.area()), 1.0); registry.fill(HIST("h_jet_pt_inclusive_v2_rho"), jet.pt() - (rholocal * jet.area()), 1.0); if (fillTHnSparse && sparseSubsample > 0 && (jet.globalIndex() % sparseSubsample) == 0) { + // pT of the leading constituent, used instead of the jet phi because the jet phi is + // already available in the 2D histograms + double leadConstPt = 0.; + for (const auto& constituent : jet.tracks_as()) { + if (constituent.pt() > leadConstPt) { + leadConstPt = constituent.pt(); + } + } const std::array qaJet = {jet.pt(), jet.eta(), jet.phi(), jet.area(), static_cast(jet.tracksIds().size()), centrality}; hJetQA->Fill(qaJet.data(), 1.0); - const std::array rhoMedianData = {centrality, jet.pt(), collision.rho(), collision.rho() * jet.area(), phiMinusPsi2, jet.area()}; + // the jet pT stored in the two analysis sparses is the background-subtracted one; the + // raw pT and both background densities of the same jet are in hRhoQA + const double ptCorrMedian = jet.pt() - collision.rho() * jet.area(); + const double ptCorrLocal = jet.pt() - rholocal * jet.area(); + const std::array rhoMedianData = {centrality, ptCorrMedian, phiMinusPsi2}; hRhoMedian->Fill(rhoMedianData.data(), 1.0); - const std::array rhoLocalData = {centrality, jet.pt(), rholocal, rholocal * jet.area(), phiMinusPsi2, jet.area()}; + const std::array rhoLocalData = {centrality, ptCorrLocal, phiMinusPsi2}; hRhoLocal->Fill(rhoLocalData.data(), 1.0); + // both densities of the same jet, for the rho QA plots + const std::array rhoQAData = {centrality, jet.pt(), collision.rho(), rholocal, phiMinusPsi2, leadConstPt, jet.area()}; + hRhoQA->Fill(rhoQAData.data(), 1.0); } if (jet.pt() > bumpLow && jet.pt() < bumpUp) { @@ -1854,7 +1953,7 @@ struct JetChargedV2 { int mediumPtCut = 40; int highPtCut = 70; int highPtCutEnd = 100; - if ((phiMinusPsi2 < o2::constants::math::PIQuarter) || (phiMinusPsi2 >= evtPlnAngleA * o2::constants::math::PIQuarter) || (phiMinusPsi2 >= evtPlnAngleB * o2::constants::math::PIQuarter && phiMinusPsi2 < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(phiMinusPsi2)) { registry.fill(HIST("h_jet_pt_in_plane_v2"), jet.pt() - (collision.rho() * jet.area()), 1.0); registry.fill(HIST("h2_centrality_jet_pt_in_plane_v2"), centrality, jet.pt() - (collision.rho() * jet.area()), 1.0); registry.fill(HIST("h_jet_pt_in_plane_v2_rho"), jet.pt() - (rholocal * jet.area()), 1.0); @@ -1893,7 +1992,7 @@ struct JetChargedV2 { registry.fill(HIST("h2_rho_cent_local_out"), centrality, rholocal, 1.0); } if (checkAbsDeltaPhi) { - if ((absDelta < o2::constants::math::PIQuarter) || (absDelta >= evtPlnAngleA * o2::constants::math::PIQuarter) || (absDelta >= evtPlnAngleB * o2::constants::math::PIQuarter && absDelta < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(absDelta)) { registry.fill(HIST("h_jet_pt_in_plane_v2_abs"), jet.pt() - (collision.rho() * jet.area()), 1.0); registry.fill(HIST("h_jet_pt_in_plane_v2_rho_abs"), jet.pt() - (rholocal * jet.area()), 1.0); } else { @@ -1910,7 +2009,7 @@ struct JetChargedV2 { phiMinusPsi3 = RecoDecay::constrainAngle(jet.phi() - ep3, -o2::constants::math::PI); float absDelta3 = std::abs(phiMinusPsi3); - if ((absDelta3 < o2::constants::math::PIQuarter) || (absDelta3 >= evtPlnAngleA * o2::constants::math::PIQuarter) || (absDelta3 >= evtPlnAngleB * o2::constants::math::PIQuarter && absDelta3 < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(absDelta3)) { registry.fill(HIST("h_jet_pt_in_plane_v3"), jet.pt() - (collision.rho() * jet.area()), 1.0); registry.fill(HIST("h_jet_pt_in_plane_v3_rho"), jet.pt() - (rholocal * jet.area()), 1.0); } else { @@ -1938,14 +2037,12 @@ struct JetChargedV2 { // folded |Delta phi| in [0, pi], only used by the checkAbsDeltaPhi cross-check absRcPhiPsi2 = std::abs(RecoDecay::constrainAngle(randomConePhi - ep2, -o2::constants::math::PI)); - int nTracksRandomCone = 0; for (auto const& track : tracks) { if (jetderiveddatautilities::selectTrack(track, trackSelection)) { float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, -o2::constants::math::PI); float dEta = track.eta() - randomConeEta; if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { randomConePt += track.pt(); - ++nTracksRandomCone; } } } @@ -1953,19 +2050,13 @@ struct JetChargedV2 { registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_localrhovsphi"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, rcPhiPsi2, 1.0); } - if ((rcPhiPsi2 < o2::constants::math::PIQuarter) || (rcPhiPsi2 >= evtPlnAngleA * o2::constants::math::PIQuarter) || (rcPhiPsi2 >= evtPlnAngleB * o2::constants::math::PIQuarter && rcPhiPsi2 < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(rcPhiPsi2)) { registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_localrhovsphi_in"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, 1.0); } else { registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_localrhovsphi_out"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, 1.0); - if (fillTHnSparse && sparseSubsample > 0 && (collision.globalIndex() % sparseSubsample) == 0) { - const std::array qaFluct = {centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, - std::fabs(rcPhiPsi2), o2::constants::math::PI * randomConeR * randomConeR, rholocalRC, - static_cast(nTracksRandomCone)}; - hFluctQA->Fill(qaFluct.data(), 1.0); - } } if (checkAbsDeltaPhi) { - if ((absRcPhiPsi2 < o2::constants::math::PIQuarter) || (absRcPhiPsi2 >= evtPlnAngleA * o2::constants::math::PIQuarter) || (absRcPhiPsi2 >= evtPlnAngleB * o2::constants::math::PIQuarter && absRcPhiPsi2 < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(absRcPhiPsi2)) { registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_localrhovsphi_in_abs"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, 1.0); } else { registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_localrhovsphi_out_abs"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, 1.0); @@ -1973,7 +2064,6 @@ struct JetChargedV2 { } // removing the leading jet from the random cone - int nTracksRandomConeWoLeadingJet = 0; if (jets.size() > 0) { // if there are no jets in the acceptance (from the jetfinder cuts) then there can be no leading jet float dPhiLeadingJet = RecoDecay::constrainAngle(leadingJetPhi - randomConePhi, -o2::constants::math::PI); float dEtaLeadingJet = leadingJetEta - randomConeEta; @@ -1999,7 +2089,6 @@ struct JetChargedV2 { float dEta = track.eta() - randomConeEta; if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { randomConePt += track.pt(); - ++nTracksRandomConeWoLeadingJet; } } } @@ -2011,7 +2100,7 @@ struct JetChargedV2 { } registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, 1.0); registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho(), 1.0); - if ((rcPhiPsi2 < o2::constants::math::PIQuarter) || (rcPhiPsi2 >= evtPlnAngleA * o2::constants::math::PIQuarter) || (rcPhiPsi2 >= evtPlnAngleB * o2::constants::math::PIQuarter && rcPhiPsi2 < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(rcPhiPsi2)) { registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet_in"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, 1.0); registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet_in"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho(), 1.0); } else { @@ -2019,13 +2108,17 @@ struct JetChargedV2 { registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet_out"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho(), 1.0); } if (fillTHnSparse && sparseSubsample > 0 && (collision.globalIndex() % sparseSubsample) == 0) { - const std::array qaFluctWo = {centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, - std::fabs(rcPhiPsi2), o2::constants::math::PI * randomConeR * randomConeR, rholocalRC, - static_cast(nTracksRandomConeWoLeadingJet)}; + // both background-density definitions, kept in two independent sparses: the unfolding and + // the raw checks use the local and the event-averaged one + const std::array qaFluctWo = {centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, + std::fabs(rcPhiPsi2)}; hFluctQAwoLeadingJet->Fill(qaFluctWo.data(), 1.0); + const std::array qaFluctWoMedian = {centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho(), + std::fabs(rcPhiPsi2)}; + hFluctQAwoLeadingJetMedian->Fill(qaFluctWoMedian.data(), 1.0); } if (checkAbsDeltaPhi) { - if ((absRcPhiPsi2 < o2::constants::math::PIQuarter) || (absRcPhiPsi2 >= evtPlnAngleA * o2::constants::math::PIQuarter) || (absRcPhiPsi2 >= evtPlnAngleB * o2::constants::math::PIQuarter && absRcPhiPsi2 < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(absRcPhiPsi2)) { registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet_in_abs"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, 1.0); registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet_in_abs"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho(), 1.0); } else { @@ -2125,9 +2218,6 @@ struct JetChargedV2 { double ep3 = 0.; int cfgNmodA = 2; int cfgNmodB = 3; - int evtPlnAngleA = 7; - int evtPlnAngleB = 3; - int evtPlnAngleC = 5; for (uint i = 0; i < epQvec.cfgnMods->size(); i++) { int nmode = epQvec.cfgnMods->at(i); int detInd = detId * 4 + epQvec.cfgnTotalSystem * 4 * (nmode - 2); @@ -2245,7 +2335,7 @@ struct JetChargedV2 { registry.fill(HIST("h2_phi_rholocal"), jet.phi() - ep2, rholocal, 1.0); registry.fill(HIST("h_jet_pt_inclusive_v2_rho"), jet.pt() - (rholocal * jet.area()), 1.0); - if ((phiMinusPsi2 < o2::constants::math::PIQuarter) || (phiMinusPsi2 >= evtPlnAngleA * o2::constants::math::PIQuarter) || (phiMinusPsi2 >= evtPlnAngleB * o2::constants::math::PIQuarter && phiMinusPsi2 < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(phiMinusPsi2)) { registry.fill(HIST("h_jet_pt_in_plane_v2_rho"), jet.pt() - (rholocal * jet.area()), 1.0); registry.fill(HIST("h2_centrality_jet_pt_in_plane_v2_rho"), centrality, jet.pt() - (rholocal * jet.area()), 1.0); } else { @@ -2262,7 +2352,7 @@ struct JetChargedV2 { phiMinusPsi3 = RecoDecay::constrainAngle(jet.phi() - ep3, -o2::constants::math::PI); float absDelta3 = std::abs(phiMinusPsi3); - if ((absDelta3 < o2::constants::math::PIQuarter) || (absDelta3 >= evtPlnAngleA * o2::constants::math::PIQuarter) || (absDelta3 >= evtPlnAngleB * o2::constants::math::PIQuarter && absDelta3 < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(absDelta3)) { registry.fill(HIST("h_jet_pt_in_plane_v3_rho"), jet.pt() - (rholocal * jet.area()), 1.0); } else { registry.fill(HIST("h_jet_pt_out_of_plane_v3_rho"), jet.pt() - (rholocal * jet.area()), 1.0); @@ -2299,13 +2389,13 @@ struct JetChargedV2 { if (fillFluctH3) { registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_localrhovsphi"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, rcPhiPsi2, 1.0); } - if ((rcPhiPsi2 < o2::constants::math::PIQuarter) || (rcPhiPsi2 >= evtPlnAngleA * o2::constants::math::PIQuarter) || (rcPhiPsi2 >= evtPlnAngleB * o2::constants::math::PIQuarter && rcPhiPsi2 < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(rcPhiPsi2)) { registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_localrhovsphi_in"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, 1.0); } else { registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_localrhovsphi_out"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, 1.0); } if (checkAbsDeltaPhi) { - if ((absRcPhiPsi2 < o2::constants::math::PIQuarter) || (absRcPhiPsi2 >= evtPlnAngleA * o2::constants::math::PIQuarter) || (absRcPhiPsi2 >= evtPlnAngleB * o2::constants::math::PIQuarter && absRcPhiPsi2 < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(absRcPhiPsi2)) { registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_localrhovsphi_in_abs"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, 1.0); } else { registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_localrhovsphi_out_abs"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, 1.0); @@ -2356,7 +2446,7 @@ struct JetChargedV2 { registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, rcPhiPsi2, 1.0); registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho(), rcPhiPsi2, 1.0); } - if ((rcPhiPsi2 < o2::constants::math::PIQuarter) || (rcPhiPsi2 >= evtPlnAngleA * o2::constants::math::PIQuarter) || (rcPhiPsi2 >= evtPlnAngleB * o2::constants::math::PIQuarter && rcPhiPsi2 < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(rcPhiPsi2)) { registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet_in"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, 1.0); registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet_in"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho(), 1.0); } else { @@ -2364,7 +2454,7 @@ struct JetChargedV2 { registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet_out"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho(), 1.0); } if (checkAbsDeltaPhi) { - if ((absRcPhiPsi2 < o2::constants::math::PIQuarter) || (absRcPhiPsi2 >= evtPlnAngleA * o2::constants::math::PIQuarter) || (absRcPhiPsi2 >= evtPlnAngleB * o2::constants::math::PIQuarter && absRcPhiPsi2 < evtPlnAngleC * o2::constants::math::PIQuarter)) { + if (isInPlane(absRcPhiPsi2)) { registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet_in_abs"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocalRC, 1.0); registry.fill(HIST("h2_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet_in_abs"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho(), 1.0); } else {