From 1e70185c15569ad17967c9eb355d9db18282c3a2 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Tue, 14 Jan 2025 15:20:55 +0800 Subject: [PATCH 01/25] charged jet v2 code add rho as function of phi, jet pt distribution of in-plane and out-pf-plane using rho_local, delta pt test --- PWGJE/Tasks/jetChargedV2.cxx | 547 ++++++++++++++++++++++++++++++++--- 1 file changed, 507 insertions(+), 40 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index dc62692a2b4..44aafd8f6fb 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -51,10 +51,12 @@ #include "Framework/AnalysisTask.h" #include "Framework/O2DatabasePDGPlugin.h" #include "Framework/HistogramRegistry.h" + #include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" + #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/Core/TrackSelectionDefaults.h" #include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetFinder.h" @@ -68,9 +70,152 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -//=====================< evt pln >=====================// -using MyCollisions = soa::Join; -//=====================< evt pln | end >=====================// +namespace o2::aod +{ +DECLARE_SOA_TABLE(MyCollisions, "AOD", "MYCOLLISION", //! vertex information of collision + o2::soa::Index<>, collision::PosZ); +using MyCollision = MyCollisions::iterator; + + namespace myTable + { + DECLARE_SOA_INDEX_COLUMN(MyCollision, mycollision); + + DECLARE_SOA_COLUMN(Psi2, psi2, Float_t); + DECLARE_SOA_COLUMN(Psi3, psi3, Float_t); + DECLARE_SOA_COLUMN(EvtPlRes, evtplres, Float_t); + } + DECLARE_SOA_TABLE(MyTablea, "AOD", "MYTABLEA", o2::soa::Index<>, + myTable::Psi2, + myTable::Psi3, + myTable::EvtPlRes); +} + +struct jetChargedV2EPTable { + Produces myTablea; + Produces outputCollisions; + + HistogramRegistry registry; + + + Configurable eventSelections{"eventSelections", "sel8", "choose event selection"}; + Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; + + Configurable vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"}; + Configurable centralityMin{"centralityMin", -999.0, "minimum centrality"}; + Configurable centralityMax{"centralityMax", 999.0, "maximum centrality"}; + Configurable trackPtMin{"trackPtMin", 0.15, "minimum pT acceptance for tracks"}; + Configurable trackPtMax{"trackPtMax", 1000., "maximum pT acceptance for tracks"}; + Configurable trackEtaMin{"trackEtaMin", -0.9, "minimum eta acceptance for tracks"}; + Configurable trackEtaMax{"trackEtaMax", 0.9, "maximum eta acceptance for tracks"}; + + Configurable jetAreaFractionMin{"jetAreaFractionMin", -99.0, "used to make a cut on the jet areas"}; + Configurable leadingConstituentPtMin{"leadingConstituentPtMin", -99.0, "minimum pT selection on jet constituent"}; + Configurable jetPtMin{"jetPtMin", 0.15, "minimum pT acceptance for jets"}; + Configurable jetPtMax{"jetPtMax", 200.0, "maximum pT acceptance for jets"}; + + Configurable trackOccupancyInTimeRangeMax{"trackOccupancyInTimeRangeMax", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; + Configurable trackOccupancyInTimeRangeMin{"trackOccupancyInTimeRangeMin", -999999, "minimum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; + + //=====================< evt pln >=====================// + Configurable cfgAddEvtSel{"cfgAddEvtSel", true, "event selection"}; + Configurable> cfgnMods{"cfgnMods", {2}, "Modulation of interest"}; + Configurable cfgnTotalSystem{"cfgnTotalSystem", 7, "total qvect 56 or number"}; + Configurable cfgDetName{"cfgDetName", "FT0M", "The name of detector to be analyzed"}; + Configurable cfgRefAName{"cfgRefAName", "TPCpos", "The name of detector for reference A"}; + Configurable cfgRefBName{"cfgRefBName", "TPCneg", "The name of detector for reference B"}; + + EventPlaneHelper helperEP; + int DetId; + int RefAId; + int RefBId; + + template + int GetDetId(const T& name) + { + if (name.value == "BPos" || name.value == "BNeg" || name.value == "BTot") { + LOGF(warning, "Using deprecated label: %s. Please use TPCpos, TPCneg, TPCall instead.", name.value); + } + if (name.value == "FT0C") { + return 0; + } else if (name.value == "FT0A") { + return 1; + } else if (name.value == "FT0M") { + return 2; + } else if (name.value == "FV0A") { + return 3; + } else if (name.value == "TPCpos" || name.value == "BPos") { + return 4; + } else if (name.value == "TPCneg" || name.value == "BNeg") { + return 5; + } else if (name.value == "TPCall" || name.value == "BTot") { + return 6; + } else { + return 0; + } + } + //=====================< evt pln | end >=====================// + + Configurable selectedJetsRadius{"selectedJetsRadius", 0.4, "resolution parameter for histograms without radius"}; + + std::vector jetPtBins; + std::vector jetPtBinsRhoAreaSub; + + int eventSelectiont = -1; + int trackSelectiont = -1; + + void init(o2::framework::InitContext&) + { + DetId = GetDetId(cfgDetName); + RefAId = GetDetId(cfgRefAName); + RefBId = GetDetId(cfgRefBName); + if (DetId == RefAId || DetId == RefBId || RefAId == RefBId) { + LOGF(info, "Wrong detector configuration \n The FT0C will be used to get Q-Vector \n The TPCpos and TPCneg will be used as reference systems"); + DetId = 0; + RefAId = 4; + RefBId = 5; + } + eventSelectiont = jetderiveddatautilities::initialiseEventSelection(static_cast(eventSelections)); + trackSelectiont = jetderiveddatautilities::initialiseTrackSelection(static_cast(trackSelections)); + } + + Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); + Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centrality >= centralityMin && aod::jcollision::centrality < centralityMax); + + void processJetV2Table(soa::Filtered>::iterator const& collision, + soa::Join const& jets, + aod::JetTracks const& tracks) + { + if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { + return; + } + if (!jetderiveddatautilities::selectCollision(collision, eventSelectiont)) { + return; + } + outputCollisions(collision.posZ()); + //=====================< evt pln [n=2->\Psi_2, n=3->\Psi_3] >=====================// + double ep2 = 0; + double ep3 = 0; + double res2 = 0; + + for (uint i = 0; i < cfgnMods->size(); i++) { + int nmode = cfgnMods->at(i); + int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + if (nmode == 2) { + if (collision.qvecAmp()[DetId] > 1e-8) { + ep2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode); + res2 = helperEP.GetResolution(helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), nmode); + } + } else if (nmode == 3) { + if (collision.qvecAmp()[DetId] > 1e-8) { + ep3 = helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode); + } + } + } + myTablea(ep2, ep3, res2); + LOGF(info, "table producer Psi2 as %f, Psi3 as %f, Res2 as %f", ep2, ep3, res2); + } + PROCESS_SWITCH(jetChargedV2EPTable, processJetV2Table, "Jet V2 table for fit", true); +}; struct Jetchargedv2Task { HistogramRegistry registry; @@ -98,6 +243,9 @@ struct Jetchargedv2Task { Configurable jetRadius{"jetRadius", 0.2, "jet resolution parameters"}; Configurable randomConeR{"randomConeR", 0.4, "size of random Cone for estimating background fluctuations"}; + Configurable trackOccupancyInTimeRangeMax{"trackOccupancyInTimeRangeMax", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; + Configurable trackOccupancyInTimeRangeMin{"trackOccupancyInTimeRangeMin", -999999, "minimum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; + Configurable NTrackCut{"NumberTrackCut", 500, "Number of Track Cut"}; //=====================< evt pln >=====================// Configurable cfgAddEvtSel{"cfgAddEvtSel", true, "event selection"}; @@ -111,6 +259,9 @@ struct Jetchargedv2Task { ConfigurableAxis cfgaxisQvec{"cfgaxisQvec", {100, -3, 3}, ""}; ConfigurableAxis cfgaxisCent{"cfgaxisCent", {90, 0, 90}, ""}; + ConfigurableAxis cfgaxisVnCent{"VnCent", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 50, 70, 100}, " % "}; + + ConfigurableAxis cfgaxisEvtfit{"cfgaxisEvtfit", {10000, 0, 10000}, ""}; EventPlaneHelper helperEP; int DetId; int RefAId; @@ -149,7 +300,9 @@ struct Jetchargedv2Task { int eventSelection = -1; int trackSelection = -1; - double evtnum = 1; // evt sum for local rho test + double evtnum = 0; // evt sum for local rho test + double AccptTrack = 0; // evt sum for local rho test + double FitTrack = 0; // trk sum for local rho test void init(o2::framework::InitContext&) { @@ -189,7 +342,6 @@ struct Jetchargedv2Task { AxisSpec jetPtAxis = {jetPtBins, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec jetPtAxisRhoAreaSub = {jetPtBinsRhoAreaSub, "#it{p}_{T} (GeV/#it{c})"}; - //< bkg sub | end >// AxisSpec axisPt = {40, 0.0, 4.0}; AxisSpec axisEta = {32, -0.8, 0.8}; @@ -200,21 +352,48 @@ struct Jetchargedv2Task { trackSelection = jetderiveddatautilities::initialiseTrackSelection(static_cast(trackSelections)); //< \sigma p_T at local rho test plot > + registry.add("h_accept_Track", "all and accept track;Track;entries", {HistType::kTH1F, {{10, 0.0, 10.0}}}); + registry.add("h_accept_Track_init", "all and accept track;Track;entries", {HistType::kTH1F, {{10, 0.0, 10.0}}}); + registry.add("h_accept_Track_Fit", "all and accept track;Track;entries", {HistType::kTH1F, {{10, 0.0, 10.0}}}); + registry.add("h_ptsum_collnum", "ptsum collnum;collnum;entries", {HistType::kTH1F, {{40, 0.0, 40}}}); - registry.add("h_ptsum_sumpt", "jet sumpt;sum p_{T};entries", {HistType::kTH1F, {{160, 0., TMath::TwoPi()}}}); - registry.add("h2_phi_track_eta", "phi vs track eta; #eta (GeV/#it{c}); #varphi", {HistType::kTH2F, {{100, -1.0, 1.0}, {160, 0., TMath::TwoPi()}}}); - registry.add("h2_phi_track_pt", "phi vs track pT; #it{p}_{T,track} (GeV/#it{c}); #varphi", {HistType::kTH2F, {{200, 0., 200.}, {160, 0., TMath::TwoPi()}}}); - registry.add("h2_centrality_phi_w_pt", "centrality vs jet #varphi; centrality; entries", {HistType::kTH2F, {{100, 0.0, 100.0}, {160, 0., TMath::TwoPi()}}}); - registry.add("h2_evtnum_phi_w_pt", "eventNumber vs jet #varphi; #eventNumber; entries", {HistType::kTH2F, {{100000, 0.0, 100000}, {160, 0., TMath::TwoPi()}}}); + registry.add("h_ptsum_sumpt", "jet sumpt;sum p_{T};entries", {HistType::kTH1F, {{40, 0., TMath::TwoPi()}}}); + registry.add("h2_phi_track_eta", "phi vs track eta; #eta (GeV/#it{c}); #varphi", {HistType::kTH2F, {{100, -1.0, 1.0}, {40, 0., TMath::TwoPi()}}}); + registry.add("h2_phi_track_pt", "phi vs track pT; #it{p}_{T,track} (GeV/#it{c}); #varphi", {HistType::kTH2F, {{200, 0., 200.}, {40, 0., TMath::TwoPi()}}}); + registry.add("h2_centrality_phi_w_pt", "centrality vs jet #varphi; centrality; entries", {HistType::kTH2F, {{100, 0.0, 100.0}, {40, 0., TMath::TwoPi()}}}); + registry.add("h2_evtnum_phi_w_pt", "eventNumber vs jet #varphi; #eventNumber; entries", {HistType::kTH2F, {{1000, 0.0, 1000}, {40, 0., TMath::TwoPi()}}}); + + //< fit quality >// + registry.add("h_PvalueCDF_CombinFit", "CDF #chi^{2}; entries", {HistType::kTH1F, {{50, 0, 1}}}); + registry.add("h2_PvalueCDFCent_CombinFit", "p-value CDF vs centrality; centrality; p-value", {HistType::kTH2F, {{100, 0, 100}, {40, 0, 1}}}); + registry.add("h2_Chi2Cent_CombinFit", "Chi2 vs centrality; centrality; #tilde{#chi^{2}}", {HistType::kTH2F, {{100, 0, 100}, {100, 0, 5}}}); + registry.add("h2_PChi2_CombinFit", "p-value vs #tilde{#chi^{2}}; p-value; #tilde{#chi^{2}}", {HistType::kTH2F, {{100, 0, 1}, {100, 0, 5}}}); + + registry.add("h2_PChi2_CombinFitA", "p-value vs #tilde{#chi^{2}}; p-value; #tilde{#chi^{2}}", {HistType::kTH2F, {{100, 0, 1}, {100, 0, 5}}}); + registry.add("h2_PChi2_CombinFitB", "p-value vs #tilde{#chi^{2}}; p-value; #tilde{#chi^{2}}", {HistType::kTH2F, {{100, 0, 1}, {100, 0, 5}}}); + registry.add("h_evtnum_centrlity", "eventNumber vs centrality ; #eventNumber", {HistType::kTH1F, {{1000, 0.0, 1000}}}); + registry.add("h_evtnum_NTrk", "eventNumber vs Number of Track ; #eventNumber", {HistType::kTH1F, {{1000, 0.0, 1000}}}); + + registry.add("Thn_evtnum_phi_centrality", "eventNumber vs jet #varphi; #eventNumber; entries", {HistType::kTHnSparseF, {{1000, 0.0, 1000}, {40, 0., TMath::TwoPi()},{100, 0.0, 100.0} }}); + + registry.add("h2_evt_fitpara", "event vs fit parameter; evtnum; parameter", {HistType::kTH2F, {cfgaxisEvtfit, {5, 0., 5}}}); + + registry.add("h_v2obs_centrality", "fitparameter v2obs vs centrality ; #centrality", {HistType::kTProfile, {cfgaxisVnCent}}); + registry.add("h_v3obs_centrality", "fitparameter v3obs vs centrality ; #centrality", {HistType::kTProfile, {cfgaxisVnCent}}); + + registry.add("h2_centrality_rhophi", "centrality vs #rho(#varphi); centrality; #rho(#varphi) ", {HistType::kTH2F, {{120, -10.0, 110.0}, {210, -10.0, 200.0}}}); + registry.add("h2_phi_rhophi", "#varphi vs #rho(#varphi); #varphi - #Psi_{EP,2}; #rho(#varphi) ", {HistType::kTH2F, {{40, 0., TMath::TwoPi()}, {210, -10.0, 200.0}}}); + + registry.add("h3_centrality_rhovsphi_phi", "centrality; #rho(#varphi); #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {200, 0.0, 200.0}, {40, 0., TMath::TwoPi()}}}); //< \sigma p_T at local rho test plot | end > - registry.add("h2_centrality_collisions", "centrality vs collisions; centrality; collisions", {HistType::kTH2F, {{1200, -10.0, 110.0}, {4, 0.0, 4.0}}}); registry.add("h2_centrality_track_pt", "centrality vs track pT; centrality; #it{p}_{T,track} (GeV/#it{c})", {HistType::kTH2F, {{1200, -10.0, 110.0}, {200, 0., 200.}}}); registry.add("h2_centrality_track_eta", "centrality vs track #eta; centrality; #eta_{track}", {HistType::kTH2F, {{1200, -10.0, 110.0}, {100, -1.0, 1.0}}}); registry.add("h2_centrality_track_phi", "centrality vs track #varphi; centrality; #varphi_{track}", {HistType::kTH2F, {{1200, -10.0, 110.0}, {160, -1.0, 7.}}}); - registry.add("h_jet_pt_rhoareasubtracted", "jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); + registry.add("h_jet_pt_rhoareasubtracted", "jet pT rhoareasubtracted;#it{p}_{T,jet} (GeV/#it{c}); entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); + registry.add("h_jet_pt_rholocal", "jet pT rholocal;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); registry.add("h_recoil_jet_pt", "jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); registry.add("h_recoil_jet_eta", "jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); @@ -226,10 +405,11 @@ struct Jetchargedv2Task { registry.add("leadJetEta", "leadJet constituent #eta ", {HistType::kTH1F, {{100, -1.0, 1.0}}}); //< RC test plots >// - registry.add("h3_centrality_RCpt_RandomCornPhi_rhorandomcone", "centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho}; #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {800, -400.0, 400.0}, {160, 0., TMath::TwoPi()}}}); - registry.add("h3_centrality_RCpt_RandomCornPhi_rhorandomconewithoutleadingjet", "centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho}; #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {800, -400.0, 400.0}, {160, 0., TMath::TwoPi()}}}); - //< bkg sub plot | end >// + registry.add("h3_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet", "centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho}; #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {800, -400.0, 400.0}, {160, 0., TMath::TwoPi()}}}); + registry.add("h3_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet", "centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho}(#varphi); #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {800, -400.0, 400.0}, {160, 0., TMath::TwoPi()}}}); + //< bkg sub plot | end >// + //< median rho >// registry.add("h_jet_pt_in_out_plane_v2", "jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); registry.add("h_jet_pt_in_plane_v2", "jet pT;#it{p}^{in-plane}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); registry.add("h_jet_pt_out_of_plane_v2", "jet pT;#it{p}^{out-of-plane}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); @@ -240,7 +420,17 @@ struct Jetchargedv2Task { registry.add("h2_centrality_jet_pt_out_of_plane_v2", "centrality vs #it{p}^{out-of-plane}_{T,jet}; centrality; #it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{120, -10.0, 110.0}, jetPtAxisRhoAreaSub}}); registry.add("h2_centrality_jet_pt_in_plane_v3", "centrality vs #it{p}^{in-plane}_{T,jet}; centrality; #it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{120, -10.0, 110.0}, jetPtAxisRhoAreaSub}}); registry.add("h2_centrality_jet_pt_out_of_plane_v3", "centrality vs #it{p}^{out-of-plane}_{T,jet}; centrality; #it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{120, -10.0, 110.0}, jetPtAxisRhoAreaSub}}); - //< bkg sub DeltaPhi plot | end >// + //< rho(phi) >// + registry.add("h_jet_pt_in_out_plane_v2_rho", "jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); + registry.add("h_jet_pt_in_plane_v2_rho", "jet pT;#it{p}^{in-plane}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); + registry.add("h_jet_pt_out_of_plane_v2_rho", "jet pT;#it{p}^{out-of-plane}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); + registry.add("h_jet_pt_in_plane_v3_rho", "jet pT;#it{p}^{in-plane}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); + registry.add("h_jet_pt_out_of_plane_v3_rho", "jet pT;#it{p}^{out-of-plane}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); + + registry.add("h2_centrality_jet_pt_in_plane_v2_rho", "centrality vs #it{p}^{in-plane}_{T,jet}; centrality; #it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{120, -10.0, 110.0}, jetPtAxisRhoAreaSub}}); + registry.add("h2_centrality_jet_pt_out_of_plane_v2_rho", "centrality vs #it{p}^{out-of-plane}_{T,jet}; centrality; #it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{120, -10.0, 110.0}, jetPtAxisRhoAreaSub}}); + registry.add("h2_centrality_jet_pt_in_plane_v3_rho", "centrality vs #it{p}^{in-plane}_{T,jet}; centrality; #it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{120, -10.0, 110.0}, jetPtAxisRhoAreaSub}}); + registry.add("h2_centrality_jet_pt_out_of_plane_v3_rho", "centrality vs #it{p}^{out-of-plane}_{T,jet}; centrality; #it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{120, -10.0, 110.0}, jetPtAxisRhoAreaSub}}); //=====================< evt pln plot >=====================// AxisSpec axisCent{cfgaxisCent, "centrality"}; @@ -250,7 +440,6 @@ struct Jetchargedv2Task { AxisSpec axisEvtPl{360, -constants::math::PI, constants::math::PI}; histosQA.add("histCent", "Centrality TrkProcess", HistType::kTH1F, {axisCent}); - histosQA.add("histCentTrkProcess_aftersel", "Centrality TrkProcess aft_sel", HistType::kTH1F, {axisCent}); for (uint i = 0; i < cfgnMods->size(); i++) { histosQA.add(Form("histQvecUncorV%d", cfgnMods->at(i)), "", {HistType::kTH3F, {axisQvecF, axisQvecF, axisCent}}); @@ -262,11 +451,13 @@ struct Jetchargedv2Task { histosQA.add(Form("histEvtPlRectrV%d", cfgnMods->at(i)), "", {HistType::kTH2F, {axisEvtPl, axisCent}}); histosQA.add(Form("histEvtPlTwistV%d", cfgnMods->at(i)), "", {HistType::kTH2F, {axisEvtPl, axisCent}}); histosQA.add(Form("histEvtPlFinalV%d", cfgnMods->at(i)), "", {HistType::kTH2F, {axisEvtPl, axisCent}}); + histosQA.add(Form("histEvtPlFinalEvtNumV%d", cfgnMods->at(i)), "", {HistType::kTH1F, {{1000, 0, 1000}}}); + } //=====================< evt pln plot | end >=====================// } - Preslice JetsPerJCollision = aod::jet::collisionId; + Preslice JetsPerJCollision = o2::aod::jet::collisionId; Preslice tracksPerJCollision = o2::aod::jtrack::collisionId; Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); @@ -300,7 +491,12 @@ struct Jetchargedv2Task { registry.fill(HIST("leadJetPt"), leadingJetPt); registry.fill(HIST("leadJetPhi"), leadingJetPhi); registry.fill(HIST("leadJetEta"), leadingJetEta); - } // end of fillLeadingJetQA template + } + + double ChiSquareCDF(int ndf, double x) + { + return TMath::Gamma(ndf/2., x/2.); + } void processjetQA(soa::Filtered>::iterator const& collision, soa::Join const& jets, @@ -334,12 +530,39 @@ struct Jetchargedv2Task { void processInOutJetV2(soa::Filtered>::iterator const& collision, soa::Join const& jets, - aod::JetTracks const&) + aod::JetTracks const& tracks) { + if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { + return; + } if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; } + double leadingJetPt = -1; + double leadingJetPhi = -1; + double leadingJetEta = -1; + + // auto collJets = jets.sliceBy(JetsPerJCollision, collision.globalIndex()); + for (auto& jet : jets) { + if (jet.pt() > leadingJetPt) { + leadingJetPt = jet.pt(); + leadingJetEta = jet.eta(); + leadingJetPhi = jet.phi(); + } + } + + int NTrk = 0; + if (jets.size() > 0) { + for (auto const& track : tracks) { + if (jetderiveddatautilities::selectTrack(track, trackSelection) && (fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { + NTrk += 1; + } + } + } + if (NTrk < NTrackCut) { + return; + } //=====================< evt pln [n=2->\Psi_2, n=3->\Psi_3] >=====================// histosQA.fill(HIST("histCent"), collision.cent()); for (uint i = 0; i < cfgnMods->size(); i++) { @@ -356,6 +579,7 @@ struct Jetchargedv2Task { histosQA.fill(HIST("histEvtPlRectrV2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], nmode), collision.cent()); histosQA.fill(HIST("histEvtPlTwistV2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], nmode), collision.cent()); histosQA.fill(HIST("histEvtPlFinalV2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlFinalEvtNumV2"), evtnum, helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode)); } } else if (nmode == 3) { histosQA.fill(HIST("histQvecUncorV3"), collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], collision.cent()); @@ -367,6 +591,7 @@ struct Jetchargedv2Task { histosQA.fill(HIST("histEvtPlRectrV3"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], nmode), collision.cent()); histosQA.fill(HIST("histEvtPlTwistV3"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], nmode), collision.cent()); histosQA.fill(HIST("histEvtPlFinalV3"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlFinalEvtNumV3"), evtnum, helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode)); } if (nmode == 2) { @@ -396,7 +621,6 @@ struct Jetchargedv2Task { registry.fill(HIST("h2_centrality_jet_pt_out_of_plane_v2"), collision.centrality(), jet.pt() - (collision.rho() * jet.area()), 1.0); } } - //< JetPtCorr = Jet_pT-*A in-plane and out-of-plane | end >// } else if (nmode == 3) { Double_t phiMinusPsi3; float evtPl3 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); @@ -422,11 +646,17 @@ struct Jetchargedv2Task { } PROCESS_SWITCH(Jetchargedv2Task, processInOutJetV2, "Jet V2 in and out of plane", true); - void processSigmaPt(soa::Filtered> const& collisions, + void processSigmaPt(soa::Filtered>::iterator const& collision, soa::Join const& jets, aod::JetTracks const& tracks) { - for (const auto& collision : collisions) { + // for (const auto& collision : collisions) { + if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { + return; + } + if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { + return; + } double leadingJetPt = -1; double leadingJetPhi = -1; double leadingJetEta = -1; @@ -439,25 +669,261 @@ struct Jetchargedv2Task { } fillLeadingJetQA(leadingJetPt, leadingJetPhi, leadingJetEta); - if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { + int NTrk = 0; + if (jets.size() > 0) { + for (auto const& track : tracks) { + if (jetderiveddatautilities::selectTrack(track, trackSelection) && (fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { + registry.fill(HIST("h_accept_Track"), 2.5); + NTrk += 1; + } + } + registry.fill(HIST("h_evtnum_NTrk"), evtnum, NTrk); + } + + TH1F* h_ptsum_sumpt_fit = new TH1F("h_ptsum_sumpt_fit", "h_ptsum_sumpt fit use", TMath::CeilNint(TMath::Sqrt(NTrk)), 0., TMath::TwoPi()); + + if (NTrk < NTrackCut) { return; } - auto collTracks = tracks.sliceBy(tracksPerJCollision, collision.globalIndex()); if (jets.size() > 0) { - for (auto const& track : collTracks) { - if (jetderiveddatautilities::selectTrack(track, trackSelection) && (fabs(track.eta() - leadingJetEta) > jetRadius)) { + for (auto const& trackfit : tracks) { + registry.fill(HIST("h_accept_Track"), 0.5); + if (jetderiveddatautilities::selectTrack(trackfit, trackSelection) && (fabs(trackfit.eta() - leadingJetEta) > jetRadius) && trackfit.pt() >= 0.2 && trackfit.pt() <= 5.) { + registry.fill(HIST("h_accept_Track_Fit"), 0.5); + FitTrack += 1; + } + } + + for (auto const& track : tracks) { + registry.fill(HIST("h_accept_Track"), 1.5); + if (jetderiveddatautilities::selectTrack(track, trackSelection) && (fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { + AccptTrack +=1; + registry.fill(HIST("h_accept_Track"), 2.5); + h_ptsum_sumpt_fit->Fill(track.phi(), track.pt()); registry.fill(HIST("h2_phi_track_pt"), track.pt(), track.phi()); registry.fill(HIST("h2_phi_track_eta"), track.eta(), track.phi()); - registry.fill(HIST("h_ptsum_sumpt"), track.phi(), track.pt()); // \sigma p_T distribution test [ && track.pt() >= 0.2 && track.pt() <= 5.] - registry.fill(HIST("h2_centrality_phi_w_pt"), collision.centrality(), track.phi(), track.pt()); // \sigma track.pt() distribution with centrality test + registry.fill(HIST("h_ptsum_sumpt"), track.phi(), track.pt()); + registry.fill(HIST("h2_centrality_phi_w_pt"), collision.centrality(), track.phi(), track.pt()); registry.fill(HIST("h2_evtnum_phi_w_pt"), evtnum, track.phi(), track.pt()); + registry.fill(HIST("Thn_evtnum_phi_centrality"), evtnum, track.phi(), collision.centrality()); + registry.fill(HIST("h_accept_Track_init"), AccptTrack); + registry.fill(HIST("h_accept_Track_Fit"),1.5); } } } registry.fill(HIST("h_ptsum_collnum"), 0.5); - evtnum += 1; + + double ep2 = 0.; + double ep3 = 0.; + for (uint i = 0; i < cfgnMods->size(); i++) { + int nmode = cfgnMods->at(i); + int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + if (nmode == 2) { + if (collision.qvecAmp()[DetId] > 1e-8) { + ep2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode); + } + } else if (nmode == 3) { + if (collision.qvecAmp()[DetId] > 1e-8) { + ep3 = helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode); + } + } } + + TF1* fFitModulation_v2v3 = 0x0; + const char * fitFunction_v2v3 = "[0] * (1. + 2. * ([1] * TMath::Cos(2. * (x - [2])) + [3] * TMath::Cos(3. * (x - [4]))))"; + fFitModulation_v2v3 = new TF1("fit_kV3", fitFunction_v2v3, 0, TMath::TwoPi()); + //=========================< set parameter >=========================// + fFitModulation_v2v3->SetParameter(0, 1.); + fFitModulation_v2v3->SetParameter(1, 0.01); + fFitModulation_v2v3->SetParameter(3, 0.01); + + if ( ep2 < 0 ) { + fFitModulation_v2v3->FixParameter(2, ep2 + TMath::TwoPi()); + } else { + fFitModulation_v2v3->FixParameter(2, ep2); + } + if ( ep3 < 0 ) { + fFitModulation_v2v3->FixParameter(4, ep3 + TMath::TwoPi()); + } else { + fFitModulation_v2v3->FixParameter(4, ep3); + } + h_ptsum_sumpt_fit->Fit(fFitModulation_v2v3, "V+","ep", 0, TMath::TwoPi()); + + Double_t temppara[5]; + temppara[0] = fFitModulation_v2v3->GetParameter(0); + temppara[1] = fFitModulation_v2v3->GetParameter(1); + temppara[2] = fFitModulation_v2v3->GetParameter(2); + temppara[3] = fFitModulation_v2v3->GetParameter(3); + temppara[4] = fFitModulation_v2v3->GetParameter(4); + for (int i = 1; i<=5; i++) { + registry.fill(HIST("h2_evt_fitpara"), evtnum, i - 0.5, temppara[i-1]); + } + registry.fill(HIST("h_v2obs_centrality"), collision.centrality(), temppara[1]); + registry.fill(HIST("h_v3obs_centrality"), collision.centrality(), temppara[3]); + + for (auto const& jet : jets) { + if ((fabs(jet.eta() - leadingJetEta) > jetRadius) && jet.pt() >= 0.2 && jet.pt() <= 5.) { + registry.fill(HIST("h2_centrality_rhophi"), collision.centrality(), fFitModulation_v2v3->Eval(jet.phi()), 1.0); + } + } + registry.fill(HIST("h_evtnum_centrlity"), evtnum, collision.centrality()); + + Int_t NDF = 1; + Int_t numOfFreePara = 2; + NDF = (Int_t)fFitModulation_v2v3->GetXaxis()->GetNbins() - numOfFreePara; + if(NDF == 0 || (float)NDF <= 0.) return; + double chi2 = 0.; + for(int i = 0; i < h_ptsum_sumpt_fit->GetXaxis()->GetNbins(); i++) { + if(h_ptsum_sumpt_fit->GetBinContent(i+1) <= 0.) continue; + chi2 += TMath::Power((h_ptsum_sumpt_fit->GetBinContent(i+1) - fFitModulation_v2v3->Eval(h_ptsum_sumpt_fit->GetXaxis()->GetBinCenter(1+i))), 2) /h_ptsum_sumpt_fit->GetBinContent(i+1); + } + + Double_t ChiSqr = 999.; + Double_t CDF = 1.; + Double_t CDFROOT = 1.; + ChiSqr = chi2; + CDF = 1. - ChiSquareCDF(NDF, ChiSqr); + CDFROOT = 1.-ChiSquareCDF(NDF, fFitModulation_v2v3->GetChisquare()); + registry.fill(HIST("h_PvalueCDF_CombinFit"), CDF); + registry.fill(HIST("h2_PvalueCDFCent_CombinFit"), collision.centrality(), CDF); + registry.fill(HIST("h2_Chi2Cent_CombinFit"), collision.centrality(), ChiSqr / ((float)NDF) ); + registry.fill(HIST("h2_PChi2_CombinFit"), CDF, ChiSqr / ((float)NDF) ); + double evtcent = collision.centrality(); + if ( evtcent >= 0 && evtcent <= 5 ) { + registry.fill(HIST("h2_PChi2_CombinFitA"), CDF, ChiSqr / ((float)NDF) ); + } else if ( evtcent >= 30 && evtcent <= 50 ) { + registry.fill(HIST("h2_PChi2_CombinFitB"), CDF, ChiSqr / ((float)NDF) ); + } + + for (uint i = 0; i < cfgnMods->size(); i++) { + int nmode = cfgnMods->at(i); + int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + for (auto const& jet : jets) { + double integralValue = fFitModulation_v2v3->Integral(jet.phi() - jetRadius, jet.phi() + jetRadius); + double rholocal = collision.rho() / (2 * jetRadius * temppara[0]) * integralValue; + + registry.fill(HIST("h_jet_pt_rholocal"), jet.pt() - (rholocal * jet.area()), 1.0); + + if (nmode == 2) { + Double_t phiMinusPsi2; + if (collision.qvecAmp()[DetId] < 1e-8) { + continue; + } + float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); + + if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + if (!isAcceptedJet(jet)) { + continue; + } + + if (jet.r() == round(selectedJetsRadius * 100.0f)) { + registry.fill(HIST("h_jet_pt_in_out_plane_v2_rho"), jet.pt() - (rholocal * jet.area()), 1.0); + } + phiMinusPsi2 = jet.phi() - evtPl2; + + if ((phiMinusPsi2 < TMath::Pi() / 4) || (phiMinusPsi2 >= 7 * TMath::Pi() / 4) || (phiMinusPsi2 >= 3 * TMath::Pi() / 4 && phiMinusPsi2 < 5 * TMath::Pi() / 4)) { + 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"), collision.centrality(), jet.pt() - (rholocal * jet.area()), 1.0); + } else { + registry.fill(HIST("h_jet_pt_out_of_plane_v2_rho"), jet.pt() - (rholocal * jet.area()), 1.0); + registry.fill(HIST("h2_centrality_jet_pt_out_of_plane_v2_rho"), collision.centrality(), jet.pt() - (rholocal * jet.area()), 1.0); + } + + } else if (nmode == 3) { + Double_t phiMinusPsi3; + float evtPl3 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); + if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + if (!isAcceptedJet(jet)) { + continue; + } + phiMinusPsi3 = jet.phi() - evtPl3; + + if ((phiMinusPsi3 < TMath::Pi() / 4) || (phiMinusPsi3 >= 7 * TMath::Pi() / 4) || (phiMinusPsi3 >= 3 * TMath::Pi() / 4 && phiMinusPsi3 < 5 * TMath::Pi() / 4)) { + registry.fill(HIST("h_jet_pt_in_plane_v3_rho"), jet.pt() - (rholocal * jet.area()), 1.0); + registry.fill(HIST("h2_centrality_jet_pt_in_plane_v3_rho"), collision.centrality(), 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); + registry.fill(HIST("h2_centrality_jet_pt_out_of_plane_v3_rho"), collision.centrality(), jet.pt() - (rholocal * jet.area()), 1.0); + } + } + } + } + // RCpT + for (uint i = 0; i < cfgnMods->size(); i++) { + TRandom3 randomNumber(0); + float randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); + float randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI); + float randomConePt = 0; + + int nmode = cfgnMods->at(i); + int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + + Double_t RcPhiPsi2; + float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); + RcPhiPsi2 = randomConePhi - evtPl2; + + for (auto const& jet : jets) { + registry.fill(HIST("h2_phi_rhophi"), jet.phi() - evtPl2, fFitModulation_v2v3->Eval(jet.phi()), 1.0); + registry.fill(HIST("h3_centrality_rhovsphi_phi"), collision.centrality(), fFitModulation_v2v3->Eval(jet.phi()), jet.phi() - evtPl2); + } + + for (auto const& track : tracks) { + if (jetderiveddatautilities::selectTrack(track, trackSelection)) { + float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-M_PI)); + float dEta = track.eta() - randomConeEta; + if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + randomConePt += track.pt(); + } + } + } + double integralValue = 0; + double rholocal = 0; + for (auto const& jet : jets) { + if (temppara[0] == 0) { + break; + } + integralValue = fFitModulation_v2v3->Integral(jet.phi() - jetRadius, jet.phi() + jetRadius); + rholocal = collision.rho()/(2 * jetRadius * temppara[0]) * integralValue; + } + // removing the leading jet from the random cone + 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(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-M_PI)); + float dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta; + + bool jetWasInCone = false; + while (TMath::Sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < jets.iteratorAt(0).r() / 100.0 + randomConeR) { + jetWasInCone = true; + randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); + randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI); + dPhiLeadingJet = RecoDecay::constrainAngle(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-M_PI)); + dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta; + } + if (jetWasInCone) { + randomConePt = 0.0; + for (auto const& track : tracks) { + if (jetderiveddatautilities::selectTrack(track, trackSelection)) { // if track selection is uniformTrack, dcaXY and dcaZ cuts need to be added as they aren't in the selection so that they can be studied here + float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-M_PI)); + float dEta = track.eta() - randomConeEta; + if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + randomConePt += track.pt(); + } + } + } + } + } + for (auto const& jet : jets) { + if (temppara[0] == 0) { + break; + } + } + registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * rholocal, RcPhiPsi2, 1.0); + } + evtnum += 1; } PROCESS_SWITCH(Jetchargedv2Task, processSigmaPt, "Sigma pT and bkg as fcn of phi", true); @@ -465,6 +931,9 @@ struct Jetchargedv2Task { soa::Join const& jets, soa::Filtered const& tracks) { + if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { + return; + } if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; } @@ -491,7 +960,6 @@ struct Jetchargedv2Task { } } } - registry.fill(HIST("h3_centrality_RCpt_RandomCornPhi_rhorandomcone"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho(), RcPhiPsi2, 1.0); // removing the leading jet from the random cone 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(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-M_PI)); @@ -508,7 +976,7 @@ struct Jetchargedv2Task { if (jetWasInCone) { randomConePt = 0.0; for (auto const& track : tracks) { - if (jetderiveddatautilities::selectTrack(track, trackSelection)) { // if track selection is uniformTrack, dcaXY and dcaZ cuts need to be added as they aren't in the selection so that they can be studied here + if (jetderiveddatautilities::selectTrack(track, trackSelection)) { float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-M_PI)); float dEta = track.eta() - randomConeEta; if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { @@ -518,7 +986,7 @@ struct Jetchargedv2Task { } } } - registry.fill(HIST("h3_centrality_RCpt_RandomCornPhi_rhorandomconewithoutleadingjet"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho(), RcPhiPsi2, 1.0); + registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho(), RcPhiPsi2, 1.0); } } PROCESS_SWITCH(Jetchargedv2Task, processRandomConeDataV2, "QA for random cone estimation of background fluctuations in data", true); @@ -526,14 +994,12 @@ struct Jetchargedv2Task { void processTracksQA(soa::Filtered>::iterator const& collision, soa::Filtered const& tracks) { - // histosQA.fill(HIST("histCentTrkProcess"), collision.centrality()); - registry.fill(HIST("h2_centrality_collisions"), collision.centrality(), 0.5); + if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { + return; + } if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; } - histosQA.fill(HIST("histCentTrkProcess_aftersel"), collision.centrality()); - registry.fill(HIST("h2_centrality_collisions"), collision.centrality(), 1.5); - for (auto const& track : tracks) { if (!jetderiveddatautilities::selectTrack(track, trackSelection)) { continue; @@ -548,5 +1014,6 @@ struct Jetchargedv2Task { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"jet-charged-v2"})}; + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"jet-charged-v2"}), + adaptAnalysisTask(cfgc, TaskName{"jet-charged-v2-table"})}; } From 793761ed0cb7e8f62f39ff35b5ed88a814f2bda6 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Tue, 14 Jan 2025 15:43:20 +0800 Subject: [PATCH 02/25] Add files via upload --- PWGJE/Tasks/jetChargedV2.cxx | 209 +++++++++++++++++------------------ 1 file changed, 104 insertions(+), 105 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index 44aafd8f6fb..aff24326049 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -76,18 +76,18 @@ DECLARE_SOA_TABLE(MyCollisions, "AOD", "MYCOLLISION", //! vertex information of o2::soa::Index<>, collision::PosZ); using MyCollision = MyCollisions::iterator; - namespace myTable - { - DECLARE_SOA_INDEX_COLUMN(MyCollision, mycollision); +namespace myTable +{ +DECLARE_SOA_INDEX_COLUMN(MyCollision, mycollision); - DECLARE_SOA_COLUMN(Psi2, psi2, Float_t); - DECLARE_SOA_COLUMN(Psi3, psi3, Float_t); - DECLARE_SOA_COLUMN(EvtPlRes, evtplres, Float_t); - } - DECLARE_SOA_TABLE(MyTablea, "AOD", "MYTABLEA", o2::soa::Index<>, - myTable::Psi2, - myTable::Psi3, - myTable::EvtPlRes); +DECLARE_SOA_COLUMN(Psi2, psi2, Float_t); +DECLARE_SOA_COLUMN(Psi3, psi3, Float_t); +DECLARE_SOA_COLUMN(EvtPlRes, evtplres, Float_t); +} +DECLARE_SOA_TABLE(MyTablea, "AOD", "MYTABLEA", o2::soa::Index<>, + myTable::Psi2, + myTable::Psi3, + myTable::EvtPlRes); } struct jetChargedV2EPTable { @@ -96,7 +96,6 @@ struct jetChargedV2EPTable { HistogramRegistry registry; - Configurable eventSelections{"eventSelections", "sel8", "choose event selection"}; Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; @@ -300,9 +299,9 @@ struct Jetchargedv2Task { int eventSelection = -1; int trackSelection = -1; - double evtnum = 0; // evt sum for local rho test - double AccptTrack = 0; // evt sum for local rho test - double FitTrack = 0; // trk sum for local rho test + double evtnum = 0; + double AccptTrack = 0; + double FitTrack = 0; void init(o2::framework::InitContext&) { @@ -375,7 +374,7 @@ struct Jetchargedv2Task { registry.add("h_evtnum_centrlity", "eventNumber vs centrality ; #eventNumber", {HistType::kTH1F, {{1000, 0.0, 1000}}}); registry.add("h_evtnum_NTrk", "eventNumber vs Number of Track ; #eventNumber", {HistType::kTH1F, {{1000, 0.0, 1000}}}); - registry.add("Thn_evtnum_phi_centrality", "eventNumber vs jet #varphi; #eventNumber; entries", {HistType::kTHnSparseF, {{1000, 0.0, 1000}, {40, 0., TMath::TwoPi()},{100, 0.0, 100.0} }}); + registry.add("Thn_evtnum_phi_centrality", "eventNumber vs jet #varphi; #eventNumber; entries", {HistType::kTHnSparseF, {{1000, 0.0, 1000}, {40, 0., TMath::TwoPi()}, {100, 0.0, 100.0}}}); registry.add("h2_evt_fitpara", "event vs fit parameter; evtnum; parameter", {HistType::kTH2F, {cfgaxisEvtfit, {5, 0., 5}}}); @@ -452,7 +451,6 @@ struct Jetchargedv2Task { histosQA.add(Form("histEvtPlTwistV%d", cfgnMods->at(i)), "", {HistType::kTH2F, {axisEvtPl, axisCent}}); histosQA.add(Form("histEvtPlFinalV%d", cfgnMods->at(i)), "", {HistType::kTH2F, {axisEvtPl, axisCent}}); histosQA.add(Form("histEvtPlFinalEvtNumV%d", cfgnMods->at(i)), "", {HistType::kTH1F, {{1000, 0, 1000}}}); - } //=====================< evt pln plot | end >=====================// } @@ -495,7 +493,7 @@ struct Jetchargedv2Task { double ChiSquareCDF(int ndf, double x) { - return TMath::Gamma(ndf/2., x/2.); + return TMath::Gamma(ndf / 2., x / 2.); } void processjetQA(soa::Filtered>::iterator const& collision, @@ -539,30 +537,30 @@ struct Jetchargedv2Task { return; } - double leadingJetPt = -1; - double leadingJetPhi = -1; - double leadingJetEta = -1; + double leadingJetPt = -1; + double leadingJetPhi = -1; + double leadingJetEta = -1; - // auto collJets = jets.sliceBy(JetsPerJCollision, collision.globalIndex()); - for (auto& jet : jets) { - if (jet.pt() > leadingJetPt) { - leadingJetPt = jet.pt(); - leadingJetEta = jet.eta(); - leadingJetPhi = jet.phi(); - } + // auto collJets = jets.sliceBy(JetsPerJCollision, collision.globalIndex()); + for (auto& jet : jets) { + if (jet.pt() > leadingJetPt) { + leadingJetPt = jet.pt(); + leadingJetEta = jet.eta(); + leadingJetPhi = jet.phi(); } + } - int NTrk = 0; - if (jets.size() > 0) { - for (auto const& track : tracks) { - if (jetderiveddatautilities::selectTrack(track, trackSelection) && (fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { - NTrk += 1; - } + int NTrk = 0; + if (jets.size() > 0) { + for (auto const& track : tracks) { + if (jetderiveddatautilities::selectTrack(track, trackSelection) && (fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { + NTrk += 1; } } - if (NTrk < NTrackCut) { - return; - } + } + if (NTrk < NTrackCut) { + return; + } //=====================< evt pln [n=2->\Psi_2, n=3->\Psi_3] >=====================// histosQA.fill(HIST("histCent"), collision.cent()); for (uint i = 0; i < cfgnMods->size(); i++) { @@ -651,68 +649,68 @@ struct Jetchargedv2Task { aod::JetTracks const& tracks) { // for (const auto& collision : collisions) { - if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { - return; - } - if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { - return; - } - double leadingJetPt = -1; - double leadingJetPhi = -1; - double leadingJetEta = -1; - for (auto& jet : jets) { - if (jet.pt() > leadingJetPt) { - leadingJetPt = jet.pt(); - leadingJetEta = jet.eta(); - leadingJetPhi = jet.phi(); - } + if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { + return; + } + if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { + return; + } + double leadingJetPt = -1; + double leadingJetPhi = -1; + double leadingJetEta = -1; + for (auto& jet : jets) { + if (jet.pt() > leadingJetPt) { + leadingJetPt = jet.pt(); + leadingJetEta = jet.eta(); + leadingJetPhi = jet.phi(); } - fillLeadingJetQA(leadingJetPt, leadingJetPhi, leadingJetEta); + } + fillLeadingJetQA(leadingJetPt, leadingJetPhi, leadingJetEta); - int NTrk = 0; - if (jets.size() > 0) { - for (auto const& track : tracks) { - if (jetderiveddatautilities::selectTrack(track, trackSelection) && (fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { - registry.fill(HIST("h_accept_Track"), 2.5); - NTrk += 1; - } + int NTrk = 0; + if (jets.size() > 0) { + for (auto const& track : tracks) { + if (jetderiveddatautilities::selectTrack(track, trackSelection) && (fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { + registry.fill(HIST("h_accept_Track"), 2.5); + NTrk += 1; } - registry.fill(HIST("h_evtnum_NTrk"), evtnum, NTrk); } + registry.fill(HIST("h_evtnum_NTrk"), evtnum, NTrk); + } - TH1F* h_ptsum_sumpt_fit = new TH1F("h_ptsum_sumpt_fit", "h_ptsum_sumpt fit use", TMath::CeilNint(TMath::Sqrt(NTrk)), 0., TMath::TwoPi()); + TH1F* h_ptsum_sumpt_fit = new TH1F("h_ptsum_sumpt_fit", "h_ptsum_sumpt fit use", TMath::CeilNint(TMath::Sqrt(NTrk)), 0., TMath::TwoPi()); - if (NTrk < NTrackCut) { - return; - } + if (NTrk < NTrackCut) { + return; + } - if (jets.size() > 0) { - for (auto const& trackfit : tracks) { - registry.fill(HIST("h_accept_Track"), 0.5); - if (jetderiveddatautilities::selectTrack(trackfit, trackSelection) && (fabs(trackfit.eta() - leadingJetEta) > jetRadius) && trackfit.pt() >= 0.2 && trackfit.pt() <= 5.) { - registry.fill(HIST("h_accept_Track_Fit"), 0.5); - FitTrack += 1; - } + if (jets.size() > 0) { + for (auto const& trackfit : tracks) { + registry.fill(HIST("h_accept_Track"), 0.5); + if (jetderiveddatautilities::selectTrack(trackfit, trackSelection) && (fabs(trackfit.eta() - leadingJetEta) > jetRadius) && trackfit.pt() >= 0.2 && trackfit.pt() <= 5.) { + registry.fill(HIST("h_accept_Track_Fit"), 0.5); + FitTrack += 1; } + } - for (auto const& track : tracks) { - registry.fill(HIST("h_accept_Track"), 1.5); - if (jetderiveddatautilities::selectTrack(track, trackSelection) && (fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { - AccptTrack +=1; - registry.fill(HIST("h_accept_Track"), 2.5); - h_ptsum_sumpt_fit->Fill(track.phi(), track.pt()); - registry.fill(HIST("h2_phi_track_pt"), track.pt(), track.phi()); - registry.fill(HIST("h2_phi_track_eta"), track.eta(), track.phi()); - registry.fill(HIST("h_ptsum_sumpt"), track.phi(), track.pt()); - registry.fill(HIST("h2_centrality_phi_w_pt"), collision.centrality(), track.phi(), track.pt()); - registry.fill(HIST("h2_evtnum_phi_w_pt"), evtnum, track.phi(), track.pt()); - registry.fill(HIST("Thn_evtnum_phi_centrality"), evtnum, track.phi(), collision.centrality()); - registry.fill(HIST("h_accept_Track_init"), AccptTrack); - registry.fill(HIST("h_accept_Track_Fit"),1.5); - } + for (auto const& track : tracks) { + registry.fill(HIST("h_accept_Track"), 1.5); + if (jetderiveddatautilities::selectTrack(track, trackSelection) && (fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { + AccptTrack += 1; + registry.fill(HIST("h_accept_Track"), 2.5); + h_ptsum_sumpt_fit->Fill(track.phi(), track.pt()); + registry.fill(HIST("h2_phi_track_pt"), track.pt(), track.phi()); + registry.fill(HIST("h2_phi_track_eta"), track.eta(), track.phi()); + registry.fill(HIST("h_ptsum_sumpt"), track.phi(), track.pt()); + registry.fill(HIST("h2_centrality_phi_w_pt"), collision.centrality(), track.phi(), track.pt()); + registry.fill(HIST("h2_evtnum_phi_w_pt"), evtnum, track.phi(), track.pt()); + registry.fill(HIST("Thn_evtnum_phi_centrality"), evtnum, track.phi(), collision.centrality()); + registry.fill(HIST("h_accept_Track_init"), AccptTrack); + registry.fill(HIST("h_accept_Track_Fit"), 1.5); } } - registry.fill(HIST("h_ptsum_collnum"), 0.5); + } + registry.fill(HIST("h_ptsum_collnum"), 0.5); double ep2 = 0.; double ep3 = 0.; @@ -731,24 +729,24 @@ struct Jetchargedv2Task { } TF1* fFitModulation_v2v3 = 0x0; - const char * fitFunction_v2v3 = "[0] * (1. + 2. * ([1] * TMath::Cos(2. * (x - [2])) + [3] * TMath::Cos(3. * (x - [4]))))"; + const char* fitFunction_v2v3 = "[0] * (1. + 2. * ([1] * TMath::Cos(2. * (x - [2])) + [3] * TMath::Cos(3. * (x - [4]))))"; fFitModulation_v2v3 = new TF1("fit_kV3", fitFunction_v2v3, 0, TMath::TwoPi()); //=========================< set parameter >=========================// fFitModulation_v2v3->SetParameter(0, 1.); fFitModulation_v2v3->SetParameter(1, 0.01); fFitModulation_v2v3->SetParameter(3, 0.01); - if ( ep2 < 0 ) { + if (ep2 < 0) { fFitModulation_v2v3->FixParameter(2, ep2 + TMath::TwoPi()); } else { fFitModulation_v2v3->FixParameter(2, ep2); } - if ( ep3 < 0 ) { + if (ep3 < 0) { fFitModulation_v2v3->FixParameter(4, ep3 + TMath::TwoPi()); } else { fFitModulation_v2v3->FixParameter(4, ep3); } - h_ptsum_sumpt_fit->Fit(fFitModulation_v2v3, "V+","ep", 0, TMath::TwoPi()); + h_ptsum_sumpt_fit->Fit(fFitModulation_v2v3, "V+", "ep", 0, TMath::TwoPi()); Double_t temppara[5]; temppara[0] = fFitModulation_v2v3->GetParameter(0); @@ -756,10 +754,10 @@ struct Jetchargedv2Task { temppara[2] = fFitModulation_v2v3->GetParameter(2); temppara[3] = fFitModulation_v2v3->GetParameter(3); temppara[4] = fFitModulation_v2v3->GetParameter(4); - for (int i = 1; i<=5; i++) { - registry.fill(HIST("h2_evt_fitpara"), evtnum, i - 0.5, temppara[i-1]); + for (int i = 1; i <= 5; i++) { + registry.fill(HIST("h2_evt_fitpara"), evtnum, i - 0.5, temppara[i - 1]); } - registry.fill(HIST("h_v2obs_centrality"), collision.centrality(), temppara[1]); + registry.fill(HIST("h_v2obs_centrality"), collision.centrality(), temppara[1]); registry.fill(HIST("h_v3obs_centrality"), collision.centrality(), temppara[3]); for (auto const& jet : jets) { @@ -772,11 +770,13 @@ struct Jetchargedv2Task { Int_t NDF = 1; Int_t numOfFreePara = 2; NDF = (Int_t)fFitModulation_v2v3->GetXaxis()->GetNbins() - numOfFreePara; - if(NDF == 0 || (float)NDF <= 0.) return; + if (NDF == 0 || (float)NDF <= 0.) + return; double chi2 = 0.; - for(int i = 0; i < h_ptsum_sumpt_fit->GetXaxis()->GetNbins(); i++) { - if(h_ptsum_sumpt_fit->GetBinContent(i+1) <= 0.) continue; - chi2 += TMath::Power((h_ptsum_sumpt_fit->GetBinContent(i+1) - fFitModulation_v2v3->Eval(h_ptsum_sumpt_fit->GetXaxis()->GetBinCenter(1+i))), 2) /h_ptsum_sumpt_fit->GetBinContent(i+1); + for (int i = 0; i < h_ptsum_sumpt_fit->GetXaxis()->GetNbins(); i++) { + if(h_ptsum_sumpt_fit->GetBinContent(i+1) <= 0.) + continue; + chi2 += TMath::Power((h_ptsum_sumpt_fit->GetBinContent(i+1) - fFitModulation_v2v3->Eval(h_ptsum_sumpt_fit->GetXaxis()->GetBinCenter(1+i))), 2) /h_ptsum_sumpt_fit->GetBinContent(i+1); } Double_t ChiSqr = 999.; @@ -784,15 +784,15 @@ struct Jetchargedv2Task { Double_t CDFROOT = 1.; ChiSqr = chi2; CDF = 1. - ChiSquareCDF(NDF, ChiSqr); - CDFROOT = 1.-ChiSquareCDF(NDF, fFitModulation_v2v3->GetChisquare()); + CDFROOT = 1. - ChiSquareCDF(NDF, fFitModulation_v2v3->GetChisquare()); registry.fill(HIST("h_PvalueCDF_CombinFit"), CDF); registry.fill(HIST("h2_PvalueCDFCent_CombinFit"), collision.centrality(), CDF); registry.fill(HIST("h2_Chi2Cent_CombinFit"), collision.centrality(), ChiSqr / ((float)NDF) ); registry.fill(HIST("h2_PChi2_CombinFit"), CDF, ChiSqr / ((float)NDF) ); double evtcent = collision.centrality(); - if ( evtcent >= 0 && evtcent <= 5 ) { + if (evtcent >= 0 && evtcent <= 5) { registry.fill(HIST("h2_PChi2_CombinFitA"), CDF, ChiSqr / ((float)NDF) ); - } else if ( evtcent >= 30 && evtcent <= 50 ) { + } else if (evtcent >= 30 && evtcent <= 50) { registry.fill(HIST("h2_PChi2_CombinFitB"), CDF, ChiSqr / ((float)NDF) ); } @@ -811,7 +811,6 @@ struct Jetchargedv2Task { continue; } float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); - if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } @@ -888,7 +887,7 @@ struct Jetchargedv2Task { break; } integralValue = fFitModulation_v2v3->Integral(jet.phi() - jetRadius, jet.phi() + jetRadius); - rholocal = collision.rho()/(2 * jetRadius * temppara[0]) * integralValue; + rholocal = collision.rho() / (2 * jetRadius * temppara[0]) * integralValue; } // removing the leading jet from the random cone if (jets.size() > 0) { // if there are no jets in the acceptance (from the jetfinder cuts) then there can be no leading jet @@ -1014,6 +1013,6 @@ struct Jetchargedv2Task { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"jet-charged-v2"}), + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"jet-charged-v2"}), adaptAnalysisTask(cfgc, TaskName{"jet-charged-v2-table"})}; } From 80e8c44e1102a4118bae85b6efbd65aad4211a29 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Tue, 14 Jan 2025 16:15:17 +0800 Subject: [PATCH 03/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index aff24326049..1c712d43b6b 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -770,7 +770,7 @@ struct Jetchargedv2Task { Int_t NDF = 1; Int_t numOfFreePara = 2; NDF = (Int_t)fFitModulation_v2v3->GetXaxis()->GetNbins() - numOfFreePara; - if (NDF == 0 || (float)NDF <= 0.) + if (NDF == 0 || static_cast <= 0.) return; double chi2 = 0.; for (int i = 0; i < h_ptsum_sumpt_fit->GetXaxis()->GetNbins(); i++) { @@ -787,13 +787,13 @@ struct Jetchargedv2Task { CDFROOT = 1. - ChiSquareCDF(NDF, fFitModulation_v2v3->GetChisquare()); registry.fill(HIST("h_PvalueCDF_CombinFit"), CDF); registry.fill(HIST("h2_PvalueCDFCent_CombinFit"), collision.centrality(), CDF); - registry.fill(HIST("h2_Chi2Cent_CombinFit"), collision.centrality(), ChiSqr / ((float)NDF) ); - registry.fill(HIST("h2_PChi2_CombinFit"), CDF, ChiSqr / ((float)NDF) ); + registry.fill(HIST("h2_Chi2Cent_CombinFit"), collision.centrality(), ChiSqr / (static_cast) ); + registry.fill(HIST("h2_PChi2_CombinFit"), CDF, ChiSqr / (static_cast) ); double evtcent = collision.centrality(); if (evtcent >= 0 && evtcent <= 5) { - registry.fill(HIST("h2_PChi2_CombinFitA"), CDF, ChiSqr / ((float)NDF) ); + registry.fill(HIST("h2_PChi2_CombinFitA"), CDF, ChiSqr / (static_cast) ); } else if (evtcent >= 30 && evtcent <= 50) { - registry.fill(HIST("h2_PChi2_CombinFitB"), CDF, ChiSqr / ((float)NDF) ); + registry.fill(HIST("h2_PChi2_CombinFitB"), CDF, ChiSqr / (static_cast) ); } for (uint i = 0; i < cfgnMods->size(); i++) { From 60b2bd38f8a2ef05c4dbfef4b949bcce24f0ba38 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Tue, 14 Jan 2025 16:25:55 +0800 Subject: [PATCH 04/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index 1c712d43b6b..94d2fa721e3 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -770,7 +770,7 @@ struct Jetchargedv2Task { Int_t NDF = 1; Int_t numOfFreePara = 2; NDF = (Int_t)fFitModulation_v2v3->GetXaxis()->GetNbins() - numOfFreePara; - if (NDF == 0 || static_cast <= 0.) + if (NDF == 0 || static_cast(NDF) <= 0.) return; double chi2 = 0.; for (int i = 0; i < h_ptsum_sumpt_fit->GetXaxis()->GetNbins(); i++) { @@ -787,13 +787,13 @@ struct Jetchargedv2Task { CDFROOT = 1. - ChiSquareCDF(NDF, fFitModulation_v2v3->GetChisquare()); registry.fill(HIST("h_PvalueCDF_CombinFit"), CDF); registry.fill(HIST("h2_PvalueCDFCent_CombinFit"), collision.centrality(), CDF); - registry.fill(HIST("h2_Chi2Cent_CombinFit"), collision.centrality(), ChiSqr / (static_cast) ); - registry.fill(HIST("h2_PChi2_CombinFit"), CDF, ChiSqr / (static_cast) ); + registry.fill(HIST("h2_Chi2Cent_CombinFit"), collision.centrality(), ChiSqr / (static_cast(NDF)) ); + registry.fill(HIST("h2_PChi2_CombinFit"), CDF, ChiSqr / (static_cast(NDF)) ); double evtcent = collision.centrality(); if (evtcent >= 0 && evtcent <= 5) { - registry.fill(HIST("h2_PChi2_CombinFitA"), CDF, ChiSqr / (static_cast) ); + registry.fill(HIST("h2_PChi2_CombinFitA"), CDF, ChiSqr / (static_cast(NDF)) ); } else if (evtcent >= 30 && evtcent <= 50) { - registry.fill(HIST("h2_PChi2_CombinFitB"), CDF, ChiSqr / (static_cast) ); + registry.fill(HIST("h2_PChi2_CombinFitB"), CDF, ChiSqr / (static_cast(NDF)) ); } for (uint i = 0; i < cfgnMods->size(); i++) { From 1cb86af0b0dd65060a869b0359b4e3d95c143d64 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Tue, 14 Jan 2025 16:31:31 +0800 Subject: [PATCH 05/25] Add files via upload --- PWGJE/Tasks/jetChargedV2.cxx | 344 +++++++++++++++++------------------ 1 file changed, 172 insertions(+), 172 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index 94d2fa721e3..576d6553554 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -76,19 +76,19 @@ DECLARE_SOA_TABLE(MyCollisions, "AOD", "MYCOLLISION", //! vertex information of o2::soa::Index<>, collision::PosZ); using MyCollision = MyCollisions::iterator; -namespace myTable +namespace myTable { DECLARE_SOA_INDEX_COLUMN(MyCollision, mycollision); DECLARE_SOA_COLUMN(Psi2, psi2, Float_t); DECLARE_SOA_COLUMN(Psi3, psi3, Float_t); DECLARE_SOA_COLUMN(EvtPlRes, evtplres, Float_t); -} +} // namespace myTable DECLARE_SOA_TABLE(MyTablea, "AOD", "MYTABLEA", o2::soa::Index<>, myTable::Psi2, myTable::Psi3, myTable::EvtPlRes); -} +} // namespace o2::aod struct jetChargedV2EPTable { Produces myTablea; @@ -728,201 +728,201 @@ struct Jetchargedv2Task { } } - TF1* fFitModulation_v2v3 = 0x0; - const char* fitFunction_v2v3 = "[0] * (1. + 2. * ([1] * TMath::Cos(2. * (x - [2])) + [3] * TMath::Cos(3. * (x - [4]))))"; - fFitModulation_v2v3 = new TF1("fit_kV3", fitFunction_v2v3, 0, TMath::TwoPi()); - //=========================< set parameter >=========================// - fFitModulation_v2v3->SetParameter(0, 1.); - fFitModulation_v2v3->SetParameter(1, 0.01); - fFitModulation_v2v3->SetParameter(3, 0.01); + TF1* fFitModulation_v2v3 = 0x0; + const char* fitFunction_v2v3 = "[0] * (1. + 2. * ([1] * TMath::Cos(2. * (x - [2])) + [3] * TMath::Cos(3. * (x - [4]))))"; + fFitModulation_v2v3 = new TF1("fit_kV3", fitFunction_v2v3, 0, TMath::TwoPi()); + //=========================< set parameter >=========================// + fFitModulation_v2v3->SetParameter(0, 1.); + fFitModulation_v2v3->SetParameter(1, 0.01); + fFitModulation_v2v3->SetParameter(3, 0.01); - if (ep2 < 0) { - fFitModulation_v2v3->FixParameter(2, ep2 + TMath::TwoPi()); - } else { - fFitModulation_v2v3->FixParameter(2, ep2); - } - if (ep3 < 0) { - fFitModulation_v2v3->FixParameter(4, ep3 + TMath::TwoPi()); - } else { - fFitModulation_v2v3->FixParameter(4, ep3); - } - h_ptsum_sumpt_fit->Fit(fFitModulation_v2v3, "V+", "ep", 0, TMath::TwoPi()); - - Double_t temppara[5]; - temppara[0] = fFitModulation_v2v3->GetParameter(0); - temppara[1] = fFitModulation_v2v3->GetParameter(1); - temppara[2] = fFitModulation_v2v3->GetParameter(2); - temppara[3] = fFitModulation_v2v3->GetParameter(3); - temppara[4] = fFitModulation_v2v3->GetParameter(4); - for (int i = 1; i <= 5; i++) { - registry.fill(HIST("h2_evt_fitpara"), evtnum, i - 0.5, temppara[i - 1]); + if (ep2 < 0) { + fFitModulation_v2v3->FixParameter(2, ep2 + TMath::TwoPi()); + } else { + fFitModulation_v2v3->FixParameter(2, ep2); + } + if (ep3 < 0) { + fFitModulation_v2v3->FixParameter(4, ep3 + TMath::TwoPi()); + } else { + fFitModulation_v2v3->FixParameter(4, ep3); + } + h_ptsum_sumpt_fit->Fit(fFitModulation_v2v3, "V+", "ep", 0, TMath::TwoPi()); + + Double_t temppara[5]; + temppara[0] = fFitModulation_v2v3->GetParameter(0); + temppara[1] = fFitModulation_v2v3->GetParameter(1); + temppara[2] = fFitModulation_v2v3->GetParameter(2); + temppara[3] = fFitModulation_v2v3->GetParameter(3); + temppara[4] = fFitModulation_v2v3->GetParameter(4); + for (int i = 1; i <= 5; i++) { + registry.fill(HIST("h2_evt_fitpara"), evtnum, i - 0.5, temppara[i - 1]); + } + registry.fill(HIST("h_v2obs_centrality"), collision.centrality(), temppara[1]); + registry.fill(HIST("h_v3obs_centrality"), collision.centrality(), temppara[3]); + + for (auto const& jet : jets) { + if ((fabs(jet.eta() - leadingJetEta) > jetRadius) && jet.pt() >= 0.2 && jet.pt() <= 5.) { + registry.fill(HIST("h2_centrality_rhophi"), collision.centrality(), fFitModulation_v2v3->Eval(jet.phi()), 1.0); } - registry.fill(HIST("h_v2obs_centrality"), collision.centrality(), temppara[1]); - registry.fill(HIST("h_v3obs_centrality"), collision.centrality(), temppara[3]); + } + registry.fill(HIST("h_evtnum_centrlity"), evtnum, collision.centrality()); + Int_t NDF = 1; + Int_t numOfFreePara = 2; + NDF = (Int_t)fFitModulation_v2v3->GetXaxis()->GetNbins() - numOfFreePara; + if (NDF == 0 || static_cast(NDF) <= 0.) + return; + double chi2 = 0.; + for (int i = 0; i < h_ptsum_sumpt_fit->GetXaxis()->GetNbins(); i++) { + if(h_ptsum_sumpt_fit->GetBinContent(i+1) <= 0.) + continue; + chi2 += TMath::Power((h_ptsum_sumpt_fit->GetBinContent(i+1) - fFitModulation_v2v3->Eval(h_ptsum_sumpt_fit->GetXaxis()->GetBinCenter(1+i))), 2) /h_ptsum_sumpt_fit->GetBinContent(i+1); + } + + Double_t ChiSqr = 999.; + Double_t CDF = 1.; + Double_t CDFROOT = 1.; + ChiSqr = chi2; + CDF = 1. - ChiSquareCDF(NDF, ChiSqr); + CDFROOT = 1. - ChiSquareCDF(NDF, fFitModulation_v2v3->GetChisquare()); + registry.fill(HIST("h_PvalueCDF_CombinFit"), CDF); + registry.fill(HIST("h2_PvalueCDFCent_CombinFit"), collision.centrality(), CDF); + registry.fill(HIST("h2_Chi2Cent_CombinFit"), collision.centrality(), ChiSqr / (static_cast(NDF)) ); + registry.fill(HIST("h2_PChi2_CombinFit"), CDF, ChiSqr / (static_cast(NDF)) ); + double evtcent = collision.centrality(); + if (evtcent >= 0 && evtcent <= 5) { + registry.fill(HIST("h2_PChi2_CombinFitA"), CDF, ChiSqr / (static_cast(NDF)) ); + } else if (evtcent >= 30 && evtcent <= 50) { + registry.fill(HIST("h2_PChi2_CombinFitB"), CDF, ChiSqr / (static_cast(NDF)) ); + } + + for (uint i = 0; i < cfgnMods->size(); i++) { + int nmode = cfgnMods->at(i); + int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); for (auto const& jet : jets) { - if ((fabs(jet.eta() - leadingJetEta) > jetRadius) && jet.pt() >= 0.2 && jet.pt() <= 5.) { - registry.fill(HIST("h2_centrality_rhophi"), collision.centrality(), fFitModulation_v2v3->Eval(jet.phi()), 1.0); - } - } - registry.fill(HIST("h_evtnum_centrlity"), evtnum, collision.centrality()); - - Int_t NDF = 1; - Int_t numOfFreePara = 2; - NDF = (Int_t)fFitModulation_v2v3->GetXaxis()->GetNbins() - numOfFreePara; - if (NDF == 0 || static_cast(NDF) <= 0.) - return; - double chi2 = 0.; - for (int i = 0; i < h_ptsum_sumpt_fit->GetXaxis()->GetNbins(); i++) { - if(h_ptsum_sumpt_fit->GetBinContent(i+1) <= 0.) - continue; - chi2 += TMath::Power((h_ptsum_sumpt_fit->GetBinContent(i+1) - fFitModulation_v2v3->Eval(h_ptsum_sumpt_fit->GetXaxis()->GetBinCenter(1+i))), 2) /h_ptsum_sumpt_fit->GetBinContent(i+1); - } + double integralValue = fFitModulation_v2v3->Integral(jet.phi() - jetRadius, jet.phi() + jetRadius); + double rholocal = collision.rho() / (2 * jetRadius * temppara[0]) * integralValue; - Double_t ChiSqr = 999.; - Double_t CDF = 1.; - Double_t CDFROOT = 1.; - ChiSqr = chi2; - CDF = 1. - ChiSquareCDF(NDF, ChiSqr); - CDFROOT = 1. - ChiSquareCDF(NDF, fFitModulation_v2v3->GetChisquare()); - registry.fill(HIST("h_PvalueCDF_CombinFit"), CDF); - registry.fill(HIST("h2_PvalueCDFCent_CombinFit"), collision.centrality(), CDF); - registry.fill(HIST("h2_Chi2Cent_CombinFit"), collision.centrality(), ChiSqr / (static_cast(NDF)) ); - registry.fill(HIST("h2_PChi2_CombinFit"), CDF, ChiSqr / (static_cast(NDF)) ); - double evtcent = collision.centrality(); - if (evtcent >= 0 && evtcent <= 5) { - registry.fill(HIST("h2_PChi2_CombinFitA"), CDF, ChiSqr / (static_cast(NDF)) ); - } else if (evtcent >= 30 && evtcent <= 50) { - registry.fill(HIST("h2_PChi2_CombinFitB"), CDF, ChiSqr / (static_cast(NDF)) ); - } + registry.fill(HIST("h_jet_pt_rholocal"), jet.pt() - (rholocal * jet.area()), 1.0); - for (uint i = 0; i < cfgnMods->size(); i++) { - int nmode = cfgnMods->at(i); - int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); - for (auto const& jet : jets) { - double integralValue = fFitModulation_v2v3->Integral(jet.phi() - jetRadius, jet.phi() + jetRadius); - double rholocal = collision.rho() / (2 * jetRadius * temppara[0]) * integralValue; + if (nmode == 2) { + Double_t phiMinusPsi2; + if (collision.qvecAmp()[DetId] < 1e-8) { + continue; + } + float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); + if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + if (!isAcceptedJet(jet)) { + continue; + } - registry.fill(HIST("h_jet_pt_rholocal"), jet.pt() - (rholocal * jet.area()), 1.0); + if (jet.r() == round(selectedJetsRadius * 100.0f)) { + registry.fill(HIST("h_jet_pt_in_out_plane_v2_rho"), jet.pt() - (rholocal * jet.area()), 1.0); + } + phiMinusPsi2 = jet.phi() - evtPl2; - if (nmode == 2) { - Double_t phiMinusPsi2; - if (collision.qvecAmp()[DetId] < 1e-8) { - continue; - } - float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); - if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { - continue; - } - if (!isAcceptedJet(jet)) { - continue; - } + if ((phiMinusPsi2 < TMath::Pi() / 4) || (phiMinusPsi2 >= 7 * TMath::Pi() / 4) || (phiMinusPsi2 >= 3 * TMath::Pi() / 4 && phiMinusPsi2 < 5 * TMath::Pi() / 4)) { + 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"), collision.centrality(), jet.pt() - (rholocal * jet.area()), 1.0); + } else { + registry.fill(HIST("h_jet_pt_out_of_plane_v2_rho"), jet.pt() - (rholocal * jet.area()), 1.0); + registry.fill(HIST("h2_centrality_jet_pt_out_of_plane_v2_rho"), collision.centrality(), jet.pt() - (rholocal * jet.area()), 1.0); + } - if (jet.r() == round(selectedJetsRadius * 100.0f)) { - registry.fill(HIST("h_jet_pt_in_out_plane_v2_rho"), jet.pt() - (rholocal * jet.area()), 1.0); - } - phiMinusPsi2 = jet.phi() - evtPl2; - - if ((phiMinusPsi2 < TMath::Pi() / 4) || (phiMinusPsi2 >= 7 * TMath::Pi() / 4) || (phiMinusPsi2 >= 3 * TMath::Pi() / 4 && phiMinusPsi2 < 5 * TMath::Pi() / 4)) { - 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"), collision.centrality(), jet.pt() - (rholocal * jet.area()), 1.0); - } else { - registry.fill(HIST("h_jet_pt_out_of_plane_v2_rho"), jet.pt() - (rholocal * jet.area()), 1.0); - registry.fill(HIST("h2_centrality_jet_pt_out_of_plane_v2_rho"), collision.centrality(), jet.pt() - (rholocal * jet.area()), 1.0); - } + } else if (nmode == 3) { + Double_t phiMinusPsi3; + float evtPl3 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); + if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + if (!isAcceptedJet(jet)) { + continue; + } + phiMinusPsi3 = jet.phi() - evtPl3; - } else if (nmode == 3) { - Double_t phiMinusPsi3; - float evtPl3 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); - if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { - continue; - } - if (!isAcceptedJet(jet)) { - continue; - } - phiMinusPsi3 = jet.phi() - evtPl3; - - if ((phiMinusPsi3 < TMath::Pi() / 4) || (phiMinusPsi3 >= 7 * TMath::Pi() / 4) || (phiMinusPsi3 >= 3 * TMath::Pi() / 4 && phiMinusPsi3 < 5 * TMath::Pi() / 4)) { - registry.fill(HIST("h_jet_pt_in_plane_v3_rho"), jet.pt() - (rholocal * jet.area()), 1.0); - registry.fill(HIST("h2_centrality_jet_pt_in_plane_v3_rho"), collision.centrality(), 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); - registry.fill(HIST("h2_centrality_jet_pt_out_of_plane_v3_rho"), collision.centrality(), jet.pt() - (rholocal * jet.area()), 1.0); - } + if ((phiMinusPsi3 < TMath::Pi() / 4) || (phiMinusPsi3 >= 7 * TMath::Pi() / 4) || (phiMinusPsi3 >= 3 * TMath::Pi() / 4 && phiMinusPsi3 < 5 * TMath::Pi() / 4)) { + registry.fill(HIST("h_jet_pt_in_plane_v3_rho"), jet.pt() - (rholocal * jet.area()), 1.0); + registry.fill(HIST("h2_centrality_jet_pt_in_plane_v3_rho"), collision.centrality(), 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); + registry.fill(HIST("h2_centrality_jet_pt_out_of_plane_v3_rho"), collision.centrality(), jet.pt() - (rholocal * jet.area()), 1.0); } } } - // RCpT - for (uint i = 0; i < cfgnMods->size(); i++) { - TRandom3 randomNumber(0); - float randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); - float randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI); - float randomConePt = 0; + } + // RCpT + for (uint i = 0; i < cfgnMods->size(); i++) { + TRandom3 randomNumber(0); + float randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); + float randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI); + float randomConePt = 0; - int nmode = cfgnMods->at(i); - int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + int nmode = cfgnMods->at(i); + int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); - Double_t RcPhiPsi2; - float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); - RcPhiPsi2 = randomConePhi - evtPl2; + Double_t RcPhiPsi2; + float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); + RcPhiPsi2 = randomConePhi - evtPl2; - for (auto const& jet : jets) { - registry.fill(HIST("h2_phi_rhophi"), jet.phi() - evtPl2, fFitModulation_v2v3->Eval(jet.phi()), 1.0); - registry.fill(HIST("h3_centrality_rhovsphi_phi"), collision.centrality(), fFitModulation_v2v3->Eval(jet.phi()), jet.phi() - evtPl2); - } + for (auto const& jet : jets) { + registry.fill(HIST("h2_phi_rhophi"), jet.phi() - evtPl2, fFitModulation_v2v3->Eval(jet.phi()), 1.0); + registry.fill(HIST("h3_centrality_rhovsphi_phi"), collision.centrality(), fFitModulation_v2v3->Eval(jet.phi()), jet.phi() - evtPl2); + } - for (auto const& track : tracks) { - if (jetderiveddatautilities::selectTrack(track, trackSelection)) { - float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-M_PI)); - float dEta = track.eta() - randomConeEta; - if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { - randomConePt += track.pt(); - } + for (auto const& track : tracks) { + if (jetderiveddatautilities::selectTrack(track, trackSelection)) { + float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-M_PI)); + float dEta = track.eta() - randomConeEta; + if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + randomConePt += track.pt(); } } - double integralValue = 0; - double rholocal = 0; - for (auto const& jet : jets) { - if (temppara[0] == 0) { - break; - } - integralValue = fFitModulation_v2v3->Integral(jet.phi() - jetRadius, jet.phi() + jetRadius); - rholocal = collision.rho() / (2 * jetRadius * temppara[0]) * integralValue; + } + double integralValue = 0; + double rholocal = 0; + for (auto const& jet : jets) { + if (temppara[0] == 0) { + break; } - // removing the leading jet from the random cone - 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(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-M_PI)); - float dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta; - - bool jetWasInCone = false; - while (TMath::Sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < jets.iteratorAt(0).r() / 100.0 + randomConeR) { - jetWasInCone = true; - randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); - randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI); - dPhiLeadingJet = RecoDecay::constrainAngle(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-M_PI)); - dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta; - } - if (jetWasInCone) { - randomConePt = 0.0; - for (auto const& track : tracks) { - if (jetderiveddatautilities::selectTrack(track, trackSelection)) { // if track selection is uniformTrack, dcaXY and dcaZ cuts need to be added as they aren't in the selection so that they can be studied here - float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-M_PI)); - float dEta = track.eta() - randomConeEta; - if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { - randomConePt += track.pt(); - } + integralValue = fFitModulation_v2v3->Integral(jet.phi() - jetRadius, jet.phi() + jetRadius); + rholocal = collision.rho() / (2 * jetRadius * temppara[0]) * integralValue; + } + // removing the leading jet from the random cone + 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(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-M_PI)); + float dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta; + + bool jetWasInCone = false; + while (TMath::Sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < jets.iteratorAt(0).r() / 100.0 + randomConeR) { + jetWasInCone = true; + randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); + randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI); + dPhiLeadingJet = RecoDecay::constrainAngle(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-M_PI)); + dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta; + } + if (jetWasInCone) { + randomConePt = 0.0; + for (auto const& track : tracks) { + if (jetderiveddatautilities::selectTrack(track, trackSelection)) { // if track selection is uniformTrack, dcaXY and dcaZ cuts need to be added as they aren't in the selection so that they can be studied here + float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-M_PI)); + float dEta = track.eta() - randomConeEta; + if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + randomConePt += track.pt(); } } } } - for (auto const& jet : jets) { - if (temppara[0] == 0) { - break; - } + } + for (auto const& jet : jets) { + if (temppara[0] == 0) { + break; } - registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * rholocal, RcPhiPsi2, 1.0); } - evtnum += 1; + registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * rholocal, RcPhiPsi2, 1.0); + } + evtnum += 1; } PROCESS_SWITCH(Jetchargedv2Task, processSigmaPt, "Sigma pT and bkg as fcn of phi", true); From aa51f09f91fc6f50cc42975eb05d0f375209c5ed Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Tue, 14 Jan 2025 16:37:04 +0800 Subject: [PATCH 06/25] jetChargedV2.cxx format change --- PWGJE/Tasks/jetChargedV2.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index 576d6553554..250cf538727 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -770,13 +770,13 @@ struct Jetchargedv2Task { Int_t NDF = 1; Int_t numOfFreePara = 2; NDF = (Int_t)fFitModulation_v2v3->GetXaxis()->GetNbins() - numOfFreePara; - if (NDF == 0 || static_cast(NDF) <= 0.) + if (NDF == 0 || static_cast(NDF) <= 0.) return; double chi2 = 0.; for (int i = 0; i < h_ptsum_sumpt_fit->GetXaxis()->GetNbins(); i++) { - if(h_ptsum_sumpt_fit->GetBinContent(i+1) <= 0.) + if (h_ptsum_sumpt_fit->GetBinContent(i+1) <= 0.) continue; - chi2 += TMath::Power((h_ptsum_sumpt_fit->GetBinContent(i+1) - fFitModulation_v2v3->Eval(h_ptsum_sumpt_fit->GetXaxis()->GetBinCenter(1+i))), 2) /h_ptsum_sumpt_fit->GetBinContent(i+1); + chi2 += TMath::Power((h_ptsum_sumpt_fit->GetBinContent(i + 1) - fFitModulation_v2v3->Eval(h_ptsum_sumpt_fit->GetXaxis()->GetBinCenter(1 + i))), 2) /h_ptsum_sumpt_fit->GetBinContent(i + 1); } Double_t ChiSqr = 999.; @@ -787,13 +787,13 @@ struct Jetchargedv2Task { CDFROOT = 1. - ChiSquareCDF(NDF, fFitModulation_v2v3->GetChisquare()); registry.fill(HIST("h_PvalueCDF_CombinFit"), CDF); registry.fill(HIST("h2_PvalueCDFCent_CombinFit"), collision.centrality(), CDF); - registry.fill(HIST("h2_Chi2Cent_CombinFit"), collision.centrality(), ChiSqr / (static_cast(NDF)) ); - registry.fill(HIST("h2_PChi2_CombinFit"), CDF, ChiSqr / (static_cast(NDF)) ); + registry.fill(HIST("h2_Chi2Cent_CombinFit"), collision.centrality(), ChiSqr / (static_cast(NDF))); + registry.fill(HIST("h2_PChi2_CombinFit"), CDF, ChiSqr / (static_cast(NDF))); double evtcent = collision.centrality(); if (evtcent >= 0 && evtcent <= 5) { - registry.fill(HIST("h2_PChi2_CombinFitA"), CDF, ChiSqr / (static_cast(NDF)) ); + registry.fill(HIST("h2_PChi2_CombinFitA"), CDF, ChiSqr / (static_cast(NDF))); } else if (evtcent >= 30 && evtcent <= 50) { - registry.fill(HIST("h2_PChi2_CombinFitB"), CDF, ChiSqr / (static_cast(NDF)) ); + registry.fill(HIST("h2_PChi2_CombinFitB"), CDF, ChiSqr / (static_cast(NDF))); } for (uint i = 0; i < cfgnMods->size(); i++) { From ca5a3d68627e3e30430df70d8f6f4de427b65d77 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Tue, 14 Jan 2025 16:40:09 +0800 Subject: [PATCH 07/25] jetChargedV2.cxx Update format --- PWGJE/Tasks/jetChargedV2.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index 250cf538727..a482159193e 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -774,9 +774,9 @@ struct Jetchargedv2Task { return; double chi2 = 0.; for (int i = 0; i < h_ptsum_sumpt_fit->GetXaxis()->GetNbins(); i++) { - if (h_ptsum_sumpt_fit->GetBinContent(i+1) <= 0.) + if (h_ptsum_sumpt_fit->GetBinContent(i + 1) <= 0.) continue; - chi2 += TMath::Power((h_ptsum_sumpt_fit->GetBinContent(i + 1) - fFitModulation_v2v3->Eval(h_ptsum_sumpt_fit->GetXaxis()->GetBinCenter(1 + i))), 2) /h_ptsum_sumpt_fit->GetBinContent(i + 1); + chi2 += TMath::Power((h_ptsum_sumpt_fit->GetBinContent(i + 1) - fFitModulation_v2v3->Eval(h_ptsum_sumpt_fit->GetXaxis()->GetBinCenter(1 + i))), 2) / h_ptsum_sumpt_fit->GetBinContent(i + 1); } Double_t ChiSqr = 999.; From 3652c97a0d47edf844cef386769ddd3891a69634 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Tue, 14 Jan 2025 16:56:31 +0800 Subject: [PATCH 08/25] jetChargedV2.cxx Update format --- PWGJE/Tasks/jetChargedV2.cxx | 165 ++--------------------------------- 1 file changed, 8 insertions(+), 157 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index a482159193e..a212876decf 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -70,152 +70,6 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -namespace o2::aod -{ -DECLARE_SOA_TABLE(MyCollisions, "AOD", "MYCOLLISION", //! vertex information of collision - o2::soa::Index<>, collision::PosZ); -using MyCollision = MyCollisions::iterator; - -namespace myTable -{ -DECLARE_SOA_INDEX_COLUMN(MyCollision, mycollision); - -DECLARE_SOA_COLUMN(Psi2, psi2, Float_t); -DECLARE_SOA_COLUMN(Psi3, psi3, Float_t); -DECLARE_SOA_COLUMN(EvtPlRes, evtplres, Float_t); -} // namespace myTable -DECLARE_SOA_TABLE(MyTablea, "AOD", "MYTABLEA", o2::soa::Index<>, - myTable::Psi2, - myTable::Psi3, - myTable::EvtPlRes); -} // namespace o2::aod - -struct jetChargedV2EPTable { - Produces myTablea; - Produces outputCollisions; - - HistogramRegistry registry; - - Configurable eventSelections{"eventSelections", "sel8", "choose event selection"}; - Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; - - Configurable vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"}; - Configurable centralityMin{"centralityMin", -999.0, "minimum centrality"}; - Configurable centralityMax{"centralityMax", 999.0, "maximum centrality"}; - Configurable trackPtMin{"trackPtMin", 0.15, "minimum pT acceptance for tracks"}; - Configurable trackPtMax{"trackPtMax", 1000., "maximum pT acceptance for tracks"}; - Configurable trackEtaMin{"trackEtaMin", -0.9, "minimum eta acceptance for tracks"}; - Configurable trackEtaMax{"trackEtaMax", 0.9, "maximum eta acceptance for tracks"}; - - Configurable jetAreaFractionMin{"jetAreaFractionMin", -99.0, "used to make a cut on the jet areas"}; - Configurable leadingConstituentPtMin{"leadingConstituentPtMin", -99.0, "minimum pT selection on jet constituent"}; - Configurable jetPtMin{"jetPtMin", 0.15, "minimum pT acceptance for jets"}; - Configurable jetPtMax{"jetPtMax", 200.0, "maximum pT acceptance for jets"}; - - Configurable trackOccupancyInTimeRangeMax{"trackOccupancyInTimeRangeMax", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; - Configurable trackOccupancyInTimeRangeMin{"trackOccupancyInTimeRangeMin", -999999, "minimum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; - - //=====================< evt pln >=====================// - Configurable cfgAddEvtSel{"cfgAddEvtSel", true, "event selection"}; - Configurable> cfgnMods{"cfgnMods", {2}, "Modulation of interest"}; - Configurable cfgnTotalSystem{"cfgnTotalSystem", 7, "total qvect 56 or number"}; - Configurable cfgDetName{"cfgDetName", "FT0M", "The name of detector to be analyzed"}; - Configurable cfgRefAName{"cfgRefAName", "TPCpos", "The name of detector for reference A"}; - Configurable cfgRefBName{"cfgRefBName", "TPCneg", "The name of detector for reference B"}; - - EventPlaneHelper helperEP; - int DetId; - int RefAId; - int RefBId; - - template - int GetDetId(const T& name) - { - if (name.value == "BPos" || name.value == "BNeg" || name.value == "BTot") { - LOGF(warning, "Using deprecated label: %s. Please use TPCpos, TPCneg, TPCall instead.", name.value); - } - if (name.value == "FT0C") { - return 0; - } else if (name.value == "FT0A") { - return 1; - } else if (name.value == "FT0M") { - return 2; - } else if (name.value == "FV0A") { - return 3; - } else if (name.value == "TPCpos" || name.value == "BPos") { - return 4; - } else if (name.value == "TPCneg" || name.value == "BNeg") { - return 5; - } else if (name.value == "TPCall" || name.value == "BTot") { - return 6; - } else { - return 0; - } - } - //=====================< evt pln | end >=====================// - - Configurable selectedJetsRadius{"selectedJetsRadius", 0.4, "resolution parameter for histograms without radius"}; - - std::vector jetPtBins; - std::vector jetPtBinsRhoAreaSub; - - int eventSelectiont = -1; - int trackSelectiont = -1; - - void init(o2::framework::InitContext&) - { - DetId = GetDetId(cfgDetName); - RefAId = GetDetId(cfgRefAName); - RefBId = GetDetId(cfgRefBName); - if (DetId == RefAId || DetId == RefBId || RefAId == RefBId) { - LOGF(info, "Wrong detector configuration \n The FT0C will be used to get Q-Vector \n The TPCpos and TPCneg will be used as reference systems"); - DetId = 0; - RefAId = 4; - RefBId = 5; - } - eventSelectiont = jetderiveddatautilities::initialiseEventSelection(static_cast(eventSelections)); - trackSelectiont = jetderiveddatautilities::initialiseTrackSelection(static_cast(trackSelections)); - } - - Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); - Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centrality >= centralityMin && aod::jcollision::centrality < centralityMax); - - void processJetV2Table(soa::Filtered>::iterator const& collision, - soa::Join const& jets, - aod::JetTracks const& tracks) - { - if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { - return; - } - if (!jetderiveddatautilities::selectCollision(collision, eventSelectiont)) { - return; - } - outputCollisions(collision.posZ()); - //=====================< evt pln [n=2->\Psi_2, n=3->\Psi_3] >=====================// - double ep2 = 0; - double ep3 = 0; - double res2 = 0; - - for (uint i = 0; i < cfgnMods->size(); i++) { - int nmode = cfgnMods->at(i); - int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); - if (nmode == 2) { - if (collision.qvecAmp()[DetId] > 1e-8) { - ep2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode); - res2 = helperEP.GetResolution(helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), nmode); - } - } else if (nmode == 3) { - if (collision.qvecAmp()[DetId] > 1e-8) { - ep3 = helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode); - } - } - } - myTablea(ep2, ep3, res2); - LOGF(info, "table producer Psi2 as %f, Psi3 as %f, Res2 as %f", ep2, ep3, res2); - } - PROCESS_SWITCH(jetChargedV2EPTable, processJetV2Table, "Jet V2 table for fit", true); -}; - struct Jetchargedv2Task { HistogramRegistry registry; HistogramRegistry histosQA{"histosQA", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; @@ -538,7 +392,6 @@ struct Jetchargedv2Task { } double leadingJetPt = -1; - double leadingJetPhi = -1; double leadingJetEta = -1; // auto collJets = jets.sliceBy(JetsPerJCollision, collision.globalIndex()); @@ -546,7 +399,6 @@ struct Jetchargedv2Task { if (jet.pt() > leadingJetPt) { leadingJetPt = jet.pt(); leadingJetEta = jet.eta(); - leadingJetPhi = jet.phi(); } } @@ -779,12 +631,14 @@ struct Jetchargedv2Task { chi2 += TMath::Power((h_ptsum_sumpt_fit->GetBinContent(i + 1) - fFitModulation_v2v3->Eval(h_ptsum_sumpt_fit->GetXaxis()->GetBinCenter(1 + i))), 2) / h_ptsum_sumpt_fit->GetBinContent(i + 1); } - Double_t ChiSqr = 999.; - Double_t CDF = 1.; - Double_t CDFROOT = 1.; + double ChiSqr = 999.; + double CDF = 1.; + double CDFROOT = 1.; + ChiSqr = chi2; CDF = 1. - ChiSquareCDF(NDF, ChiSqr); CDFROOT = 1. - ChiSquareCDF(NDF, fFitModulation_v2v3->GetChisquare()); + registry.fill(HIST("h_PvalueCDF_CombinFit"), CDF); registry.fill(HIST("h2_PvalueCDFCent_CombinFit"), collision.centrality(), CDF); registry.fill(HIST("h2_Chi2Cent_CombinFit"), collision.centrality(), ChiSqr / (static_cast(NDF))); @@ -915,10 +769,8 @@ struct Jetchargedv2Task { } } } - for (auto const& jet : jets) { - if (temppara[0] == 0) { - break; - } + if (temppara[0] == 0) { + break; } registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * rholocal, RcPhiPsi2, 1.0); } @@ -1013,6 +865,5 @@ struct Jetchargedv2Task { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"jet-charged-v2"}), - adaptAnalysisTask(cfgc, TaskName{"jet-charged-v2-table"})}; + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"jet-charged-v2"})}; } From 441925eecfea605ebe0feb696500833c32d13708 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Wed, 15 Jan 2025 22:54:36 +0800 Subject: [PATCH 09/25] jetChargedV2.cxx Update format --- PWGJE/Tasks/jetChargedV2.cxx | 351 +++++++++++++++++------------------ 1 file changed, 174 insertions(+), 177 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index a212876decf..3a39594c991 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -5,13 +5,11 @@ // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING". // -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -// jet v2 task +/// \file jetChargedV2.cxx +/// \brief This file contains the implementation for the Charged Jet v2 analysis in the ALICE experiment. +/// /// \author Yubiao Wang -// C++/ROOT includes. +/// \date 2025 #include #include @@ -23,7 +21,7 @@ #include #include // o2Physics includes. - +#include "CommonConstants/MathConstants.h" #include "CCDB/BasicCCDBManager.h" #include "DataFormatsParameters/GRPMagField.h" @@ -70,7 +68,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -struct Jetchargedv2Task { +struct jetchargedv2Task { HistogramRegistry registry; HistogramRegistry histosQA{"histosQA", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; @@ -98,8 +96,7 @@ struct Jetchargedv2Task { Configurable randomConeR{"randomConeR", 0.4, "size of random Cone for estimating background fluctuations"}; Configurable trackOccupancyInTimeRangeMax{"trackOccupancyInTimeRangeMax", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; Configurable trackOccupancyInTimeRangeMin{"trackOccupancyInTimeRangeMin", -999999, "minimum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; - Configurable NTrackCut{"NumberTrackCut", 500, "Number of Track Cut"}; - + Configurable nTrackCut{"numberTrackCut", 500, "Number of Track Cut"}; //=====================< evt pln >=====================// Configurable cfgAddEvtSel{"cfgAddEvtSel", true, "event selection"}; Configurable> cfgnMods{"cfgnMods", {2}, "Modulation of interest"}; @@ -116,12 +113,12 @@ struct Jetchargedv2Task { ConfigurableAxis cfgaxisEvtfit{"cfgaxisEvtfit", {10000, 0, 10000}, ""}; EventPlaneHelper helperEP; - int DetId; - int RefAId; - int RefBId; + int detId; + int refAId; + int refBId; template - int GetDetId(const T& name) + int getDetId(const T& name) { if (name.value == "BPos" || name.value == "BNeg" || name.value == "BTot") { LOGF(warning, "Using deprecated label: %s. Please use TPCpos, TPCneg, TPCall instead.", name.value); @@ -154,19 +151,19 @@ struct Jetchargedv2Task { int eventSelection = -1; int trackSelection = -1; double evtnum = 0; - double AccptTrack = 0; - double FitTrack = 0; + double accptTrack = 0; + double fitTrack = 0; void init(o2::framework::InitContext&) { - DetId = GetDetId(cfgDetName); - RefAId = GetDetId(cfgRefAName); - RefBId = GetDetId(cfgRefBName); - if (DetId == RefAId || DetId == RefBId || RefAId == RefBId) { + detId = getDetId(cfgDetName); + refAId = getDetId(cfgRefAName); + refBId = getDetId(cfgRefBName); + if (detId == refAId || detId == refBId || refAId == refBId) { LOGF(info, "Wrong detector configuration \n The FT0C will be used to get Q-Vector \n The TPCpos and TPCneg will be used as reference systems"); - DetId = 0; - RefAId = 4; - RefBId = 5; + detId = 0; + refAId = 4; + refBId = 5; } auto jetPtTemp = 0.0; @@ -210,15 +207,15 @@ struct Jetchargedv2Task { registry.add("h_accept_Track_Fit", "all and accept track;Track;entries", {HistType::kTH1F, {{10, 0.0, 10.0}}}); registry.add("h_ptsum_collnum", "ptsum collnum;collnum;entries", {HistType::kTH1F, {{40, 0.0, 40}}}); - registry.add("h_ptsum_sumpt", "jet sumpt;sum p_{T};entries", {HistType::kTH1F, {{40, 0., TMath::TwoPi()}}}); - registry.add("h2_phi_track_eta", "phi vs track eta; #eta (GeV/#it{c}); #varphi", {HistType::kTH2F, {{100, -1.0, 1.0}, {40, 0., TMath::TwoPi()}}}); - registry.add("h2_phi_track_pt", "phi vs track pT; #it{p}_{T,track} (GeV/#it{c}); #varphi", {HistType::kTH2F, {{200, 0., 200.}, {40, 0., TMath::TwoPi()}}}); - registry.add("h2_centrality_phi_w_pt", "centrality vs jet #varphi; centrality; entries", {HistType::kTH2F, {{100, 0.0, 100.0}, {40, 0., TMath::TwoPi()}}}); - registry.add("h2_evtnum_phi_w_pt", "eventNumber vs jet #varphi; #eventNumber; entries", {HistType::kTH2F, {{1000, 0.0, 1000}, {40, 0., TMath::TwoPi()}}}); + registry.add("h_ptsum_sumpt", "jet sumpt;sum p_{T};entries", {HistType::kTH1F, {{40, 0., o2::constants::math::PI * 2}}}); + registry.add("h2_phi_track_eta", "phi vs track eta; #eta (GeV/#it{c}); #varphi", {HistType::kTH2F, {{100, -1.0, 1.0}, {40, 0., o2::constants::math::PI * 2}}}); + registry.add("h2_phi_track_pt", "phi vs track pT; #it{p}_{T,track} (GeV/#it{c}); #varphi", {HistType::kTH2F, {{200, 0., 200.}, {40, 0., o2::constants::math::PI * 2}}}); + registry.add("h2_centrality_phi_w_pt", "centrality vs jet #varphi; centrality; entries", {HistType::kTH2F, {{100, 0.0, 100.0}, {40, 0., o2::constants::math::PI * 2}}}); + registry.add("h2_evtnum_phi_w_pt", "eventNumber vs jet #varphi; #eventNumber; entries", {HistType::kTH2F, {{1000, 0.0, 1000}, {40, 0., o2::constants::math::PI * 2}}}); //< fit quality >// - registry.add("h_PvalueCDF_CombinFit", "CDF #chi^{2}; entries", {HistType::kTH1F, {{50, 0, 1}}}); - registry.add("h2_PvalueCDFCent_CombinFit", "p-value CDF vs centrality; centrality; p-value", {HistType::kTH2F, {{100, 0, 100}, {40, 0, 1}}}); + registry.add("h_PvalueCDF_CombinFit", "cDF #chi^{2}; entries", {HistType::kTH1F, {{50, 0, 1}}}); + registry.add("h2_PvalueCDFCent_CombinFit", "p-value cDF vs centrality; centrality; p-value", {HistType::kTH2F, {{100, 0, 100}, {40, 0, 1}}}); registry.add("h2_Chi2Cent_CombinFit", "Chi2 vs centrality; centrality; #tilde{#chi^{2}}", {HistType::kTH2F, {{100, 0, 100}, {100, 0, 5}}}); registry.add("h2_PChi2_CombinFit", "p-value vs #tilde{#chi^{2}}; p-value; #tilde{#chi^{2}}", {HistType::kTH2F, {{100, 0, 1}, {100, 0, 5}}}); @@ -228,7 +225,7 @@ struct Jetchargedv2Task { registry.add("h_evtnum_centrlity", "eventNumber vs centrality ; #eventNumber", {HistType::kTH1F, {{1000, 0.0, 1000}}}); registry.add("h_evtnum_NTrk", "eventNumber vs Number of Track ; #eventNumber", {HistType::kTH1F, {{1000, 0.0, 1000}}}); - registry.add("Thn_evtnum_phi_centrality", "eventNumber vs jet #varphi; #eventNumber; entries", {HistType::kTHnSparseF, {{1000, 0.0, 1000}, {40, 0., TMath::TwoPi()}, {100, 0.0, 100.0}}}); + registry.add("Thn_evtnum_phi_centrality", "eventNumber vs jet #varphi; #eventNumber; entries", {HistType::kTHnSparseF, {{1000, 0.0, 1000}, {40, 0., o2::constants::math::PI * 2}, {100, 0.0, 100.0}}}); registry.add("h2_evt_fitpara", "event vs fit parameter; evtnum; parameter", {HistType::kTH2F, {cfgaxisEvtfit, {5, 0., 5}}}); @@ -236,9 +233,9 @@ struct Jetchargedv2Task { registry.add("h_v3obs_centrality", "fitparameter v3obs vs centrality ; #centrality", {HistType::kTProfile, {cfgaxisVnCent}}); registry.add("h2_centrality_rhophi", "centrality vs #rho(#varphi); centrality; #rho(#varphi) ", {HistType::kTH2F, {{120, -10.0, 110.0}, {210, -10.0, 200.0}}}); - registry.add("h2_phi_rhophi", "#varphi vs #rho(#varphi); #varphi - #Psi_{EP,2}; #rho(#varphi) ", {HistType::kTH2F, {{40, 0., TMath::TwoPi()}, {210, -10.0, 200.0}}}); + registry.add("h2_phi_rhophi", "#varphi vs #rho(#varphi); #varphi - #Psi_{EP,2}; #rho(#varphi) ", {HistType::kTH2F, {{40, 0., o2::constants::math::PI * 2}, {210, -10.0, 200.0}}}); - registry.add("h3_centrality_rhovsphi_phi", "centrality; #rho(#varphi); #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {200, 0.0, 200.0}, {40, 0., TMath::TwoPi()}}}); + registry.add("h3_centrality_rhovsphi_phi", "centrality; #rho(#varphi); #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {200, 0.0, 200.0}, {40, 0., o2::constants::math::PI * 2}}}); //< \sigma p_T at local rho test plot | end > registry.add("h2_centrality_track_pt", "centrality vs track pT; centrality; #it{p}_{T,track} (GeV/#it{c})", {HistType::kTH2F, {{1200, -10.0, 110.0}, {200, 0., 200.}}}); @@ -258,8 +255,8 @@ struct Jetchargedv2Task { registry.add("leadJetEta", "leadJet constituent #eta ", {HistType::kTH1F, {{100, -1.0, 1.0}}}); //< RC test plots >// - registry.add("h3_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet", "centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho}; #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {800, -400.0, 400.0}, {160, 0., TMath::TwoPi()}}}); - registry.add("h3_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet", "centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho}(#varphi); #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {800, -400.0, 400.0}, {160, 0., TMath::TwoPi()}}}); + registry.add("h3_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet", "centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho}; #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {800, -400.0, 400.0}, {160, 0., o2::constants::math::PI * 2}}}); + registry.add("h3_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet", "centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho}(#varphi); #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {800, -400.0, 400.0}, {160, 0., o2::constants::math::PI * 2}}}); //< bkg sub plot | end >// //< median rho >// @@ -309,7 +306,7 @@ struct Jetchargedv2Task { //=====================< evt pln plot | end >=====================// } - Preslice JetsPerJCollision = o2::aod::jet::collisionId; + Preslice jetsPerJCollision = o2::aod::jet::collisionId; Preslice tracksPerJCollision = o2::aod::jtrack::collisionId; Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); @@ -319,13 +316,13 @@ struct Jetchargedv2Task { bool isAcceptedJet(U const& jet) { if (jetAreaFractionMin > -98.0) { - if (jet.area() < jetAreaFractionMin * M_PI * (jet.r() / 100.0) * (jet.r() / 100.0)) { + if (jet.area() < jetAreaFractionMin * o2::constants::math::PI * (jet.r() / 100.0) * (jet.r() / 100.0)) { return false; } } if (leadingConstituentPtMin > -98.0) { bool isMinleadingConstituent = false; - for (auto& constituent : jet.template tracks_as()) { + for (const auto& constituent : jet.template tracks_as()) { if (constituent.pt() >= leadingConstituentPtMin) { isMinleadingConstituent = true; break; @@ -345,9 +342,9 @@ struct Jetchargedv2Task { registry.fill(HIST("leadJetEta"), leadingJetEta); } - double ChiSquareCDF(int ndf, double x) + double chiSquareCDF(int nDF, double x) { - return TMath::Gamma(ndf / 2., x / 2.); + return TMath::Gamma(nDF / 2., x / 2.); } void processjetQA(soa::Filtered>::iterator const& collision, @@ -378,7 +375,7 @@ struct Jetchargedv2Task { } } } - PROCESS_SWITCH(Jetchargedv2Task, processjetQA, "jet rho v2 jet QA", true); + PROCESS_SWITCH(jetchargedv2Task, processjetQA, "jet rho v2 jet QA", true); void processInOutJetV2(soa::Filtered>::iterator const& collision, soa::Join const& jets, @@ -394,62 +391,62 @@ struct Jetchargedv2Task { double leadingJetPt = -1; double leadingJetEta = -1; - // auto collJets = jets.sliceBy(JetsPerJCollision, collision.globalIndex()); - for (auto& jet : jets) { + // auto collJets = jets.sliceBy(jetsPerJCollision, collision.globalIndex()); + for (const auto& jet : jets) { if (jet.pt() > leadingJetPt) { leadingJetPt = jet.pt(); leadingJetEta = jet.eta(); } } - int NTrk = 0; + int nTrk = 0; if (jets.size() > 0) { for (auto const& track : tracks) { - if (jetderiveddatautilities::selectTrack(track, trackSelection) && (fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { - NTrk += 1; + if (jetderiveddatautilities::selectTrack(track, trackSelection) && (std::fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { + nTrk += 1; } } } - if (NTrk < NTrackCut) { + if (nTrk < nTrackCut) { return; } //=====================< evt pln [n=2->\Psi_2, n=3->\Psi_3] >=====================// histosQA.fill(HIST("histCent"), collision.cent()); for (uint i = 0; i < cfgnMods->size(); i++) { int nmode = cfgnMods->at(i); - int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + int detInd = detId * 4 + cfgnTotalSystem * 4 * (nmode - 2); if (nmode == 2) { - if (collision.qvecAmp()[DetId] > 1e-8) { - histosQA.fill(HIST("histQvecUncorV2"), collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], collision.cent()); - histosQA.fill(HIST("histQvecRectrV2"), collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], collision.cent()); - histosQA.fill(HIST("histQvecTwistV2"), collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], collision.cent()); - histosQA.fill(HIST("histQvecFinalV2"), collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], collision.cent()); - - histosQA.fill(HIST("histEvtPlUncorV2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlRectrV2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlTwistV2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlFinalV2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlFinalEvtNumV2"), evtnum, helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode)); + if (collision.qvecAmp()[detId] > 1e-8) { + histosQA.fill(HIST("histQvecUncorV2"), collision.qvecRe()[detInd], collision.qvecIm()[detInd], collision.cent()); + histosQA.fill(HIST("histQvecRectrV2"), collision.qvecRe()[detInd + 1], collision.qvecIm()[detInd + 1], collision.cent()); + histosQA.fill(HIST("histQvecTwistV2"), collision.qvecRe()[detInd + 2], collision.qvecIm()[detInd + 2], collision.cent()); + histosQA.fill(HIST("histQvecFinalV2"), collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], collision.cent()); + + histosQA.fill(HIST("histEvtPlUncorV2"), helperEP.GetEventPlane(collision.qvecRe()[detInd], collision.qvecIm()[detInd], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlRectrV2"), helperEP.GetEventPlane(collision.qvecRe()[detInd + 1], collision.qvecIm()[detInd + 1], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlTwistV2"), helperEP.GetEventPlane(collision.qvecRe()[detInd + 2], collision.qvecIm()[detInd + 2], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlFinalV2"), helperEP.GetEventPlane(collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlFinalEvtNumV2"), evtnum, helperEP.GetEventPlane(collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], nmode)); } } else if (nmode == 3) { - histosQA.fill(HIST("histQvecUncorV3"), collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], collision.cent()); - histosQA.fill(HIST("histQvecRectrV3"), collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], collision.cent()); - histosQA.fill(HIST("histQvecTwistV3"), collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], collision.cent()); - histosQA.fill(HIST("histQvecFinalV3"), collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], collision.cent()); - - histosQA.fill(HIST("histEvtPlUncorV3"), helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlRectrV3"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlTwistV3"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlFinalV3"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlFinalEvtNumV3"), evtnum, helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode)); + histosQA.fill(HIST("histQvecUncorV3"), collision.qvecRe()[detInd], collision.qvecIm()[detInd], collision.cent()); + histosQA.fill(HIST("histQvecRectrV3"), collision.qvecRe()[detInd + 1], collision.qvecIm()[detInd + 1], collision.cent()); + histosQA.fill(HIST("histQvecTwistV3"), collision.qvecRe()[detInd + 2], collision.qvecIm()[detInd + 2], collision.cent()); + histosQA.fill(HIST("histQvecFinalV3"), collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], collision.cent()); + + histosQA.fill(HIST("histEvtPlUncorV3"), helperEP.GetEventPlane(collision.qvecRe()[detInd], collision.qvecIm()[detInd], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlRectrV3"), helperEP.GetEventPlane(collision.qvecRe()[detInd + 1], collision.qvecIm()[detInd + 1], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlTwistV3"), helperEP.GetEventPlane(collision.qvecRe()[detInd + 2], collision.qvecIm()[detInd + 2], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlFinalV3"), helperEP.GetEventPlane(collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlFinalEvtNumV3"), evtnum, helperEP.GetEventPlane(collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], nmode)); } if (nmode == 2) { - Double_t phiMinusPsi2; - if (collision.qvecAmp()[DetId] < 1e-8) { + double phiMinusPsi2; + if (collision.qvecAmp()[detId] < 1e-8) { continue; } - float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); + float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[detInd], collision.qvecIm()[detInd], nmode); for (auto const& jet : jets) { if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; @@ -463,7 +460,7 @@ struct Jetchargedv2Task { } phiMinusPsi2 = jet.phi() - evtPl2; - if ((phiMinusPsi2 < TMath::Pi() / 4) || (phiMinusPsi2 >= 7 * TMath::Pi() / 4) || (phiMinusPsi2 >= 3 * TMath::Pi() / 4 && phiMinusPsi2 < 5 * TMath::Pi() / 4)) { + if ((phiMinusPsi2 < o2::constants::math::PI / 4) || (phiMinusPsi2 >= 7 * o2::constants::math::PI / 4) || (phiMinusPsi2 >= 3 * o2::constants::math::PI / 4 && phiMinusPsi2 < 5 * o2::constants::math::PI / 4)) { 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"), collision.centrality(), jet.pt() - (collision.rho() * jet.area()), 1.0); } else { @@ -472,8 +469,8 @@ struct Jetchargedv2Task { } } } else if (nmode == 3) { - Double_t phiMinusPsi3; - float evtPl3 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); + double phiMinusPsi3; + float evtPl3 = helperEP.GetEventPlane(collision.qvecRe()[detInd], collision.qvecIm()[detInd], nmode); for (auto const& jet : jets) { if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; @@ -483,7 +480,7 @@ struct Jetchargedv2Task { } phiMinusPsi3 = jet.phi() - evtPl3; - if ((phiMinusPsi3 < TMath::Pi() / 4) || (phiMinusPsi3 >= 7 * TMath::Pi() / 4) || (phiMinusPsi3 >= 3 * TMath::Pi() / 4 && phiMinusPsi3 < 5 * TMath::Pi() / 4)) { + if ((phiMinusPsi3 < o2::constants::math::PI / 4) || (phiMinusPsi3 >= 7 * o2::constants::math::PI / 4) || (phiMinusPsi3 >= 3 * o2::constants::math::PI / 4 && phiMinusPsi3 < 5 * o2::constants::math::PI / 4)) { registry.fill(HIST("h_jet_pt_in_plane_v3"), jet.pt() - (collision.rho() * jet.area()), 1.0); registry.fill(HIST("h2_centrality_jet_pt_in_plane_v3"), collision.centrality(), jet.pt() - (collision.rho() * jet.area()), 1.0); } else { @@ -494,7 +491,7 @@ struct Jetchargedv2Task { } } } - PROCESS_SWITCH(Jetchargedv2Task, processInOutJetV2, "Jet V2 in and out of plane", true); + PROCESS_SWITCH(jetchargedv2Task, processInOutJetV2, "Jet V2 in and out of plane", true); void processSigmaPt(soa::Filtered>::iterator const& collision, soa::Join const& jets, @@ -510,7 +507,7 @@ struct Jetchargedv2Task { double leadingJetPt = -1; double leadingJetPhi = -1; double leadingJetEta = -1; - for (auto& jet : jets) { + for (const auto& jet : jets) { if (jet.pt() > leadingJetPt) { leadingJetPt = jet.pt(); leadingJetEta = jet.eta(); @@ -519,45 +516,45 @@ struct Jetchargedv2Task { } fillLeadingJetQA(leadingJetPt, leadingJetPhi, leadingJetEta); - int NTrk = 0; + int nTrk = 0; if (jets.size() > 0) { for (auto const& track : tracks) { - if (jetderiveddatautilities::selectTrack(track, trackSelection) && (fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { + if (jetderiveddatautilities::selectTrack(track, trackSelection) && (std::fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { registry.fill(HIST("h_accept_Track"), 2.5); - NTrk += 1; + nTrk += 1; } } - registry.fill(HIST("h_evtnum_NTrk"), evtnum, NTrk); + registry.fill(HIST("h_evtnum_NTrk"), evtnum, nTrk); } - TH1F* h_ptsum_sumpt_fit = new TH1F("h_ptsum_sumpt_fit", "h_ptsum_sumpt fit use", TMath::CeilNint(TMath::Sqrt(NTrk)), 0., TMath::TwoPi()); + TH1F* hPtsumSumptFit = new TH1F("h_ptsum_sumpt_fit", "h_ptsum_sumpt fit use", TMath::CeilNint(std::sqrt(nTrk)), 0., o2::constants::math::PI * 2); - if (NTrk < NTrackCut) { + if (nTrk < nTrackCut) { return; } if (jets.size() > 0) { for (auto const& trackfit : tracks) { registry.fill(HIST("h_accept_Track"), 0.5); - if (jetderiveddatautilities::selectTrack(trackfit, trackSelection) && (fabs(trackfit.eta() - leadingJetEta) > jetRadius) && trackfit.pt() >= 0.2 && trackfit.pt() <= 5.) { + if (jetderiveddatautilities::selectTrack(trackfit, trackSelection) && (std::fabs(trackfit.eta() - leadingJetEta) > jetRadius) && trackfit.pt() >= 0.2 && trackfit.pt() <= 5.) { registry.fill(HIST("h_accept_Track_Fit"), 0.5); - FitTrack += 1; + fitTrack += 1; } } for (auto const& track : tracks) { registry.fill(HIST("h_accept_Track"), 1.5); - if (jetderiveddatautilities::selectTrack(track, trackSelection) && (fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { - AccptTrack += 1; + if (jetderiveddatautilities::selectTrack(track, trackSelection) && (std::fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { + accptTrack += 1; registry.fill(HIST("h_accept_Track"), 2.5); - h_ptsum_sumpt_fit->Fill(track.phi(), track.pt()); + hPtsumSumptFit->Fill(track.phi(), track.pt()); registry.fill(HIST("h2_phi_track_pt"), track.pt(), track.phi()); registry.fill(HIST("h2_phi_track_eta"), track.eta(), track.phi()); registry.fill(HIST("h_ptsum_sumpt"), track.phi(), track.pt()); registry.fill(HIST("h2_centrality_phi_w_pt"), collision.centrality(), track.phi(), track.pt()); registry.fill(HIST("h2_evtnum_phi_w_pt"), evtnum, track.phi(), track.pt()); registry.fill(HIST("Thn_evtnum_phi_centrality"), evtnum, track.phi(), collision.centrality()); - registry.fill(HIST("h_accept_Track_init"), AccptTrack); + registry.fill(HIST("h_accept_Track_init"), accptTrack); registry.fill(HIST("h_accept_Track_Fit"), 1.5); } } @@ -568,44 +565,44 @@ struct Jetchargedv2Task { double ep3 = 0.; for (uint i = 0; i < cfgnMods->size(); i++) { int nmode = cfgnMods->at(i); - int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + int detInd = detId * 4 + cfgnTotalSystem * 4 * (nmode - 2); if (nmode == 2) { - if (collision.qvecAmp()[DetId] > 1e-8) { - ep2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode); + if (collision.qvecAmp()[detId] > 1e-8) { + ep2 = helperEP.GetEventPlane(collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], nmode); } } else if (nmode == 3) { - if (collision.qvecAmp()[DetId] > 1e-8) { - ep3 = helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode); + if (collision.qvecAmp()[detId] > 1e-8) { + ep3 = helperEP.GetEventPlane(collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], nmode); } } } - TF1* fFitModulation_v2v3 = 0x0; - const char* fitFunction_v2v3 = "[0] * (1. + 2. * ([1] * TMath::Cos(2. * (x - [2])) + [3] * TMath::Cos(3. * (x - [4]))))"; - fFitModulation_v2v3 = new TF1("fit_kV3", fitFunction_v2v3, 0, TMath::TwoPi()); + TF1* fFitModulationV2v3 = 0x0; + const char* fitFunction_V2v3 = "[0] * (1. + 2. * ([1] * TMath::Cos(2. * (x - [2])) + [3] * TMath::Cos(3. * (x - [4]))))"; + fFitModulationV2v3 = new TF1("fit_kV3", fitFunction_V2v3, 0, o2::constants::math::PI * 2); //=========================< set parameter >=========================// - fFitModulation_v2v3->SetParameter(0, 1.); - fFitModulation_v2v3->SetParameter(1, 0.01); - fFitModulation_v2v3->SetParameter(3, 0.01); + fFitModulationV2v3->SetParameter(0, 1.); + fFitModulationV2v3->SetParameter(1, 0.01); + fFitModulationV2v3->SetParameter(3, 0.01); if (ep2 < 0) { - fFitModulation_v2v3->FixParameter(2, ep2 + TMath::TwoPi()); + fFitModulationV2v3->FixParameter(2, RecoDecay::constrainAngle(ep2 + o2::constants::math::PI * 2)); //MARK } else { - fFitModulation_v2v3->FixParameter(2, ep2); + fFitModulationV2v3->FixParameter(2, ep2); } if (ep3 < 0) { - fFitModulation_v2v3->FixParameter(4, ep3 + TMath::TwoPi()); + fFitModulationV2v3->FixParameter(4, RecoDecay::constrainAngle(ep3 + o2::constants::math::PI * 2)); } else { - fFitModulation_v2v3->FixParameter(4, ep3); + fFitModulationV2v3->FixParameter(4, ep3); } - h_ptsum_sumpt_fit->Fit(fFitModulation_v2v3, "V+", "ep", 0, TMath::TwoPi()); + hPtsumSumptFit->Fit(fFitModulationV2v3, "V+", "ep", 0, o2::constants::math::PI * 2); - Double_t temppara[5]; - temppara[0] = fFitModulation_v2v3->GetParameter(0); - temppara[1] = fFitModulation_v2v3->GetParameter(1); - temppara[2] = fFitModulation_v2v3->GetParameter(2); - temppara[3] = fFitModulation_v2v3->GetParameter(3); - temppara[4] = fFitModulation_v2v3->GetParameter(4); + double temppara[5]; + temppara[0] = fFitModulationV2v3->GetParameter(0); + temppara[1] = fFitModulationV2v3->GetParameter(1); + temppara[2] = fFitModulationV2v3->GetParameter(2); + temppara[3] = fFitModulationV2v3->GetParameter(3); + temppara[4] = fFitModulationV2v3->GetParameter(4); for (int i = 1; i <= 5; i++) { registry.fill(HIST("h2_evt_fitpara"), evtnum, i - 0.5, temppara[i - 1]); } @@ -613,58 +610,58 @@ struct Jetchargedv2Task { registry.fill(HIST("h_v3obs_centrality"), collision.centrality(), temppara[3]); for (auto const& jet : jets) { - if ((fabs(jet.eta() - leadingJetEta) > jetRadius) && jet.pt() >= 0.2 && jet.pt() <= 5.) { - registry.fill(HIST("h2_centrality_rhophi"), collision.centrality(), fFitModulation_v2v3->Eval(jet.phi()), 1.0); + if ((std::fabs(jet.eta() - leadingJetEta) > jetRadius) && jet.pt() >= 0.2 && jet.pt() <= 5.) { + registry.fill(HIST("h2_centrality_rhophi"), collision.centrality(), fFitModulationV2v3->Eval(jet.phi()), 1.0); } } registry.fill(HIST("h_evtnum_centrlity"), evtnum, collision.centrality()); - Int_t NDF = 1; - Int_t numOfFreePara = 2; - NDF = (Int_t)fFitModulation_v2v3->GetXaxis()->GetNbins() - numOfFreePara; - if (NDF == 0 || static_cast(NDF) <= 0.) + int nDF = 1; + int numOfFreePara = 2; + nDF = (int)fFitModulationV2v3->GetXaxis()->GetNbins() - numOfFreePara; + if (nDF == 0 || static_cast(nDF) <= 0.) return; double chi2 = 0.; - for (int i = 0; i < h_ptsum_sumpt_fit->GetXaxis()->GetNbins(); i++) { - if (h_ptsum_sumpt_fit->GetBinContent(i + 1) <= 0.) + for (int i = 0; i < hPtsumSumptFit->GetXaxis()->GetNbins(); i++) { + if (hPtsumSumptFit->GetBinContent(i + 1) <= 0.) continue; - chi2 += TMath::Power((h_ptsum_sumpt_fit->GetBinContent(i + 1) - fFitModulation_v2v3->Eval(h_ptsum_sumpt_fit->GetXaxis()->GetBinCenter(1 + i))), 2) / h_ptsum_sumpt_fit->GetBinContent(i + 1); + chi2 += std::pow((hPtsumSumptFit->GetBinContent(i + 1) - fFitModulationV2v3->Eval(hPtsumSumptFit->GetXaxis()->GetBinCenter(1 + i))), 2) / hPtsumSumptFit->GetBinContent(i + 1); } - double ChiSqr = 999.; - double CDF = 1.; - double CDFROOT = 1.; + double chiSqr = 999.; + double cDF = 1.; + + + chiSqr = chi2; + cDF = 1. - chiSquareCDF(nDF, chiSqr); - ChiSqr = chi2; - CDF = 1. - ChiSquareCDF(NDF, ChiSqr); - CDFROOT = 1. - ChiSquareCDF(NDF, fFitModulation_v2v3->GetChisquare()); - registry.fill(HIST("h_PvalueCDF_CombinFit"), CDF); - registry.fill(HIST("h2_PvalueCDFCent_CombinFit"), collision.centrality(), CDF); - registry.fill(HIST("h2_Chi2Cent_CombinFit"), collision.centrality(), ChiSqr / (static_cast(NDF))); - registry.fill(HIST("h2_PChi2_CombinFit"), CDF, ChiSqr / (static_cast(NDF))); + registry.fill(HIST("h_PvalueCDF_CombinFit"), cDF); + registry.fill(HIST("h2_PvalueCDFCent_CombinFit"), collision.centrality(), cDF); + registry.fill(HIST("h2_Chi2Cent_CombinFit"), collision.centrality(), chiSqr / (static_cast(nDF))); + registry.fill(HIST("h2_PChi2_CombinFit"), cDF, chiSqr / (static_cast(nDF))); double evtcent = collision.centrality(); if (evtcent >= 0 && evtcent <= 5) { - registry.fill(HIST("h2_PChi2_CombinFitA"), CDF, ChiSqr / (static_cast(NDF))); + registry.fill(HIST("h2_PChi2_CombinFitA"), cDF, chiSqr / (static_cast(nDF))); } else if (evtcent >= 30 && evtcent <= 50) { - registry.fill(HIST("h2_PChi2_CombinFitB"), CDF, ChiSqr / (static_cast(NDF))); + registry.fill(HIST("h2_PChi2_CombinFitB"), cDF, chiSqr / (static_cast(nDF))); } for (uint i = 0; i < cfgnMods->size(); i++) { int nmode = cfgnMods->at(i); - int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + int detInd = detId * 4 + cfgnTotalSystem * 4 * (nmode - 2); for (auto const& jet : jets) { - double integralValue = fFitModulation_v2v3->Integral(jet.phi() - jetRadius, jet.phi() + jetRadius); + double integralValue = fFitModulationV2v3->Integral(jet.phi() - jetRadius, jet.phi() + jetRadius); double rholocal = collision.rho() / (2 * jetRadius * temppara[0]) * integralValue; registry.fill(HIST("h_jet_pt_rholocal"), jet.pt() - (rholocal * jet.area()), 1.0); if (nmode == 2) { - Double_t phiMinusPsi2; - if (collision.qvecAmp()[DetId] < 1e-8) { + double phiMinusPsi2; + if (collision.qvecAmp()[detId] < 1e-8) { continue; } - float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); + float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[detInd], collision.qvecIm()[detInd], nmode); if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } @@ -677,7 +674,7 @@ struct Jetchargedv2Task { } phiMinusPsi2 = jet.phi() - evtPl2; - if ((phiMinusPsi2 < TMath::Pi() / 4) || (phiMinusPsi2 >= 7 * TMath::Pi() / 4) || (phiMinusPsi2 >= 3 * TMath::Pi() / 4 && phiMinusPsi2 < 5 * TMath::Pi() / 4)) { + if ((phiMinusPsi2 < o2::constants::math::PI / 4) || (phiMinusPsi2 >= 7 * o2::constants::math::PI / 4) || (phiMinusPsi2 >= 3 * o2::constants::math::PI / 4 && phiMinusPsi2 < 5 * o2::constants::math::PI / 4)) { 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"), collision.centrality(), jet.pt() - (rholocal * jet.area()), 1.0); } else { @@ -686,8 +683,8 @@ struct Jetchargedv2Task { } } else if (nmode == 3) { - Double_t phiMinusPsi3; - float evtPl3 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); + double phiMinusPsi3; + float evtPl3 = helperEP.GetEventPlane(collision.qvecRe()[detInd], collision.qvecIm()[detInd], nmode); if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } @@ -696,7 +693,7 @@ struct Jetchargedv2Task { } phiMinusPsi3 = jet.phi() - evtPl3; - if ((phiMinusPsi3 < TMath::Pi() / 4) || (phiMinusPsi3 >= 7 * TMath::Pi() / 4) || (phiMinusPsi3 >= 3 * TMath::Pi() / 4 && phiMinusPsi3 < 5 * TMath::Pi() / 4)) { + if ((phiMinusPsi3 < o2::constants::math::PI / 4) || (phiMinusPsi3 >= 7 * o2::constants::math::PI / 4) || (phiMinusPsi3 >= 3 * o2::constants::math::PI / 4 && phiMinusPsi3 < 5 * o2::constants::math::PI / 4)) { registry.fill(HIST("h_jet_pt_in_plane_v3_rho"), jet.pt() - (rholocal * jet.area()), 1.0); registry.fill(HIST("h2_centrality_jet_pt_in_plane_v3_rho"), collision.centrality(), jet.pt() - (rholocal * jet.area()), 1.0); } else { @@ -710,26 +707,26 @@ struct Jetchargedv2Task { for (uint i = 0; i < cfgnMods->size(); i++) { TRandom3 randomNumber(0); float randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); - float randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI); + float randomConePhi = randomNumber.Uniform(0.0, o2::constants::math::TwoPI); float randomConePt = 0; int nmode = cfgnMods->at(i); - int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + int detInd = detId * 4 + cfgnTotalSystem * 4 * (nmode - 2); - Double_t RcPhiPsi2; - float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); - RcPhiPsi2 = randomConePhi - evtPl2; + double rcPhiPsi2; + float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[detInd], collision.qvecIm()[detInd], nmode); + rcPhiPsi2 = randomConePhi - evtPl2; for (auto const& jet : jets) { - registry.fill(HIST("h2_phi_rhophi"), jet.phi() - evtPl2, fFitModulation_v2v3->Eval(jet.phi()), 1.0); - registry.fill(HIST("h3_centrality_rhovsphi_phi"), collision.centrality(), fFitModulation_v2v3->Eval(jet.phi()), jet.phi() - evtPl2); + registry.fill(HIST("h2_phi_rhophi"), jet.phi() - evtPl2, fFitModulationV2v3->Eval(jet.phi()), 1.0); + registry.fill(HIST("h3_centrality_rhovsphi_phi"), collision.centrality(), fFitModulationV2v3->Eval(jet.phi()), jet.phi() - evtPl2); } for (auto const& track : tracks) { if (jetderiveddatautilities::selectTrack(track, trackSelection)) { - float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-M_PI)); + float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-o2::constants::math::PI)); float dEta = track.eta() - randomConeEta; - if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { randomConePt += track.pt(); } } @@ -740,29 +737,29 @@ struct Jetchargedv2Task { if (temppara[0] == 0) { break; } - integralValue = fFitModulation_v2v3->Integral(jet.phi() - jetRadius, jet.phi() + jetRadius); + integralValue = fFitModulationV2v3->Integral(jet.phi() - jetRadius, jet.phi() + jetRadius); rholocal = collision.rho() / (2 * jetRadius * temppara[0]) * integralValue; } // removing the leading jet from the random cone 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(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-M_PI)); + float dPhiLeadingJet = RecoDecay::constrainAngle(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-o2::constants::math::PI)); float dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta; bool jetWasInCone = false; - while (TMath::Sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < jets.iteratorAt(0).r() / 100.0 + randomConeR) { + while (std::sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < jets.iteratorAt(0).r() / 100.0 + randomConeR) { jetWasInCone = true; randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); - randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI); - dPhiLeadingJet = RecoDecay::constrainAngle(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-M_PI)); + randomConePhi = randomNumber.Uniform(0.0, o2::constants::math::TwoPI); + dPhiLeadingJet = RecoDecay::constrainAngle(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-o2::constants::math::PI)); dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta; } if (jetWasInCone) { randomConePt = 0.0; for (auto const& track : tracks) { if (jetderiveddatautilities::selectTrack(track, trackSelection)) { // if track selection is uniformTrack, dcaXY and dcaZ cuts need to be added as they aren't in the selection so that they can be studied here - float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-M_PI)); + float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-o2::constants::math::PI)); float dEta = track.eta() - randomConeEta; - if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { randomConePt += track.pt(); } } @@ -772,11 +769,11 @@ struct Jetchargedv2Task { if (temppara[0] == 0) { break; } - registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * rholocal, RcPhiPsi2, 1.0); + registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet"), collision.centrality(), randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocal, rcPhiPsi2, 1.0); } evtnum += 1; } - PROCESS_SWITCH(Jetchargedv2Task, processSigmaPt, "Sigma pT and bkg as fcn of phi", true); + PROCESS_SWITCH(jetchargedv2Task, processSigmaPt, "Sigma pT and bkg as fcn of phi", true); void processRandomConeDataV2(soa::Filtered>::iterator const& collision, soa::Join const& jets, @@ -792,55 +789,55 @@ struct Jetchargedv2Task { for (uint i = 0; i < cfgnMods->size(); i++) { TRandom3 randomNumber(0); float randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); - float randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI); + float randomConePhi = randomNumber.Uniform(0.0, o2::constants::math::TwoPI); float randomConePt = 0; int nmode = cfgnMods->at(i); - int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + int detInd = detId * 4 + cfgnTotalSystem * 4 * (nmode - 2); - Double_t RcPhiPsi2; - float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); - RcPhiPsi2 = randomConePhi - evtPl2; + double rcPhiPsi2; + float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[detInd], collision.qvecIm()[detInd], nmode); + rcPhiPsi2 = randomConePhi - evtPl2; for (auto const& track : tracks) { if (jetderiveddatautilities::selectTrack(track, trackSelection)) { - float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-M_PI)); + float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-o2::constants::math::PI)); float dEta = track.eta() - randomConeEta; - if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { randomConePt += track.pt(); } } } // removing the leading jet from the random cone 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(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-M_PI)); + float dPhiLeadingJet = RecoDecay::constrainAngle(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-o2::constants::math::PI)); float dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta; bool jetWasInCone = false; - while (TMath::Sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < jets.iteratorAt(0).r() / 100.0 + randomConeR) { + while (std::sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < jets.iteratorAt(0).r() / 100.0 + randomConeR) { jetWasInCone = true; randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); - randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI); - dPhiLeadingJet = RecoDecay::constrainAngle(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-M_PI)); + randomConePhi = randomNumber.Uniform(0.0, o2::constants::math::TwoPI); + dPhiLeadingJet = RecoDecay::constrainAngle(jets.iteratorAt(0).phi() - randomConePhi, static_cast(-o2::constants::math::PI)); dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta; } if (jetWasInCone) { randomConePt = 0.0; for (auto const& track : tracks) { if (jetderiveddatautilities::selectTrack(track, trackSelection)) { - float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-M_PI)); + float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast(-o2::constants::math::PI)); float dEta = track.eta() - randomConeEta; - if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { + if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) { randomConePt += track.pt(); } } } } } - registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho(), RcPhiPsi2, 1.0); + registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet"), collision.centrality(), randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho(), rcPhiPsi2, 1.0); } } - PROCESS_SWITCH(Jetchargedv2Task, processRandomConeDataV2, "QA for random cone estimation of background fluctuations in data", true); + PROCESS_SWITCH(jetchargedv2Task, processRandomConeDataV2, "QA for random cone estimation of background fluctuations in data", true); void processTracksQA(soa::Filtered>::iterator const& collision, soa::Filtered const& tracks) @@ -860,10 +857,10 @@ struct Jetchargedv2Task { registry.fill(HIST("h2_centrality_track_phi"), collision.centrality(), track.phi()); } } - PROCESS_SWITCH(Jetchargedv2Task, processTracksQA, "QA for charged tracks", true); + PROCESS_SWITCH(jetchargedv2Task, processTracksQA, "QA for charged tracks", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"jet-charged-v2"})}; + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"jetChargedV2"})}; } From 7ec71ad8e3b88aa1b148da9bca56a3a9260c8e74 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Wed, 15 Jan 2025 23:10:27 +0800 Subject: [PATCH 10/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 37 +----------------------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index 3a39594c991..5907548e414 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -245,11 +245,6 @@ struct jetchargedv2Task { registry.add("h_jet_pt_rhoareasubtracted", "jet pT rhoareasubtracted;#it{p}_{T,jet} (GeV/#it{c}); entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); registry.add("h_jet_pt_rholocal", "jet pT rholocal;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); - registry.add("h_recoil_jet_pt", "jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); - registry.add("h_recoil_jet_eta", "jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_recoil_jet_phi", "jet #phi;#phi_{jet};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); - registry.add("h_recoil_jet_dphi", "hadron-jet #Delta#phi;#Delta#phi_{jet,trigger hadron};entries", {HistType::kTH1F, {{40, -2.0, 2.0}}}); - registry.add("leadJetPt", "leadJet Pt ", {HistType::kTH1F, {{200, 0., 200.0}}}); registry.add("leadJetPhi", "leadJet constituent #phi ", {HistType::kTH1F, {{80, -1.0, 7.}}}); registry.add("leadJetEta", "leadJet constituent #eta ", {HistType::kTH1F, {{100, -1.0, 1.0}}}); @@ -347,36 +342,6 @@ struct jetchargedv2Task { return TMath::Gamma(nDF / 2., x / 2.); } - void processjetQA(soa::Filtered>::iterator const& collision, - soa::Join const& jets, - aod::JetTracks const& tracks) - { - if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { - return; - } - double leadingTrackpT = 0.0; - double leadingTrackPhi = 0.0; - for (auto const& track : tracks) { - if (track.pt() > 6.0 && track.pt() < 10.0) { - if (track.pt() > leadingTrackpT) { - leadingTrackpT = track.pt(); - leadingTrackPhi = track.phi(); - } - } - } - if (leadingTrackpT == 0.0) - return; - for (auto& jet : jets) { - if (TMath::Abs(RecoDecay::constrainAngle(RecoDecay::constrainAngle(jet.phi(), -o2::constants::math::PIHalf) - RecoDecay::constrainAngle(leadingTrackPhi, -o2::constants::math::PIHalf), -o2::constants::math::PIHalf) > 0.6)) { - registry.fill(HIST("h_recoil_jet_pt"), jet.pt()); - registry.fill(HIST("h_recoil_jet_eta"), jet.eta()); - registry.fill(HIST("h_recoil_jet_phi"), jet.phi()); - registry.fill(HIST("h_recoil_jet_dphi"), jet.phi() - leadingTrackPhi); - } - } - } - PROCESS_SWITCH(jetchargedv2Task, processjetQA, "jet rho v2 jet QA", true); - void processInOutJetV2(soa::Filtered>::iterator const& collision, soa::Join const& jets, aod::JetTracks const& tracks) @@ -618,7 +583,7 @@ struct jetchargedv2Task { int nDF = 1; int numOfFreePara = 2; - nDF = (int)fFitModulationV2v3->GetXaxis()->GetNbins() - numOfFreePara; + nDF = static_cast(fFitModulationV2v3->GetXaxis()->GetNbins()) - numOfFreePara; if (nDF == 0 || static_cast(nDF) <= 0.) return; double chi2 = 0.; From 2da6059f196d95e5c843f085dd8e186338e2206e Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Wed, 15 Jan 2025 23:13:55 +0800 Subject: [PATCH 11/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index 5907548e414..932425a5522 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -5,11 +5,14 @@ // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING". // +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +// +/// \author Yubiao Wang /// \file jetChargedV2.cxx /// \brief This file contains the implementation for the Charged Jet v2 analysis in the ALICE experiment. -/// -/// \author Yubiao Wang -/// \date 2025 + #include #include @@ -551,7 +554,7 @@ struct jetchargedv2Task { fFitModulationV2v3->SetParameter(3, 0.01); if (ep2 < 0) { - fFitModulationV2v3->FixParameter(2, RecoDecay::constrainAngle(ep2 + o2::constants::math::PI * 2)); //MARK + fFitModulationV2v3->FixParameter(2, RecoDecay::constrainAngle(ep2 + o2::constants::math::PI * 2)); } else { fFitModulationV2v3->FixParameter(2, ep2); } @@ -596,11 +599,9 @@ struct jetchargedv2Task { double chiSqr = 999.; double cDF = 1.; - chiSqr = chi2; cDF = 1. - chiSquareCDF(nDF, chiSqr); - registry.fill(HIST("h_PvalueCDF_CombinFit"), cDF); registry.fill(HIST("h2_PvalueCDFCent_CombinFit"), collision.centrality(), cDF); registry.fill(HIST("h2_Chi2Cent_CombinFit"), collision.centrality(), chiSqr / (static_cast(nDF))); From 710a318588c60eae83b166e8ed3ef6c71bdcf380 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Wed, 15 Jan 2025 23:39:47 +0800 Subject: [PATCH 12/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index 932425a5522..694dad42108 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -11,8 +11,7 @@ // /// \author Yubiao Wang /// \file jetChargedV2.cxx -/// \brief This file contains the implementation for the Charged Jet v2 analysis in the ALICE experiment. - +/// \brief This file contains the implementation for the Charged Jet v2 analysis in the ALICE experiment #include #include @@ -71,7 +70,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -struct jetchargedv2Task { +struct JetChargedV2 { HistogramRegistry registry; HistogramRegistry histosQA{"histosQA", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; @@ -459,7 +458,7 @@ struct jetchargedv2Task { } } } - PROCESS_SWITCH(jetchargedv2Task, processInOutJetV2, "Jet V2 in and out of plane", true); + PROCESS_SWITCH(JetChargedV2, processInOutJetV2, "Jet V2 in and out of plane", true); void processSigmaPt(soa::Filtered>::iterator const& collision, soa::Join const& jets, @@ -739,7 +738,7 @@ struct jetchargedv2Task { } evtnum += 1; } - PROCESS_SWITCH(jetchargedv2Task, processSigmaPt, "Sigma pT and bkg as fcn of phi", true); + PROCESS_SWITCH(JetChargedV2, processSigmaPt, "Sigma pT and bkg as fcn of phi", true); void processRandomConeDataV2(soa::Filtered>::iterator const& collision, soa::Join const& jets, @@ -803,7 +802,7 @@ struct jetchargedv2Task { registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet"), collision.centrality(), randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho(), rcPhiPsi2, 1.0); } } - PROCESS_SWITCH(jetchargedv2Task, processRandomConeDataV2, "QA for random cone estimation of background fluctuations in data", true); + PROCESS_SWITCH(JetChargedV2, processRandomConeDataV2, "QA for random cone estimation of background fluctuations in data", true); void processTracksQA(soa::Filtered>::iterator const& collision, soa::Filtered const& tracks) @@ -823,10 +822,10 @@ struct jetchargedv2Task { registry.fill(HIST("h2_centrality_track_phi"), collision.centrality(), track.phi()); } } - PROCESS_SWITCH(jetchargedv2Task, processTracksQA, "QA for charged tracks", true); + PROCESS_SWITCH(JetChargedV2, processTracksQA, "QA for charged tracks", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"jetChargedV2"})}; + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"jet-charged-v2"})}; } From f135cac18b02711793186e58a74bf1dd32664dda Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Thu, 16 Jan 2025 12:26:00 +0800 Subject: [PATCH 13/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 50 ++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index 694dad42108..ee468202340 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -98,7 +98,7 @@ struct JetChargedV2 { Configurable randomConeR{"randomConeR", 0.4, "size of random Cone for estimating background fluctuations"}; Configurable trackOccupancyInTimeRangeMax{"trackOccupancyInTimeRangeMax", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; Configurable trackOccupancyInTimeRangeMin{"trackOccupancyInTimeRangeMin", -999999, "minimum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; - Configurable nTrackCut{"numberTrackCut", 500, "Number of Track Cut"}; + Configurable numberTrackCut{"numberTrackCut", 500, "Number of Track Cut"}; //=====================< evt pln >=====================// Configurable cfgAddEvtSel{"cfgAddEvtSel", true, "event selection"}; Configurable> cfgnMods{"cfgnMods", {2}, "Modulation of interest"}; @@ -111,7 +111,7 @@ struct JetChargedV2 { ConfigurableAxis cfgaxisQvec{"cfgaxisQvec", {100, -3, 3}, ""}; ConfigurableAxis cfgaxisCent{"cfgaxisCent", {90, 0, 90}, ""}; - ConfigurableAxis cfgaxisVnCent{"VnCent", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 50, 70, 100}, " % "}; + ConfigurableAxis cfgaxisVnCent{"vnCent", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 50, 70, 100}, " % "}; ConfigurableAxis cfgaxisEvtfit{"cfgaxisEvtfit", {10000, 0, 10000}, ""}; EventPlaneHelper helperEP; @@ -209,11 +209,11 @@ struct JetChargedV2 { registry.add("h_accept_Track_Fit", "all and accept track;Track;entries", {HistType::kTH1F, {{10, 0.0, 10.0}}}); registry.add("h_ptsum_collnum", "ptsum collnum;collnum;entries", {HistType::kTH1F, {{40, 0.0, 40}}}); - registry.add("h_ptsum_sumpt", "jet sumpt;sum p_{T};entries", {HistType::kTH1F, {{40, 0., o2::constants::math::PI * 2}}}); - registry.add("h2_phi_track_eta", "phi vs track eta; #eta (GeV/#it{c}); #varphi", {HistType::kTH2F, {{100, -1.0, 1.0}, {40, 0., o2::constants::math::PI * 2}}}); - registry.add("h2_phi_track_pt", "phi vs track pT; #it{p}_{T,track} (GeV/#it{c}); #varphi", {HistType::kTH2F, {{200, 0., 200.}, {40, 0., o2::constants::math::PI * 2}}}); - registry.add("h2_centrality_phi_w_pt", "centrality vs jet #varphi; centrality; entries", {HistType::kTH2F, {{100, 0.0, 100.0}, {40, 0., o2::constants::math::PI * 2}}}); - registry.add("h2_evtnum_phi_w_pt", "eventNumber vs jet #varphi; #eventNumber; entries", {HistType::kTH2F, {{1000, 0.0, 1000}, {40, 0., o2::constants::math::PI * 2}}}); + registry.add("h_ptsum_sumpt", "jet sumpt;sum p_{T};entries", {HistType::kTH1F, {{40, 0., o2::constants::math::TwoPI}}}); + registry.add("h2_phi_track_eta", "phi vs track eta; #eta (GeV/#it{c}); #varphi", {HistType::kTH2F, {{100, -1.0, 1.0}, {40, 0., o2::constants::math::TwoPI}}}); + registry.add("h2_phi_track_pt", "phi vs track pT; #it{p}_{T,track} (GeV/#it{c}); #varphi", {HistType::kTH2F, {{200, 0., 200.}, {40, 0., o2::constants::math::TwoPI}}}); + registry.add("h2_centrality_phi_w_pt", "centrality vs jet #varphi; centrality; entries", {HistType::kTH2F, {{100, 0.0, 100.0}, {40, 0., o2::constants::math::TwoPI}}}); + registry.add("h2_evtnum_phi_w_pt", "eventNumber vs jet #varphi; #eventNumber; entries", {HistType::kTH2F, {{1000, 0.0, 1000}, {40, 0., o2::constants::math::TwoPI}}}); //< fit quality >// registry.add("h_PvalueCDF_CombinFit", "cDF #chi^{2}; entries", {HistType::kTH1F, {{50, 0, 1}}}); @@ -227,7 +227,7 @@ struct JetChargedV2 { registry.add("h_evtnum_centrlity", "eventNumber vs centrality ; #eventNumber", {HistType::kTH1F, {{1000, 0.0, 1000}}}); registry.add("h_evtnum_NTrk", "eventNumber vs Number of Track ; #eventNumber", {HistType::kTH1F, {{1000, 0.0, 1000}}}); - registry.add("Thn_evtnum_phi_centrality", "eventNumber vs jet #varphi; #eventNumber; entries", {HistType::kTHnSparseF, {{1000, 0.0, 1000}, {40, 0., o2::constants::math::PI * 2}, {100, 0.0, 100.0}}}); + registry.add("Thn_evtnum_phi_centrality", "eventNumber vs jet #varphi; #eventNumber; entries", {HistType::kTHnSparseF, {{1000, 0.0, 1000}, {40, 0., o2::constants::math::TwoPI}, {100, 0.0, 100.0}}}); registry.add("h2_evt_fitpara", "event vs fit parameter; evtnum; parameter", {HistType::kTH2F, {cfgaxisEvtfit, {5, 0., 5}}}); @@ -235,9 +235,9 @@ struct JetChargedV2 { registry.add("h_v3obs_centrality", "fitparameter v3obs vs centrality ; #centrality", {HistType::kTProfile, {cfgaxisVnCent}}); registry.add("h2_centrality_rhophi", "centrality vs #rho(#varphi); centrality; #rho(#varphi) ", {HistType::kTH2F, {{120, -10.0, 110.0}, {210, -10.0, 200.0}}}); - registry.add("h2_phi_rhophi", "#varphi vs #rho(#varphi); #varphi - #Psi_{EP,2}; #rho(#varphi) ", {HistType::kTH2F, {{40, 0., o2::constants::math::PI * 2}, {210, -10.0, 200.0}}}); + registry.add("h2_phi_rhophi", "#varphi vs #rho(#varphi); #varphi - #Psi_{EP,2}; #rho(#varphi) ", {HistType::kTH2F, {{40, 0., o2::constants::math::TwoPI}, {210, -10.0, 200.0}}}); - registry.add("h3_centrality_rhovsphi_phi", "centrality; #rho(#varphi); #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {200, 0.0, 200.0}, {40, 0., o2::constants::math::PI * 2}}}); + registry.add("h3_centrality_rhovsphi_phi", "centrality; #rho(#varphi); #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {200, 0.0, 200.0}, {40, 0., o2::constants::math::TwoPI}}}); //< \sigma p_T at local rho test plot | end > registry.add("h2_centrality_track_pt", "centrality vs track pT; centrality; #it{p}_{T,track} (GeV/#it{c})", {HistType::kTH2F, {{1200, -10.0, 110.0}, {200, 0., 200.}}}); @@ -252,8 +252,8 @@ struct JetChargedV2 { registry.add("leadJetEta", "leadJet constituent #eta ", {HistType::kTH1F, {{100, -1.0, 1.0}}}); //< RC test plots >// - registry.add("h3_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet", "centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho}; #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {800, -400.0, 400.0}, {160, 0., o2::constants::math::PI * 2}}}); - registry.add("h3_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet", "centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho}(#varphi); #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {800, -400.0, 400.0}, {160, 0., o2::constants::math::PI * 2}}}); + registry.add("h3_centrality_deltapT_RandomCornPhi_rhorandomconewithoutleadingjet", "centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho}; #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {800, -400.0, 400.0}, {160, 0., o2::constants::math::TwoPI}}}); + registry.add("h3_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet", "centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho}(#varphi); #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {800, -400.0, 400.0}, {160, 0., o2::constants::math::TwoPI}}}); //< bkg sub plot | end >// //< median rho >// @@ -374,7 +374,7 @@ struct JetChargedV2 { } } } - if (nTrk < nTrackCut) { + if (nTrk < numberTrackCut) { return; } //=====================< evt pln [n=2->\Psi_2, n=3->\Psi_3] >=====================// @@ -427,7 +427,7 @@ struct JetChargedV2 { } phiMinusPsi2 = jet.phi() - evtPl2; - if ((phiMinusPsi2 < o2::constants::math::PI / 4) || (phiMinusPsi2 >= 7 * o2::constants::math::PI / 4) || (phiMinusPsi2 >= 3 * o2::constants::math::PI / 4 && phiMinusPsi2 < 5 * o2::constants::math::PI / 4)) { + if ((phiMinusPsi2 < o2::constants::math::PIQuarter) || (phiMinusPsi2 >= 7 * o2::constants::math::PIQuarter) || (phiMinusPsi2 >= 3 * o2::constants::math::PIQuarter && phiMinusPsi2 < 5 * o2::constants::math::PIQuarter)) { 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"), collision.centrality(), jet.pt() - (collision.rho() * jet.area()), 1.0); } else { @@ -447,7 +447,7 @@ struct JetChargedV2 { } phiMinusPsi3 = jet.phi() - evtPl3; - if ((phiMinusPsi3 < o2::constants::math::PI / 4) || (phiMinusPsi3 >= 7 * o2::constants::math::PI / 4) || (phiMinusPsi3 >= 3 * o2::constants::math::PI / 4 && phiMinusPsi3 < 5 * o2::constants::math::PI / 4)) { + if ((phiMinusPsi3 < o2::constants::math::PIQuarter) || (phiMinusPsi3 >= 7 * o2::constants::math::PIQuarter) || (phiMinusPsi3 >= 3 * o2::constants::math::PIQuarter && phiMinusPsi3 < 5 * o2::constants::math::PIQuarter)) { registry.fill(HIST("h_jet_pt_in_plane_v3"), jet.pt() - (collision.rho() * jet.area()), 1.0); registry.fill(HIST("h2_centrality_jet_pt_in_plane_v3"), collision.centrality(), jet.pt() - (collision.rho() * jet.area()), 1.0); } else { @@ -494,9 +494,9 @@ struct JetChargedV2 { registry.fill(HIST("h_evtnum_NTrk"), evtnum, nTrk); } - TH1F* hPtsumSumptFit = new TH1F("h_ptsum_sumpt_fit", "h_ptsum_sumpt fit use", TMath::CeilNint(std::sqrt(nTrk)), 0., o2::constants::math::PI * 2); + TH1F* hPtsumSumptFit = new TH1F("h_ptsum_sumpt_fit", "h_ptsum_sumpt fit use", TMath::CeilNint(std::sqrt(nTrk)), 0., o2::constants::math::TwoPI); - if (nTrk < nTrackCut) { + if (nTrk < numberTrackCut) { return; } @@ -545,24 +545,24 @@ struct JetChargedV2 { } TF1* fFitModulationV2v3 = 0x0; - const char* fitFunction_V2v3 = "[0] * (1. + 2. * ([1] * TMath::Cos(2. * (x - [2])) + [3] * TMath::Cos(3. * (x - [4]))))"; - fFitModulationV2v3 = new TF1("fit_kV3", fitFunction_V2v3, 0, o2::constants::math::PI * 2); + const char* fitFunctionV2v3 = "[0] * (1. + 2. * ([1] * std::cos(2. * (x - [2])) + [3] * std::cos(3. * (x - [4]))))"; + fFitModulationV2v3 = new TF1("fit_kV3", fitFunctionV2v3, 0, o2::constants::math::TwoPI); //=========================< set parameter >=========================// fFitModulationV2v3->SetParameter(0, 1.); fFitModulationV2v3->SetParameter(1, 0.01); fFitModulationV2v3->SetParameter(3, 0.01); if (ep2 < 0) { - fFitModulationV2v3->FixParameter(2, RecoDecay::constrainAngle(ep2 + o2::constants::math::PI * 2)); + fFitModulationV2v3->FixParameter(2, RecoDecay::constrainAngle(ep2 + o2::constants::math::TwoPI)); } else { fFitModulationV2v3->FixParameter(2, ep2); } if (ep3 < 0) { - fFitModulationV2v3->FixParameter(4, RecoDecay::constrainAngle(ep3 + o2::constants::math::PI * 2)); + fFitModulationV2v3->FixParameter(4, RecoDecay::constrainAngle(ep3 + o2::constants::math::TwoPI)); } else { fFitModulationV2v3->FixParameter(4, ep3); } - hPtsumSumptFit->Fit(fFitModulationV2v3, "V+", "ep", 0, o2::constants::math::PI * 2); + hPtsumSumptFit->Fit(fFitModulationV2v3, "V+", "ep", 0, o2::constants::math::TwoPI); double temppara[5]; temppara[0] = fFitModulationV2v3->GetParameter(0); @@ -639,7 +639,7 @@ struct JetChargedV2 { } phiMinusPsi2 = jet.phi() - evtPl2; - if ((phiMinusPsi2 < o2::constants::math::PI / 4) || (phiMinusPsi2 >= 7 * o2::constants::math::PI / 4) || (phiMinusPsi2 >= 3 * o2::constants::math::PI / 4 && phiMinusPsi2 < 5 * o2::constants::math::PI / 4)) { + if ((phiMinusPsi2 < o2::constants::math::PIQuarter) || (phiMinusPsi2 >= 7 * o2::constants::math::PIQuarter) || (phiMinusPsi2 >= 3 * o2::constants::math::PIQuarter && phiMinusPsi2 < 5 * o2::constants::math::PIQuarter)) { 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"), collision.centrality(), jet.pt() - (rholocal * jet.area()), 1.0); } else { @@ -658,7 +658,7 @@ struct JetChargedV2 { } phiMinusPsi3 = jet.phi() - evtPl3; - if ((phiMinusPsi3 < o2::constants::math::PI / 4) || (phiMinusPsi3 >= 7 * o2::constants::math::PI / 4) || (phiMinusPsi3 >= 3 * o2::constants::math::PI / 4 && phiMinusPsi3 < 5 * o2::constants::math::PI / 4)) { + if ((phiMinusPsi3 < o2::constants::math::PIQuarter) || (phiMinusPsi3 >= 7 * o2::constants::math::PIQuarter) || (phiMinusPsi3 >= 3 * o2::constants::math::PIQuarter && phiMinusPsi3 < 5 * o2::constants::math::PIQuarter)) { registry.fill(HIST("h_jet_pt_in_plane_v3_rho"), jet.pt() - (rholocal * jet.area()), 1.0); registry.fill(HIST("h2_centrality_jet_pt_in_plane_v3_rho"), collision.centrality(), jet.pt() - (rholocal * jet.area()), 1.0); } else { @@ -827,5 +827,5 @@ struct JetChargedV2 { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"jet-charged-v2"})}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From ad7dc808bd41297863f536810bed5618f7931ab0 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Thu, 16 Jan 2025 13:42:16 +0800 Subject: [PATCH 14/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index ee468202340..217ca98c2ae 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -111,7 +111,7 @@ struct JetChargedV2 { ConfigurableAxis cfgaxisQvec{"cfgaxisQvec", {100, -3, 3}, ""}; ConfigurableAxis cfgaxisCent{"cfgaxisCent", {90, 0, 90}, ""}; - ConfigurableAxis cfgaxisVnCent{"vnCent", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 50, 70, 100}, " % "}; + ConfigurableAxis cfgAxisVnCent{"vnCent", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 50, 70, 100}, " % "}; ConfigurableAxis cfgaxisEvtfit{"cfgaxisEvtfit", {10000, 0, 10000}, ""}; EventPlaneHelper helperEP; @@ -231,8 +231,8 @@ struct JetChargedV2 { registry.add("h2_evt_fitpara", "event vs fit parameter; evtnum; parameter", {HistType::kTH2F, {cfgaxisEvtfit, {5, 0., 5}}}); - registry.add("h_v2obs_centrality", "fitparameter v2obs vs centrality ; #centrality", {HistType::kTProfile, {cfgaxisVnCent}}); - registry.add("h_v3obs_centrality", "fitparameter v3obs vs centrality ; #centrality", {HistType::kTProfile, {cfgaxisVnCent}}); + registry.add("h_v2obs_centrality", "fitparameter v2obs vs centrality ; #centrality", {HistType::kTProfile, {cfgAxisVnCent}}); + registry.add("h_v3obs_centrality", "fitparameter v3obs vs centrality ; #centrality", {HistType::kTProfile, {cfgAxisVnCent}}); registry.add("h2_centrality_rhophi", "centrality vs #rho(#varphi); centrality; #rho(#varphi) ", {HistType::kTH2F, {{120, -10.0, 110.0}, {210, -10.0, 200.0}}}); registry.add("h2_phi_rhophi", "#varphi vs #rho(#varphi); #varphi - #Psi_{EP,2}; #rho(#varphi) ", {HistType::kTH2F, {{40, 0., o2::constants::math::TwoPI}, {210, -10.0, 200.0}}}); @@ -553,12 +553,12 @@ struct JetChargedV2 { fFitModulationV2v3->SetParameter(3, 0.01); if (ep2 < 0) { - fFitModulationV2v3->FixParameter(2, RecoDecay::constrainAngle(ep2 + o2::constants::math::TwoPI)); + fFitModulationV2v3->FixParameter(2, ep2 + o2::constants::math::TwoPI); } else { fFitModulationV2v3->FixParameter(2, ep2); } if (ep3 < 0) { - fFitModulationV2v3->FixParameter(4, RecoDecay::constrainAngle(ep3 + o2::constants::math::TwoPI)); + fFitModulationV2v3->FixParameter(4, ep3 + o2::constants::math::TwoPI); } else { fFitModulationV2v3->FixParameter(4, ep3); } From b5decae8c07435a8a8aa7071dedfa0d683d17711 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Thu, 16 Jan 2025 18:56:20 +0800 Subject: [PATCH 15/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 61 +++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index 217ca98c2ae..dc8a8e71d24 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -98,7 +98,6 @@ struct JetChargedV2 { Configurable randomConeR{"randomConeR", 0.4, "size of random Cone for estimating background fluctuations"}; Configurable trackOccupancyInTimeRangeMax{"trackOccupancyInTimeRangeMax", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; Configurable trackOccupancyInTimeRangeMin{"trackOccupancyInTimeRangeMin", -999999, "minimum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; - Configurable numberTrackCut{"numberTrackCut", 500, "Number of Track Cut"}; //=====================< evt pln >=====================// Configurable cfgAddEvtSel{"cfgAddEvtSel", true, "event selection"}; Configurable> cfgnMods{"cfgnMods", {2}, "Modulation of interest"}; @@ -107,13 +106,13 @@ struct JetChargedV2 { Configurable cfgRefAName{"cfgRefAName", "TPCpos", "The name of detector for reference A"}; Configurable cfgRefBName{"cfgRefBName", "TPCneg", "The name of detector for reference B"}; - ConfigurableAxis cfgaxisQvecF{"cfgaxisQvecF", {300, -1, 1}, ""}; - ConfigurableAxis cfgaxisQvec{"cfgaxisQvec", {100, -3, 3}, ""}; - ConfigurableAxis cfgaxisCent{"cfgaxisCent", {90, 0, 90}, ""}; + ConfigurableAxis cfgAxisQvecF{"cfgAxisQvecF", {300, -1, 1}, ""}; + ConfigurableAxis cfgAxisQvec{"cfgAxisQvec", {100, -3, 3}, ""}; + ConfigurableAxis cfgAxisCent{"cfgAxisCent", {90, 0, 90}, ""}; ConfigurableAxis cfgAxisVnCent{"vnCent", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 50, 70, 100}, " % "}; - ConfigurableAxis cfgaxisEvtfit{"cfgaxisEvtfit", {10000, 0, 10000}, ""}; + ConfigurableAxis cfgAxisEvtfit{"cfgAxisEvtfit", {10000, 0, 10000}, ""}; EventPlaneHelper helperEP; int detId; int refAId; @@ -155,6 +154,7 @@ struct JetChargedV2 { double evtnum = 0; double accptTrack = 0; double fitTrack = 0; + TH1F* hPtsumSumptFit = nullptr; void init(o2::framework::InitContext&) { @@ -229,11 +229,17 @@ struct JetChargedV2 { registry.add("Thn_evtnum_phi_centrality", "eventNumber vs jet #varphi; #eventNumber; entries", {HistType::kTHnSparseF, {{1000, 0.0, 1000}, {40, 0., o2::constants::math::TwoPI}, {100, 0.0, 100.0}}}); - registry.add("h2_evt_fitpara", "event vs fit parameter; evtnum; parameter", {HistType::kTH2F, {cfgaxisEvtfit, {5, 0., 5}}}); + registry.add("h2_evt_fitpara", "event vs fit parameter; evtnum; parameter", {HistType::kTH2F, {cfgAxisEvtfit, {5, 0., 5}}}); registry.add("h_v2obs_centrality", "fitparameter v2obs vs centrality ; #centrality", {HistType::kTProfile, {cfgAxisVnCent}}); registry.add("h_v3obs_centrality", "fitparameter v3obs vs centrality ; #centrality", {HistType::kTProfile, {cfgAxisVnCent}}); + registry.add("h_fitparaRho_evtnum", "fitparameter #rho_{0} vs evtnum ; #eventnumber", {HistType::kTH1F, {{1000, 0.0, 1000}}}); + registry.add("h_fitparaPsi2_evtnum", "fitparameter #Psi_{2} vs evtnum ; #eventnumber", {HistType::kTH1F, {{1000, 0.0, 1000}}}); + registry.add("h_fitparaPsi3_evtnum", "fitparameter #Psi_{3} vs evtnum ; #eventnumber", {HistType::kTH1F, {{1000, 0.0, 1000}}}); + registry.add("h_fitparav2obs_evtnum", "fitparameter v2obs vs evtnum ; #eventnumber", {HistType::kTH1F, {{1000, 0.0, 1000}}}); + registry.add("h_fitparav3obs_evtnum", "fitparameter v3obs vs evtnum ; #eventnumber", {HistType::kTH1F, {{1000, 0.0, 1000}}}); + registry.add("h2_centrality_rhophi", "centrality vs #rho(#varphi); centrality; #rho(#varphi) ", {HistType::kTH2F, {{120, -10.0, 110.0}, {210, -10.0, 200.0}}}); registry.add("h2_phi_rhophi", "#varphi vs #rho(#varphi); #varphi - #Psi_{EP,2}; #rho(#varphi) ", {HistType::kTH2F, {{40, 0., o2::constants::math::TwoPI}, {210, -10.0, 200.0}}}); @@ -280,9 +286,9 @@ struct JetChargedV2 { registry.add("h2_centrality_jet_pt_out_of_plane_v3_rho", "centrality vs #it{p}^{out-of-plane}_{T,jet}; centrality; #it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{120, -10.0, 110.0}, jetPtAxisRhoAreaSub}}); //=====================< evt pln plot >=====================// - AxisSpec axisCent{cfgaxisCent, "centrality"}; - AxisSpec axisQvec{cfgaxisQvec, "Q"}; - AxisSpec axisQvecF{cfgaxisQvecF, "Q"}; + AxisSpec axisCent{cfgAxisCent, "centrality"}; + AxisSpec axisQvec{cfgAxisQvec, "Q"}; + AxisSpec axisQvecF{cfgAxisQvecF, "Q"}; AxisSpec axisEvtPl{360, -constants::math::PI, constants::math::PI}; @@ -298,7 +304,6 @@ struct JetChargedV2 { histosQA.add(Form("histEvtPlRectrV%d", cfgnMods->at(i)), "", {HistType::kTH2F, {axisEvtPl, axisCent}}); histosQA.add(Form("histEvtPlTwistV%d", cfgnMods->at(i)), "", {HistType::kTH2F, {axisEvtPl, axisCent}}); histosQA.add(Form("histEvtPlFinalV%d", cfgnMods->at(i)), "", {HistType::kTH2F, {axisEvtPl, axisCent}}); - histosQA.add(Form("histEvtPlFinalEvtNumV%d", cfgnMods->at(i)), "", {HistType::kTH1F, {{1000, 0, 1000}}}); } //=====================< evt pln plot | end >=====================// } @@ -374,9 +379,6 @@ struct JetChargedV2 { } } } - if (nTrk < numberTrackCut) { - return; - } //=====================< evt pln [n=2->\Psi_2, n=3->\Psi_3] >=====================// histosQA.fill(HIST("histCent"), collision.cent()); for (uint i = 0; i < cfgnMods->size(); i++) { @@ -393,7 +395,6 @@ struct JetChargedV2 { histosQA.fill(HIST("histEvtPlRectrV2"), helperEP.GetEventPlane(collision.qvecRe()[detInd + 1], collision.qvecIm()[detInd + 1], nmode), collision.cent()); histosQA.fill(HIST("histEvtPlTwistV2"), helperEP.GetEventPlane(collision.qvecRe()[detInd + 2], collision.qvecIm()[detInd + 2], nmode), collision.cent()); histosQA.fill(HIST("histEvtPlFinalV2"), helperEP.GetEventPlane(collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlFinalEvtNumV2"), evtnum, helperEP.GetEventPlane(collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], nmode)); } } else if (nmode == 3) { histosQA.fill(HIST("histQvecUncorV3"), collision.qvecRe()[detInd], collision.qvecIm()[detInd], collision.cent()); @@ -405,7 +406,6 @@ struct JetChargedV2 { histosQA.fill(HIST("histEvtPlRectrV3"), helperEP.GetEventPlane(collision.qvecRe()[detInd + 1], collision.qvecIm()[detInd + 1], nmode), collision.cent()); histosQA.fill(HIST("histEvtPlTwistV3"), helperEP.GetEventPlane(collision.qvecRe()[detInd + 2], collision.qvecIm()[detInd + 2], nmode), collision.cent()); histosQA.fill(HIST("histEvtPlFinalV3"), helperEP.GetEventPlane(collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlFinalEvtNumV3"), evtnum, helperEP.GetEventPlane(collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], nmode)); } if (nmode == 2) { @@ -494,11 +494,7 @@ struct JetChargedV2 { registry.fill(HIST("h_evtnum_NTrk"), evtnum, nTrk); } - TH1F* hPtsumSumptFit = new TH1F("h_ptsum_sumpt_fit", "h_ptsum_sumpt fit use", TMath::CeilNint(std::sqrt(nTrk)), 0., o2::constants::math::TwoPI); - - if (nTrk < numberTrackCut) { - return; - } + hPtsumSumptFit = new TH1F("h_ptsum_sumpt_fit", "h_ptsum_sumpt fit use", TMath::CeilNint(std::sqrt(nTrk)), 0., o2::constants::math::TwoPI); if (jets.size() > 0) { for (auto const& trackfit : tracks) { @@ -552,15 +548,21 @@ struct JetChargedV2 { fFitModulationV2v3->SetParameter(1, 0.01); fFitModulationV2v3->SetParameter(3, 0.01); - if (ep2 < 0) { - fFitModulationV2v3->FixParameter(2, ep2 + o2::constants::math::TwoPI); + double ep2fix = 0.; + double ep3fix = 0.; + ep2fix = RecoDecay::constrainAngle(ep2); + ep3fix = RecoDecay::constrainAngle(ep3); + if (ep2fix < 0) { + double ep2para = ep2 + o2::constants::math::TwoPI; + fFitModulationV2v3->FixParameter(2, ep2para); } else { - fFitModulationV2v3->FixParameter(2, ep2); + fFitModulationV2v3->FixParameter(2, ep2fix); } - if (ep3 < 0) { - fFitModulationV2v3->FixParameter(4, ep3 + o2::constants::math::TwoPI); + if (ep3fix < 0) { + double ep3para = ep3 + o2::constants::math::TwoPI; + fFitModulationV2v3->FixParameter(4, ep3para); } else { - fFitModulationV2v3->FixParameter(4, ep3); + fFitModulationV2v3->FixParameter(4, ep3fix); } hPtsumSumptFit->Fit(fFitModulationV2v3, "V+", "ep", 0, o2::constants::math::TwoPI); @@ -573,6 +575,13 @@ struct JetChargedV2 { for (int i = 1; i <= 5; i++) { registry.fill(HIST("h2_evt_fitpara"), evtnum, i - 0.5, temppara[i - 1]); } + + registry.fill(HIST("h_fitparaRho_evtnum"), evtnum, temppara[0]); + registry.fill(HIST("h_fitparav2obs_evtnum"), evtnum, temppara[1]); + registry.fill(HIST("h_fitparaPsi2_evtnum"), evtnum, temppara[2]); + registry.fill(HIST("h_fitparav3obs_evtnum"), evtnum, temppara[3]); + registry.fill(HIST("h_fitparaPsi3_evtnum"), evtnum, temppara[4]); + registry.fill(HIST("h_v2obs_centrality"), collision.centrality(), temppara[1]); registry.fill(HIST("h_v3obs_centrality"), collision.centrality(), temppara[3]); From c32e5828a213b2eb90b3f97ae2938170f301df1e Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Thu, 16 Jan 2025 20:23:50 +0800 Subject: [PATCH 16/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index dc8a8e71d24..e60717a7525 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -110,7 +110,7 @@ struct JetChargedV2 { ConfigurableAxis cfgAxisQvec{"cfgAxisQvec", {100, -3, 3}, ""}; ConfigurableAxis cfgAxisCent{"cfgAxisCent", {90, 0, 90}, ""}; - ConfigurableAxis cfgAxisVnCent{"vnCent", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 50, 70, 100}, " % "}; + ConfigurableAxis cfgAxisVnCent{"cfgAxisVnCent", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 50, 70, 100}, " % "}; ConfigurableAxis cfgAxisEvtfit{"cfgAxisEvtfit", {10000, 0, 10000}, ""}; EventPlaneHelper helperEP; @@ -337,6 +337,14 @@ struct JetChargedV2 { return true; } + void constrainToZeroToTwoPi(double angle) + { + angle = RecoDecay::constrainAngle(angle); + if (angle < 0) { + angle += o2::constants::math::TwoPI; + } + } + void fillLeadingJetQA(double leadingJetPt, double leadingJetPhi, double leadingJetEta) { registry.fill(HIST("leadJetPt"), leadingJetPt); @@ -548,22 +556,12 @@ struct JetChargedV2 { fFitModulationV2v3->SetParameter(1, 0.01); fFitModulationV2v3->SetParameter(3, 0.01); - double ep2fix = 0.; - double ep3fix = 0.; - ep2fix = RecoDecay::constrainAngle(ep2); - ep3fix = RecoDecay::constrainAngle(ep3); - if (ep2fix < 0) { - double ep2para = ep2 + o2::constants::math::TwoPI; - fFitModulationV2v3->FixParameter(2, ep2para); - } else { - fFitModulationV2v3->FixParameter(2, ep2fix); - } - if (ep3fix < 0) { - double ep3para = ep3 + o2::constants::math::TwoPI; - fFitModulationV2v3->FixParameter(4, ep3para); - } else { - fFitModulationV2v3->FixParameter(4, ep3fix); - } + constrainToZeroToTwoPi(ep2); + constrainToZeroToTwoPi(ep3); + + fFitModulationV2v3->FixParameter(2, ep2); + fFitModulationV2v3->FixParameter(4, ep3); + hPtsumSumptFit->Fit(fFitModulationV2v3, "V+", "ep", 0, o2::constants::math::TwoPI); double temppara[5]; From 3a0970e42ee86c722cf8abdedaf615ed8e40ed5b Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Thu, 16 Jan 2025 21:11:27 +0800 Subject: [PATCH 17/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index e60717a7525..819b5960d8d 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -337,14 +337,6 @@ struct JetChargedV2 { return true; } - void constrainToZeroToTwoPi(double angle) - { - angle = RecoDecay::constrainAngle(angle); - if (angle < 0) { - angle += o2::constants::math::TwoPI; - } - } - void fillLeadingJetQA(double leadingJetPt, double leadingJetPhi, double leadingJetEta) { registry.fill(HIST("leadJetPt"), leadingJetPt); @@ -556,11 +548,21 @@ struct JetChargedV2 { fFitModulationV2v3->SetParameter(1, 0.01); fFitModulationV2v3->SetParameter(3, 0.01); - constrainToZeroToTwoPi(ep2); - constrainToZeroToTwoPi(ep3); + double ep2fix = 0.; + double ep3fix = 0.; - fFitModulationV2v3->FixParameter(2, ep2); - fFitModulationV2v3->FixParameter(4, ep3); + if (ep2 < 0) { + ep2fix = RecoDecay::constrainAngle(ep2); + fFitModulationV2v3->FixParameter(2, ep2fix); + } else { + fFitModulationV2v3->FixParameter(2, ep2); + } + if (ep3 < 0) { + ep3fix = RecoDecay::constrainAngle(ep3); + fFitModulationV2v3->FixParameter(4, ep3fix); + } else { + fFitModulationV2v3->FixParameter(4, ep3); + } hPtsumSumptFit->Fit(fFitModulationV2v3, "V+", "ep", 0, o2::constants::math::TwoPI); From edce4294efe90bb9a886610b290ada52dd498775 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Thu, 16 Jan 2025 22:48:01 +0800 Subject: [PATCH 18/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index 819b5960d8d..10de47da163 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -745,6 +745,7 @@ struct JetChargedV2 { } registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet"), collision.centrality(), randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocal, rcPhiPsi2, 1.0); } + hPtsumSumptFit->Reset(); evtnum += 1; } PROCESS_SWITCH(JetChargedV2, processSigmaPt, "Sigma pT and bkg as fcn of phi", true); From 8641428ecbc45d65fab88ae2debb03f82103260a Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Fri, 17 Jan 2025 15:52:19 +0800 Subject: [PATCH 19/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index 10de47da163..d75eaf56971 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -371,7 +371,6 @@ struct JetChargedV2 { } } - int nTrk = 0; if (jets.size() > 0) { for (auto const& track : tracks) { if (jetderiveddatautilities::selectTrack(track, trackSelection) && (std::fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { From 56cc00c01fc0ec5f39770e2d757100b2aaf29979 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Fri, 17 Jan 2025 16:13:14 +0800 Subject: [PATCH 20/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index d75eaf56971..f077128ccaa 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -374,7 +374,6 @@ struct JetChargedV2 { if (jets.size() > 0) { for (auto const& track : tracks) { if (jetderiveddatautilities::selectTrack(track, trackSelection) && (std::fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { - nTrk += 1; } } } From 3d6bfc7e5a11bf5792b8932cd094194f38183420 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Fri, 17 Jan 2025 16:20:47 +0800 Subject: [PATCH 21/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index f077128ccaa..dceae55745a 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -370,13 +370,6 @@ struct JetChargedV2 { leadingJetEta = jet.eta(); } } - - if (jets.size() > 0) { - for (auto const& track : tracks) { - if (jetderiveddatautilities::selectTrack(track, trackSelection) && (std::fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { - } - } - } //=====================< evt pln [n=2->\Psi_2, n=3->\Psi_3] >=====================// histosQA.fill(HIST("histCent"), collision.cent()); for (uint i = 0; i < cfgnMods->size(); i++) { From c228936883d019799c114be3f873edec77600cdb Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Fri, 17 Jan 2025 16:46:56 +0800 Subject: [PATCH 22/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index dceae55745a..a3bada434e7 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -350,8 +350,7 @@ struct JetChargedV2 { } void processInOutJetV2(soa::Filtered>::iterator const& collision, - soa::Join const& jets, - aod::JetTracks const& tracks) + soa::Join const& jets) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -359,17 +358,6 @@ struct JetChargedV2 { if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; } - - double leadingJetPt = -1; - double leadingJetEta = -1; - - // auto collJets = jets.sliceBy(jetsPerJCollision, collision.globalIndex()); - for (const auto& jet : jets) { - if (jet.pt() > leadingJetPt) { - leadingJetPt = jet.pt(); - leadingJetEta = jet.eta(); - } - } //=====================< evt pln [n=2->\Psi_2, n=3->\Psi_3] >=====================// histosQA.fill(HIST("histCent"), collision.cent()); for (uint i = 0; i < cfgnMods->size(); i++) { From a0a587b4471ba4ec257bb02687ec3422f1acc90d Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Fri, 17 Jan 2025 22:20:06 +0800 Subject: [PATCH 23/25] Add files via upload --- PWGJE/Tasks/CMakeLists.txt | 20 +-- PWGJE/Tasks/jetChargedV2EPTable.cxx | 225 ++++++++++++++++++++++++++++ 2 files changed, 229 insertions(+), 16 deletions(-) create mode 100644 PWGJE/Tasks/jetChargedV2EPTable.cxx diff --git a/PWGJE/Tasks/CMakeLists.txt b/PWGJE/Tasks/CMakeLists.txt index 8f916dcca34..1a48bc2e489 100644 --- a/PWGJE/Tasks/CMakeLists.txt +++ b/PWGJE/Tasks/CMakeLists.txt @@ -34,10 +34,6 @@ o2physics_add_dpl_workflow(emc-tmmonitor SOURCES emcTmMonitor.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(hadron-photon-correlation - SOURCES hadronPhotonCorrelation.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(mc-generator-studies SOURCES mcGeneratorStudies.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore @@ -48,10 +44,6 @@ o2physics_add_dpl_workflow(photon-isolation-qa COMPONENT_NAME Analysis) if(FastJet_FOUND) - o2physics_add_dpl_workflow(jet-background-analysis - SOURCES jetBackgroundAnalysis.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore - COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-substructure SOURCES jetSubstructure.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore @@ -112,6 +104,10 @@ o2physics_add_dpl_workflow(jet-substructure-bplus SOURCES jetChargedV2.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-charged-v2ept + SOURCES jetChargedV2EPTable.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-d0-qa SOURCES jetFinderD0QA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore @@ -136,10 +132,6 @@ o2physics_add_dpl_workflow(jet-substructure-bplus SOURCES jetFinderV0QA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(jet-spectra-charged - SOURCES jetSpectraCharged.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore - COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(trigger-correlations SOURCES triggerCorrelations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::PWGJECore O2Physics::AnalysisCore @@ -180,10 +172,6 @@ o2physics_add_dpl_workflow(jet-substructure-bplus SOURCES jetHadronRecoil.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(recoil-jets - SOURCES recoilJets.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore - COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-nsubjettiness SOURCES nsubjettiness.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore diff --git a/PWGJE/Tasks/jetChargedV2EPTable.cxx b/PWGJE/Tasks/jetChargedV2EPTable.cxx new file mode 100644 index 00000000000..df9c4a8862b --- /dev/null +++ b/PWGJE/Tasks/jetChargedV2EPTable.cxx @@ -0,0 +1,225 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet v2 task +/// \author Yubiao Wang +// C++/ROOT includes. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// o2Physics includes. + +#include "CCDB/BasicCCDBManager.h" +#include "DataFormatsParameters/GRPMagField.h" + +#include "Framework/runDataProcessing.h" + +#include "Common/DataModel/FT0Corrected.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/Centrality.h" +#include "Common/CCDB/ctpRateFetcher.h" + +//< evt pln .h >// +#include "Framework/ASoAHelpers.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/StaticFor.h" + +#include "Common/DataModel/Qvectors.h" +#include "Common/Core/EventPlaneHelper.h" +//< evt pln .h | end >// + +// o2 includes. +#include "DetectorsCommonDataFormats/AlignParam.h" + +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/HistogramRegistry.h" + +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "PWGJE/Core/FastJetUtilities.h" +#include "PWGJE/Core/JetFinder.h" +#include "PWGJE/Core/JetFindingUtilities.h" +#include "PWGJE/DataModel/Jet.h" + +#include "PWGJE/Core/JetDerivedDataUtilities.h" +#include "EventFiltering/filterTables.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +namespace o2::aod +{ +DECLARE_SOA_TABLE(MyCollisions, "AOD", "MYCOLLISION", //! vertex information of collision + o2::soa::Index<>, collision::PosZ); +using MyCollision = MyCollisions::iterator; + + namespace myTable + { + DECLARE_SOA_INDEX_COLUMN(MyCollision, mycollision); + + DECLARE_SOA_COLUMN(Psi2, psi2, Float_t); + DECLARE_SOA_COLUMN(Psi3, psi3, Float_t); + DECLARE_SOA_COLUMN(EvtPlRes, evtplres, Float_t); + } + DECLARE_SOA_TABLE(MyTable, "AOD", "MYTABLE", o2::soa::Index<>, + myTable::Psi2, + myTable::Psi3, + myTable::EvtPlRes); +} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +struct jetChargedV2EPTable { + Produces myTable; + Produces outputCollisions; + + HistogramRegistry registry; + + + Configurable eventSelections{"eventSelections", "sel8", "choose event selection"}; + Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; + + Configurable vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"}; + Configurable centralityMin{"centralityMin", -999.0, "minimum centrality"}; + Configurable centralityMax{"centralityMax", 999.0, "maximum centrality"}; + Configurable trackPtMin{"trackPtMin", 0.15, "minimum pT acceptance for tracks"}; + Configurable trackPtMax{"trackPtMax", 1000., "maximum pT acceptance for tracks"}; + Configurable trackEtaMin{"trackEtaMin", -0.9, "minimum eta acceptance for tracks"}; + Configurable trackEtaMax{"trackEtaMax", 0.9, "maximum eta acceptance for tracks"}; + + Configurable jetAreaFractionMin{"jetAreaFractionMin", -99.0, "used to make a cut on the jet areas"}; + Configurable leadingConstituentPtMin{"leadingConstituentPtMin", -99.0, "minimum pT selection on jet constituent"}; + Configurable jetPtMin{"jetPtMin", 0.15, "minimum pT acceptance for jets"}; + Configurable jetPtMax{"jetPtMax", 200.0, "maximum pT acceptance for jets"}; + + Configurable trackOccupancyInTimeRangeMax{"trackOccupancyInTimeRangeMax", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; + Configurable trackOccupancyInTimeRangeMin{"trackOccupancyInTimeRangeMin", -999999, "minimum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; + + //=====================< evt pln >=====================// + Configurable cfgAddEvtSel{"cfgAddEvtSel", true, "event selection"}; + Configurable> cfgnMods{"cfgnMods", {2}, "Modulation of interest"}; + Configurable cfgnTotalSystem{"cfgnTotalSystem", 7, "total qvect 56 or number"}; + Configurable cfgDetName{"cfgDetName", "FT0M", "The name of detector to be analyzed"}; + Configurable cfgRefAName{"cfgRefAName", "TPCpos", "The name of detector for reference A"}; + Configurable cfgRefBName{"cfgRefBName", "TPCneg", "The name of detector for reference B"}; + + EventPlaneHelper helperEP; + int DetId; + int RefAId; + int RefBId; + + template + int GetDetId(const T& name) + { + if (name.value == "BPos" || name.value == "BNeg" || name.value == "BTot") { + LOGF(warning, "Using deprecated label: %s. Please use TPCpos, TPCneg, TPCall instead.", name.value); + } + if (name.value == "FT0C") { + return 0; + } else if (name.value == "FT0A") { + return 1; + } else if (name.value == "FT0M") { + return 2; + } else if (name.value == "FV0A") { + return 3; + } else if (name.value == "TPCpos" || name.value == "BPos") { + return 4; + } else if (name.value == "TPCneg" || name.value == "BNeg") { + return 5; + } else if (name.value == "TPCall" || name.value == "BTot") { + return 6; + } else { + return 0; + } + } + //=====================< evt pln | end >=====================// + + Configurable selectedJetsRadius{"selectedJetsRadius", 0.4, "resolution parameter for histograms without radius"}; + + std::vector jetPtBins; + std::vector jetPtBinsRhoAreaSub; + + int eventSelectiont = -1; + int trackSelectiont = -1; + + void init(o2::framework::InitContext&) + { + DetId = GetDetId(cfgDetName); + RefAId = GetDetId(cfgRefAName); + RefBId = GetDetId(cfgRefBName); + if (DetId == RefAId || DetId == RefBId || RefAId == RefBId) { + LOGF(info, "Wrong detector configuration \n The FT0C will be used to get Q-Vector \n The TPCpos and TPCneg will be used as reference systems"); + DetId = 0; + RefAId = 4; + RefBId = 5; + } + eventSelectiont = jetderiveddatautilities::initialiseEventSelection(static_cast(eventSelections)); + trackSelectiont = jetderiveddatautilities::initialiseTrackSelection(static_cast(trackSelections)); + } + + Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); + Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centrality >= centralityMin && aod::jcollision::centrality < centralityMax); + + void processJetV2Table(soa::Filtered>::iterator const& collision, + soa::Join const& jets, + aod::JetTracks const& tracks) + { + if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { + return; + } + if (!jetderiveddatautilities::selectCollision(collision, eventSelectiont)) { + return; + } + outputCollisions(collision.posZ()); + //=====================< evt pln [n=2->\Psi_2, n=3->\Psi_3] >=====================// + double ep2 = 0; + double ep3 = 0; + double res2 = 0; + + for (uint i = 0; i < cfgnMods->size(); i++) { + int nmode = cfgnMods->at(i); + int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + if (nmode == 2) { + if (collision.qvecAmp()[DetId] > 1e-8) { + ep2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode); + res2 = helperEP.GetResolution(helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), nmode); + } + } else if (nmode == 3) { + if (collision.qvecAmp()[DetId] > 1e-8) { + ep3 = helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode); + } + } + } + myTable(ep2, ep3, res2); + LOGF(info, "table producer Psi2 as %f, Psi3 as %f, Res2 as %f", ep2, ep3, res2); + } + PROCESS_SWITCH(jetChargedV2EPTable, processJetV2Table, "Jet V2 table for fit", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"jet-charged-v2ept"})}; +} From dc82dcbf6804a11c43fa94a3f2b37fe4ff151a48 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Sat, 18 Jan 2025 16:10:44 +0800 Subject: [PATCH 24/25] Update jetChargedV2.cxx --- PWGJE/Tasks/jetChargedV2.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index a3bada434e7..4ca6f03bfcc 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -543,7 +543,7 @@ struct JetChargedV2 { fFitModulationV2v3->FixParameter(4, ep3); } - hPtsumSumptFit->Fit(fFitModulationV2v3, "V+", "ep", 0, o2::constants::math::TwoPI); + hPtsumSumptFit->Fit(fFitModulationV2v3, "Q", "ep", 0, o2::constants::math::TwoPI); double temppara[5]; temppara[0] = fFitModulationV2v3->GetParameter(0); From 6a8778919080c867d9ceddadb9eb6d29499b2fe3 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Sat, 18 Jan 2025 08:17:47 +0000 Subject: [PATCH 25/25] Please consider the following formatting changes --- PWGJE/Tasks/jetChargedV2EPTable.cxx | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/PWGJE/Tasks/jetChargedV2EPTable.cxx b/PWGJE/Tasks/jetChargedV2EPTable.cxx index df9c4a8862b..f87cd2cb712 100644 --- a/PWGJE/Tasks/jetChargedV2EPTable.cxx +++ b/PWGJE/Tasks/jetChargedV2EPTable.cxx @@ -77,19 +77,19 @@ DECLARE_SOA_TABLE(MyCollisions, "AOD", "MYCOLLISION", //! vertex information of o2::soa::Index<>, collision::PosZ); using MyCollision = MyCollisions::iterator; - namespace myTable - { - DECLARE_SOA_INDEX_COLUMN(MyCollision, mycollision); - - DECLARE_SOA_COLUMN(Psi2, psi2, Float_t); - DECLARE_SOA_COLUMN(Psi3, psi3, Float_t); - DECLARE_SOA_COLUMN(EvtPlRes, evtplres, Float_t); - } - DECLARE_SOA_TABLE(MyTable, "AOD", "MYTABLE", o2::soa::Index<>, - myTable::Psi2, - myTable::Psi3, - myTable::EvtPlRes); -} +namespace myTable +{ +DECLARE_SOA_INDEX_COLUMN(MyCollision, mycollision); + +DECLARE_SOA_COLUMN(Psi2, psi2, Float_t); +DECLARE_SOA_COLUMN(Psi3, psi3, Float_t); +DECLARE_SOA_COLUMN(EvtPlRes, evtplres, Float_t); +} // namespace myTable +DECLARE_SOA_TABLE(MyTable, "AOD", "MYTABLE", o2::soa::Index<>, + myTable::Psi2, + myTable::Psi3, + myTable::EvtPlRes); +} // namespace o2::aod ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// struct jetChargedV2EPTable { @@ -98,7 +98,6 @@ struct jetChargedV2EPTable { HistogramRegistry registry; - Configurable eventSelections{"eventSelections", "sel8", "choose event selection"}; Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"};