From d40fa64da23afc369ce9fc3e7972701ce39bbbaf Mon Sep 17 00:00:00 2001 From: mvolkl <38325723+mvolkl@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:29:01 +0100 Subject: [PATCH 01/16] PWGHF: Added vertex distance selection to Lb selector task (#7514) * Added normalisation to Gaussian * Added PID and fixed MC parts * Fixed formatting * Added braces for linter * removed unused variable * Added selection on vertex to vertex distance --------- Co-authored-by: mvolkl --- PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx b/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx index 7ff5d21828d..d9b1872e83e 100644 --- a/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx @@ -50,6 +50,7 @@ struct HfCandidateSelectorLbToLcPi { Configurable impactParameterMaximum{"impactParameterMaximum", 0.2, "Maximum impact parameter for single tracks"}; Configurable maxDecayLengthError{"maxDecayLengthError", 0.015, "decay length error quality selection"}; Configurable maxDecayLengthXYError{"maxDecayLengthXYError", 0.01, "decay length xy error quality selection"}; + Configurable maxVertexDistanceLbLc{"maxVertexDistanceLbLc", 0.05, "maximum distance between Lb and Lc vertex"}; Configurable> cuts{"cuts", {hf_cuts_lb_to_lc_pi::cuts[0], hf_cuts_lb_to_lc_pi::nBinsPt, hf_cuts_lb_to_lc_pi::nCutVars, hf_cuts_lb_to_lc_pi::labelsPt, hf_cuts_lb_to_lc_pi::labelsCutVar}, "Lb0 candidate selection per pT bin"}; Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc+"}; @@ -142,6 +143,15 @@ struct HfCandidateSelectorLbToLcPi { return false; } + // distance between Lb and Lc decay + float diffXVert = hfCandLb.xSecondaryVertex() - hfCandLc.xSecondaryVertex(); + float diffYVert = hfCandLb.ySecondaryVertex() - hfCandLc.ySecondaryVertex(); + float diffZVert = hfCandLb.zSecondaryVertex() - hfCandLc.zSecondaryVertex(); + float vertexDistance = sqrt(diffXVert * diffXVert + diffYVert * diffYVert + diffZVert * diffZVert); + if (vertexDistance > maxVertexDistanceLbLc) { + return false; + } + return true; } From 0bb95102ee8293ac1e236106528c03e0d284fe59 Mon Sep 17 00:00:00 2001 From: yhambard <127940767+yhambard@users.noreply.github.com> Date: Fri, 30 Aug 2024 20:30:38 +0400 Subject: [PATCH 02/16] [PWGEM] phosElId mass spectra update (#7509) added a new workflow for constructing mass spectra of dielectrons where one of the candidate electrons if from PHOS readings --- PWGEM/Tasks/phosElId.cxx | 509 +++++++++++++++++++++++++-------------- 1 file changed, 328 insertions(+), 181 deletions(-) diff --git a/PWGEM/Tasks/phosElId.cxx b/PWGEM/Tasks/phosElId.cxx index eebd59d384a..2423992f953 100644 --- a/PWGEM/Tasks/phosElId.cxx +++ b/PWGEM/Tasks/phosElId.cxx @@ -56,8 +56,30 @@ using namespace o2::aod::evsel; using namespace o2::framework; using namespace o2::framework::expressions; +namespace o2::aod +{ +namespace PHOSMatch +{ +DECLARE_SOA_INDEX_COLUMN(Collision, collision); +DECLARE_SOA_INDEX_COLUMN(Track, track); +DECLARE_SOA_INDEX_COLUMN(CaloCluster, caloCluster); +DECLARE_SOA_COLUMN(SignalCharge, signalCharge, float); +DECLARE_SOA_COLUMN(SignalZ, signalZ, float); +DECLARE_SOA_COLUMN(SignalPx, signalPx, double); +DECLARE_SOA_COLUMN(SignalPy, signalPy, double); +DECLARE_SOA_COLUMN(SignalPz, signalPz, double); +DECLARE_SOA_COLUMN(SignalE, signalE, double); +} // namespace PHOSMatch + +DECLARE_SOA_TABLE(PHOSMatchindexTable, "AOD", "PHSMTCH", //! + o2::soa::Index<>, PHOSMatch::CollisionId, PHOSMatch::CaloClusterId, PHOSMatch::TrackId); //! + +} // namespace o2::aod + struct phosElId { + Produces phosMatch; + using SelCollisions = soa::Join; using myTracks = soa::Join; @@ -95,29 +117,37 @@ struct phosElId { Configurable> pMean_dx_neg_mod3{"pMean_dx_neg_mod3", {11.83, -0.17, 1.71}, "parameters for mean dx function on module 3 for negative tracks"}; Configurable> pMean_dx_neg_mod4{"pMean_dx_neg_mod4", {84.96, 0.79, 2.83}, "parameters for mean dx function on module 4 for negative tracks"}; - Configurable cfgEtaMax{"cfgEtaMax", {0.8f}, "Comma separated list of eta ranges"}; - Configurable cfgPtMin{"cfgPtMin", {0.2f}, "Comma separated list of pt min"}; - Configurable cfgPtMax{"cfgPtMax", {20.f}, "Comma separated list of pt max"}; - Configurable cfgDCAxyMax{"cfgDCAxyMax", {3.f}, "Comma separated list of dcaxy max"}; - Configurable cfgDCAzMax{"cfgDCAzMax", {3.f}, "Comma separated list of dcaz max"}; - Configurable cfgITSchi2Max{"cfgITSchi2Max", {5.f}, "Comma separated list of its chi2 max"}; - Configurable cfgITSnclsMin{"cfgITSnclsMin", {4.5f}, "Comma separated list of min number of ITS clusters"}; - Configurable cfgITSnclsMax{"cfgITSnclsMax", {7.5f}, "Comma separated list of max number of ITS clusters"}; - Configurable cfgTPCchi2Max{"cfgTPCchi2Max", {4.f}, "Comma separated list of tpc chi2 max"}; - Configurable cfgTPCnclsMin{"cfgTPCnclsMin", {90.f}, "Comma separated list of min number of TPC clusters"}; - Configurable cfgTPCnclsMax{"cfgTPCnclsMax", {170.f}, "Comma separated list of max number of TPC clusters"}; - Configurable cfgTPCnclsCRMin{"cfgTPCnclsCRMin", {80.f}, "Comma separated list of min number of TPC crossed rows"}; - Configurable cfgTPCnclsCRMax{"cfgTPCnclsCRMax", {161.f}, "Comma separated list of max number of TPC crossed rows"}; - Configurable cfgTPCNSigmaElMin{"cfgTPCNSigmaElMin", {-3.f}, "Comma separated list of min TPC nsigma e for inclusion"}; - Configurable cfgTPCNSigmaElMax{"cfgTPCNSigmaElMax", {2.f}, "Comma separated list of max TPC nsigma e for inclusion"}; - Configurable cfgTPCNSigmaPiMin{"cfgTPCNSigmaPiMin", {-3.f}, "Comma separated list of min TPC nsigma pion for exclusion"}; - Configurable cfgTPCNSigmaPiMax{"cfgTPCNSigmaPiMax", {3.5f}, "Comma separated list of max TPC nsigma pion for exclusion"}; - Configurable cfgTPCNSigmaPrMin{"cfgTPCNSigmaPrMin", {-3.f}, "Comma separated list of min TPC nsigma proton for exclusion"}; - Configurable cfgTPCNSigmaPrMax{"cfgTPCNSigmaPrMax", {4.f}, "Comma separated list of max TPC nsigma proton for exclusion"}; - Configurable cfgTPCNSigmaKaMin{"cfgTPCNSigmaKaMin", {-3.f}, "Comma separated list of min TPC nsigma kaon for exclusion"}; - Configurable cfgTPCNSigmaKaMax{"cfgTPCNSigmaKaMax", {4.f}, "Comma separated list of max TPC nsigma kaon for exclusion"}; - Configurable cfgTOFNSigmaElMin{"cfgTOFNSigmaElMin", {-3.f}, "Comma separated list of min TOF nsigma e for inclusion"}; - Configurable cfgTOFNSigmaElMax{"cfgTOFNSigmaElMax", {3.f}, "Comma separated list of max TOF nsigma e for inclusion"}; + Configurable cfgEtaMax{"cfgEtaMax", {0.8f}, "eta ranges"}; + Configurable cfgPtMin{"cfgPtMin", {0.2f}, "pt min"}; + Configurable cfgPtMax{"cfgPtMax", {20.f}, "pt max"}; + Configurable cfgDCAxyMax{"cfgDCAxyMax", {3.f}, "dcaxy max"}; + Configurable cfgDCAzMax{"cfgDCAzMax", {3.f}, "dcaz max"}; + Configurable cfgITSchi2Max{"cfgITSchi2Max", {5.f}, "its chi2 max"}; + Configurable cfgITSnclsMin{"cfgITSnclsMin", {4.5f}, "min number of ITS clusters"}; + Configurable cfgITSnclsMax{"cfgITSnclsMax", {7.5f}, "max number of ITS clusters"}; + Configurable cfgTPCchi2Max{"cfgTPCchi2Max", {4.f}, "tpc chi2 max"}; + Configurable cfgTPCnclsMin{"cfgTPCnclsMin", {90.f}, "min number of TPC clusters"}; + Configurable cfgTPCnclsMax{"cfgTPCnclsMax", {170.f}, "max number of TPC clusters"}; + Configurable cfgTPCnclsCRMin{"cfgTPCnclsCRMin", {80.f}, "min number of TPC crossed rows"}; + Configurable cfgTPCnclsCRMax{"cfgTPCnclsCRMax", {161.f}, "max number of TPC crossed rows"}; + Configurable cfgTPCNSigmaElMin{"cfgTPCNSigmaElMin", {-3.f}, "min TPC nsigma e for inclusion"}; + Configurable cfgTPCNSigmaElMax{"cfgTPCNSigmaElMax", {2.f}, "max TPC nsigma e for inclusion"}; + Configurable cfgTPCNSigmaPiMin{"cfgTPCNSigmaPiMin", {-3.f}, "min TPC nsigma pion for exclusion"}; + Configurable cfgTPCNSigmaPiMax{"cfgTPCNSigmaPiMax", {3.5f}, "max TPC nsigma pion for exclusion"}; + Configurable cfgTPCNSigmaPrMin{"cfgTPCNSigmaPrMin", {-3.f}, "min TPC nsigma proton for exclusion"}; + Configurable cfgTPCNSigmaPrMax{"cfgTPCNSigmaPrMax", {4.f}, "max TPC nsigma proton for exclusion"}; + Configurable cfgTPCNSigmaKaMin{"cfgTPCNSigmaKaMin", {-3.f}, "min TPC nsigma kaon for exclusion"}; + Configurable cfgTPCNSigmaKaMax{"cfgTPCNSigmaKaMax", {4.f}, "max TPC nsigma kaon for exclusion"}; + Configurable cfgTOFNSigmaElMin{"cfgTOFNSigmaElMin", {-3.f}, "min TOF nsigma e for inclusion"}; + Configurable cfgTOFNSigmaElMax{"cfgTOFNSigmaElMax", {3.f}, "max TOF nsigma e for inclusion"}; + + Filter ptFilter = (aod::track::pt > cfgPtMin) && (aod::track::pt < cfgPtMax); + Filter etafilter = nabs(aod::track::eta) < cfgEtaMax; + Filter dcaxyfilter = nabs(aod::track::dcaXY) < cfgDCAxyMax; + Filter dcazfilter = nabs(aod::track::dcaZ) < cfgDCAzMax; + Filter itschi2filter = aod::track::itsChi2NCl < cfgITSchi2Max; + Filter tpcchi2filter = aod::track::tpcChi2NCl < cfgTPCchi2Max; + Filter mapfilter = (aod::track::itsClusterMap & uint8_t(1)) > 0; Service ccdb; std::unique_ptr geomPHOS; @@ -176,7 +206,7 @@ struct phosElId { axisEta{200, -0.2, 0.2, "#eta"}, axisPhi{80, 240, 320, "#varphi"}, axisE{200, 0, 10, "E (GeV)", "E (GeV)"}, - // axisMassSpectrum{4000, 0, 4, "M (GeV/c^{2})", "Mass e^{+}e^{-} (GeV/c^{2})"}, + axisMassSpectrum{4000, 0, 4, "M (GeV/c^{2})", "Mass e^{+}e^{-} (GeV/c^{2})"}, axisEp{nBinsEp, mEpmin, mEpmax, "E/p", "E_{cluster}/p_{track}"}, axisdX{nBinsDeltaX, mDeltaXmin, mDeltaXmax, "x_{tr}-x_{clu} (cm)", "x_{tr}-x_{clu} (cm)"}, axisdZ{nBinsDeltaZ, mDeltaZmin, mDeltaZmax, "z_{tr}-z_{clu} (cm)", "z_{tr}-z_{clu} (cm)"}, @@ -187,10 +217,10 @@ struct phosElId { axisZ{150, -75., 75., "z (cm)", "z (cm)"}, axisDCATrackXY{400, -.1, .1, "DCA XY (cm)", "DCA XY (cm)"}, axisDCATrackZ{400, -.1, .1, "DCA Z (cm)", "DCA Z (cm)"}, - axisVColX{400, -.1, .1, "colision vertex x (cm)", "colision vertex x (cm)"}, // make 3 different histo + axisVColX{400, -.1, .1, "colision vertex x (cm)", "colision vertex x (cm)"}, axisVColY{400, -.1, .1, "colision vertex y (cm)", "colision vertex y (cm)"}, axisVColZ{400, -20., 20., "colision vertex z (cm)", "colision vertex z (cm)"}, // should look like gauss - axisVTrackX{400, -10., 10., "track vertex x (cm)", "track vertex x (cm)"}, // make 3 different histo + axisVTrackX{400, -10., 10., "track vertex x (cm)", "track vertex x (cm)"}, axisVTrackY{400, -10., 10., "track vertex y (cm)", "track vertex y (cm)"}, axisVTrackZ{400, -10., 10., "track vertex z (cm)", "track vertex z (cm)"}; @@ -218,36 +248,36 @@ struct phosElId { mHistManager.add("hCluE_ncells_mod", "Cluster energy spectrum per module", HistType::kTH3F, {axisE, axisCells, axisModes}); mHistManager.add("hCluXZ_mod", "Local cluster X Z per module", HistType::kTH3F, {axisX, axisZ, axisModes}); - mHistManager.add("hCluE_v_p_disp", "Cluster energy vs p | OK dispersion", HistType::kTH3F, {axisE, axisP, axisModes}); - mHistManager.add("hCluE_v_p_1sigma", "Cluster energy vs p within trackmatch 1sigma", HistType::kTH3F, {axisE, axisP, axisModes}); - mHistManager.add("hCluE_v_p_1sigma_disp", "Cluster energy vs p within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisE, axisP, axisModes}); - mHistManager.add("hCluE_v_p_2sigma", "Cluster energy vs p within trackmatch 2sigma", HistType::kTH3F, {axisE, axisP, axisModes}); - mHistManager.add("hCluE_v_p_2sigma_disp", "Cluster energy vs p within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisE, axisP, axisModes}); - - mHistManager.add("hEp_v_p_disp", "E/p ratio vs p | OK dispersion", HistType::kTH3F, {axisEp, axisP, axisModes}); - mHistManager.add("hEp_v_p_1sigma", "E/p ratio vs p within trackmatch 1sigma", HistType::kTH3F, {axisEp, axisP, axisModes}); - mHistManager.add("hEp_v_p_1sigma_disp", "E/p ratio vs p within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisEp, axisP, axisModes}); - mHistManager.add("hEp_v_p_2sigma", "E/p ratio vs p within trackmatch 2sigma", HistType::kTH3F, {axisEp, axisP, axisModes}); - mHistManager.add("hEp_v_p_2sigma_disp", "E/p ratio vs p within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisEp, axisP, axisModes}); - - mHistManager.add("hdZpmod", "dz,p_{tr},module", HistType::kTH3F, {axisdZ, axisP, axisModes}); - mHistManager.add("hdZpmod_pos", "dz,p_{tr},module positive tracks", HistType::kTH3F, {axisdZ, axisP, axisModes}); - mHistManager.add("hdZpmod_neg", "dz,p_{tr},module negative tracks", HistType::kTH3F, {axisdZ, axisP, axisModes}); - mHistManager.add("hdXpmod", "dx,p_{tr},module", HistType::kTH3F, {axisdX, axisP, axisModes}); - mHistManager.add("hdXpmod_pos", "dx,p_{tr},module positive tracks", HistType::kTH3F, {axisdX, axisP, axisModes}); - mHistManager.add("hdXpmod_neg", "dx,p_{tr},module negative tracks", HistType::kTH3F, {axisdX, axisP, axisModes}); - - mHistManager.add("hCluE_v_p_disp_TPC", "Cluster energy vs p | OK dispersion", HistType::kTH3F, {axisE, axisP, axisModes}); - mHistManager.add("hCluE_v_p_1sigma_TPC", "Cluster energy vs p within trackmatch 1sigma", HistType::kTH3F, {axisE, axisP, axisModes}); - mHistManager.add("hCluE_v_p_1sigma_disp_TPC", "Cluster energy vs p within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisE, axisP, axisModes}); - mHistManager.add("hCluE_v_p_2sigma_TPC", "Cluster energy vs p within trackmatch 2sigma", HistType::kTH3F, {axisE, axisP, axisModes}); - mHistManager.add("hCluE_v_p_2sigma_disp_TPC", "Cluster energy vs p within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisE, axisP, axisModes}); - - mHistManager.add("hEp_v_p_disp_TPC", "E/p ratio vs p | OK dispersion", HistType::kTH3F, {axisEp, axisP, axisModes}); - mHistManager.add("hEp_v_p_1sigma_TPC", "E/p ratio vs p within trackmatch 1sigma", HistType::kTH3F, {axisEp, axisP, axisModes}); - mHistManager.add("hEp_v_p_1sigma_disp_TPC", "E/p ratio vs p within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisEp, axisP, axisModes}); - mHistManager.add("hEp_v_p_2sigma_TPC", "E/p ratio vs p within trackmatch 2sigma", HistType::kTH3F, {axisEp, axisP, axisModes}); - mHistManager.add("hEp_v_p_2sigma_disp_TPC", "E/p ratio vs p within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisEp, axisP, axisModes}); + mHistManager.add("hCluE_v_pt_disp", "Cluster energy vs p | OK dispersion", HistType::kTH3F, {axisE, axisPt, axisModes}); + mHistManager.add("hCluE_v_pt_1sigma", "Cluster energy vs p within trackmatch 1sigma", HistType::kTH3F, {axisE, axisPt, axisModes}); + mHistManager.add("hCluE_v_pt_1sigma_disp", "Cluster energy vs p within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisE, axisPt, axisModes}); + mHistManager.add("hCluE_v_pt_2sigma", "Cluster energy vs p within trackmatch 2sigma", HistType::kTH3F, {axisE, axisPt, axisModes}); + mHistManager.add("hCluE_v_pt_2sigma_disp", "Cluster energy vs p within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisE, axisPt, axisModes}); + + mHistManager.add("hEp_v_pt_disp", "E/p ratio vs p | OK dispersion", HistType::kTH3F, {axisEp, axisPt, axisModes}); + mHistManager.add("hEp_v_pt_1sigma", "E/p ratio vs p within trackmatch 1sigma", HistType::kTH3F, {axisEp, axisPt, axisModes}); + mHistManager.add("hEp_v_pt_1sigma_disp", "E/p ratio vs p within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisEp, axisPt, axisModes}); + mHistManager.add("hEp_v_pt_2sigma", "E/p ratio vs p within trackmatch 2sigma", HistType::kTH3F, {axisEp, axisPt, axisModes}); + mHistManager.add("hEp_v_pt_2sigma_disp", "E/p ratio vs p within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisEp, axisPt, axisModes}); + + mHistManager.add("hdZpmod", "dz,p_{tr},module", HistType::kTH3F, {axisdZ, axisPt, axisModes}); + mHistManager.add("hdZpmod_pos", "dz,p_{tr},module positive tracks", HistType::kTH3F, {axisdZ, axisPt, axisModes}); + mHistManager.add("hdZpmod_neg", "dz,p_{tr},module negative tracks", HistType::kTH3F, {axisdZ, axisPt, axisModes}); + mHistManager.add("hdXpmod", "dx,p_{tr},module", HistType::kTH3F, {axisdX, axisPt, axisModes}); + mHistManager.add("hdXpmod_pos", "dx,p_{tr},module positive tracks", HistType::kTH3F, {axisdX, axisPt, axisModes}); + mHistManager.add("hdXpmod_neg", "dx,p_{tr},module negative tracks", HistType::kTH3F, {axisdX, axisPt, axisModes}); + + mHistManager.add("hCluE_v_pt_disp_TPC", "Cluster energy vs p | OK dispersion", HistType::kTH3F, {axisE, axisPt, axisModes}); + mHistManager.add("hCluE_v_pt_1sigma_TPC", "Cluster energy vs p within trackmatch 1sigma", HistType::kTH3F, {axisE, axisPt, axisModes}); + mHistManager.add("hCluE_v_pt_1sigma_disp_TPC", "Cluster energy vs p within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisE, axisPt, axisModes}); + mHistManager.add("hCluE_v_pt_2sigma_TPC", "Cluster energy vs p within trackmatch 2sigma", HistType::kTH3F, {axisE, axisPt, axisModes}); + mHistManager.add("hCluE_v_pt_2sigma_disp_TPC", "Cluster energy vs p within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisE, axisPt, axisModes}); + + mHistManager.add("hEp_v_pt_disp_TPC", "E/p ratio vs p | OK dispersion", HistType::kTH3F, {axisEp, axisPt, axisModes}); + mHistManager.add("hEp_v_pt_1sigma_TPC", "E/p ratio vs p within trackmatch 1sigma", HistType::kTH3F, {axisEp, axisPt, axisModes}); + mHistManager.add("hEp_v_pt_1sigma_disp_TPC", "E/p ratio vs p within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisEp, axisPt, axisModes}); + mHistManager.add("hEp_v_pt_2sigma_TPC", "E/p ratio vs p within trackmatch 2sigma", HistType::kTH3F, {axisEp, axisPt, axisModes}); + mHistManager.add("hEp_v_pt_2sigma_disp_TPC", "E/p ratio vs p within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisEp, axisPt, axisModes}); geomPHOS = std::make_unique("PHOS"); fSigma_dz = new TF1("fSigma_dz", "[0]/(x+[1])^[2]+pol1(3)", 0.3, 10); @@ -277,7 +307,7 @@ struct phosElId { } void process(soa::Join::iterator const& collision, aod::CaloClusters& clusters, - myTracks& tracks, + soa::Filtered& tracks, aod::BCsWithTimestamps const&) { auto bc = collision.bc_as(); @@ -350,7 +380,7 @@ struct phosElId { bool isPion = nsigmaTPCPi > cfgTPCNSigmaPiMin && nsigmaTPCPi < cfgTPCNSigmaPiMax; bool isKaon = nsigmaTPCKa > cfgTPCNSigmaKaMin && nsigmaTPCKa < cfgTPCNSigmaKaMax; bool isProton = nsigmaTPCPr > cfgTPCNSigmaPrMin && nsigmaTPCPr < cfgTPCNSigmaPrMax; - if (isElectron || !isPion || !isKaon || !isProton) + if (isElectron && !(isPion || isKaon || isProton)) isElectron = true; } @@ -383,42 +413,43 @@ struct phosElId { } if (isDispOK) { - mHistManager.fill(HIST("hCluE_v_p_disp"), cluE, trackPT, module); - mHistManager.fill(HIST("hEp_v_p_disp"), Ep, trackPT, module); + mHistManager.fill(HIST("hCluE_v_pt_disp"), cluE, trackPT, module); + mHistManager.fill(HIST("hEp_v_pt_disp"), Ep, trackPT, module); if (isElectron) { - mHistManager.fill(HIST("hCluE_v_p_disp_TPC"), cluE, trackPT, module); - mHistManager.fill(HIST("hEp_v_p_disp_TPC"), Ep, trackPT, module); + mHistManager.fill(HIST("hCluE_v_pt_disp_TPC"), cluE, trackPT, module); + mHistManager.fill(HIST("hEp_v_pt_disp_TPC"), Ep, trackPT, module); } } if (!isWithin2Sigma(module, trackPT, dZ, dX)) continue; - mHistManager.fill(HIST("hCluE_v_p_2sigma"), cluE, trackPT, module); - mHistManager.fill(HIST("hEp_v_p_2sigma"), Ep, trackPT, module); + mHistManager.fill(HIST("hCluE_v_pt_2sigma"), cluE, trackPT, module); + mHistManager.fill(HIST("hEp_v_pt_2sigma"), Ep, trackPT, module); if (isElectron) { - mHistManager.fill(HIST("hCluE_v_p_2sigma_TPC"), cluE, trackPT, module); - mHistManager.fill(HIST("hEp_v_p_2sigma_TPC"), Ep, trackPT, module); + mHistManager.fill(HIST("hCluE_v_pt_2sigma_TPC"), cluE, trackPT, module); + mHistManager.fill(HIST("hEp_v_pt_2sigma_TPC"), Ep, trackPT, module); } if (isDispOK) { - mHistManager.fill(HIST("hCluE_v_p_2sigma_disp"), cluE, trackPT, module); - mHistManager.fill(HIST("hEp_v_p_2sigma_disp"), Ep, trackPT, module); + mHistManager.fill(HIST("hCluE_v_pt_2sigma_disp"), cluE, trackPT, module); + mHistManager.fill(HIST("hEp_v_pt_2sigma_disp"), Ep, trackPT, module); if (isElectron) { - mHistManager.fill(HIST("hCluE_v_p_2sigma_disp_TPC"), cluE, trackPT, module); - mHistManager.fill(HIST("hEp_v_p_2sigma_disp_TPC"), Ep, trackPT, module); + mHistManager.fill(HIST("hCluE_v_pt_2sigma_disp_TPC"), cluE, trackPT, module); + mHistManager.fill(HIST("hEp_v_pt_2sigma_disp_TPC"), Ep, trackPT, module); } + phosMatch(collision.index(), clu.index(), track.index()); } if (isWithin1Sigma(module, trackPT, dZ, dX)) { - mHistManager.fill(HIST("hCluE_v_p_1sigma"), cluE, trackPT, module); - mHistManager.fill(HIST("hEp_v_p_1sigma"), Ep, trackPT, module); + mHistManager.fill(HIST("hCluE_v_pt_1sigma"), cluE, trackPT, module); + mHistManager.fill(HIST("hEp_v_pt_1sigma"), Ep, trackPT, module); if (isElectron) { - mHistManager.fill(HIST("hCluE_v_p_1sigma_TPC"), cluE, trackPT, module); - mHistManager.fill(HIST("hEp_v_p_1sigma_TPC"), Ep, trackPT, module); + mHistManager.fill(HIST("hCluE_v_pt_1sigma_TPC"), cluE, trackPT, module); + mHistManager.fill(HIST("hEp_v_pt_1sigma_TPC"), Ep, trackPT, module); } if (isDispOK) { - mHistManager.fill(HIST("hCluE_v_p_1sigma_disp"), cluE, trackPT, module); - mHistManager.fill(HIST("hEp_v_p_1sigma_disp"), Ep, trackPT, module); + mHistManager.fill(HIST("hCluE_v_pt_1sigma_disp"), cluE, trackPT, module); + mHistManager.fill(HIST("hEp_v_pt_1sigma_disp"), Ep, trackPT, module); if (isElectron) { - mHistManager.fill(HIST("hCluE_v_p_1sigma_disp_TPC"), cluE, trackPT, module); - mHistManager.fill(HIST("hEp_v_p_1sigma_disp_TPC"), Ep, trackPT, module); + mHistManager.fill(HIST("hCluE_v_pt_1sigma_disp_TPC"), cluE, trackPT, module); + mHistManager.fill(HIST("hEp_v_pt_1sigma_disp_TPC"), Ep, trackPT, module); } } } @@ -585,34 +616,202 @@ struct phosElId { } }; +struct massSpectra { + + using SelCollisions = soa::Join; + using myTracks = soa::Join; + + Configurable mEvSelTrig{"mEvSelTrig", kTVXinPHOS, "Select events with this trigger"}; + + Configurable cfgEtaMax{"cfgEtaMax", {0.8f}, "eta ranges"}; + Configurable cfgPtMin{"cfgPtMin", {0.2f}, "pt min"}; + Configurable cfgPtMax{"cfgPtMax", {20.f}, "pt max"}; + Configurable cfgDCAxyMax{"cfgDCAxyMax", {3.f}, "dcaxy max"}; + Configurable cfgDCAzMax{"cfgDCAzMax", {3.f}, "dcaz max"}; + Configurable cfgITSchi2Max{"cfgITSchi2Max", {5.f}, "its chi2 max"}; + Configurable cfgITSnclsMin{"cfgITSnclsMin", {4.5f}, "min number of ITS clusters"}; + Configurable cfgITSnclsMax{"cfgITSnclsMax", {7.5f}, "max number of ITS clusters"}; + Configurable cfgTPCchi2Max{"cfgTPCchi2Max", {4.f}, "tpc chi2 max"}; + Configurable cfgTPCnclsMin{"cfgTPCnclsMin", {90.f}, "min number of TPC clusters"}; + Configurable cfgTPCnclsMax{"cfgTPCnclsMax", {170.f}, "max number of TPC clusters"}; + Configurable cfgTPCnclsCRMin{"cfgTPCnclsCRMin", {80.f}, "min number of TPC crossed rows"}; + Configurable cfgTPCnclsCRMax{"cfgTPCnclsCRMax", {161.f}, "max number of TPC crossed rows"}; + + Configurable cfgTPCNSigmaElMin{"cfgTPCNSigmaElMin", {-3.f}, "min TPC nsigma e for inclusion"}; + Configurable cfgTPCNSigmaElMax{"cfgTPCNSigmaElMax", {2.f}, "max TPC nsigma e for inclusion"}; + Configurable cfgTPCNSigmaPiMin{"cfgTPCNSigmaPiMin", {-3.f}, "min TPC nsigma pion for exclusion"}; + Configurable cfgTPCNSigmaPiMax{"cfgTPCNSigmaPiMax", {3.5f}, "max TPC nsigma pion for exclusion"}; + Configurable cfgTPCNSigmaPrMin{"cfgTPCNSigmaPrMin", {-3.f}, "min TPC nsigma proton for exclusion"}; + Configurable cfgTPCNSigmaPrMax{"cfgTPCNSigmaPrMax", {4.f}, "max TPC nsigma proton for exclusion"}; + Configurable cfgTPCNSigmaKaMin{"cfgTPCNSigmaKaMin", {-3.f}, "min TPC nsigma kaon for exclusion"}; + Configurable cfgTPCNSigmaKaMax{"cfgTPCNSigmaKaMax", {4.f}, "max TPC nsigma kaon for exclusion"}; + Configurable cfgTOFNSigmaElMin{"cfgTOFNSigmaElMin", {-3.f}, "min TOF nsigma e for inclusion"}; + Configurable cfgTOFNSigmaElMax{"cfgTOFNSigmaElMax", {3.f}, "max TOF nsigma e for inclusion"}; + + Configurable> cfgEpSigmaPars{"cfgEpSigmaPars", {1.3e-02, 1.9e-02, 1.1e-02, 3.e-02}, "E/p sigma function parameters (from alice 3 mc tests + const)"}; + + Service ccdb; + std::unique_ptr geomPHOS; + double bz{0.}; // magnetic field + int runNumber{0}; + + HistogramRegistry mHistManager{"MassSpectraHistograms"}; + TF1* fEp_sigma_phos; + + void init(InitContext const&) + { + LOG(info) << "Initializing PHOS electron identification analysis task ..."; + + std::vector momentum_binning = {0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, + 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, + 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 10.}; + + const AxisSpec + axisCounter{1, 0, +1, ""}, + axisPt{momentum_binning, "p_{T} (GeV/c)"}, + axisMassSpectrum{4000, 0, 4, "M (GeV/c^{2})", "Mass e^{+}e^{-} (GeV/c^{2})"}; + + mHistManager.add("eventCounter", "eventCounter", kTH1F, {axisCounter}); + mHistManager.add("TVXinPHOSCounter", "TVXinPHOSCounter", kTH1F, {axisCounter}); + + mHistManager.add("h_eh_mass_spectra", "Mass e^{#pm}h^{#mp} vs momentum e^{#pm}h^{#mp}", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_ee_mass_spectra", "Mass e^{#pm}e^{#mp} vs momentum e^{#pm}e^{#mp}", HistType::kTH2F, {axisMassSpectrum, axisPt}); + + geomPHOS = std::make_unique("PHOS"); + + std::vector EpSigmaPars = cfgEpSigmaPars; + fEp_sigma_phos = new TF1("fEp_sigma_phos", "sqrt([0]*[0]/x/x+[1]*[1]/x+[2]*[2])+[3]", 0.01, 10); + fEp_sigma_phos->SetParameters(EpSigmaPars.at(0), EpSigmaPars.at(1), EpSigmaPars.at(2), EpSigmaPars.at(3)); + } + + void process(soa::Join::iterator const& collision, + aod::CaloClusters const& clusters, + myTracks const& tracks, + o2::aod::PHOSMatchindexTable const& matches, + aod::BCsWithTimestamps const&) + { + auto bc = collision.bc_as(); + if (runNumber != bc.runNumber()) { + LOG(info) << ">>>>>>>>>>>> Current run number: " << runNumber; + o2::parameters::GRPMagField* grpo = ccdb->getForTimeStamp("GLO/Config/GRPMagField", bc.timestamp()); + if (grpo == nullptr) { + LOGF(fatal, "Run 3 GRP object (type o2::parameters::GRPMagField) is not available in CCDB for run=%d at timestamp=%llu", bc.runNumber(), bc.timestamp()); + } + o2::base::Propagator::initFieldFromGRP(grpo); + bz = o2::base::Propagator::Instance()->getNominalBz(); + LOG(info) << ">>>>>>>>>>>> Magnetic field: " << bz; + runNumber = bc.runNumber(); + } + if (fabs(collision.posZ()) > 10.f) + return; + mHistManager.fill(HIST("eventCounter"), 0.5); + if (!collision.alias_bit(mEvSelTrig)) + return; + mHistManager.fill(HIST("TVXinPHOSCounter"), 0.5); + + if (clusters.size() == 0) + return; // Nothing to process + + for (auto const& TPCel : tracks) { + + if (!TPCel.has_collision() || fabs(TPCel.dcaXY()) > cfgDCAxyMax || fabs(TPCel.dcaZ()) > cfgDCAzMax || !TPCel.hasTPC() || fabs(TPCel.eta()) > 0.15) + continue; + if (TPCel.pt() < cfgPtMin || TPCel.pt() > cfgPtMax) + continue; + if (TPCel.itsChi2NCl() > cfgITSchi2Max) + continue; + if (TPCel.itsNCls() < cfgITSnclsMin || TPCel.itsNCls() > cfgITSnclsMax || !((TPCel.itsClusterMap() & uint8_t(1)) > 0)) + continue; + if (TPCel.tpcChi2NCl() > cfgTPCchi2Max) + continue; + if (TPCel.tpcNClsFound() < cfgTPCnclsMin || TPCel.tpcNClsFound() > cfgTPCnclsMax) + continue; + if (TPCel.tpcNClsCrossedRows() < cfgTPCnclsCRMin || TPCel.tpcNClsCrossedRows() > cfgTPCnclsCRMax) + continue; + + bool isElectron = false; + float nsigmaTPCEl = TPCel.tpcNSigmaEl(); + float nsigmaTOFEl = TPCel.tofNSigmaEl(); + bool isTPC_electron = nsigmaTPCEl > cfgTPCNSigmaElMin && nsigmaTPCEl < cfgTPCNSigmaElMax; + bool isTOF_electron = nsigmaTOFEl > cfgTOFNSigmaElMin && nsigmaTOFEl < cfgTOFNSigmaElMax; + isElectron = isTPC_electron || isTOF_electron; + + float nsigmaTPCPi = TPCel.tpcNSigmaPi(); + float nsigmaTPCKa = TPCel.tpcNSigmaKa(); + float nsigmaTPCPr = TPCel.tpcNSigmaPr(); + bool isPion = nsigmaTPCPi > cfgTPCNSigmaPiMin && nsigmaTPCPi < cfgTPCNSigmaPiMax; + bool isKaon = nsigmaTPCKa > cfgTPCNSigmaKaMin && nsigmaTPCKa < cfgTPCNSigmaKaMax; + bool isProton = nsigmaTPCPr > cfgTPCNSigmaPrMin && nsigmaTPCPr < cfgTPCNSigmaPrMax; + if (isElectron && !(isPion || isKaon || isProton)) + isElectron = true; + if (!isElectron) + continue; + + for (auto const& match : matches) { + auto clust2 = clusters.iteratorAt(match.caloClusterId()); + auto track2 = tracks.iteratorAt(match.trackId()); + + if (TPCel.collisionId() != track2.collisionId()) + continue; + if (TPCel.index() >= track2.index()) + break; + + if (TPCel.sign() == track2.sign()) + continue; + float mass_2tracks = 0, mom_2tracks = 0; + TLorentzVector P1, P2; + P1.SetPxPyPzE(TPCel.px(), TPCel.py(), TPCel.pz(), TPCel.energy(0)); + P2.SetPxPyPzE(track2.px(), track2.py(), track2.pz(), track2.energy(0)); + mom_2tracks = (P1 + P2).Pt(); + mass_2tracks = (P1 + P2).M(); + mHistManager.fill(HIST("h_eh_mass_spectra"), mass_2tracks, mom_2tracks); + + if (fabs(clust2.e() / track2.p() - 1) < 2 * fEp_sigma_phos->Eval(mom_2tracks)) { + mHistManager.fill(HIST("h_ee_mass_spectra"), mass_2tracks, mom_2tracks); + } + } + } // end of double loop + } +}; + struct tpcElIdMassSpectrum { using SelCollisions = soa::Join; using myTracks = soa::Join; - Configurable cfgEtaMax{"cfgEtaMax", {0.8f}, "Comma separated list of eta ranges"}; - Configurable cfgPtMin{"cfgPtMin", {0.2f}, "Comma separated list of pt min"}; - Configurable cfgPtMax{"cfgPtMax", {20.f}, "Comma separated list of pt max"}; - Configurable cfgDCAxyMax{"cfgDCAxyMax", {3.f}, "Comma separated list of dcaxy max"}; - Configurable cfgDCAzMax{"cfgDCAzMax", {3.f}, "Comma separated list of dcaz max"}; - Configurable cfgITSchi2Max{"cfgITSchi2Max", {5.f}, "Comma separated list of its chi2 max"}; - Configurable cfgITSnclsMin{"cfgITSnclsMin", {4.5f}, "Comma separated list of min number of ITS clusters"}; - Configurable cfgITSnclsMax{"cfgITSnclsMax", {7.5f}, "Comma separated list of max number of ITS clusters"}; - Configurable cfgTPCchi2Max{"cfgTPCchi2Max", {4.f}, "Comma separated list of tpc chi2 max"}; - Configurable cfgTPCnclsMin{"cfgTPCnclsMin", {90.f}, "Comma separated list of min number of TPC clusters"}; - Configurable cfgTPCnclsMax{"cfgTPCnclsMax", {170.f}, "Comma separated list of max number of TPC clusters"}; - Configurable cfgTPCnclsCRMin{"cfgTPCnclsCRMin", {80.f}, "Comma separated list of min number of TPC crossed rows"}; - Configurable cfgTPCnclsCRMax{"cfgTPCnclsCRMax", {161.f}, "Comma separated list of max number of TPC crossed rows"}; - Configurable cfgTPCNSigmaElMin{"cfgTPCNSigmaElMin", {-3.f}, "Comma separated list of min TPC nsigma e for inclusion"}; - Configurable cfgTPCNSigmaElMax{"cfgTPCNSigmaElMax", {2.f}, "Comma separated list of max TPC nsigma e for inclusion"}; - Configurable cfgTPCNSigmaPiMin{"cfgTPCNSigmaPiMin", {-3.f}, "Comma separated list of min TPC nsigma pion for exclusion"}; - Configurable cfgTPCNSigmaPiMax{"cfgTPCNSigmaPiMax", {3.5f}, "Comma separated list of max TPC nsigma pion for exclusion"}; - Configurable cfgTPCNSigmaPrMin{"cfgTPCNSigmaPrMin", {-3.f}, "Comma separated list of min TPC nsigma proton for exclusion"}; - Configurable cfgTPCNSigmaPrMax{"cfgTPCNSigmaPrMax", {4.f}, "Comma separated list of max TPC nsigma proton for exclusion"}; - Configurable cfgTPCNSigmaKaMin{"cfgTPCNSigmaKaMin", {-3.f}, "Comma separated list of min TPC nsigma kaon for exclusion"}; - Configurable cfgTPCNSigmaKaMax{"cfgTPCNSigmaKaMax", {4.f}, "Comma separated list of max TPC nsigma kaon for exclusion"}; - Configurable cfgTOFNSigmaElMin{"cfgTOFNSigmaElMin", {-3.f}, "Comma separated list of min TOF nsigma e for inclusion"}; - Configurable cfgTOFNSigmaElMax{"cfgTOFNSigmaElMax", {3.f}, "Comma separated list of max TOF nsigma e for inclusion"}; + Configurable cfgEtaMax{"cfgEtaMax", {0.8f}, "eta ranges"}; + Configurable cfgPtMin{"cfgPtMin", {0.2f}, "pt min"}; + Configurable cfgPtMax{"cfgPtMax", {20.f}, "pt max"}; + Configurable cfgDCAxyMax{"cfgDCAxyMax", {3.f}, "dcaxy max"}; + Configurable cfgDCAzMax{"cfgDCAzMax", {3.f}, "dcaz max"}; + Configurable cfgITSchi2Max{"cfgITSchi2Max", {5.f}, "its chi2 max"}; + Configurable cfgITSnclsMin{"cfgITSnclsMin", {4.5f}, "min number of ITS clusters"}; + Configurable cfgITSnclsMax{"cfgITSnclsMax", {7.5f}, "max number of ITS clusters"}; + Configurable cfgTPCchi2Max{"cfgTPCchi2Max", {4.f}, "tpc chi2 max"}; + Configurable cfgTPCnclsMin{"cfgTPCnclsMin", {90.f}, "min number of TPC clusters"}; + Configurable cfgTPCnclsMax{"cfgTPCnclsMax", {170.f}, "max number of TPC clusters"}; + Configurable cfgTPCnclsCRMin{"cfgTPCnclsCRMin", {80.f}, "min number of TPC crossed rows"}; + Configurable cfgTPCnclsCRMax{"cfgTPCnclsCRMax", {161.f}, "max number of TPC crossed rows"}; + Configurable cfgTPCNSigmaElMin{"cfgTPCNSigmaElMin", {-3.f}, "min TPC nsigma e for inclusion"}; + Configurable cfgTPCNSigmaElMax{"cfgTPCNSigmaElMax", {2.f}, "max TPC nsigma e for inclusion"}; + Configurable cfgTPCNSigmaPiMin{"cfgTPCNSigmaPiMin", {-3.f}, "min TPC nsigma pion for exclusion"}; + Configurable cfgTPCNSigmaPiMax{"cfgTPCNSigmaPiMax", {3.5f}, "max TPC nsigma pion for exclusion"}; + Configurable cfgTPCNSigmaPrMin{"cfgTPCNSigmaPrMin", {-3.f}, "min TPC nsigma proton for exclusion"}; + Configurable cfgTPCNSigmaPrMax{"cfgTPCNSigmaPrMax", {4.f}, "max TPC nsigma proton for exclusion"}; + Configurable cfgTPCNSigmaKaMin{"cfgTPCNSigmaKaMin", {-3.f}, "min TPC nsigma kaon for exclusion"}; + Configurable cfgTPCNSigmaKaMax{"cfgTPCNSigmaKaMax", {4.f}, "max TPC nsigma kaon for exclusion"}; + Configurable cfgTOFNSigmaElMin{"cfgTOFNSigmaElMin", {-3.f}, "min TOF nsigma e for inclusion"}; + Configurable cfgTOFNSigmaElMax{"cfgTOFNSigmaElMax", {3.f}, "max TOF nsigma e for inclusion"}; + + Filter ptFilter = (aod::track::pt > cfgPtMin) && (aod::track::pt < cfgPtMax); + Filter etafilter = nabs(aod::track::eta) < cfgEtaMax; + Filter dcaxyfilter = nabs(aod::track::dcaXY) < cfgDCAxyMax; + Filter dcazfilter = nabs(aod::track::dcaZ) < cfgDCAzMax; + + Filter tpcEl = ((aod::pidtpc::tpcNSigmaEl > cfgTPCNSigmaElMin) && (aod::pidtpc::tpcNSigmaEl < cfgTPCNSigmaElMax)) || ((aod::pidtof::tofNSigmaEl > cfgTOFNSigmaElMin) && (aod::pidtof::tofNSigmaEl < cfgTOFNSigmaElMax)); + Filter tpcPi_rej = (aod::pidtpc::tpcNSigmaPi < cfgTPCNSigmaPiMin) || (aod::pidtpc::tpcNSigmaPi > cfgTPCNSigmaPiMax); + Filter tpcKa_rej = (aod::pidtpc::tpcNSigmaKa < cfgTPCNSigmaKaMin) || (aod::pidtpc::tpcNSigmaKa > cfgTPCNSigmaPrMax); + Filter tpcPr_rej = (aod::pidtpc::tpcNSigmaPr < cfgTPCNSigmaPrMin) || (aod::pidtpc::tpcNSigmaPr > cfgTPCNSigmaPrMax); Service ccdb; std::unique_ptr geomPHOS; @@ -628,10 +827,7 @@ struct tpcElIdMassSpectrum { 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 10.}; const AxisSpec axisCounter{1, 0, +1, ""}, - axisVColX{400, -.5, .5, "colision vertex x (cm)", "colision vertex x (cm)"}, // make 3 different histo - axisVColY{400, -.5, .5, "colision vertex y (cm)", "colision vertex y (cm)"}, - axisVColZ{400, -20., 20., "colision vertex z (cm)", "colision vertex z (cm)"}, // should look like gauss - axisVTrackX{400, -5., 5., "track vertex x (cm)", "track vertex x (cm)"}, // make 3 different histo + axisVTrackX{400, -5., 5., "track vertex x (cm)", "track vertex x (cm)"}, axisVTrackY{400, -5., 5., "track vertex y (cm)", "track vertex y (cm)"}, axisVTrackZ{400, -20., 20., "track vertex z (cm)", "track vertex z (cm)"}, axisMassSpectrum{4000, 0, 4, "M (GeV/c^{2})", "Mass e^{+}e^{-} (GeV/c^{2})"}, @@ -641,13 +837,15 @@ struct tpcElIdMassSpectrum { axisEta{600, -3., 3., "#eta"}; mHistManager.add("eventCounter", "eventCounter", kTH1F, {axisCounter}); - - mHistManager.add("hTPCspectra_isElectron", "isElectron | TPC dE/dx spectra", HistType::kTH2F, {axisPt, axisTPC}); mHistManager.add("hTPCspectra_isElectronRej", "isElectron with rejection | TPC dE/dx spectra", HistType::kTH2F, {axisPt, axisTPC}); - mHistManager.add("h_TPCee_MS_mp", "Mass e^{#pm}e^{#mp} vs momentum e^{#pm}e^{#mp} (from TPC candidates) vs pt", HistType::kTH2F, {axisMassSpectrum, axisPt}); - mHistManager.add("h_TPCee_MS_mm", "Mass e^{-}e^{-} vs momentum e^{-}e^{-} (from TPC candidates) vs pt", HistType::kTH2F, {axisMassSpectrum, axisPt}); - mHistManager.add("h_TPCee_MS_pp", "Mass e^{+}e^{+} vs momentum e^{+}e^{+} (from TPC candidates) vs pt", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_TPCee_MS_mp", "Mass e^{#pm}e^{#mp} vs momentum e^{#pm}e^{#mp} (from TPC candidates) vs pair pt", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_TPCee_MS_mm", "Mass e^{-}e^{-} vs momentum e^{-}e^{-} (from TPC candidates) vs pair pt", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_TPCee_MS_pp", "Mass e^{+}e^{+} vs momentum e^{+}e^{+} (from TPC candidates) vs pair pt", HistType::kTH2F, {axisMassSpectrum, axisPt}); + + mHistManager.add("h_TPCee_MS_mp_phosRange", "Mass e^{#pm}e^{#mp} vs momentum e^{#pm}e^{#mp} (from TPC candidates) vs pair pt with one e in phosRange", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_TPCee_MS_mm_phosRange", "Mass e^{-}e^{-} vs momentum e^{-}e^{-} (from TPC candidates) vs pair pt with one e in phosRange", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_TPCee_MS_pp_phosRange", "Mass e^{+}e^{+} vs momentum e^{+}e^{+} (from TPC candidates) vs pair pt with one e in phosRange", HistType::kTH2F, {axisMassSpectrum, axisPt}); mHistManager.add("hTrackVX", "Track vertex coordinate X", HistType::kTH1F, {axisVTrackX}); mHistManager.add("hTrackVY", "Track vertex coordinate Y", HistType::kTH1F, {axisVTrackY}); @@ -661,41 +859,32 @@ struct tpcElIdMassSpectrum { mHistManager.add("hTrackEta", "Track eta", HistType::kTH1F, {axisEta}); mHistManager.add("hTrackEta_Cut", "Track eta after cut", HistType::kTH1F, {axisEta}); - mHistManager.add("hColVX", "Collision vertex coordinate X", HistType::kTH1F, {axisVColX}); - mHistManager.add("hColVY", "Collision vertex coordinate Y", HistType::kTH1F, {axisVColY}); - mHistManager.add("hColVZ", "Collision vertex coordinate Z", HistType::kTH1F, {axisVColZ}); - geomPHOS = std::make_unique("PHOS"); } void process(soa::Join::iterator const& collision, - myTracks& tracks) + soa::Filtered& tracks) { mHistManager.fill(HIST("eventCounter"), 0.5); if (fabs(collision.posZ()) > 10.f) return; - mHistManager.fill(HIST("hColVX"), collision.posX()); - mHistManager.fill(HIST("hColVY"), collision.posY()); - mHistManager.fill(HIST("hColVZ"), collision.posZ()); for (auto& [track1, track2] : combinations(CombinationsStrictlyUpperIndexPolicy(tracks, tracks))) { - if (!track1.has_collision() || fabs(track1.dcaXY()) > cfgDCAxyMax || fabs(track1.dcaZ()) > cfgDCAzMax || !track1.hasTPC() || fabs(track1.eta()) > cfgEtaMax) + if (!track1.has_collision() || !track1.hasTPC()) continue; - if (!track2.has_collision() || fabs(track2.dcaXY()) > cfgDCAxyMax || fabs(track2.dcaZ()) > cfgDCAzMax || !track2.hasTPC() || fabs(track2.eta()) > cfgEtaMax) + if (!track2.has_collision() || !track2.hasTPC()) continue; if (track1.collisionId() != track2.collisionId()) continue; - if (track1.pt() < cfgPtMin || track2.pt() < cfgPtMin || track1.pt() > cfgPtMax || track2.pt() > cfgPtMax) - continue; if (!((track1.itsClusterMap() & uint8_t(1)) > 0) || !((track2.itsClusterMap() & uint8_t(1)) > 0)) continue; if (track1.itsChi2NCl() > cfgITSchi2Max || track2.itsChi2NCl() > cfgITSchi2Max) continue; + if (track1.tpcChi2NCl() > cfgTPCchi2Max || track2.tpcChi2NCl() > cfgTPCchi2Max) + continue; if (track1.itsNCls() < cfgITSnclsMin || track2.itsNCls() < cfgITSnclsMin) continue; if (track1.itsNCls() > cfgITSnclsMax || track2.itsNCls() > cfgITSnclsMax) continue; - if (track1.tpcChi2NCl() > cfgTPCchi2Max || track2.tpcChi2NCl() > cfgTPCchi2Max) - continue; if (track1.tpcNClsFound() < cfgTPCnclsMin || track2.tpcNClsFound() < cfgTPCnclsMin) continue; if (track1.tpcNClsFound() > cfgTPCnclsMax || track2.tpcNClsFound() > cfgTPCnclsMax) @@ -705,49 +894,27 @@ struct tpcElIdMassSpectrum { if (track1.tpcNClsCrossedRows() > cfgTPCnclsCRMax || track2.tpcNClsCrossedRows() > cfgTPCnclsCRMax) continue; - float nsigmaTPCEl1 = track1.tpcNSigmaEl(); - float nsigmaTOFEl1 = track1.tofNSigmaEl(); - bool is1TPC_electron = nsigmaTPCEl1 > cfgTPCNSigmaElMin && nsigmaTPCEl1 < cfgTPCNSigmaElMax; - bool is1TOF_electron = nsigmaTOFEl1 > cfgTOFNSigmaElMin && nsigmaTOFEl1 < cfgTOFNSigmaElMax; - bool is1Electron = is1TPC_electron || is1TOF_electron; - if (!is1Electron) - continue; - float nsigmaTPCEl2 = track2.tpcNSigmaEl(); - float nsigmaTOFEl2 = track2.tofNSigmaEl(); - bool is2TPC_electron = nsigmaTPCEl2 > cfgTPCNSigmaElMin && nsigmaTPCEl2 < cfgTPCNSigmaElMax; - bool is2TOF_electron = nsigmaTOFEl2 > cfgTOFNSigmaElMin && nsigmaTOFEl2 < cfgTOFNSigmaElMax; - bool is2Electron = is2TPC_electron || is2TOF_electron; - if (!is2Electron) - continue; - - float nsigmaTPCPi1 = track1.tpcNSigmaPi(); - float nsigmaTPCKa1 = track1.tpcNSigmaKa(); - float nsigmaTPCPr1 = track1.tpcNSigmaPr(); - bool is1Pion = nsigmaTPCPi1 > cfgTPCNSigmaPiMin && nsigmaTPCPi1 < cfgTPCNSigmaPiMax; - bool is1Kaon = nsigmaTPCKa1 > cfgTPCNSigmaKaMin && nsigmaTPCKa1 < cfgTPCNSigmaKaMax; - bool is1Proton = nsigmaTPCPr1 > cfgTPCNSigmaPrMin && nsigmaTPCPr1 < cfgTPCNSigmaPrMax; - if (is1Pion || is1Kaon || is1Proton) - continue; - float nsigmaTPCPi2 = track2.tpcNSigmaPi(); - float nsigmaTPCKa2 = track2.tpcNSigmaKa(); - float nsigmaTPCPr2 = track2.tpcNSigmaPr(); - bool is2Pion = nsigmaTPCPi2 > cfgTPCNSigmaPiMin && nsigmaTPCPi2 < cfgTPCNSigmaPiMax; - bool is2Kaon = nsigmaTPCKa2 > cfgTPCNSigmaKaMin && nsigmaTPCKa2 < cfgTPCNSigmaKaMax; - bool is2Proton = nsigmaTPCPr2 > cfgTPCNSigmaPrMin && nsigmaTPCPr2 < cfgTPCNSigmaPrMax; - if (is2Pion || is2Kaon || is2Proton) - continue; - TLorentzVector P1, P2; P1.SetPxPyPzE(track1.px(), track1.py(), track1.pz(), track1.energy(0)); P2.SetPxPyPzE(track2.px(), track2.py(), track2.pz(), track2.energy(0)); + bool inPhosEtaRange = (fabs(track1.eta()) < 0.12 || fabs(track2.eta()) < 0.12); + bool inPhosPhiRange = (track1.phi() * TMath::RadToDeg() > 240 && track1.phi() * TMath::RadToDeg() < 310) || (track2.phi() * TMath::RadToDeg() > 240 && track2.phi() * TMath::RadToDeg() < 310); + bool inPhosRange = inPhosEtaRange && inPhosPhiRange; if (track1.sign() == track2.sign()) { - if (track1.sign() > 0) + if (track1.sign() > 0) { mHistManager.fill(HIST("h_TPCee_MS_pp"), (P1 + P2).M(), (P1 + P2).Pt()); - else + if (inPhosRange) + mHistManager.fill(HIST("h_TPCee_MS_pp_phosRange"), (P1 + P2).M(), (P1 + P2).Pt()); + } else { mHistManager.fill(HIST("h_TPCee_MS_mm"), (P1 + P2).M(), (P1 + P2).Pt()); + if (inPhosRange) + mHistManager.fill(HIST("h_TPCee_MS_mm_phosRange"), (P1 + P2).M(), (P1 + P2).Pt()); + } } else { mHistManager.fill(HIST("h_TPCee_MS_mp"), (P1 + P2).M(), (P1 + P2).Pt()); + if (inPhosRange) + mHistManager.fill(HIST("h_TPCee_MS_mp_phosRange"), (P1 + P2).M(), (P1 + P2).Pt()); } } @@ -758,38 +925,17 @@ struct tpcElIdMassSpectrum { mHistManager.fill(HIST("hTrackVY"), track1.y()); mHistManager.fill(HIST("hTrackVZ"), track1.z()); - if (!track1.has_collision() || fabs(track1.dcaXY()) > cfgDCAxyMax || fabs(track1.dcaZ()) > cfgDCAzMax || !track1.hasTPC() || fabs(track1.eta()) > cfgEtaMax) - continue; - if (track1.pt() < cfgPtMin || track1.pt() > cfgPtMax) + if (!track1.has_collision() || !track1.hasTPC()) continue; - if (track1.itsChi2NCl() > cfgITSchi2Max) + if (track1.itsChi2NCl() > cfgITSchi2Max || track1.tpcChi2NCl() > cfgTPCchi2Max) continue; if (track1.itsNCls() < cfgITSnclsMin || track1.itsNCls() > cfgITSnclsMax || !((track1.itsClusterMap() & uint8_t(1)) > 0)) continue; - if (track1.tpcChi2NCl() > cfgTPCchi2Max) - continue; if (track1.tpcNClsFound() < cfgTPCnclsMin || track1.tpcNClsFound() > cfgTPCnclsMax) continue; if (track1.tpcNClsCrossedRows() < cfgTPCnclsCRMin || track1.tpcNClsCrossedRows() > cfgTPCnclsCRMax) continue; - float nsigmaTPCEl1 = track1.tpcNSigmaEl(); - float nsigmaTOFEl1 = track1.tofNSigmaEl(); - bool is1TPC_electron = nsigmaTPCEl1 > cfgTPCNSigmaElMin && nsigmaTPCEl1 < cfgTPCNSigmaElMax; - bool is1TOF_electron = nsigmaTOFEl1 > cfgTOFNSigmaElMin && nsigmaTOFEl1 < cfgTOFNSigmaElMax; - bool is1Electron = is1TPC_electron || is1TOF_electron; - if (!is1Electron) - continue; - mHistManager.fill(HIST("hTPCspectra_isElectron"), track1.pt(), track1.tpcSignal()); - - float nsigmaTPCPi1 = track1.tpcNSigmaPi(); - float nsigmaTPCKa1 = track1.tpcNSigmaKa(); - float nsigmaTPCPr1 = track1.tpcNSigmaPr(); - bool is1Pion = nsigmaTPCPi1 > cfgTPCNSigmaPiMin && nsigmaTPCPi1 < cfgTPCNSigmaPiMax; - bool is1Kaon = nsigmaTPCKa1 > cfgTPCNSigmaKaMin && nsigmaTPCKa1 < cfgTPCNSigmaKaMax; - bool is1Proton = nsigmaTPCPr1 > cfgTPCNSigmaPrMin && nsigmaTPCPr1 < cfgTPCNSigmaPrMax; - if (is1Pion || is1Kaon || is1Proton) - continue; mHistManager.fill(HIST("hTPCspectra_isElectronRej"), track1.pt(), track1.tpcSignal()); mHistManager.fill(HIST("hTrackPt_Cut"), track1.pt()); @@ -805,6 +951,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { auto workflow = WorkflowSpec{ adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc)}; return workflow; } From faa2965e144a7dfe8ac87528e082ee7846d7dab8 Mon Sep 17 00:00:00 2001 From: Sigurd Nese <32108009+sigurdnese@users.noreply.github.com> Date: Fri, 30 Aug 2024 19:30:33 +0200 Subject: [PATCH 03/16] Fix bug in new cuts. Add track cut for open charm analyses. (#7515) --- PWGDQ/Core/CutsLibrary.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index 18dd9edd6f7..0b25a3660d8 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -768,6 +768,12 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) return cut; } + if (!nameStr.compare("pTLow05DCAzHigh03")) { + cut->AddCut(GetAnalysisCut("muonLowPt")); + cut->AddCut(GetAnalysisCut("PrimaryTrack_DCAz")); + return cut; + } + if (!nameStr.compare("pTLow04DCAzHigh03")) { cut->AddCut(GetAnalysisCut("pTLow04")); cut->AddCut(GetAnalysisCut("PrimaryTrack_DCAz")); @@ -3602,14 +3608,17 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) if (!nameStr.compare("pTLow04")) { cut->AddCut(VarManager::kPt, 0.4, 1000.0); + return cut; } if (!nameStr.compare("pTLow03")) { cut->AddCut(VarManager::kPt, 0.3, 1000.0); + return cut; } if (!nameStr.compare("pTLow02")) { cut->AddCut(VarManager::kPt, 0.2, 1000.0); + return cut; } // ----------------------------------------------- From d0c4ab180e1d04e92c17801daf4984c7d68b7f11 Mon Sep 17 00:00:00 2001 From: EmilGorm <50658075+EmilGorm@users.noreply.github.com> Date: Fri, 30 Aug 2024 20:53:47 +0200 Subject: [PATCH 04/16] Added central moment switch to FlowPtContainer (#7511) Co-authored-by: Emil Gorm Nielsen --- .../GenericFramework/Core/FlowPtContainer.cxx | 107 ++++++++++++++---- PWGCF/GenericFramework/Core/FlowPtContainer.h | 16 ++- .../Tasks/flowGenericFramework.cxx | 2 + 3 files changed, 99 insertions(+), 26 deletions(-) diff --git a/PWGCF/GenericFramework/Core/FlowPtContainer.cxx b/PWGCF/GenericFramework/Core/FlowPtContainer.cxx index d7b6b8dd114..4faf529cbc5 100644 --- a/PWGCF/GenericFramework/Core/FlowPtContainer.cxx +++ b/PWGCF/GenericFramework/Core/FlowPtContainer.cxx @@ -20,8 +20,12 @@ FlowPtContainer::FlowPtContainer() : TNamed("name", "name"), mpar(0), fillCounter(0), fEventWeight(kEventWeight::kUnity), + fUseCentralMoments(true), + sumP(), corrNum(), - corrDen() {} + corrDen(), + cmNum(), + cmDen() {} FlowPtContainer::~FlowPtContainer() { delete fCMTermList; @@ -36,8 +40,12 @@ FlowPtContainer::FlowPtContainer(const char* name) : TNamed(name, name), mpar(0), fillCounter(0), fEventWeight(kEventWeight::kUnity), + fUseCentralMoments(true), + sumP(), corrNum(), - corrDen() {} + corrDen(), + cmNum(), + cmDen() {} FlowPtContainer::FlowPtContainer(const char* name, const char* title, int nbinsx, double* xbins, const int& m, const GFWCorrConfigs& configs) : TNamed(name, title), fCMTermList(0), fCorrList(0), @@ -47,8 +55,12 @@ FlowPtContainer::FlowPtContainer(const char* name, const char* title, int nbinsx mpar(m), fillCounter(0), fEventWeight(kEventWeight::kUnity), + fUseCentralMoments(true), + sumP(), corrNum(), - corrDen() + corrDen(), + cmNum(), + cmDen() { Initialise(nbinsx, xbins, m, configs); }; @@ -61,8 +73,12 @@ FlowPtContainer::FlowPtContainer(const char* name, const char* title, int nbinsx mpar(m), fillCounter(0), fEventWeight(kEventWeight::kUnity), + fUseCentralMoments(true), + sumP(), corrNum(), - corrDen() + corrDen(), + cmNum(), + cmDen() { Initialise(nbinsx, xlow, xhigh, m, configs); }; @@ -100,7 +116,12 @@ void FlowPtContainer::Initialise(const o2::framework::AxisSpec axis, const int& for (auto m(1); m <= mpar; ++m) { if (!(configs.GetpTCorrMasks()[i] & (1 << (m - 1)))) continue; - fCovList->Add(new BootstrapProfile(Form("%s_mpt%i", configs.GetHeads()[i].c_str(), m), Form("%s_mpt%i", configs.GetHeads()[i].c_str(), m), nMultiBins, &multiBins[0])); + if (fUseCentralMoments) { + for (auto j = 0; j < m; ++j) + fCovList->Add(new BootstrapProfile(Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, m - j - 1), Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, m - j - 1), nMultiBins, &multiBins[0])); + } else { + fCovList->Add(new BootstrapProfile(Form("%spt%i", configs.GetHeads()[i].c_str(), m), Form("%spt%i", configs.GetHeads()[i].c_str(), m), nMultiBins, &multiBins[0])); + } } } if (nsub) { @@ -136,7 +157,12 @@ void FlowPtContainer::Initialise(int nbinsx, double* xbins, const int& m, const for (auto m(1); m <= mpar; ++m) { if (!(configs.GetpTCorrMasks()[i] & (1 << (m - 1)))) continue; - fCovList->Add(new BootstrapProfile(Form("%s_mpt%i", configs.GetHeads()[i].c_str(), m + 1), Form("%s_mpt%i", configs.GetHeads()[i].c_str(), m + 1), nbinsx, xbins)); + if (fUseCentralMoments) { + for (auto j = 0; j < m; ++j) + fCovList->Add(new BootstrapProfile(Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, m - j - 1), Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, m - j - 1), nbinsx, xbins)); + } else { + fCovList->Add(new BootstrapProfile(Form("%spt%i", configs.GetHeads()[i].c_str(), m), Form("%spt%i", configs.GetHeads()[i].c_str(), m), nbinsx, xbins)); + } } } if (nsub) { @@ -171,7 +197,12 @@ void FlowPtContainer::Initialise(int nbinsx, double xlow, double xhigh, const in for (auto m(1); m <= mpar; ++m) { if (!(configs.GetpTCorrMasks()[i] & (1 << (m - 1)))) continue; - fCovList->Add(new BootstrapProfile(Form("%s_mpt%i", configs.GetHeads()[i].c_str(), m + 1), Form("%s_mpt%i", configs.GetHeads()[i].c_str(), m + 1), nbinsx, xlow, xhigh)); + if (fUseCentralMoments) { + for (auto j = 0; j < m; ++j) + fCovList->Add(new BootstrapProfile(Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, m - j - 1), Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, m - j - 1), nbinsx, xlow, xhigh)); + } else { + fCovList->Add(new BootstrapProfile(Form("%spt%i", configs.GetHeads()[i].c_str(), m), Form("%spt%i", configs.GetHeads()[i].c_str(), m), nbinsx, xlow, xhigh)); + } } } if (nsub) { @@ -226,7 +257,7 @@ void FlowPtContainer::FillPtProfiles(const double& centmult, const double& rn) } return; } -void FlowPtContainer::FillVnPtProfiles(const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask) +void FlowPtContainer::FillVnPtCorrProfiles(const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask) { if (!mask) return; @@ -239,6 +270,21 @@ void FlowPtContainer::FillVnPtProfiles(const double& centmult, const double& flo } return; } +void FlowPtContainer::FillVnDeltaPtProfiles(const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask) +{ + if (!mask) + return; + for (auto m(1); m <= mpar; ++m) { + if (!(mask & (1 << (m - 1)))) + continue; + for (auto i = 0; i < m; ++i) { + if (cmDen[m - 1] != 0) + dynamic_cast(fCovList->At(fillCounter))->FillProfile(centmult, flowval * cmNum[m * (m - 1) / 2 + i], (fEventWeight == kUnity) ? 1.0 : flowtuples * cmDen[m - 1], rn); + ++fillCounter; + } + } + return; +} void FlowPtContainer::FillCMProfiles(const double& centmult, const double& rn) { if (sumP[GetVectorIndex(0, 0)] == 0) @@ -247,28 +293,39 @@ void FlowPtContainer::FillCMProfiles(const double& centmult, const double& rn) double tau2 = sumP[GetVectorIndex(3, 0)] / pow(sumP[GetVectorIndex(1, 0)], 3); double tau3 = sumP[GetVectorIndex(4, 0)] / pow(sumP[GetVectorIndex(1, 0)], 4); // double tau4 = sumP[GetVectorIndex(5,0)]/pow(sumP[GetVectorIndex(1,0)],5); - double weight1 = 1 - tau1; - double weight2 = 1 - 3 * tau1 + 2 * tau2; - double weight3 = 1 - 6 * tau1 + 3 * tau1 * tau1 + 8 * tau2 - 6 * tau3; + cmDen.push_back(sumP[GetVectorIndex(1, 0)]); + cmDen.push_back(1 - tau1); + cmDen.push_back(1 - 3 * tau1 + 2 * tau2); + cmDen.push_back(1 - 6 * tau1 + 3 * tau1 * tau1 + 8 * tau2 - 6 * tau3); // double weight4 = 1 - 10*tau1 + 15*tau1*tau1 + 20*tau2 - 20*tau1*tau2 - 30*tau3 + 24*tau4; - if (mpar < 1 || sumP[GetVectorIndex(1, 0)] == 0) + if (mpar < 1 || cmDen[0] == 0) return; - dynamic_cast(fCMTermList->At(0))->FillProfile(centmult, sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)], (fEventWeight == kEventWeight::kUnity) ? 1.0 : sumP[GetVectorIndex(1, 0)], rn); - if (mpar < 2 || sumP[GetVectorIndex(2, 0)] == 0 || weight1 == 0) + cmNum.push_back(sumP[GetVectorIndex(1, 1)] / cmDen[0]); + dynamic_cast(fCMTermList->At(0))->FillProfile(centmult, cmNum[0], (fEventWeight == kEventWeight::kUnity) ? 1.0 : cmDen[0], rn); + if (mpar < 2 || sumP[GetVectorIndex(2, 0)] == 0 || cmDen[1] == 0) return; - dynamic_cast(fCMTermList->At(1))->FillProfile(centmult, 1 / weight1 * (sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)]), (fEventWeight == kEventWeight::kUnity) ? 1.0 : weight1, rn); - dynamic_cast(fCMTermList->At(2))->FillProfile(centmult, 1 / weight1 * (-2 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 2 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)]), (fEventWeight == kEventWeight::kUnity) ? 1.0 : weight1, rn); - if (mpar < 3 || sumP[GetVectorIndex(3, 0)] == 0 || weight2 == 0) + cmNum.push_back(1 / cmDen[1] * (sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)])); + dynamic_cast(fCMTermList->At(1))->FillProfile(centmult, cmNum[1], (fEventWeight == kEventWeight::kUnity) ? 1.0 : cmDen[1], rn); + cmNum.push_back(1 / cmDen[1] * (-2 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 2 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)])); + dynamic_cast(fCMTermList->At(2))->FillProfile(centmult, cmNum[2], (fEventWeight == kEventWeight::kUnity) ? 1.0 : cmDen[1], rn); + if (mpar < 3 || sumP[GetVectorIndex(3, 0)] == 0 || cmDen[2] == 0) return; - dynamic_cast(fCMTermList->At(3))->FillProfile(centmult, 1 / weight2 * (sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 3 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 2 * tau2 * sumP[GetVectorIndex(3, 3)] / sumP[GetVectorIndex(3, 0)]), (fEventWeight == kEventWeight::kUnity) ? 1.0 : weight2, rn); - dynamic_cast(fCMTermList->At(4))->FillProfile(centmult, 1 / weight2 * (-3 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 3 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] + 6 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 6 * tau2 * sumP[GetVectorIndex(3, 2)] / sumP[GetVectorIndex(3, 0)]), (fEventWeight == kEventWeight::kUnity) ? 1.0 : weight2, rn); - dynamic_cast(fCMTermList->At(5))->FillProfile(centmult, 1 / weight2 * (3 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 6 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] - 3 * tau1 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 6 * tau2 * sumP[GetVectorIndex(3, 1)] / sumP[GetVectorIndex(3, 0)]), (fEventWeight == kEventWeight::kUnity) ? 1.0 : weight2, rn); - if (mpar < 4 || sumP[GetVectorIndex(4, 0)] == 0 || weight3 == 0) + cmNum.push_back(1 / cmDen[2] * (sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 3 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 2 * tau2 * sumP[GetVectorIndex(3, 3)] / sumP[GetVectorIndex(3, 0)])); + dynamic_cast(fCMTermList->At(3))->FillProfile(centmult, cmNum[3], (fEventWeight == kEventWeight::kUnity) ? 1.0 : cmDen[2], rn); + cmNum.push_back(1 / cmDen[2] * (-3 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 3 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] + 6 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 6 * tau2 * sumP[GetVectorIndex(3, 2)] / sumP[GetVectorIndex(3, 0)])); + dynamic_cast(fCMTermList->At(4))->FillProfile(centmult, cmNum[4], (fEventWeight == kEventWeight::kUnity) ? 1.0 : cmDen[2], rn); + cmNum.push_back(1 / cmDen[2] * (3 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 6 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] - 3 * tau1 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 6 * tau2 * sumP[GetVectorIndex(3, 1)] / sumP[GetVectorIndex(3, 0)])); + dynamic_cast(fCMTermList->At(5))->FillProfile(centmult, cmNum[5], (fEventWeight == kEventWeight::kUnity) ? 1.0 : cmDen[2], rn); + if (mpar < 4 || sumP[GetVectorIndex(4, 0)] == 0 || cmDen[3] == 0) return; - dynamic_cast(fCMTermList->At(6))->FillProfile(centmult, 1 / weight3 * (sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 6 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 3 * tau1 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] + 8 * tau2 * sumP[GetVectorIndex(3, 3)] / sumP[GetVectorIndex(3, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 6 * tau3 * sumP[GetVectorIndex(4, 4)] / sumP[GetVectorIndex(4, 0)]), (fEventWeight == kEventWeight::kUnity) ? 1.0 : weight3, rn); - dynamic_cast(fCMTermList->At(7))->FillProfile(centmult, 1 / weight3 * (-4 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 12 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 12 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 12 * tau1 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] - 8 * tau2 * sumP[GetVectorIndex(3, 3)] / sumP[GetVectorIndex(3, 0)] - 24 * tau2 * sumP[GetVectorIndex(3, 2)] / sumP[GetVectorIndex(3, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 24 * tau3 * sumP[GetVectorIndex(4, 3)] / sumP[GetVectorIndex(4, 0)]), (fEventWeight == kEventWeight::kUnity) ? 1.0 : weight3, rn); - dynamic_cast(fCMTermList->At(8))->FillProfile(centmult, 1 / weight3 * (6 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 6 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] - 24 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 6 * tau1 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 6 * tau1 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] + 12 * tau1 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] + 24 * tau2 * sumP[GetVectorIndex(3, 2)] / sumP[GetVectorIndex(3, 0)] + 24 * tau2 * sumP[GetVectorIndex(3, 1)] / sumP[GetVectorIndex(3, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 36 * tau3 * sumP[GetVectorIndex(4, 2)] / sumP[GetVectorIndex(4, 0)]), (fEventWeight == kEventWeight::kUnity) ? 1.0 : weight3, rn); - dynamic_cast(fCMTermList->At(9))->FillProfile(centmult, 1 / weight3 * (-4 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 12 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] + 12 * tau1 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 12 * tau1 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] - 24 * tau2 * sumP[GetVectorIndex(3, 1)] / sumP[GetVectorIndex(3, 0)] - 8 * tau2 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 24 * tau3 * sumP[GetVectorIndex(4, 1)] / sumP[GetVectorIndex(4, 0)]), (fEventWeight == kEventWeight::kUnity) ? 1.0 : weight3, rn); + cmNum.push_back(1 / cmDen[3] * (sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 6 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 3 * tau1 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] + 8 * tau2 * sumP[GetVectorIndex(3, 3)] / sumP[GetVectorIndex(3, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 6 * tau3 * sumP[GetVectorIndex(4, 4)] / sumP[GetVectorIndex(4, 0)])); + dynamic_cast(fCMTermList->At(6))->FillProfile(centmult, cmNum[6], (fEventWeight == kEventWeight::kUnity) ? 1.0 : cmDen[3], rn); + cmNum.push_back(1 / cmDen[3] * (-4 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 12 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 12 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 12 * tau1 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] - 8 * tau2 * sumP[GetVectorIndex(3, 3)] / sumP[GetVectorIndex(3, 0)] - 24 * tau2 * sumP[GetVectorIndex(3, 2)] / sumP[GetVectorIndex(3, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 24 * tau3 * sumP[GetVectorIndex(4, 3)] / sumP[GetVectorIndex(4, 0)])); + dynamic_cast(fCMTermList->At(7))->FillProfile(centmult, cmNum[7], (fEventWeight == kEventWeight::kUnity) ? 1.0 : cmDen[3], rn); + cmNum.push_back(1 / cmDen[3] * (6 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 6 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] - 24 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 6 * tau1 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 6 * tau1 * tau1 * sumP[GetVectorIndex(2, 2)] / sumP[GetVectorIndex(2, 0)] + 12 * tau1 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] + 24 * tau2 * sumP[GetVectorIndex(3, 2)] / sumP[GetVectorIndex(3, 0)] + 24 * tau2 * sumP[GetVectorIndex(3, 1)] / sumP[GetVectorIndex(3, 0)] * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 36 * tau3 * sumP[GetVectorIndex(4, 2)] / sumP[GetVectorIndex(4, 0)])); + dynamic_cast(fCMTermList->At(8))->FillProfile(centmult, cmNum[8], (fEventWeight == kEventWeight::kUnity) ? 1.0 : cmDen[3], rn); + cmNum.push_back(1 / cmDen[3] * (-4 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 12 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] + 12 * tau1 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] - 12 * tau1 * tau1 * sumP[GetVectorIndex(2, 1)] / sumP[GetVectorIndex(2, 0)] - 24 * tau2 * sumP[GetVectorIndex(3, 1)] / sumP[GetVectorIndex(3, 0)] - 8 * tau2 * sumP[GetVectorIndex(1, 1)] / sumP[GetVectorIndex(1, 0)] + 24 * tau3 * sumP[GetVectorIndex(4, 1)] / sumP[GetVectorIndex(4, 0)])); + dynamic_cast(fCMTermList->At(9))->FillProfile(centmult, cmNum[9], (fEventWeight == kEventWeight::kUnity) ? 1.0 : cmDen[3], rn); return; } double FlowPtContainer::OrderedAddition(std::vector vec) diff --git a/PWGCF/GenericFramework/Core/FlowPtContainer.h b/PWGCF/GenericFramework/Core/FlowPtContainer.h index 981c1d0540c..fa9a46e200b 100644 --- a/PWGCF/GenericFramework/Core/FlowPtContainer.h +++ b/PWGCF/GenericFramework/Core/FlowPtContainer.h @@ -49,11 +49,22 @@ class FlowPtContainer : public TNamed void CalculateCorrelations(); void CalculateCMTerms(); void FillPtProfiles(const Double_t& lMult, const Double_t& rn); - void FillVnPtProfiles(const double& lMult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask); + void FillVnPtCorrProfiles(const double& lMult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask); + void FillVnDeltaPtProfiles(const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask); + void FillVnPtProfiles(const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask) + { + if (fUseCentralMoments) + FillVnDeltaPtProfiles(centmult, flowval, flowtuples, rn, mask); + else + FillVnPtCorrProfiles(centmult, flowval, flowtuples, rn, mask); + } void FillCMProfiles(const double& lMult, const double& rn); TList* GetCorrList() { return fCorrList; } TList* GetCMTermList() { return fCMTermList; } + TList* GetCovList() { return fCovList; } void SetEventWeight(const unsigned int& lWeight) { fEventWeight = lWeight; } + void SetUseCentralMoments(bool newval) { fUseCentralMoments = newval; } + bool usesCentralMoments() { return fUseCentralMoments; } void RebinMulti(Int_t nbins); void RebinMulti(Int_t nbins, double* binedges); TH1* getCentralMomentHist(int ind, int m); @@ -82,11 +93,14 @@ class FlowPtContainer : public TNamed int mpar; int fillCounter; unsigned int fEventWeight; + bool fUseCentralMoments; void MergeBSLists(TList* source, TList* target); TH1* raiseHistToPower(TH1* inh, double p); std::vector sumP; //! std::vector corrNum; //! std::vector corrDen; //! + std::vector cmNum; //! + std::vector cmDen; //! static constexpr float fFactorial[9] = {1., 1., 2., 6., 24., 120., 720., 5040., 40320.}; static constexpr int fSign[9] = {1, -1, 1, -1, 1, -1, 1, -1, 1}; diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index d18d08309bf..5bc41f81886 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -83,6 +83,7 @@ struct GenericFramework { O2_DEFINE_CONFIGURABLE(cfgFillQA, bool, false, "Fill QA histograms") O2_DEFINE_CONFIGURABLE(cfgUseAdditionalEventCut, bool, false, "Use additional event cut on mult correlations") O2_DEFINE_CONFIGURABLE(cfgUseAdditionalTrackCut, bool, false, "Use additional track cut on phi") + O2_DEFINE_CONFIGURABLE(cfgUseCentralMoments, bool, true, "Use central moments in vn-pt calculations") O2_DEFINE_CONFIGURABLE(cfgEfficiency, std::string, "", "CCDB path to efficiency object") O2_DEFINE_CONFIGURABLE(cfgAcceptance, std::string, "", "CCDB path to acceptance object") O2_DEFINE_CONFIGURABLE(cfgDCAxy, float, 0.2, "Cut on DCA in the transverse direction (cm)"); @@ -239,6 +240,7 @@ struct GenericFramework { fFC_gen->Initialize(oba, multAxis, cfgNbootstrap); } delete oba; + fFCpt->SetUseCentralMoments(cfgUseCentralMoments); fFCpt->Initialise(multAxis, cfgMpar, configs, cfgNbootstrap); // Event selection - Alex if (cfgUseAdditionalEventCut) { From 65344cab0aa6af0fdc7f4e2a5af554bd3dfd6f78 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Fri, 30 Aug 2024 21:34:50 +0200 Subject: [PATCH 05/16] Fix cosPA calculation (#7517) * Fix cosPA calculation * Please consider the following formatting changes --- PWGLF/DataModel/LFStrangenessTables.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index 1e6f3b990b9..1eedee47828 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -993,8 +993,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(CascRadius, cascradius, //! // CosPAs DECLARE_SOA_DYNAMIC_COLUMN(V0CosPA, v0cosPA, //! [](float Xlambda, float Ylambda, float Zlambda, float PxLambda, float PyLambda, float PzLambda, float pvX, float pvY, float pvZ) -> float { return RecoDecay::cpa(std::array{pvX, pvY, pvZ}, std::array{Xlambda, Ylambda, Zlambda}, std::array{PxLambda, PyLambda, PzLambda}); }); +// DECLARE_SOA_DYNAMIC_COLUMN(CascCosPA, casccosPA, //! +// [](float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) -> float { return RecoDecay::cpa(std::array{pvX, pvY, pvZ}, std::array{X, Y, Z}, std::array{Px, Py, Pz}); }); DECLARE_SOA_DYNAMIC_COLUMN(CascCosPA, casccosPA, //! - [](float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) -> float { return RecoDecay::cpa(std::array{pvX, pvY, pvZ}, std::array{X, Y, Z}, std::array{Px, Py, Pz}); }); + [](float X, float Y, float Z, float PxBach, float PxPos, float PxNeg, float PyBach, float PyPos, float PyNeg, float PzBach, float PzPos, float PzNeg, float pvX, float pvY, float pvZ) -> float { return RecoDecay::cpa(std::array{pvX, pvY, pvZ}, std::array{X, Y, Z}, std::array{PxBach + PxPos + PxNeg, PyBach + PyPos + PyNeg, PzBach + PzPos + PzNeg}); }); DECLARE_SOA_DYNAMIC_COLUMN(DCAV0ToPV, dcav0topv, //! [](float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) -> float { return std::sqrt((std::pow((pvY - Y) * Pz - (pvZ - Z) * Py, 2) + std::pow((pvX - X) * Pz - (pvZ - Z) * Px, 2) + std::pow((pvX - X) * Py - (pvY - Y) * Px, 2)) / (Px * Px + Py * Py + Pz * Pz)); }); @@ -1143,7 +1145,7 @@ DECLARE_SOA_TABLE(StoredCascCores, "AOD", "CASCCORE", //! core information about cascdata::V0Radius, cascdata::CascRadius, cascdata::V0CosPA, - cascdata::CascCosPA, + cascdata::CascCosPA, cascdata::DCAV0ToPV, // Invariant masses @@ -1186,7 +1188,7 @@ DECLARE_SOA_TABLE(StoredKFCascCores, "AOD", "KFCASCCORE", //! cascdata::V0Radius, cascdata::CascRadius, cascdata::V0CosPA, - cascdata::CascCosPA, + cascdata::CascCosPA, cascdata::DCAV0ToPV, // Invariant masses @@ -1224,7 +1226,7 @@ DECLARE_SOA_TABLE(StoredTraCascCores, "AOD", "TRACASCCORE", //! cascdata::V0Radius, cascdata::CascRadius, cascdata::V0CosPA, - cascdata::CascCosPA, + cascdata::CascCosPA, cascdata::DCAV0ToPV, // Invariant masses From 3158e22b0aa2a6b7ad725e2a88f7b9367f5833a5 Mon Sep 17 00:00:00 2001 From: feisenhu <53603353+feisenhu@users.noreply.github.com> Date: Fri, 30 Aug 2024 22:36:06 +0200 Subject: [PATCH 06/16] [PWGEM] Add MC signal of direct B->c->e decay (#7519) --- PWGDQ/Core/MCSignalLibrary.cxx | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/PWGDQ/Core/MCSignalLibrary.cxx b/PWGDQ/Core/MCSignalLibrary.cxx index 7950f5666ad..7a33333b0a7 100644 --- a/PWGDQ/Core/MCSignalLibrary.cxx +++ b/PWGDQ/Core/MCSignalLibrary.cxx @@ -904,13 +904,21 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) } // Any b to any c in history b -> c -> e - if (!nameStr.compare("eeFromBtoCandBtoC")) { + if (!nameStr.compare("eeFromAnyBtoCandAnyBtoC")) { MCProng prong(2, {11, 402}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}, false, {502}, {false}); // check if mother pdg code is in history prong.SetSourceBit(0, MCProng::kPhysicalPrimary); signal = new MCSignal(name, "ee pairs with any beauty to charm in decay chain", {prong, prong}, {-1, -1}); // signal at pair level return signal; } + // b->c->e, b->c->e + if (!nameStr.compare("eeFromBtoCandBtoC")) { + MCProng prong(3, {11, 402, 502}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}, false); // check if mother pdg code is in history + prong.SetSourceBit(0, MCProng::kPhysicalPrimary); + signal = new MCSignal(name, "ee pairs with any beauty to charm in decay chain", {prong, prong}, {-1, -1}); // signal at pair level + return signal; + } + // Any b->e and Any b->X->c->e // Looking at such decays: B -> (e) D -> (e)e and bar{B} -> e // Signal allows combinations of ee from the same B meson @@ -934,6 +942,7 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) return signal; } + // b->e and b->c->e if (!nameStr.compare("eeFromBandBtoC")) { MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); prongB.SetSourceBit(0, MCProng::kPhysicalPrimary); @@ -943,7 +952,7 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) return signal; } - // Any b->e and Any b->c->e + // b->e and b->c->e if (!nameStr.compare("eeFromBandBtoCBis")) { MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); prongB.SetSourceBit(0, MCProng::kPhysicalPrimary); @@ -953,7 +962,7 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) return signal; } - // Any b->e and Any b->c->e (same mother/grandmother) + // b->e and b->c->e (same mother/grandmother) // require that the mother is the grandmother of the other electron if (!nameStr.compare("eeFromBandBtoCsameGM")) { MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); @@ -964,7 +973,7 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) return signal; } - // Any b->e and Any b->c->e (same mother/grandmother) + // b->e and b->c->e (same mother/grandmother) // require that the mother is the grandmother of the other electron if (!nameStr.compare("eeFromBandBtoCsameGMBis")) { MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); @@ -975,7 +984,7 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) return signal; } - // Any b->e and Any b->c->e (different mother/grandmother) + // b->e and b->c->e (different mother/grandmother) // require that the mother is not the grandmother of the other electron if (!nameStr.compare("eeFromBandBtoCdiffGM")) { MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); @@ -986,7 +995,7 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) return signal; } - // Any b->e and Any b->c->e (different mother/grandmother) + // b->e and b->c->e (different mother/grandmother) // require that the mother is not the grandmother of the other electron if (!nameStr.compare("eeFromBandBtoCdiffGMBis")) { MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); From 927ecc6f4307b5136b5ae059f919258a18ca244f Mon Sep 17 00:00:00 2001 From: HANSEO PARK <53218370+hanseopark@users.noreply.github.com> Date: Fri, 30 Aug 2024 23:42:14 +0200 Subject: [PATCH 07/16] [PWGJE] Add MCP and updating matching with tagging (#7518) * remote unused parameter * modiciation of track counting * modification of resolution function to add flavour * fix clang-format * fix the calcualtion * Fix clang-format * fix mistake * Processing to update QA of sv * Being updating SV QA * Add distribution of jet pt with flavour when removed by cut selection for efficiency and purity using sv * updating sv * fix prong acceptance * fix bool and TMath value * Urgent fix tagger point for efficiency and purity * Add configuration about searchUpToQuark which is chossen between quark and hadron level for flavour definition * Being developing tagging * Being developing tagging * implement sv tagging jet and cut selection of ip method * fix clang * fix clang of datamodel * Add prong acceptance * devloping original tracks to jtrackextras * devloping original tracks to jtrackextras * fix clang-format * fix geoSign def * fix unused parameter * mistake write code * Fix to use resolution function of flavour * Add weighted histogram * fix clang format * fix mistake * Add MCP and updating matching with tagging * fix error --- PWGJE/TableProducer/jettaggerhf.cxx | 34 +- PWGJE/Tasks/jettaggerhfQA.cxx | 531 +++++++++++++++++++++++++--- 2 files changed, 510 insertions(+), 55 deletions(-) diff --git a/PWGJE/TableProducer/jettaggerhf.cxx b/PWGJE/TableProducer/jettaggerhf.cxx index 797e2a9119c..143611aa87a 100644 --- a/PWGJE/TableProducer/jettaggerhf.cxx +++ b/PWGJE/TableProducer/jettaggerhf.cxx @@ -33,11 +33,12 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -template +template struct JetTaggerHFTask { Produces taggingTableData; Produces taggingTableMCD; + Produces taggingTableMCP; // configuration topological cut for track and sv Configurable trackDcaXYMax{"trackDcaXYMax", 1, "minimum DCA xy acceptance for tracks [cm]"}; @@ -328,6 +329,33 @@ struct JetTaggerHFTask { } PROCESS_SWITCH(JetTaggerHFTask, processMCDWithSV, "Fill tagging decision for mcd jets with sv", false); + void processMCP(JetCollision const& /*collision*/, JetTableMCP const& mcpjets, JetParticles const& particles) + { + for (auto& mcpjet : mcpjets) { + bool flagtaggedjetIP = 0; + bool flagtaggedjetSV = 0; + typename JetParticles::iterator hfparticle; + int origin = 0; + // TODO + if (removeGluonShower) { + if (jettaggingutilities::mcpJetFromHFShower(mcpjet, particles, maxDeltaR, searchUpToQuark)) + origin = jettaggingutilities::mcpJetFromHFShower(mcpjet, particles, maxDeltaR, searchUpToQuark); + else + origin = 0; + } else { + if (jettaggingutilities::jetParticleFromHFShower(mcpjet, particles, hfparticle, searchUpToQuark)) + origin = jettaggingutilities::jetParticleFromHFShower(mcpjet, particles, hfparticle, searchUpToQuark); + else + origin = 0; + } + jetProb.clear(); + jetProb.reserve(maxOrder); + jetProb.push_back(-1); + taggingTableMCP(origin, jetProb, flagtaggedjetIP, flagtaggedjetSV); + } + } + PROCESS_SWITCH(JetTaggerHFTask, processMCP, "Fill tagging decision for mcp jets with sv", false); + void processTraining(JetCollision const& /*collision*/, JetTableMCD const& /*mcdjets*/, JetTagTracksMCD const& /*tracks*/) { // To create table for ML @@ -335,8 +363,8 @@ struct JetTaggerHFTask { PROCESS_SWITCH(JetTaggerHFTask, processTraining, "Fill tagging decision for mcd jets", false); }; -using JetTaggerChargedJets = JetTaggerHFTask, soa::Join, aod::ChargedJetTags, aod::ChargedMCDetectorLevelJetTags>; -using JetTaggerFullJets = JetTaggerHFTask, soa::Join, aod::FullJetTags, aod::FullMCDetectorLevelJetTags>; +using JetTaggerChargedJets = JetTaggerHFTask, soa::Join, soa::Join, aod::ChargedJetTags, aod::ChargedMCDetectorLevelJetTags, aod::ChargedMCParticleLevelJetTags>; +using JetTaggerFullJets = JetTaggerHFTask, soa::Join, soa::Join, aod::FullJetTags, aod::FullMCDetectorLevelJetTags, aod::FullMCParticleLevelJetTags>; // using JetTaggerNeutralJets = JetTaggerHFTask,soa::Join, aod::NeutralJetTags, aod::NeutralMCDetectorLevelJetTags>; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGJE/Tasks/jettaggerhfQA.cxx b/PWGJE/Tasks/jettaggerhfQA.cxx index 360ce5f758d..9f7fa7d30ae 100644 --- a/PWGJE/Tasks/jettaggerhfQA.cxx +++ b/PWGJE/Tasks/jettaggerhfQA.cxx @@ -60,9 +60,16 @@ struct JetTaggerHFQA { Configurable prongsigmaLxyzMax{"prongsigmaLxyzMax", 100, "maximum sigma of decay length of prongs on xyz plane"}; Configurable numFlavourSpecies{"numFlavourSpecies", 6, "number of jet flavour species"}; Configurable numOrder{"numOrder", 6, "number of ordering"}; + Configurable pTHatMaxMCD{"pTHatMaxMCD", 999.0, "maximum fraction of hard scattering for jet acceptance in detector MC"}; + Configurable pTHatMaxMCP{"pTHatMaxMCP", 999.0, "maximum fraction of hard scattering for jet acceptance in particle MC"}; + Configurable pTHatExponent{"pTHatExponent", 6.0, "exponent of the event weight for the calculation of pTHat"}; + 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 checkMcCollisionIsMatched{"checkMcCollisionIsMatched", false, "0: count whole MCcollisions, 1: select MCcollisions which only have their correspond collisions"}; 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 eventSelections{"eventSelections", "sel8", "choose event selection"}; Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; // Binning ConfigurableAxis binJetFlavour{"binJetFlavour", {6, -0.5, 5.5}, ""}; @@ -91,12 +98,17 @@ struct JetTaggerHFQA { ConfigurableAxis binSigmaLxyz{"binSigmaLxyz", {100, 0., 0.1}, ""}; int numberOfJetFlavourSpecies = 6; + int eventSelection = -1; int trackSelection = -1; HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext const&) { + numberOfJetFlavourSpecies = static_cast(numFlavourSpecies); + + eventSelection = jetderiveddatautilities::initialiseEventSelection(static_cast(eventSelections)); + trackSelection = jetderiveddatautilities::initialiseTrackSelection(static_cast(trackSelections)); // Axis AxisSpec jetFlavourAxis = {binJetFlavour, "Jet flavour"}; AxisSpec jetPtAxis = {binJetPt, "#it{p}_{T, jet}"}; @@ -124,9 +136,6 @@ struct JetTaggerHFQA { AxisSpec sigmaLxyAxis = {binSigmaLxy, "#sigma_{L_{XY}} [cm]"}; AxisSpec sigmaLxyzAxis = {binSigmaLxyz, "#sigma_{L_{XYZ}} [cm]"}; - numberOfJetFlavourSpecies = static_cast(numFlavourSpecies); - - trackSelection = jetderiveddatautilities::initialiseTrackSelection(static_cast(trackSelections)); if (doprocessTracksDca) { registry.add("h_impact_parameter_xy", "", {HistType::kTH1F, {{impactParameterXYAxis}}}); registry.add("h_impact_parameter_xy_significance", "", {HistType::kTH1F, {{impactParameterXYSignificanceAxis}}}); @@ -218,11 +227,37 @@ struct JetTaggerHFQA { registry.add("h3_sign_impact_parameter_xyz_significance_tc_flavour", "", {HistType::kTH3F, {{impactParameterXYZSignificanceAxis}, {numOrderAxis}, {jetFlavourAxis}}}); } } + if (doprocessIPsMCP || doprocessIPsMCPWeighted) { + registry.add("h2_jet_pt_part_flavour", "", {HistType::kTH2F, {{jetPtAxis}, {jetFlavourAxis}}}); + registry.add("h2_jet_eta_part_flavour", "", {HistType::kTH2F, {{etaAxis}, {jetFlavourAxis}}}); + registry.add("h2_jet_phi_part_flavour", "", {HistType::kTH2F, {{phiAxis}, {jetFlavourAxis}}}); + } + if (doprocessIPsMCPMCDMatched) { - registry.add("h3_response_matrix_jet_pt_jet_pt_part_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {jetPtAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_jet_pt_part_matchedgeo_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {jetPtAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_jet_pt_part_matchedgeo_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {jetPtAxis}, {jetFlavourAxis}}}); registry.add("h3_jet_pt_flavour_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {jetFlavourAxis}, {jetFlavourAxis}}}); - registry.add("h_compare_flavour_flavour_run2", "", {HistType::kTH1F, {{3, 0, 3}}}); + registry.add("h3_jet_eta_flavour_flavour_run2", "", {HistType::kTH3F, {{etaAxis}, {jetFlavourAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_phi_flavour_flavour_run2", "", {HistType::kTH3F, {{phiAxis}, {jetFlavourAxis}, {jetFlavourAxis}}}); + registry.add("h_compare_flavour_flavour_run2", "", {HistType::kTH1F, {{2, 0, 2}}}); + if (fillIPxy) { + registry.add("h3_jet_pt_impact_parameter_xy_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {impactParameterXYAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_sigma_impact_parameter_xy_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {sigmaImpactParameterXYAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_sign_impact_parameter_xy_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {impactParameterXYAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_impact_parameter_xy_significance_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {impactParameterXYSignificanceAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_sign_impact_parameter_xy_significance_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {impactParameterXYSignificanceAxis}, {jetFlavourAxis}}}); + registry.add("h3_track_pt_impact_parameter_xy_flavour_run2", "", {HistType::kTH3F, {{trackPtAxis}, {impactParameterXYAxis}, {jetFlavourAxis}}}); + registry.add("h3_track_pt_sign_impact_parameter_xy_flavour_run2", "", {HistType::kTH3F, {{trackPtAxis}, {impactParameterXYAxis}, {jetFlavourAxis}}}); + registry.add("h3_track_pt_impact_parameter_xy_significance_flavour_run2", "", {HistType::kTH3F, {{trackPtAxis}, {impactParameterXYSignificanceAxis}, {jetFlavourAxis}}}); + registry.add("h3_track_pt_sign_impact_parameter_xy_significance_flavour_run2", "", {HistType::kTH3F, {{trackPtAxis}, {impactParameterXYSignificanceAxis}, {jetFlavourAxis}}}); + } + if (fillTrackCounting) { + registry.add("h3_jet_pt_sign_impact_parameter_xy_significance_flavour_run2_N1", "", {HistType::kTH3F, {{jetPtAxis}, {impactParameterXYSignificanceAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_sign_impact_parameter_xy_significance_flavour_run2_N2", "", {HistType::kTH3F, {{jetPtAxis}, {impactParameterXYSignificanceAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_sign_impact_parameter_xy_significance_flavour_run2_N3", "", {HistType::kTH3F, {{jetPtAxis}, {impactParameterXYSignificanceAxis}, {jetFlavourAxis}}}); + } } + if (doprocessJPData) { registry.add("h2_jet_pt_JP", "jet pt jet probability untagged", {HistType::kTH2F, {{jetPtAxis}, {JetProbabilityAxis}}}); registry.add("h2_jet_pt_neg_log_JP", "jet pt jet probabilityun tagged", {HistType::kTH2F, {{jetPtAxis}, {JetProbabilityLogAxis}}}); @@ -291,10 +326,34 @@ struct JetTaggerHFQA { registry.add("h3_jet_pt_3prong_Sxyz_N1_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {SxyzAxis}, {jetFlavourAxis}}}); registry.add("h3_jet_pt_3prong_mass_N1_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {massAxis}, {jetFlavourAxis}}}); } + if (doprocessSV2ProngMCPMCDMatched || doprocessSV2ProngMCPMCDMatchedWeighted) { + registry.add("h3_jet_pt_2prong_Lxy_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {LxyAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_2prong_sigmaLxy_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {sigmaLxyAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_2prong_Sxy_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {SxyAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_2prong_Lxyz_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {LxyzAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_2prong_sigmaLxyz_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {sigmaLxyzAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_2prong_Sxyz_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {SxyzAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_2prong_Sxy_N1_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {SxyAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_2prong_Sxyz_N1_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {SxyzAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_2prong_mass_N1_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {massAxis}, {jetFlavourAxis}}}); + } + if (doprocessSV3ProngMCPMCDMatched || doprocessSV3ProngMCPMCDMatchedWeighted) { + registry.add("h3_jet_pt_3prong_Lxy_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {LxyAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_3prong_sigmaLxy_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {sigmaLxyAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_3prong_Sxy_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {SxyAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_3prong_Lxyz_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {LxyzAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_3prong_sigmaLxyz_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {sigmaLxyzAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_3prong_Sxyz_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {SxyzAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_3prong_Sxy_N1_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {SxyAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_3prong_Sxyz_N1_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {SxyzAxis}, {jetFlavourAxis}}}); + registry.add("h3_jet_pt_3prong_mass_N1_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {massAxis}, {jetFlavourAxis}}}); + } } // 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); + PresliceUnsorted> CollisionsPerMCPCollision = aod::jmccollisionlb::mcCollisionId; + Preslice particlesPerCollision = aod::jmcparticle::mcCollisionId; using JetTagTracksData = soa::Join; using JetTagTracksMCD = soa::Join; @@ -306,6 +365,29 @@ struct JetTaggerHFQA { return a[0] > b[0]; }; + template + bool isAcceptedJet(U const& jet) + { + if (jetAreaFractionMin > -98.0) { + if (jet.area() < jetAreaFractionMin * M_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()) { + if (constituent.pt() >= leadingConstituentPtMin) { + isMinleadingConstituent = true; + break; + } + } + if (!isMinleadingConstituent) { + return false; + } + } + return true; + } + template bool trackAcceptance(T const& track) { @@ -318,6 +400,11 @@ struct JetTaggerHFQA { template void fillHistogramIPsData(T const& jet, U const& /*jtracks*/) { + float eventWeight = 1.0; + float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + if (jet.pt() > pTHatMaxMCD * pTHat) { + return; + } std::vector> vecSignImpXYSig, vecSignImpZSig, vecSignImpXYZSig; for (auto& track : jet.template tracks_as()) { if (!trackAcceptance(track)) @@ -399,6 +486,10 @@ struct JetTaggerHFQA { template void fillHistogramIPsMCD(T const& mcdjet, U const& /*jtracks*/, float eventWeight = 1.0) { + float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + if (mcdjet.pt() > pTHatMaxMCD * pTHat) { + return; + } std::vector vecImpXY[numberOfJetFlavourSpecies], vecSignImpXY[numberOfJetFlavourSpecies], vecImpXYSig[numberOfJetFlavourSpecies], vecSignImpXYSig[numberOfJetFlavourSpecies]; std::vector vecImpZ[numberOfJetFlavourSpecies], vecSignImpZ[numberOfJetFlavourSpecies], vecImpZSig[numberOfJetFlavourSpecies], vecSignImpZSig[numberOfJetFlavourSpecies]; std::vector vecImpXYZ[numberOfJetFlavourSpecies], vecSignImpXYZ[numberOfJetFlavourSpecies], vecImpXYZSig[numberOfJetFlavourSpecies], vecSignImpXYZSig[numberOfJetFlavourSpecies]; @@ -555,38 +646,101 @@ struct JetTaggerHFQA { } } - Preslice particlesPerCollision = aod::jmcparticle::mcCollisionId; - template - void fillHistogramIPsMCPMCDMatched(T const& collision, U const& mcdjets, V const&, W const&, X const& particles) + template + void fillHistogramIPsMCP(T const& mcpjet, float eventWeight = 1.0) { - auto const particlesPerColl = particles.sliceBy(particlesPerCollision, collision.mcCollisionId()); - for (auto& mcdjet : mcdjets) { - if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { - continue; - } - float eventWeight = mcdjet.eventWeight(); - int jetflavour = mcdjet.origin(); - if (jetflavour == JetTaggingSpecies::none) - jetflavour = JetTaggingSpecies::lightflavour; - int jetflavourRun2Def = -1; - // if (!mcdjet.has_matchedJetGeo()) continue; - for (auto& mcpjet : mcdjet.template matchedJetGeo_as()) { - jetflavourRun2Def = jettaggingutilities::getJetFlavor(mcpjet, particlesPerColl); - registry.fill(HIST("h3_response_matrix_jet_pt_jet_pt_part_flavour"), mcdjet.pt(), mcpjet.pt(), jetflavour, eventWeight); + float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + if (mcpjet.pt() > pTHatMaxMCD * pTHat) { + return; + } + int jetflavour = mcpjet.origin(); + if (jetflavour == JetTaggingSpecies::none) { + LOGF(debug, "NOT DEFINE JET FLAVOR"); + } + registry.fill(HIST("h2_jet_pt_part_flavour"), mcpjet.pt(), jetflavour, eventWeight); + registry.fill(HIST("h2_jet_eta_part_flavour"), mcpjet.eta(), jetflavour, eventWeight); + registry.fill(HIST("h2_jet_phi_part_flavour"), mcpjet.phi(), jetflavour, eventWeight); + } + + template + void fillHistogramIPsMatched(T const& mcdjet, U const&, V const&, W const& particlesPerColl, float eventWeight = 1.0) + { + float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + if (mcdjet.pt() > pTHatMaxMCD * pTHat) { + return; + } + std::vector vecImpXY[numberOfJetFlavourSpecies], vecSignImpXY[numberOfJetFlavourSpecies], vecImpXYSig[numberOfJetFlavourSpecies], vecSignImpXYSig[numberOfJetFlavourSpecies]; + int jetflavour = mcdjet.origin(); + if (jetflavour == JetTaggingSpecies::none) + jetflavour = JetTaggingSpecies::lightflavour; + int jetflavourRun2Def = -1; + // if (!mcdjet.has_matchedJetGeo()) continue; + for (auto& mcpjet : mcdjet.template matchedJetGeo_as()) { + jetflavourRun2Def = jettaggingutilities::getJetFlavor(mcpjet, particlesPerColl); + registry.fill(HIST("h3_jet_pt_jet_pt_part_matchedgeo_flavour"), mcpjet.pt(), mcdjet.pt(), jetflavour, eventWeight); + registry.fill(HIST("h3_jet_pt_jet_pt_part_matchedgeo_flavour_run2"), mcpjet.pt(), mcdjet.pt(), jetflavourRun2Def, eventWeight); + } + if (jetflavourRun2Def < 0) + return; + if (jetflavour == jetflavourRun2Def) + registry.fill(HIST("h_compare_flavour_flavour_run2"), 0.5); + else + registry.fill(HIST("h_compare_flavour_flavour_run2"), 1.5); + registry.fill(HIST("h3_jet_pt_flavour_flavour_run2"), mcdjet.pt(), jetflavour, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_eta_flavour_flavour_run2"), mcdjet.eta(), jetflavour, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_phi_flavour_flavour_run2"), mcdjet.phi(), jetflavour, jetflavourRun2Def, eventWeight); + for (auto& track : mcdjet.template tracks_as()) { + int geoSign = jettaggingutilities::getGeoSign(mcdjet, track); + if (fillIPxy) { + float varImpXY, varSignImpXY, varImpXYSig, varSignImpXYSig; + varImpXY = track.dcaXY() * jettaggingutilities::cmTomum; + float varSigmaImpXY = track.dcaXY() * jettaggingutilities::cmTomum; + varSignImpXY = geoSign * std::abs(track.dcaXY()) * jettaggingutilities::cmTomum; + varImpXYSig = track.dcaXY() / track.sigmadcaXY(); + varSignImpXYSig = geoSign * std::abs(track.dcaXY()) / track.sigmadcaXY(); + registry.fill(HIST("h3_jet_pt_impact_parameter_xy_flavour_run2"), mcdjet.pt(), varImpXY, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_sigma_impact_parameter_xy_flavour_run2"), mcdjet.pt(), varSigmaImpXY, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_sign_impact_parameter_xy_flavour_run2"), mcdjet.pt(), varSignImpXY, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_impact_parameter_xy_significance_flavour_run2"), mcdjet.pt(), varImpXYSig, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_sign_impact_parameter_xy_significance_flavour_run2"), mcdjet.pt(), varSignImpXYSig, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_track_pt_impact_parameter_xy_flavour_run2"), track.pt(), varImpXY, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_track_pt_sign_impact_parameter_xy_flavour_run2"), track.pt(), varSignImpXY, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_track_pt_impact_parameter_xy_significance_flavour_run2"), track.pt(), varImpXYSig, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_track_pt_sign_impact_parameter_xy_significance_flavour_run2"), track.pt(), varSignImpXYSig, jetflavourRun2Def, eventWeight); + vecImpXY[jetflavour].push_back(varImpXY); + vecSignImpXY[jetflavour].push_back(varSignImpXY); + vecImpXYSig[jetflavour].push_back(varImpXYSig); + vecSignImpXYSig[jetflavour].push_back(varSignImpXYSig); } - registry.fill(HIST("h3_jet_pt_flavour_flavour_run2"), mcdjet.pt(), jetflavour, jetflavourRun2Def, eventWeight); - if (jetflavourRun2Def < 0) - continue; - if (jetflavour == jetflavourRun2Def) - registry.fill(HIST("h_compare_flavour_flavour_run2"), 0.5); - else - registry.fill(HIST("h_compare_flavour_flavour_run2"), 1.5); + } + if (!fillTrackCounting) + return; + sort(vecImpXY[jetflavour].begin(), vecImpXY[jetflavour].end(), std::greater()); + sort(vecSignImpXY[jetflavour].begin(), vecSignImpXY[jetflavour].end(), std::greater()); + sort(vecImpXYSig[jetflavour].begin(), vecImpXYSig[jetflavour].end(), std::greater()); + sort(vecSignImpXYSig[jetflavour].begin(), vecSignImpXYSig[jetflavour].end(), std::greater()); + if (vecImpXY[jetflavour].size() > 0) { // N1 + if (fillIPxy) + registry.fill(HIST("h3_jet_pt_sign_impact_parameter_xy_significance_flavour_run2_N1"), mcdjet.pt(), vecSignImpXYSig[jetflavour][0], jetflavourRun2Def, eventWeight); + } + if (vecImpXY[jetflavour].size() > 1) { // N2 + if (fillIPxy) + registry.fill(HIST("h3_jet_pt_sign_impact_parameter_xy_significance_flavour_run2_N2"), mcdjet.pt(), vecSignImpXYSig[jetflavour][1], jetflavourRun2Def, eventWeight); + } + if (vecImpXY[jetflavour].size() > 2) { // N3 + if (fillIPxy) + registry.fill(HIST("h3_jet_pt_sign_impact_parameter_xy_significance_flavour_run2_N3"), mcdjet.pt(), vecSignImpXYSig[jetflavour][2], jetflavourRun2Def, eventWeight); } } template void fillHistogramJPData(T const& jet) { + float eventWeight = 1.0; + float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + if (jet.pt() > pTHatMaxMCD * pTHat) { + return; + } registry.fill(HIST("h2_jet_pt_JP"), jet.pt(), jet.jetProb()[0]); registry.fill(HIST("h2_jet_pt_neg_log_JP"), jet.pt(), -1 * std::log(jet.jetProb()[0])); registry.fill(HIST("h2_jet_pt_JP_N1"), jet.pt(), jet.jetProb()[1]); @@ -600,6 +754,10 @@ struct JetTaggerHFQA { template void fillHistogramJPMCD(T const& mcdjet, float eventWeight = 1.0) { + float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + if (mcdjet.pt() > pTHatMaxMCD * pTHat) { + return; + } registry.fill(HIST("h3_jet_pt_JP_flavour"), mcdjet.pt(), mcdjet.jetProb()[0], mcdjet.origin(), eventWeight); registry.fill(HIST("h3_jet_pt_neg_log_JP_flavour"), mcdjet.pt(), -1 * TMath::Log(mcdjet.jetProb()[0]), mcdjet.origin(), eventWeight); registry.fill(HIST("h3_jet_pt_JP_N1_flavour"), mcdjet.pt(), mcdjet.jetProb()[1], mcdjet.origin(), eventWeight); @@ -613,6 +771,11 @@ struct JetTaggerHFQA { template void fillHistogramSV2ProngData(T const& jet, U const& /*prongs*/) { + float eventWeight = 1.0; + float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + if (jet.pt() > pTHatMaxMCD * pTHat) { + return; + } registry.fill(HIST("h_2prong_nprongs"), jet.template secondaryVertices_as().size()); for (const auto& prong : jet.template secondaryVertices_as()) { auto Lxy = prong.decayLengthXY(); @@ -637,6 +800,11 @@ struct JetTaggerHFQA { template void fillHistogramSV3ProngData(T const& jet, U const& /*prongs*/) { + float eventWeight = 1.0; + float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + if (jet.pt() > pTHatMaxMCD * pTHat) { + return; + } registry.fill(HIST("h_3prong_nprongs"), jet.template secondaryVertices_as().size()); for (const auto& prong : jet.template secondaryVertices_as()) { auto Lxy = prong.decayLengthXY(); @@ -661,8 +829,12 @@ struct JetTaggerHFQA { template void fillHistogramSV2ProngMCD(T const& mcdjet, U const& /*prongs*/, float eventWeight = 1.0) { + float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + if (mcdjet.pt() > pTHatMaxMCD * pTHat) { + return; + } auto origin = mcdjet.origin(); - registry.fill(HIST("h2_2prong_nprongs_flavour"), mcdjet.template secondaryVertices_as().size(), origin); + registry.fill(HIST("h2_2prong_nprongs_flavour"), mcdjet.template secondaryVertices_as().size(), origin, eventWeight); if (mcdjet.template secondaryVertices_as().size() < 1) return; for (const auto& prong : mcdjet.template secondaryVertices_as()) { @@ -670,26 +842,67 @@ struct JetTaggerHFQA { auto Sxy = prong.decayLengthXY() / prong.errorDecayLengthXY(); auto Lxyz = prong.decayLength(); auto Sxyz = prong.decayLength() / prong.errorDecayLength(); - registry.fill(HIST("h3_jet_pt_2prong_Lxy_flavour"), mcdjet.pt(), Lxy, origin); - registry.fill(HIST("h3_jet_pt_2prong_Sxy_flavour"), mcdjet.pt(), Sxy, origin); - registry.fill(HIST("h3_jet_pt_2prong_Lxyz_flavour"), mcdjet.pt(), Lxyz, origin); - registry.fill(HIST("h3_jet_pt_2prong_Sxyz_flavour"), mcdjet.pt(), Sxyz, origin); - registry.fill(HIST("h3_jet_pt_2prong_sigmaLxy_flavour"), mcdjet.pt(), prong.errorDecayLengthXY(), origin); - registry.fill(HIST("h3_jet_pt_2prong_sigmaLxyz_flavour"), mcdjet.pt(), prong.errorDecayLength(), origin); + registry.fill(HIST("h3_jet_pt_2prong_Lxy_flavour"), mcdjet.pt(), Lxy, origin, eventWeight); + registry.fill(HIST("h3_jet_pt_2prong_Sxy_flavour"), mcdjet.pt(), Sxy, origin, eventWeight); + registry.fill(HIST("h3_jet_pt_2prong_Lxyz_flavour"), mcdjet.pt(), Lxyz, origin, eventWeight); + registry.fill(HIST("h3_jet_pt_2prong_Sxyz_flavour"), mcdjet.pt(), Sxyz, origin, eventWeight); + registry.fill(HIST("h3_jet_pt_2prong_sigmaLxy_flavour"), mcdjet.pt(), prong.errorDecayLengthXY(), origin, eventWeight); + registry.fill(HIST("h3_jet_pt_2prong_sigmaLxyz_flavour"), mcdjet.pt(), prong.errorDecayLength(), origin, eventWeight); } auto bjetCand = jettaggingutilities::jetFromProngMaxDecayLength(mcdjet, prongChi2PCAMax, prongsigmaLxyMax); auto maxSxy = bjetCand.decayLengthXY() / bjetCand.errorDecayLengthXY(); auto massSV = bjetCand.m(); auto bjetCandForXYZ = jettaggingutilities::jetFromProngMaxDecayLength(mcdjet, prongChi2PCAMax, prongsigmaLxyzMax, true); auto maxSxyz = bjetCandForXYZ.decayLength() / bjetCandForXYZ.errorDecayLength(); - registry.fill(HIST("h3_jet_pt_2prong_Sxy_N1_flavour"), mcdjet.pt(), maxSxy, origin); - registry.fill(HIST("h3_jet_pt_2prong_Sxyz_N1_flavour"), mcdjet.pt(), maxSxyz, origin); - registry.fill(HIST("h3_jet_pt_2prong_mass_N1_flavour"), mcdjet.pt(), massSV, origin); + registry.fill(HIST("h3_jet_pt_2prong_Sxy_N1_flavour"), mcdjet.pt(), maxSxy, origin, eventWeight); + registry.fill(HIST("h3_jet_pt_2prong_Sxyz_N1_flavour"), mcdjet.pt(), maxSxyz, origin, eventWeight); + registry.fill(HIST("h3_jet_pt_2prong_mass_N1_flavour"), mcdjet.pt(), massSV, origin, eventWeight); + } + + template + void fillHistogramSV2ProngMCPMCDMatched(T const& mcdjet, U const& /*mcpjets*/, V const& /*prongs*/, W const& particlesPerColl, float eventWeight = 1.0) + { + float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + if (mcdjet.pt() > pTHatMaxMCD * pTHat) { + return; + } + int jetflavourRun2Def = -1; + for (auto& mcpjet : mcdjet.template matchedJetGeo_as()) { + jetflavourRun2Def = jettaggingutilities::getJetFlavor(mcpjet, particlesPerColl); + } + if (jetflavourRun2Def < 0) + return; + if (mcdjet.template secondaryVertices_as().size() < 1) + return; + for (const auto& prong : mcdjet.template secondaryVertices_as()) { + auto Lxy = prong.decayLengthXY(); + auto Sxy = prong.decayLengthXY() / prong.errorDecayLengthXY(); + auto Lxyz = prong.decayLength(); + auto Sxyz = prong.decayLength() / prong.errorDecayLength(); + registry.fill(HIST("h3_jet_pt_2prong_Lxy_flavour_run2"), mcdjet.pt(), Lxy, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_2prong_Sxy_flavour_run2"), mcdjet.pt(), Sxy, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_2prong_Lxyz_flavour_run2"), mcdjet.pt(), Lxyz, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_2prong_Sxyz_flavour_run2"), mcdjet.pt(), Sxyz, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_2prong_sigmaLxy_flavour_run2"), mcdjet.pt(), prong.errorDecayLengthXY(), jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_2prong_sigmaLxyz_flavour_run2"), mcdjet.pt(), prong.errorDecayLength(), jetflavourRun2Def, eventWeight); + } + auto bjetCand = jettaggingutilities::jetFromProngMaxDecayLength(mcdjet, prongChi2PCAMax, prongsigmaLxyMax); + auto maxSxy = bjetCand.decayLengthXY() / bjetCand.errorDecayLengthXY(); + auto massSV = bjetCand.m(); + auto bjetCandForXYZ = jettaggingutilities::jetFromProngMaxDecayLength(mcdjet, prongChi2PCAMax, prongsigmaLxyzMax, true); + auto maxSxyz = bjetCandForXYZ.decayLength() / bjetCandForXYZ.errorDecayLength(); + registry.fill(HIST("h3_jet_pt_2prong_Sxy_N1_flavour_run2"), mcdjet.pt(), maxSxy, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_2prong_Sxyz_N1_flavour_run2"), mcdjet.pt(), maxSxyz, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_2prong_mass_N1_flavour_run2"), mcdjet.pt(), massSV, jetflavourRun2Def, eventWeight); } template void fillHistogramSV3ProngMCD(T const& mcdjet, U const& /*prongs*/, float eventWeight = 1.0) { + float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + if (mcdjet.pt() > pTHatMaxMCD * pTHat) { + return; + } auto origin = mcdjet.origin(); registry.fill(HIST("h2_3prong_nprongs_flavour"), mcdjet.template secondaryVertices_as().size(), origin); if (mcdjet.template secondaryVertices_as().size() < 1) @@ -699,21 +912,58 @@ struct JetTaggerHFQA { auto Sxy = prong.decayLengthXY() / prong.errorDecayLengthXY(); auto Lxyz = prong.decayLength(); auto Sxyz = prong.decayLength() / prong.errorDecayLength(); - registry.fill(HIST("h3_jet_pt_3prong_Lxy_flavour"), mcdjet.pt(), Lxy, origin); - registry.fill(HIST("h3_jet_pt_3prong_Sxy_flavour"), mcdjet.pt(), Sxy, origin); - registry.fill(HIST("h3_jet_pt_3prong_Lxyz_flavour"), mcdjet.pt(), Lxyz, origin); - registry.fill(HIST("h3_jet_pt_3prong_Sxyz_flavour"), mcdjet.pt(), Sxyz, origin); - registry.fill(HIST("h3_jet_pt_3prong_sigmaLxy_flavour"), mcdjet.pt(), prong.errorDecayLengthXY(), origin); - registry.fill(HIST("h3_jet_pt_3prong_sigmaLxyz_flavour"), mcdjet.pt(), prong.errorDecayLength(), origin); + registry.fill(HIST("h3_jet_pt_3prong_Lxy_flavour"), mcdjet.pt(), Lxy, origin, eventWeight); + registry.fill(HIST("h3_jet_pt_3prong_Sxy_flavour"), mcdjet.pt(), Sxy, origin, eventWeight); + registry.fill(HIST("h3_jet_pt_3prong_Lxyz_flavour"), mcdjet.pt(), Lxyz, origin, eventWeight); + registry.fill(HIST("h3_jet_pt_3prong_Sxyz_flavour"), mcdjet.pt(), Sxyz, origin, eventWeight); + registry.fill(HIST("h3_jet_pt_3prong_sigmaLxy_flavour"), mcdjet.pt(), prong.errorDecayLengthXY(), origin, eventWeight); + registry.fill(HIST("h3_jet_pt_3prong_sigmaLxyz_flavour"), mcdjet.pt(), prong.errorDecayLength(), origin, eventWeight); } auto bjetCand = jettaggingutilities::jetFromProngMaxDecayLength(mcdjet, prongChi2PCAMax, prongsigmaLxyMax); auto maxSxy = bjetCand.decayLengthXY() / bjetCand.errorDecayLengthXY(); auto massSV = bjetCand.m(); auto bjetCandForXYZ = jettaggingutilities::jetFromProngMaxDecayLength(mcdjet, prongChi2PCAMax, prongsigmaLxyzMax, true); auto maxSxyz = bjetCandForXYZ.decayLength() / bjetCandForXYZ.errorDecayLength(); - registry.fill(HIST("h3_jet_pt_3prong_Sxy_N1_flavour"), mcdjet.pt(), maxSxy, origin); - registry.fill(HIST("h3_jet_pt_3prong_Sxyz_N1_flavour"), mcdjet.pt(), maxSxyz, origin); - registry.fill(HIST("h3_jet_pt_3prong_mass_N1_flavour"), mcdjet.pt(), massSV, origin); + registry.fill(HIST("h3_jet_pt_3prong_Sxy_N1_flavour"), mcdjet.pt(), maxSxy, origin, eventWeight); + registry.fill(HIST("h3_jet_pt_3prong_Sxyz_N1_flavour"), mcdjet.pt(), maxSxyz, origin, eventWeight); + registry.fill(HIST("h3_jet_pt_3prong_mass_N1_flavour"), mcdjet.pt(), massSV, origin, eventWeight); + } + + template + void fillHistogramSV3ProngMCPMCDMatched(T const& mcdjet, U const& /*mcpjets*/, V const& /*prongs*/, W const& particlesPerColl, float eventWeight = 1.0) + { + float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + if (mcdjet.pt() > pTHatMaxMCD * pTHat) { + return; + } + int jetflavourRun2Def = -1; + for (auto& mcpjet : mcdjet.template matchedJetGeo_as()) { + jetflavourRun2Def = jettaggingutilities::getJetFlavor(mcpjet, particlesPerColl); + } + if (jetflavourRun2Def < 0) + return; + if (mcdjet.template secondaryVertices_as().size() < 1) + return; + for (const auto& prong : mcdjet.template secondaryVertices_as()) { + auto Lxy = prong.decayLengthXY(); + auto Sxy = prong.decayLengthXY() / prong.errorDecayLengthXY(); + auto Lxyz = prong.decayLength(); + auto Sxyz = prong.decayLength() / prong.errorDecayLength(); + registry.fill(HIST("h3_jet_pt_3prong_Lxy_flavour_run2"), mcdjet.pt(), Lxy, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_3prong_Sxy_flavour_run2"), mcdjet.pt(), Sxy, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_3prong_Lxyz_flavour_run2"), mcdjet.pt(), Lxyz, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_3prong_Sxyz_flavour_run2"), mcdjet.pt(), Sxyz, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_3prong_sigmaLxy_flavour_run2"), mcdjet.pt(), prong.errorDecayLengthXY(), jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_3prong_sigmaLxyz_flavour_run2"), mcdjet.pt(), prong.errorDecayLength(), jetflavourRun2Def, eventWeight); + } + auto bjetCand = jettaggingutilities::jetFromProngMaxDecayLength(mcdjet, prongChi2PCAMax, prongsigmaLxyMax); + auto maxSxy = bjetCand.decayLengthXY() / bjetCand.errorDecayLengthXY(); + auto massSV = bjetCand.m(); + auto bjetCandForXYZ = jettaggingutilities::jetFromProngMaxDecayLength(mcdjet, prongChi2PCAMax, prongsigmaLxyzMax, true); + auto maxSxyz = bjetCandForXYZ.decayLength() / bjetCandForXYZ.errorDecayLength(); + registry.fill(HIST("h3_jet_pt_3prong_Sxy_N1_flavour_run2"), mcdjet.pt(), maxSxy, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_3prong_Sxyz_N1_flavour_run2"), mcdjet.pt(), maxSxyz, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_jet_pt_3prong_mass_N1_flavour_run2"), mcdjet.pt(), massSV, jetflavourRun2Def, eventWeight); } void processDummy(aod::Collision const&, aod::Tracks const&) @@ -757,6 +1007,9 @@ struct JetTaggerHFQA { if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } + if (!isAcceptedJet(jet)) { + continue; + } fillHistogramIPsData(jet, jtracks); } } @@ -771,6 +1024,9 @@ struct JetTaggerHFQA { if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } + if (!isAcceptedJet(mcdjet)) { + continue; + } fillHistogramIPsMCD(mcdjet, jtracks); } } @@ -790,11 +1046,83 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processIPsMCDWeighted, "Fill impact parameter imformation for mcd jets", false); - void processIPsMCPMCDMatched(soa::Filtered>::iterator const& jcollision, JetTagTableMCDMCPMatched const& mcdjets, JetTagTableMCPMCDMatched const& mcpjets, JetTagTracksMCD const& jtracks, JetParticles& particles) + void processIPsMCP(soa::Filtered const& collisions, JetTagTableMCP const& mcpjets, JetParticles&) + { + for (auto mcpjet : mcpjets) { + if (!jetfindingutilities::isInEtaAcceptance(mcpjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + if (!isAcceptedJet(mcpjet)) { + return; + } + if (checkMcCollisionIsMatched) { + auto collisionspermcpjet = collisions.sliceBy(CollisionsPerMCPCollision, mcpjet.mcCollisionId()); + if (collisionspermcpjet.size() >= 1 && jetderiveddatautilities::selectCollision(collisionspermcpjet.begin(), eventSelection)) { + fillHistogramIPsMCP(mcpjet); + } else { + fillHistogramIPsMCP(mcpjet); + } + } + } + } + PROCESS_SWITCH(JetTaggerHFQA, processIPsMCP, "Fill impact parameter imformation for mcp jets", false); + + void processIPsMCPWeighted(soa::Filtered const& collisions, soa::Join const& mcpjets, JetParticles&) + { + for (auto mcpjet : mcpjets) { + if (!jetfindingutilities::isInEtaAcceptance(mcpjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + if (!isAcceptedJet(mcpjet)) { + return; + } + if (checkMcCollisionIsMatched) { + auto collisionspermcpjet = collisions.sliceBy(CollisionsPerMCPCollision, mcpjet.mcCollisionId()); + if (collisionspermcpjet.size() >= 1 && jetderiveddatautilities::selectCollision(collisionspermcpjet.begin(), eventSelection)) { + fillHistogramIPsMCP(mcpjet, mcpjet.eventWeight()); + } else { + fillHistogramIPsMCP(mcpjet, mcpjet.eventWeight()); + } + } + } + } + PROCESS_SWITCH(JetTaggerHFQA, processIPsMCPWeighted, "Fill impact parameter imformation for mcp jets weighted", false); + + void processIPsMCPMCDMatched(soa::Filtered>::iterator const& collision, JetTagTableMCDMCPMatched const& mcdjets, JetTagTableMCPMCDMatched const& mcpjets, JetTagTracksMCD const& jtracks, JetParticles& particles) + { + if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { + return; + } + for (auto& mcdjet : mcdjets) { + auto const particlesPerColl = particles.sliceBy(particlesPerCollision, collision.mcCollisionId()); + if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + if (!isAcceptedJet(mcdjet)) { + continue; + } + fillHistogramIPsMatched(mcdjet, mcpjets, jtracks, particlesPerColl); + } + } + PROCESS_SWITCH(JetTaggerHFQA, processIPsMCPMCDMatched, "Fill impact parameter imformation for mcp mcd matched jets", false); + + void processIPsMCPMCDMatchedWeighted(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, soa::Join const& mcpjets, JetTagTracksMCD const& jtracks, JetParticles& particles) { - fillHistogramIPsMCPMCDMatched(jcollision, mcdjets, mcpjets, jtracks, particles); + if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { + return; + } + for (auto& mcdjet : mcdjets) { + auto const particlesPerColl = particles.sliceBy(particlesPerCollision, collision.mcCollisionId()); + if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + if (!isAcceptedJet(mcdjet)) { + continue; + } + fillHistogramIPsMatched(mcdjet, mcpjets, jtracks, particlesPerColl, mcdjet.eventWeight()); + } } - PROCESS_SWITCH(JetTaggerHFQA, processIPsMCPMCDMatched, "Fill impact parameter imformation for mcp mcd mathced jets", false); + PROCESS_SWITCH(JetTaggerHFQA, processIPsMCPMCDMatchedWeighted, "Fill impact parameter imformation for mcp mcd matched jets", false); void processJPData(soa::Filtered::iterator const& collision, JetTagTableData const& jets, JetTagTracksData const&) { @@ -805,6 +1133,9 @@ struct JetTaggerHFQA { if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } + if (!isAcceptedJet(jet)) { + continue; + } fillHistogramJPData(jet); } } @@ -819,6 +1150,9 @@ struct JetTaggerHFQA { if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } + if (!isAcceptedJet(mcdjet)) { + continue; + } fillHistogramJPMCD(mcdjet); } } @@ -833,6 +1167,9 @@ struct JetTaggerHFQA { if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } + if (!isAcceptedJet(mcdjet)) { + continue; + } fillHistogramJPMCD(mcdjet, mcdjet.eventWeight()); } } @@ -847,6 +1184,9 @@ struct JetTaggerHFQA { if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } + if (!isAcceptedJet(jet)) { + continue; + } fillHistogramSV2ProngData(jet, prongs); } } @@ -861,6 +1201,9 @@ struct JetTaggerHFQA { if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } + if (!isAcceptedJet(jet)) { + continue; + } fillHistogramSV3ProngData(jet, prongs); } } @@ -875,6 +1218,9 @@ struct JetTaggerHFQA { if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } + if (!isAcceptedJet(mcdjet)) { + continue; + } fillHistogramSV2ProngMCD(mcdjet, prongs); } } @@ -889,11 +1235,50 @@ struct JetTaggerHFQA { if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } + if (!isAcceptedJet(mcdjet)) { + continue; + } fillHistogramSV2ProngMCD(mcdjet, prongs, mcdjet.eventWeight()); } } PROCESS_SWITCH(JetTaggerHFQA, processSV2ProngMCDWeighted, "Fill 2prong imformation for mcd jets", false); + void processSV2ProngMCPMCDMatched(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, JetTagTableMCPMCDMatched const& mcpjets, aod::MCDSecondaryVertex2Prongs const& prongs, JetParticles& particles) + { + if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { + return; + } + for (auto mcdjet : mcdjets) { + auto const particlesPerColl = particles.sliceBy(particlesPerCollision, collision.mcCollisionId()); + if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + if (!isAcceptedJet(mcdjet)) { + continue; + } + fillHistogramSV2ProngMCPMCDMatched(mcdjet, mcpjets, prongs, particlesPerColl); + } + } + PROCESS_SWITCH(JetTaggerHFQA, processSV2ProngMCPMCDMatched, "Fill 2prong imformation for mcd jets", false); + + void processSV2ProngMCPMCDMatchedWeighted(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, JetTagTableMCPMCDMatched const& mcpjets, aod::MCDSecondaryVertex2Prongs const& prongs, JetParticles& particles) + { + if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { + return; + } + for (auto mcdjet : mcdjets) { + auto const particlesPerColl = particles.sliceBy(particlesPerCollision, collision.mcCollisionId()); + if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + if (!isAcceptedJet(mcdjet)) { + continue; + } + fillHistogramSV2ProngMCPMCDMatched(mcdjet, mcpjets, prongs, particlesPerColl, mcdjet.eventWeight()); + } + } + PROCESS_SWITCH(JetTaggerHFQA, processSV2ProngMCPMCDMatchedWeighted, "Fill 2prong imformation for mcd jets", false); + void processSV3ProngMCD(soa::Filtered::iterator const& collision, soa::Join const& mcdjets, aod::MCDSecondaryVertex3Prongs const& prongs) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { @@ -903,6 +1288,9 @@ struct JetTaggerHFQA { if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } + if (!isAcceptedJet(mcdjet)) { + continue; + } fillHistogramSV3ProngMCD(mcdjet, prongs); } } @@ -917,16 +1305,55 @@ struct JetTaggerHFQA { if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } + if (!isAcceptedJet(mcdjet)) { + continue; + } fillHistogramSV3ProngMCD(mcdjet, prongs, mcdjet.eventWeight()); } } PROCESS_SWITCH(JetTaggerHFQA, processSV3ProngMCDWeighted, "Fill 3prong imformation for mcd jets", false); + + void processSV3ProngMCPMCDMatched(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, JetTagTableMCPMCDMatched const& mcpjets, aod::MCDSecondaryVertex3Prongs const& prongs, JetParticles& particles) + { + if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { + return; + } + for (auto mcdjet : mcdjets) { + auto const particlesPerColl = particles.sliceBy(particlesPerCollision, collision.mcCollisionId()); + if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + if (!isAcceptedJet(mcdjet)) { + continue; + } + fillHistogramSV3ProngMCPMCDMatched(mcdjet, mcpjets, prongs, particlesPerColl); + } + } + PROCESS_SWITCH(JetTaggerHFQA, processSV3ProngMCPMCDMatched, "Fill 3prong imformation for mcd jets", false); + + void processSV3ProngMCPMCDMatchedWeighted(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, JetTagTableMCPMCDMatched const& mcpjets, aod::MCDSecondaryVertex3Prongs const& prongs, JetParticles& particles) + { + if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { + return; + } + for (auto mcdjet : mcdjets) { + auto const particlesPerColl = particles.sliceBy(particlesPerCollision, collision.mcCollisionId()); + if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + if (!isAcceptedJet(mcdjet)) { + continue; + } + fillHistogramSV3ProngMCPMCDMatched(mcdjet, mcpjets, prongs, particlesPerColl, mcdjet.eventWeight()); + } + } + PROCESS_SWITCH(JetTaggerHFQA, processSV3ProngMCPMCDMatchedWeighted, "Fill 3prong imformation for mcd jets", false); }; using JetTaggerQAChargedDataJets = soa::Join; using JetTaggerQAChargedMCDJets = soa::Join; using JetTaggerQAChargedMCDMCPJets = soa::Join; -using JetTaggerQAChargedMCPJets = soa::Join; +using JetTaggerQAChargedMCPJets = soa::Join; using JetTaggerQAChargedMCPMCDJets = soa::Join; using JetTaggerQACharged = JetTaggerHFQA; From 968cc1ef247f0277d9b6a112c7c1121b74af41df Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Sat, 31 Aug 2024 00:44:51 +0200 Subject: [PATCH 08/16] PWGEM/Dilepton: remove q vectors for 4th harmonics (#7520) * Please consider the following formatting changes * PWGEM/Dilepton: remove q vectors for 4th harmonics --------- Co-authored-by: ALICE Action Bot --- PWGEM/Dilepton/Core/Dilepton.h | 2 - PWGEM/Dilepton/DataModel/dileptonTables.h | 18 +++--- .../TableProducer/createEMEventDilepton.cxx | 16 +---- .../TableProducer/filterDielectronEvent.cxx | 16 +---- PWGEM/Dilepton/Utils/EventHistograms.h | 61 ++++++++++--------- .../TableProducer/createEMEventPhoton.cxx | 22 ++----- 6 files changed, 49 insertions(+), 86 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 51b5ad97812..6ba38a36d52 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -829,7 +829,6 @@ struct Dilepton { {{999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}}, // 1st harmonics {q2ft0m, q2ft0a, q2ft0c, q2btot, q2bpos, q2bneg}, // 2nd harmonics {q3ft0m, q3ft0a, q3ft0c, q3btot, q3bpos, q3bneg}, // 3rd harmonics - {{999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}}, // 4th harmonics }; if constexpr (ev_id == 0) { @@ -1039,7 +1038,6 @@ struct Dilepton { {{999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}}, // 1st harmonics {q2ft0m, q2ft0a, q2ft0c, q2btot, q2bpos, q2bneg}, // 2nd harmonics {q3ft0m, q3ft0a, q3ft0c, q3btot, q3bpos, q3bneg}, // 3rd harmonics - {{999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}}, // 4th harmonics }; if (nmod == 2) { diff --git a/PWGEM/Dilepton/DataModel/dileptonTables.h b/PWGEM/Dilepton/DataModel/dileptonTables.h index 750ecc971f5..541362c6ee0 100644 --- a/PWGEM/Dilepton/DataModel/dileptonTables.h +++ b/PWGEM/Dilepton/DataModel/dileptonTables.h @@ -153,8 +153,8 @@ DECLARE_SOA_TABLE(EMEventsQvec, "AOD", "EMEVENTQVEC", //! event q vector table emevent::Q2xBPos, emevent::Q2yBPos, emevent::Q2xBNeg, emevent::Q2yBNeg, emevent::Q2xBTot, emevent::Q2yBTot, emevent::Q3xFT0M, emevent::Q3yFT0M, emevent::Q3xFT0A, emevent::Q3yFT0A, emevent::Q3xFT0C, emevent::Q3yFT0C, emevent::Q3xBPos, emevent::Q3yBPos, emevent::Q3xBNeg, emevent::Q3yBNeg, emevent::Q3xBTot, emevent::Q3yBTot, - emevent::Q4xFT0M, emevent::Q4yFT0M, emevent::Q4xFT0A, emevent::Q4yFT0A, emevent::Q4xFT0C, emevent::Q4yFT0C, - emevent::Q4xBPos, emevent::Q4yBPos, emevent::Q4xBNeg, emevent::Q4yBNeg, emevent::Q4xBTot, emevent::Q4yBTot, + // emevent::Q4xFT0M, emevent::Q4yFT0M, emevent::Q4xFT0A, emevent::Q4yFT0A, emevent::Q4xFT0C, emevent::Q4yFT0C, + // emevent::Q4xBPos, emevent::Q4yBPos, emevent::Q4xBNeg, emevent::Q4yBNeg, emevent::Q4xBTot, emevent::Q4yBTot, // Dynamic columns emevent::EP2FT0M, @@ -168,13 +168,13 @@ DECLARE_SOA_TABLE(EMEventsQvec, "AOD", "EMEVENTQVEC", //! event q vector table emevent::EP3FT0C, emevent::EP3BPos, emevent::EP3BNeg, - emevent::EP3BTot, - emevent::EP4FT0M, - emevent::EP4FT0A, - emevent::EP4FT0C, - emevent::EP4BPos, - emevent::EP4BNeg, - emevent::EP4BTot); + emevent::EP3BTot); +// emevent::EP4FT0M, +// emevent::EP4FT0A, +// emevent::EP4FT0C, +// emevent::EP4BPos, +// emevent::EP4BNeg, +// emevent::EP4BTot using EMEventQvec = EMEventsQvec::iterator; DECLARE_SOA_TABLE(EMSWTriggerInfos, "AOD", "EMSWTRIGGERINFO", //! joinable to EMEvents diff --git a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx index 7ddf963f617..3006dacce05 100644 --- a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx +++ b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx @@ -204,29 +204,19 @@ struct CreateEMEventDilepton { if constexpr (eventype == EMEventType::kEvent) { event_cent(105.f, 105.f, 105.f, 105.f); event_qvec( - 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f); } else if constexpr (eventype == EMEventType::kEvent_Cent) { event_cent(collision.centFT0M(), collision.centFT0A(), collision.centFT0C(), collision.centNTPV()); event_qvec( - 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f); } else if constexpr (eventype == EMEventType::kEvent_Cent_Qvec) { event_cent(collision.centFT0M(), collision.centFT0A(), collision.centFT0C(), collision.centNTPV()); float q2xft0m = 999.f, q2yft0m = 999.f, q2xft0a = 999.f, q2yft0a = 999.f, q2xft0c = 999.f, q2yft0c = 999.f, q2xbpos = 999.f, q2ybpos = 999.f, q2xbneg = 999.f, q2ybneg = 999.f, q2xbtot = 999.f, q2ybtot = 999.f; float q3xft0m = 999.f, q3yft0m = 999.f, q3xft0a = 999.f, q3yft0a = 999.f, q3xft0c = 999.f, q3yft0c = 999.f, q3xbpos = 999.f, q3ybpos = 999.f, q3xbneg = 999.f, q3ybneg = 999.f, q3xbtot = 999.f, q3ybtot = 999.f; - float q4xft0m = 999.f, q4yft0m = 999.f, q4xft0a = 999.f, q4yft0a = 999.f, q4xft0c = 999.f, q4yft0c = 999.f, q4xbpos = 999.f, q4ybpos = 999.f, q4xbneg = 999.f, q4ybneg = 999.f, q4xbtot = 999.f, q4ybtot = 999.f; - if (collision.qvecFT0CReVec().size() >= 3) { // harmonics 2,3,4 - q2xft0m = collision.qvecFT0MReVec()[0], q2xft0a = collision.qvecFT0AReVec()[0], q2xft0c = collision.qvecFT0CReVec()[0], q2xbpos = collision.qvecBPosReVec()[0], q2xbneg = collision.qvecBNegReVec()[0], q2xbtot = collision.qvecBTotReVec()[0]; - q2yft0m = collision.qvecFT0MImVec()[0], q2yft0a = collision.qvecFT0AImVec()[0], q2yft0c = collision.qvecFT0CImVec()[0], q2ybpos = collision.qvecBPosImVec()[0], q2ybneg = collision.qvecBNegImVec()[0], q2ybtot = collision.qvecBTotImVec()[0]; - q3xft0m = collision.qvecFT0MReVec()[1], q3xft0a = collision.qvecFT0AReVec()[1], q3xft0c = collision.qvecFT0CReVec()[1], q3xbpos = collision.qvecBPosReVec()[1], q3xbneg = collision.qvecBNegReVec()[1], q3xbtot = collision.qvecBTotReVec()[1]; - q3yft0m = collision.qvecFT0MImVec()[1], q3yft0a = collision.qvecFT0AImVec()[1], q3yft0c = collision.qvecFT0CImVec()[1], q3ybpos = collision.qvecBPosImVec()[1], q3ybneg = collision.qvecBNegImVec()[1], q3ybtot = collision.qvecBTotImVec()[1]; - q4xft0m = collision.qvecFT0MReVec()[2], q4xft0a = collision.qvecFT0AReVec()[2], q4xft0c = collision.qvecFT0CReVec()[2], q4xbpos = collision.qvecBPosReVec()[2], q4xbneg = collision.qvecBNegReVec()[2], q4xbtot = collision.qvecBTotReVec()[2]; - q4yft0m = collision.qvecFT0MImVec()[2], q4yft0a = collision.qvecFT0AImVec()[2], q4yft0c = collision.qvecFT0CImVec()[2], q4ybpos = collision.qvecBPosImVec()[2], q4ybneg = collision.qvecBNegImVec()[2], q4ybtot = collision.qvecBTotImVec()[2]; - } else if (collision.qvecFT0CReVec().size() >= 2) { // harmonics 2,3 + if (collision.qvecFT0CReVec().size() >= 2) { // harmonics 2,3 q2xft0m = collision.qvecFT0MReVec()[0], q2xft0a = collision.qvecFT0AReVec()[0], q2xft0c = collision.qvecFT0CReVec()[0], q2xbpos = collision.qvecBPosReVec()[0], q2xbneg = collision.qvecBNegReVec()[0], q2xbtot = collision.qvecBTotReVec()[0]; q2yft0m = collision.qvecFT0MImVec()[0], q2yft0a = collision.qvecFT0AImVec()[0], q2yft0c = collision.qvecFT0CImVec()[0], q2ybpos = collision.qvecBPosImVec()[0], q2ybneg = collision.qvecBNegImVec()[0], q2ybtot = collision.qvecBTotImVec()[0]; q3xft0m = collision.qvecFT0MReVec()[1], q3xft0a = collision.qvecFT0AReVec()[1], q3xft0c = collision.qvecFT0CReVec()[1], q3xbpos = collision.qvecBPosReVec()[1], q3xbneg = collision.qvecBNegReVec()[1], q3xbtot = collision.qvecBTotReVec()[1]; @@ -237,12 +227,10 @@ struct CreateEMEventDilepton { } event_qvec( q2xft0m, q2yft0m, q2xft0a, q2yft0a, q2xft0c, q2yft0c, q2xbpos, q2ybpos, q2xbneg, q2ybneg, q2xbtot, q2ybtot, - q3xft0m, q3yft0m, q3xft0a, q3yft0a, q3xft0c, q3yft0c, q3xbpos, q3ybpos, q3xbneg, q3ybneg, q3xbtot, q3ybtot, - q4xft0m, q4yft0m, q4xft0a, q4yft0a, q4xft0c, q4yft0c, q4xbpos, q4ybpos, q4xbneg, q4ybneg, q4xbtot, q4ybtot); + q3xft0m, q3yft0m, q3xft0a, q3yft0a, q3xft0c, q3yft0c, q3xbpos, q3ybpos, q3xbneg, q3ybneg, q3xbtot, q3ybtot); } else { event_cent(105.f, 105.f, 105.f, 105.f); event_qvec( - 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f); } diff --git a/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx b/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx index cc944169d5f..ea15648f708 100644 --- a/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx +++ b/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx @@ -899,29 +899,19 @@ struct createEMEvent2VP { if constexpr (eventype == EMEventType::kEvent) { event_cent(105.f, 105.f, 105.f, 105.f); event_qvec( - 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f); } else if constexpr (eventype == EMEventType::kEvent_Cent) { event_cent(collision.centFT0M(), collision.centFT0A(), collision.centFT0C(), collision.centNTPV()); event_qvec( - 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f); } else if constexpr (eventype == EMEventType::kEvent_Cent_Qvec) { event_cent(collision.centFT0M(), collision.centFT0A(), collision.centFT0C(), collision.centNTPV()); float q2xft0m = 999.f, q2yft0m = 999.f, q2xft0a = 999.f, q2yft0a = 999.f, q2xft0c = 999.f, q2yft0c = 999.f, q2xbpos = 999.f, q2ybpos = 999.f, q2xbneg = 999.f, q2ybneg = 999.f, q2xbtot = 999.f, q2ybtot = 999.f; float q3xft0m = 999.f, q3yft0m = 999.f, q3xft0a = 999.f, q3yft0a = 999.f, q3xft0c = 999.f, q3yft0c = 999.f, q3xbpos = 999.f, q3ybpos = 999.f, q3xbneg = 999.f, q3ybneg = 999.f, q3xbtot = 999.f, q3ybtot = 999.f; - float q4xft0m = 999.f, q4yft0m = 999.f, q4xft0a = 999.f, q4yft0a = 999.f, q4xft0c = 999.f, q4yft0c = 999.f, q4xbpos = 999.f, q4ybpos = 999.f, q4xbneg = 999.f, q4ybneg = 999.f, q4xbtot = 999.f, q4ybtot = 999.f; - if (collision.qvecFT0CReVec().size() >= 3) { // harmonics 2,3,4 - q2xft0m = collision.qvecFT0MReVec()[0], q2xft0a = collision.qvecFT0AReVec()[0], q2xft0c = collision.qvecFT0CReVec()[0], q2xbpos = collision.qvecBPosReVec()[0], q2xbneg = collision.qvecBNegReVec()[0], q2xbtot = collision.qvecBTotReVec()[0]; - q2yft0m = collision.qvecFT0MImVec()[0], q2yft0a = collision.qvecFT0AImVec()[0], q2yft0c = collision.qvecFT0CImVec()[0], q2ybpos = collision.qvecBPosImVec()[0], q2ybneg = collision.qvecBNegImVec()[0], q2ybtot = collision.qvecBTotImVec()[0]; - q3xft0m = collision.qvecFT0MReVec()[1], q3xft0a = collision.qvecFT0AReVec()[1], q3xft0c = collision.qvecFT0CReVec()[1], q3xbpos = collision.qvecBPosReVec()[1], q3xbneg = collision.qvecBNegReVec()[1], q3xbtot = collision.qvecBTotReVec()[1]; - q3yft0m = collision.qvecFT0MImVec()[1], q3yft0a = collision.qvecFT0AImVec()[1], q3yft0c = collision.qvecFT0CImVec()[1], q3ybpos = collision.qvecBPosImVec()[1], q3ybneg = collision.qvecBNegImVec()[1], q3ybtot = collision.qvecBTotImVec()[1]; - q4xft0m = collision.qvecFT0MReVec()[2], q4xft0a = collision.qvecFT0AReVec()[2], q4xft0c = collision.qvecFT0CReVec()[2], q4xbpos = collision.qvecBPosReVec()[2], q4xbneg = collision.qvecBNegReVec()[2], q4xbtot = collision.qvecBTotReVec()[2]; - q4yft0m = collision.qvecFT0MImVec()[2], q4yft0a = collision.qvecFT0AImVec()[2], q4yft0c = collision.qvecFT0CImVec()[2], q4ybpos = collision.qvecBPosImVec()[2], q4ybneg = collision.qvecBNegImVec()[2], q4ybtot = collision.qvecBTotImVec()[2]; - } else if (collision.qvecFT0CReVec().size() >= 2) { // harmonics 2,3 + if (collision.qvecFT0CReVec().size() >= 2) { // harmonics 2,3 q2xft0m = collision.qvecFT0MReVec()[0], q2xft0a = collision.qvecFT0AReVec()[0], q2xft0c = collision.qvecFT0CReVec()[0], q2xbpos = collision.qvecBPosReVec()[0], q2xbneg = collision.qvecBNegReVec()[0], q2xbtot = collision.qvecBTotReVec()[0]; q2yft0m = collision.qvecFT0MImVec()[0], q2yft0a = collision.qvecFT0AImVec()[0], q2yft0c = collision.qvecFT0CImVec()[0], q2ybpos = collision.qvecBPosImVec()[0], q2ybneg = collision.qvecBNegImVec()[0], q2ybtot = collision.qvecBTotImVec()[0]; q3xft0m = collision.qvecFT0MReVec()[1], q3xft0a = collision.qvecFT0AReVec()[1], q3xft0c = collision.qvecFT0CReVec()[1], q3xbpos = collision.qvecBPosReVec()[1], q3xbneg = collision.qvecBNegReVec()[1], q3xbtot = collision.qvecBTotReVec()[1]; @@ -932,12 +922,10 @@ struct createEMEvent2VP { } event_qvec( q2xft0m, q2yft0m, q2xft0a, q2yft0a, q2xft0c, q2yft0c, q2xbpos, q2ybpos, q2xbneg, q2ybneg, q2xbtot, q2ybtot, - q3xft0m, q3yft0m, q3xft0a, q3yft0a, q3xft0c, q3yft0c, q3xbpos, q3ybpos, q3xbneg, q3ybneg, q3xbtot, q3ybtot, - q4xft0m, q4yft0m, q4xft0a, q4yft0a, q4xft0c, q4yft0c, q4xbpos, q4ybpos, q4xbneg, q4ybneg, q4xbtot, q4ybtot); + q3xft0m, q3yft0m, q3xft0a, q3yft0a, q3xft0c, q3yft0c, q3xbpos, q3ybpos, q3xbneg, q3ybneg, q3xbtot, q3ybtot); } else { event_cent(105.f, 105.f, 105.f, 105.f); event_qvec( - 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f); } diff --git a/PWGEM/Dilepton/Utils/EventHistograms.h b/PWGEM/Dilepton/Utils/EventHistograms.h index 197ef364219..410cf65120e 100644 --- a/PWGEM/Dilepton/Utils/EventHistograms.h +++ b/PWGEM/Dilepton/Utils/EventHistograms.h @@ -117,38 +117,39 @@ void addEventHistograms(HistogramRegistry* fRegistry) fRegistry->add("Event/before/hPrfQ3FT0AQ3BNeg_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BNeg}", kTProfile, {{100, 0, 100}}, false); fRegistry->add("Event/before/hPrfQ3FT0AQ3BTot_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BTot}", kTProfile, {{100, 0, 100}}, false); fRegistry->add("Event/before/hPrfQ3FT0AQ3FT0C_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{FT0C};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{FT0C}", kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons - } else if constexpr (nmod == 4) { // Q4 - fRegistry->add("Event/before/hQ4xFT0M_CentFT0C", "hQ4xFT0M_CentFT0C;centrality FT0C (%);Q_{4,x}^{FT0M}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ4yFT0M_CentFT0C", "hQ4yFT0M_CentFT0C;centrality FT0C (%);Q_{4,y}^{FT0M}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ4xFT0A_CentFT0C", "hQ4xFT0A_CentFT0C;centrality FT0C (%);Q_{4,x}^{FT0A}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ4yFT0A_CentFT0C", "hQ4yFT0A_CentFT0C;centrality FT0C (%);Q_{4,y}^{FT0A}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ4xFT0C_CentFT0C", "hQ4xFT0C_CentFT0C;centrality FT0C (%);Q_{4,x}^{FT0C}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ4yFT0C_CentFT0C", "hQ4yFT0C_CentFT0C;centrality FT0C (%);Q_{4,y}^{FT0C}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ4xBPos_CentFT0C", "hQ4xBPos_CentFT0C;centrality FT0C (%);Q_{4,x}^{BPos}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ4yBPos_CentFT0C", "hQ4yBPos_CentFT0C;centrality FT0C (%);Q_{4,y}^{BPos}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ4xBNeg_CentFT0C", "hQ4xBNeg_CentFT0C;centrality FT0C (%);Q_{4,x}^{BNeg}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ4yBNeg_CentFT0C", "hQ4yBNeg_CentFT0C;centrality FT0C (%);Q_{4,y}^{BNeg}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ4xBTot_CentFT0C", "hQ4xBTot_CentFT0C;centrality FT0C (%);Q_{4,x}^{BTot}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ4yBTot_CentFT0C", "hQ4yBTot_CentFT0C;centrality FT0C (%);Q_{4,y}^{BTot}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + } + // else if constexpr (nmod == 4) { // Q4 + // fRegistry->add("Event/before/hQ4xFT0M_CentFT0C", "hQ4xFT0M_CentFT0C;centrality FT0C (%);Q_{4,x}^{FT0M}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + // fRegistry->add("Event/before/hQ4yFT0M_CentFT0C", "hQ4yFT0M_CentFT0C;centrality FT0C (%);Q_{4,y}^{FT0M}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + // fRegistry->add("Event/before/hQ4xFT0A_CentFT0C", "hQ4xFT0A_CentFT0C;centrality FT0C (%);Q_{4,x}^{FT0A}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + // fRegistry->add("Event/before/hQ4yFT0A_CentFT0C", "hQ4yFT0A_CentFT0C;centrality FT0C (%);Q_{4,y}^{FT0A}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + // fRegistry->add("Event/before/hQ4xFT0C_CentFT0C", "hQ4xFT0C_CentFT0C;centrality FT0C (%);Q_{4,x}^{FT0C}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + // fRegistry->add("Event/before/hQ4yFT0C_CentFT0C", "hQ4yFT0C_CentFT0C;centrality FT0C (%);Q_{4,y}^{FT0C}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + // fRegistry->add("Event/before/hQ4xBPos_CentFT0C", "hQ4xBPos_CentFT0C;centrality FT0C (%);Q_{4,x}^{BPos}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + // fRegistry->add("Event/before/hQ4yBPos_CentFT0C", "hQ4yBPos_CentFT0C;centrality FT0C (%);Q_{4,y}^{BPos}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + // fRegistry->add("Event/before/hQ4xBNeg_CentFT0C", "hQ4xBNeg_CentFT0C;centrality FT0C (%);Q_{4,x}^{BNeg}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + // fRegistry->add("Event/before/hQ4yBNeg_CentFT0C", "hQ4yBNeg_CentFT0C;centrality FT0C (%);Q_{4,y}^{BNeg}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + // fRegistry->add("Event/before/hQ4xBTot_CentFT0C", "hQ4xBTot_CentFT0C;centrality FT0C (%);Q_{4,x}^{BTot}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); + // fRegistry->add("Event/before/hQ4yBTot_CentFT0C", "hQ4yBTot_CentFT0C;centrality FT0C (%);Q_{4,y}^{BTot}", kTH2F, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hEP4FT0M_CentFT0C", "4rd harmonics event plane FT0M;centrality FT0C (%);#Psi_{4}^{FT0M} (rad.)", kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP4FT0A_CentFT0C", "4rd harmonics event plane FT0A;centrality FT0C (%);#Psi_{4}^{FT0A} (rad.)", kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP4FT0C_CentFT0C", "4rd harmonics event plane FT0C;centrality FT0C (%);#Psi_{4}^{FT0C} (rad.)", kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP4BPos_CentFT0C", "4rd harmonics event plane BPos;centrality FT0C (%);#Psi_{4}^{BPos} (rad.)", kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP4BNeg_CentFT0C", "4rd harmonics event plane BNeg;centrality FT0C (%);#Psi_{4}^{BNeg} (rad.)", kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP4BTot_CentFT0C", "4rd harmonics event plane BTot;centrality FT0C (%);#Psi_{4}^{BTot} (rad.)", kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + // fRegistry->add("Event/before/hEP4FT0M_CentFT0C", "4rd harmonics event plane FT0M;centrality FT0C (%);#Psi_{4}^{FT0M} (rad.)", kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + // fRegistry->add("Event/before/hEP4FT0A_CentFT0C", "4rd harmonics event plane FT0A;centrality FT0C (%);#Psi_{4}^{FT0A} (rad.)", kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + // fRegistry->add("Event/before/hEP4FT0C_CentFT0C", "4rd harmonics event plane FT0C;centrality FT0C (%);#Psi_{4}^{FT0C} (rad.)", kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + // fRegistry->add("Event/before/hEP4BPos_CentFT0C", "4rd harmonics event plane BPos;centrality FT0C (%);#Psi_{4}^{BPos} (rad.)", kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + // fRegistry->add("Event/before/hEP4BNeg_CentFT0C", "4rd harmonics event plane BNeg;centrality FT0C (%);#Psi_{4}^{BNeg} (rad.)", kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + // fRegistry->add("Event/before/hEP4BTot_CentFT0C", "4rd harmonics event plane BTot;centrality FT0C (%);#Psi_{4}^{BTot} (rad.)", kTH2F, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hPrfQ4FT0MQ4BPos_CentFT0C", "Q_{4}^{FT0M} #upoint Q_{4}^{BPos};centrality FT0C (%);Q_{4}^{FT0M} #upoint Q_{4}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ4FT0MQ4BNeg_CentFT0C", "Q_{4}^{FT0M} #upoint Q_{4}^{BNeg};centrality FT0C (%);Q_{4}^{FT0M} #upoint Q_{4}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ4BPosQ4BNeg_CentFT0C", "Q_{4}^{BPos} #upoint Q_{4}^{BNeg};centrality FT0C (%);Q_{4}^{BPos} #upoint Q_{4}^{BNeg}", kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. - fRegistry->add("Event/before/hPrfQ4FT0CQ4BPos_CentFT0C", "Q_{4}^{FT0C} #upoint Q_{4}^{BPos};centrality FT0C (%);Q_{4}^{FT0C} #upoint Q_{4}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ4FT0CQ4BNeg_CentFT0C", "Q_{4}^{FT0C} #upoint Q_{4}^{BNeg};centrality FT0C (%);Q_{4}^{FT0C} #upoint Q_{4}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ4FT0CQ4BTot_CentFT0C", "Q_{4}^{FT0C} #upoint Q_{4}^{BTot};centrality FT0C (%);Q_{4}^{FT0C} #upoint Q_{4}^{BTot}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ4FT0AQ4BPos_CentFT0C", "Q_{4}^{FT0A} #upoint Q_{4}^{BPos};centrality FT0C (%);Q_{4}^{FT0A} #upoint Q_{4}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ4FT0AQ4BNeg_CentFT0C", "Q_{4}^{FT0A} #upoint Q_{4}^{BNeg};centrality FT0C (%);Q_{4}^{FT0A} #upoint Q_{4}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ4FT0AQ4BTot_CentFT0C", "Q_{4}^{FT0A} #upoint Q_{4}^{BTot};centrality FT0C (%);Q_{4}^{FT0A} #upoint Q_{4}^{BTot}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ4FT0AQ4FT0C_CentFT0C", "Q_{4}^{FT0A} #upoint Q_{4}^{FT0C};centrality FT0C (%);Q_{4}^{FT0A} #upoint Q_{4}^{FT0C}", kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons - } + // fRegistry->add("Event/before/hPrfQ4FT0MQ4BPos_CentFT0C", "Q_{4}^{FT0M} #upoint Q_{4}^{BPos};centrality FT0C (%);Q_{4}^{FT0M} #upoint Q_{4}^{BPos}", kTProfile, {{100, 0, 100}}, false); + // fRegistry->add("Event/before/hPrfQ4FT0MQ4BNeg_CentFT0C", "Q_{4}^{FT0M} #upoint Q_{4}^{BNeg};centrality FT0C (%);Q_{4}^{FT0M} #upoint Q_{4}^{BNeg}", kTProfile, {{100, 0, 100}}, false); + // fRegistry->add("Event/before/hPrfQ4BPosQ4BNeg_CentFT0C", "Q_{4}^{BPos} #upoint Q_{4}^{BNeg};centrality FT0C (%);Q_{4}^{BPos} #upoint Q_{4}^{BNeg}", kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. + // fRegistry->add("Event/before/hPrfQ4FT0CQ4BPos_CentFT0C", "Q_{4}^{FT0C} #upoint Q_{4}^{BPos};centrality FT0C (%);Q_{4}^{FT0C} #upoint Q_{4}^{BPos}", kTProfile, {{100, 0, 100}}, false); + // fRegistry->add("Event/before/hPrfQ4FT0CQ4BNeg_CentFT0C", "Q_{4}^{FT0C} #upoint Q_{4}^{BNeg};centrality FT0C (%);Q_{4}^{FT0C} #upoint Q_{4}^{BNeg}", kTProfile, {{100, 0, 100}}, false); + // fRegistry->add("Event/before/hPrfQ4FT0CQ4BTot_CentFT0C", "Q_{4}^{FT0C} #upoint Q_{4}^{BTot};centrality FT0C (%);Q_{4}^{FT0C} #upoint Q_{4}^{BTot}", kTProfile, {{100, 0, 100}}, false); + // fRegistry->add("Event/before/hPrfQ4FT0AQ4BPos_CentFT0C", "Q_{4}^{FT0A} #upoint Q_{4}^{BPos};centrality FT0C (%);Q_{4}^{FT0A} #upoint Q_{4}^{BPos}", kTProfile, {{100, 0, 100}}, false); + // fRegistry->add("Event/before/hPrfQ4FT0AQ4BNeg_CentFT0C", "Q_{4}^{FT0A} #upoint Q_{4}^{BNeg};centrality FT0C (%);Q_{4}^{FT0A} #upoint Q_{4}^{BNeg}", kTProfile, {{100, 0, 100}}, false); + // fRegistry->add("Event/before/hPrfQ4FT0AQ4BTot_CentFT0C", "Q_{4}^{FT0A} #upoint Q_{4}^{BTot};centrality FT0C (%);Q_{4}^{FT0A} #upoint Q_{4}^{BTot}", kTProfile, {{100, 0, 100}}, false); + // fRegistry->add("Event/before/hPrfQ4FT0AQ4FT0C_CentFT0C", "Q_{4}^{FT0A} #upoint Q_{4}^{FT0C};centrality FT0C (%);Q_{4}^{FT0A} #upoint Q_{4}^{FT0C}", kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + // } fRegistry->addClone("Event/before/", "Event/after/"); } diff --git a/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx b/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx index fa6b7f9ce25..102388dceec 100644 --- a/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx +++ b/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx @@ -160,29 +160,19 @@ struct CreateEMEvent { float q2xft0m = 999.f, q2yft0m = 999.f, q2xft0a = 999.f, q2yft0a = 999.f, q2xft0c = 999.f, q2yft0c = 999.f, q2xbpos = 999.f, q2ybpos = 999.f, q2xbneg = 999.f, q2ybneg = 999.f, q2xbtot = 999.f, q2ybtot = 999.f; float q3xft0m = 999.f, q3yft0m = 999.f, q3xft0a = 999.f, q3yft0a = 999.f, q3xft0c = 999.f, q3yft0c = 999.f, q3xbpos = 999.f, q3ybpos = 999.f, q3xbneg = 999.f, q3ybneg = 999.f, q3xbtot = 999.f, q3ybtot = 999.f; - float q4xft0m = 999.f, q4yft0m = 999.f, q4xft0a = 999.f, q4yft0a = 999.f, q4xft0c = 999.f, q4yft0c = 999.f, q4xbpos = 999.f, q4ybpos = 999.f, q4xbneg = 999.f, q4ybneg = 999.f, q4xbtot = 999.f, q4ybtot = 999.f; if constexpr (eventype == EMEventType::kEvent) { event_cent(105.f, 105.f, 105.f, 105.f); event_qvec(q2xft0m, q2yft0m, q2xft0a, q2yft0a, q2xft0c, q2yft0c, q2xbpos, q2ybpos, q2xbneg, q2ybneg, q2xbtot, q2ybtot, - q3xft0m, q3yft0m, q3xft0a, q3yft0a, q3xft0c, q3yft0c, q3xbpos, q3ybpos, q3xbneg, q3ybneg, q3xbtot, q3ybtot, - q4xft0m, q4yft0m, q4xft0a, q4yft0a, q4xft0c, q4yft0c, q4xbpos, q4ybpos, q4xbneg, q4ybneg, q4xbtot, q4ybtot); + q3xft0m, q3yft0m, q3xft0a, q3yft0a, q3xft0c, q3yft0c, q3xbpos, q3ybpos, q3xbneg, q3ybneg, q3xbtot, q3ybtot); } else if constexpr (eventype == EMEventType::kEvent_Cent) { event_cent(collision.centFT0M(), collision.centFT0A(), collision.centFT0C(), collision.centNTPV()); event_qvec(q2xft0m, q2yft0m, q2xft0a, q2yft0a, q2xft0c, q2yft0c, q2xbpos, q2ybpos, q2xbneg, q2ybneg, q2xbtot, q2ybtot, - q3xft0m, q3yft0m, q3xft0a, q3yft0a, q3xft0c, q3yft0c, q3xbpos, q3ybpos, q3xbneg, q3ybneg, q3xbtot, q3ybtot, - q4xft0m, q4yft0m, q4xft0a, q4yft0a, q4xft0c, q4yft0c, q4xbpos, q4ybpos, q4xbneg, q4ybneg, q4xbtot, q4ybtot); + q3xft0m, q3yft0m, q3xft0a, q3yft0a, q3xft0c, q3yft0c, q3xbpos, q3ybpos, q3xbneg, q3ybneg, q3xbtot, q3ybtot); } else if constexpr (eventype == EMEventType::kEvent_Cent_Qvec) { event_cent(collision.centFT0M(), collision.centFT0A(), collision.centFT0C(), collision.centNTPV()); - if (collision.qvecFT0CReVec().size() >= 3) { // harmonics 2,3,4 - q2xft0m = collision.qvecFT0MReVec()[0], q2xft0a = collision.qvecFT0AReVec()[0], q2xft0c = collision.qvecFT0CReVec()[0], q2xbpos = collision.qvecBPosReVec()[0], q2xbneg = collision.qvecBNegReVec()[0], q2xbtot = collision.qvecBTotReVec()[0]; - q2yft0m = collision.qvecFT0MImVec()[0], q2yft0a = collision.qvecFT0AImVec()[0], q2yft0c = collision.qvecFT0CImVec()[0], q2ybpos = collision.qvecBPosImVec()[0], q2ybneg = collision.qvecBNegImVec()[0], q2ybtot = collision.qvecBTotImVec()[0]; - q3xft0m = collision.qvecFT0MReVec()[1], q3xft0a = collision.qvecFT0AReVec()[1], q3xft0c = collision.qvecFT0CReVec()[1], q3xbpos = collision.qvecBPosReVec()[1], q3xbneg = collision.qvecBNegReVec()[1], q3xbtot = collision.qvecBTotReVec()[1]; - q3yft0m = collision.qvecFT0MImVec()[1], q3yft0a = collision.qvecFT0AImVec()[1], q3yft0c = collision.qvecFT0CImVec()[1], q3ybpos = collision.qvecBPosImVec()[1], q3ybneg = collision.qvecBNegImVec()[1], q3ybtot = collision.qvecBTotImVec()[1]; - q4xft0m = collision.qvecFT0MReVec()[2], q4xft0a = collision.qvecFT0AReVec()[2], q4xft0c = collision.qvecFT0CReVec()[2], q4xbpos = collision.qvecBPosReVec()[2], q4xbneg = collision.qvecBNegReVec()[2], q4xbtot = collision.qvecBTotReVec()[2]; - q4yft0m = collision.qvecFT0MImVec()[2], q4yft0a = collision.qvecFT0AImVec()[2], q4yft0c = collision.qvecFT0CImVec()[2], q4ybpos = collision.qvecBPosImVec()[2], q4ybneg = collision.qvecBNegImVec()[2], q4ybtot = collision.qvecBTotImVec()[2]; - } else if (collision.qvecFT0CReVec().size() >= 2) { // harmonics 2,3 + if (collision.qvecFT0CReVec().size() >= 2) { // harmonics 2,3 q2xft0m = collision.qvecFT0MReVec()[0], q2xft0a = collision.qvecFT0AReVec()[0], q2xft0c = collision.qvecFT0CReVec()[0], q2xbpos = collision.qvecBPosReVec()[0], q2xbneg = collision.qvecBNegReVec()[0], q2xbtot = collision.qvecBTotReVec()[0]; q2yft0m = collision.qvecFT0MImVec()[0], q2yft0a = collision.qvecFT0AImVec()[0], q2yft0c = collision.qvecFT0CImVec()[0], q2ybpos = collision.qvecBPosImVec()[0], q2ybneg = collision.qvecBNegImVec()[0], q2ybtot = collision.qvecBTotImVec()[0]; q3xft0m = collision.qvecFT0MReVec()[1], q3xft0a = collision.qvecFT0AReVec()[1], q3xft0c = collision.qvecFT0CReVec()[1], q3xbpos = collision.qvecBPosReVec()[1], q3xbneg = collision.qvecBNegReVec()[1], q3xbtot = collision.qvecBTotReVec()[1]; @@ -192,13 +182,11 @@ struct CreateEMEvent { q2yft0m = collision.qvecFT0MImVec()[0], q2yft0a = collision.qvecFT0AImVec()[0], q2yft0c = collision.qvecFT0CImVec()[0], q2ybpos = collision.qvecBPosImVec()[0], q2ybneg = collision.qvecBNegImVec()[0], q2ybtot = collision.qvecBTotImVec()[0]; } event_qvec(q2xft0m, q2yft0m, q2xft0a, q2yft0a, q2xft0c, q2yft0c, q2xbpos, q2ybpos, q2xbneg, q2ybneg, q2xbtot, q2ybtot, - q3xft0m, q3yft0m, q3xft0a, q3yft0a, q3xft0c, q3yft0c, q3xbpos, q3ybpos, q3xbneg, q3ybneg, q3xbtot, q3ybtot, - q4xft0m, q4yft0m, q4xft0a, q4yft0a, q4xft0c, q4yft0c, q4xbpos, q4ybpos, q4xbneg, q4ybneg, q4xbtot, q4ybtot); + q3xft0m, q3yft0m, q3xft0a, q3yft0a, q3xft0c, q3yft0c, q3xbpos, q3ybpos, q3xbneg, q3ybneg, q3xbtot, q3ybtot); } else { event_cent(105.f, 105.f, 105.f, 105.f); event_qvec(q2xft0m, q2yft0m, q2xft0a, q2yft0a, q2xft0c, q2yft0c, q2xbpos, q2ybpos, q2xbneg, q2ybneg, q2xbtot, q2ybtot, - q3xft0m, q3yft0m, q3xft0a, q3yft0a, q3xft0c, q3yft0c, q3xbpos, q3ybpos, q3xbneg, q3ybneg, q3xbtot, q3ybtot, - q4xft0m, q4yft0m, q4xft0a, q4yft0a, q4xft0c, q4yft0c, q4xbpos, q4ybpos, q4xbneg, q4ybneg, q4xbtot, q4ybtot); + q3xft0m, q3yft0m, q3xft0a, q3yft0a, q3xft0c, q3yft0c, q3xbpos, q3ybpos, q3xbneg, q3ybneg, q3xbtot, q3ybtot); } } // end of collision loop map_ncolls_per_bc.clear(); From 1e08af1e420c95abb1894d58bcecb260095472fe Mon Sep 17 00:00:00 2001 From: skundu692 <86804743+skundu692@users.noreply.github.com> Date: Sat, 31 Aug 2024 01:48:23 +0200 Subject: [PATCH 09/16] PWGLF: update rotation background (#7522) * Add resolution histogram and fix abs() function * Optimize PID * Improved rotational background --- PWGLF/Tasks/Resonances/highmasslambda.cxx | 37 ++- PWGLF/Tasks/Resonances/highmasslambdasvx.cxx | 254 ++++++++++++++----- 2 files changed, 211 insertions(+), 80 deletions(-) diff --git a/PWGLF/Tasks/Resonances/highmasslambda.cxx b/PWGLF/Tasks/Resonances/highmasslambda.cxx index 2839b9b65d7..c0885d814a2 100644 --- a/PWGLF/Tasks/Resonances/highmasslambda.cxx +++ b/PWGLF/Tasks/Resonances/highmasslambda.cxx @@ -122,6 +122,8 @@ struct highmasslambda { Configurable cMaxV0DCA{"cMaxV0DCA", 0.2, "Maximum V0 DCA to PV"}; Configurable cMaxV0LifeTime{"cMaxV0LifeTime", 20, "Maximum V0 life time"}; Configurable cSigmaMassKs0{"cSigmaMassKs0", 0.006, "Sigma cut on KS0 mass"}; + Configurable cMinLambdaMass{"cMinLambdaMass", 2.18, "Minimum lambda mass"}; + Configurable cMaxLambdaMass{"cMaxLambdaMass", 2.42, "Maximum lambda mass"}; // config for V0 daughters Configurable ConfDaughEta{"ConfDaughEta", 0.8f, "V0 Daugh sel: max eta"}; Configurable ConfDaughPt{"ConfDaughPt", 0.1f, "V0 Daugh sel: min pt"}; @@ -169,8 +171,8 @@ struct highmasslambda { { std::vector occupancyBinning = {0.0, 500.0, 1000.0, 1500.0, 2000.0, 3000.0, 4000.0, 5000.0, 50000.0}; // std::vector dcaBinning = {0.0, 0.0005, 0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.012, 0.014, 0.016, 0.02, 0.03, 0.05, 0.1, 0.5, 1.0}; - std::vector dcaBinning = {0.0, 0.0005, 0.001, 0.002, 0.003, 0.004, 0.006, 0.008, 0.01, 0.015, 0.02, 0.04, 0.08, 0.1, 0.3, 1.0}; - std::vector ptProtonBinning = {0.2, 0.3, 0.5, 0.8, 1.2, 1.6, 2.0, 3.0, 4.0, 6.0}; + std::vector dcaBinning = {0.0, 0.0005, 0.001, 0.0012, 0.0014, 0.0016, 0.002, 0.0025, 0.003, 0.004, 0.005, 0.006, 0.008, 0.01, 0.015, 0.02, 0.04, 0.05, 0.06, 0.08, 0.1, 0.3, 1.0}; + std::vector ptProtonBinning = {0.2, 0.3, 0.5, 0.6, 0.8, 1.2, 1.4, 1.6, 2.0, 3.0, 4.0, 6.0}; std::vector ptLambdaBinning = {2.0, 3.0, 4.0, 5.0, 6.0}; const AxisSpec thnAxisInvMass{configThnAxisInvMass, "#it{M} (GeV/#it{c}^{2})"}; @@ -587,7 +589,7 @@ struct highmasslambda { ConfigurableAxis axisEPAngle{"axisEPAngle", {1, -TMath::Pi() / 2, TMath::Pi() / 2}, "event plane angle"}; using BinningTypeVertexContributor = ColumnBinningPolicy; - ROOT::Math::PxPyPzMVector Lambdac, Proton, Kshort, LambdacRot, ProtonRot, fourVecDauCM; + ROOT::Math::PxPyPzMVector Lambdac, Proton, Kshort, LambdacRot, KshortRot, fourVecDauCM; ROOT::Math::XYZVector threeVecDauCM, threeVecDauCMXY, eventplaneVec, eventplaneVecNorm, beamvector; double massPi = TDatabasePDG::Instance()->GetParticle(kPiPlus)->Mass(); // FIXME: Get from the common header double massPr = TDatabasePDG::Instance()->GetParticle(kProton)->Mass(); // FIXME: Get from the common header @@ -728,9 +730,6 @@ struct highmasslambda { if (Lambdac.Pt() > 6.0 || Lambdac.Pt() < 2.0) { continue; } - if (TMath::Abs(Lambdac.Rapidity()) > confRapidity) { - continue; - } auto phiminuspsi = GetPhiInRange(Lambdac.Phi() - psiFT0C); if (useSP) { @@ -747,21 +746,21 @@ struct highmasslambda { dcasum = v0.dcav0topv() - track1.dcaXY(); } histos.fill(HIST("hMassvsDecaySum"), Lambdac.M(), dcasum); - if (fillDefault && Lambdac.M() > 2.18 && Lambdac.M() <= 2.42) { + if (fillDefault && Lambdac.M() > cMinLambdaMass && Lambdac.M() <= cMaxLambdaMass && TMath::Abs(Lambdac.Rapidity()) < confRapidity && Lambdac.Pt() > 2.0 && Lambdac.Pt() <= 6.0) { if (fillDecayLength) { histos.fill(HIST("hSparseV2SASameEvent_V2"), Lambdac.M(), Lambdac.Pt(), v2, dcasum); } histos.fill(HIST("hSparseV2SASameEvent_V2_new"), Lambdac.M(), Lambdac.Pt(), v2, TMath::Abs(track1.dcaXY()), Proton.Pt()); } if (fillOccupancy && occupancy < cfgOccupancyCut) { - if (Lambdac.M() > 2.18 && Lambdac.M() <= 2.42) { + if (Lambdac.M() > cMinLambdaMass && Lambdac.M() <= cMaxLambdaMass && TMath::Abs(Lambdac.Rapidity()) < confRapidity && Lambdac.Pt() > 2.0 && Lambdac.Pt() <= 6.0) { if (fillDecayLength) { histos.fill(HIST("hSparseV2SASameEvent_V2_occupancy"), Lambdac.M(), Lambdac.Pt(), v2, dcasum, TMath::Abs(track1.dcaXY())); } histos.fill(HIST("hSparseV2SASameEvent_V2_new_occupancy"), Lambdac.M(), Lambdac.Pt(), v2, TMath::Abs(track1.dcaXY()), Proton.Pt()); } } else { - if (Lambdac.M() > 2.18 && Lambdac.M() <= 2.42) { + if (Lambdac.M() > cMinLambdaMass && Lambdac.M() <= cMaxLambdaMass && TMath::Abs(Lambdac.Rapidity()) < confRapidity && Lambdac.Pt() > 2.0 && Lambdac.Pt() <= 6.0) { if (fillDecayLength) { histos.fill(HIST("hSparseV2SASameEvent_V2_occupancy"), Lambdac.M(), Lambdac.Pt(), v2, dcasum, TMath::Abs(track1.dcaXY())); } @@ -775,10 +774,10 @@ struct highmasslambda { auto anglestep = (angleend - anglestart) / (1.0 * (nBkgRotations - 1)); auto rotangle = anglestart + nrotbkg * anglestep; histos.fill(HIST("hRotation"), rotangle); - auto rotProtonPx = track1.px() * std::cos(rotangle) - track1.py() * std::sin(rotangle); - auto rotProtonPy = track1.px() * std::sin(rotangle) + track1.py() * std::cos(rotangle); - ProtonRot = ROOT::Math::PxPyPzMVector(rotProtonPx, rotProtonPy, track1.pz(), massPr); - LambdacRot = ProtonRot + Kshort; + auto rotKaonPx = Kshort.px() * std::cos(rotangle) - Kshort.py() * std::sin(rotangle); + auto rotKaonPy = Kshort.px() * std::sin(rotangle) + Kshort.py() * std::cos(rotangle); + KshortRot = ROOT::Math::PxPyPzMVector(rotKaonPx, rotKaonPy, Kshort.pz(), massK0s); + LambdacRot = Proton + KshortRot; auto phiminuspsiRot = GetPhiInRange(LambdacRot.Phi() - psiFT0C); if (useSP) { v2Rot = TMath::Cos(2.0 * phiminuspsiRot) * QFT0C; @@ -786,21 +785,21 @@ struct highmasslambda { if (!useSP) { v2Rot = TMath::Cos(2.0 * phiminuspsiRot); } - if (fillDefault && LambdacRot.M() > 2.18 && LambdacRot.M() <= 2.42) { + if (fillDefault && LambdacRot.M() > cMinLambdaMass && LambdacRot.M() <= cMaxLambdaMass && TMath::Abs(LambdacRot.Rapidity()) < confRapidity && LambdacRot.Pt() > 2.0 && LambdacRot.Pt() <= 6.0) { if (fillDecayLength) { histos.fill(HIST("hSparseV2SASameEventRotational_V2"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, dcasum); } histos.fill(HIST("hSparseV2SASameEventRotational_V2_new"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, TMath::Abs(track1.dcaXY()), Proton.Pt()); } if (fillOccupancy && occupancy < cfgOccupancyCut) { - if (LambdacRot.M() > 2.18 && LambdacRot.M() <= 2.42) { + if (LambdacRot.M() > cMinLambdaMass && LambdacRot.M() <= cMaxLambdaMass && TMath::Abs(LambdacRot.Rapidity()) < confRapidity && LambdacRot.Pt() > 2.0 && LambdacRot.Pt() <= 6.0) { if (fillDecayLength) { histos.fill(HIST("hSparseV2SASameEventRotational_V2_occupancy"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, dcasum, TMath::Abs(track1.dcaXY())); } histos.fill(HIST("hSparseV2SASameEventRotational_V2_new_occupancy"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, TMath::Abs(track1.dcaXY()), Proton.Pt()); } } else { - if (LambdacRot.M() > 2.18 && LambdacRot.M() <= 2.42) { + if (LambdacRot.M() > cMinLambdaMass && LambdacRot.M() <= cMaxLambdaMass && TMath::Abs(LambdacRot.Rapidity()) < confRapidity && LambdacRot.Pt() > 2.0 && LambdacRot.Pt() <= 6.0) { if (fillDecayLength) { histos.fill(HIST("hSparseV2SASameEventRotational_V2_occupancy"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, dcasum, TMath::Abs(track1.dcaXY())); } @@ -929,21 +928,21 @@ struct highmasslambda { // auto diffangle = Proton.Phi() - Lambdac.Phi(); // auto decaylength = TMath::Abs((track1.dcaXY() / TMath::Sin(diffangle)) / (Lambdac.P() / 2.286)); // auto dcasum = TMath::Sqrt(track1.dcaXY() * track1.dcaXY() + v0.dcav0topv() * v0.dcav0topv()); - if (fillDefault && Lambdac.M() > 2.18 && Lambdac.M() <= 2.42) { + if (fillDefault && Lambdac.M() > cMinLambdaMass && Lambdac.M() <= cMaxLambdaMass) { if (fillDecayLength) { histos.fill(HIST("hSparseV2SAMixedEvent_V2"), Lambdac.M(), Lambdac.Pt(), v2, dcasum); } histos.fill(HIST("hSparseV2SAMixedEvent_V2_new"), Lambdac.M(), Lambdac.Pt(), v2, TMath::Abs(track1.dcaXY()), Proton.Pt()); } if (fillOccupancy && occupancy < cfgOccupancyCut) { - if (Lambdac.M() > 2.18 && Lambdac.M() <= 2.42) { + if (Lambdac.M() > cMinLambdaMass && Lambdac.M() <= cMaxLambdaMass) { if (fillDecayLength) { histos.fill(HIST("hSparseV2SAMixedEvent_V2_occupancy"), Lambdac.M(), Lambdac.Pt(), v2, dcasum, TMath::Abs(track1.dcaXY())); } histos.fill(HIST("hSparseV2SAMixedEvent_V2_new_occupancy"), Lambdac.M(), Lambdac.Pt(), v2, TMath::Abs(track1.dcaXY()), Proton.Pt()); } } else { - if (Lambdac.M() > 2.18 && Lambdac.M() <= 2.42) { + if (Lambdac.M() > cMinLambdaMass && Lambdac.M() <= cMaxLambdaMass) { if (fillDecayLength) { histos.fill(HIST("hSparseV2SAMixedEvent_V2_occupancy"), Lambdac.M(), Lambdac.Pt(), v2, dcasum, TMath::Abs(track1.dcaXY())); } diff --git a/PWGLF/Tasks/Resonances/highmasslambdasvx.cxx b/PWGLF/Tasks/Resonances/highmasslambdasvx.cxx index 1379f27f1d1..5bc0cc483dc 100644 --- a/PWGLF/Tasks/Resonances/highmasslambdasvx.cxx +++ b/PWGLF/Tasks/Resonances/highmasslambdasvx.cxx @@ -107,29 +107,32 @@ struct highmasslambdasvx { Configurable confRapidity{"confRapidity", 0.8, "cut on Rapidity"}; Configurable cfgCutPT{"cfgCutPT", 0.3, "PT cut on daughter track"}; Configurable cfgCutEta{"cfgCutEta", 0.8, "Eta cut on daughter track"}; - Configurable cfgCutDCAxymin1{"cfgCutDCAxymin1", 0.004f, "Minimum DCAxy range for tracks pt 0 to 0.5"}; + Configurable cfgCutDCAxymin1{"cfgCutDCAxymin1", 0.005f, "Minimum DCAxy range for tracks pt 0 to 0.5"}; Configurable cfgCutDCAxymin2{"cfgCutDCAxymin2", 0.003f, "Minimum DCAxy range for tracks pt 0.5 to 1"}; - Configurable cfgCutDCAxymin3{"cfgCutDCAxymin3", 0.0025f, "Minimum DCAxy range for tracks pt 1.0 to 1.5"}; + Configurable cfgCutDCAxymin3{"cfgCutDCAxymin3", 0.003f, "Minimum DCAxy range for tracks pt 1.0 to 1.5"}; Configurable cfgCutDCAxymin4{"cfgCutDCAxymin4", 0.002f, "Minimum DCAxy range for tracks pt 1.5 to 2.0"}; - Configurable cfgCutDCAxymin5{"cfgCutDCAxymin5", 0.0015f, "Minimum DCAxy range for tracks pt 2.0 to 3.0"}; - Configurable cfgCutDCAxymin6{"cfgCutDCAxymin6", 0.001f, "Minimum DCAxy range for tracks GT pt 3.0"}; + Configurable cfgCutDCAxymin5{"cfgCutDCAxymin5", 0.001f, "Minimum DCAxy range for tracks pt 2.0 to 2.5"}; + Configurable cfgCutDCAxymin6{"cfgCutDCAxymin6", 0.0003f, "Minimum DCAxy range for tracks pt 2.5 to 3.0"}; + Configurable cfgCutDCAxymin7{"cfgCutDCAxymin7", 0.0003f, "Minimum DCAxy range for tracks pt 3.0 to 4.0"}; + Configurable cfgCutDCAxymin8{"cfgCutDCAxymin8", 0.0003f, "Minimum DCAxy range for tracks pt 4.0 to 10.0"}; Configurable cfgCutDCAxy{"cfgCutDCAxy", 0.1f, "DCAxy range for tracks"}; Configurable cfgCutDCAz{"cfgCutDCAz", 1.0f, "DCAz range for tracks"}; Configurable cfgITScluster{"cfgITScluster", 5, "Number of ITS cluster"}; Configurable cfgITSclusterInnerlayer{"cfgITSclusterInnerlayer", 1, "Minimum Number of ITS cluster in inner barrel"}; Configurable cfgTPCcluster{"cfgTPCcluster", 70, "Number of TPC cluster"}; - Configurable ispTdepPID{"ispTdepPID", true, "pT dependent PID"}; + Configurable PIDstrategy{"PIDstrategy", 0, "0: TOF Veto, 1: TOF Veto opti, 2: TOF, 3: TOF loose 1, 4: TOF loose 2, 5: old pt dep"}; Configurable nsigmaCutTPC{"nsigmacutTPC", 3.0, "Value of the TPC Nsigma cut"}; - Configurable nsigmaCutCombined{"nsigmaCutCombined", 2.0, "Combined nsigma cut"}; - Configurable nsigmaCutCombinedKaon{"nsigmaCutCombinedKaon", 1.5, "Combined nsigma cut Kaon"}; - Configurable nsigmaCutCombinedPion{"nsigmaCutCombinedPion", 2.0, "Combined nsigma cut Pion"}; - Configurable nsigmaCutTPCPre{"nsigmacutTPCPre", 5.0, "Value of the TPC Nsigma cut Pre filter"}; + Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, "TPC TOF combined PID"}; + Configurable nsigmaCutTPCPre{"nsigmacutTPCPre", 3.0, "Value of the TPC Nsigma cut Pre filter"}; // Configs for V0 Configurable ConfV0DCADaughMax{"ConfV0DCADaughMax", 0.2f, "Maximum DCA between the V0 daughters"}; Configurable ConfV0CPAMin{"ConfV0CPAMin", 0.9998f, "Minimum CPA of V0"}; Configurable cMaxV0DCA{"cMaxV0DCA", 0.1, "Maximum V0 DCA to PV"}; Configurable cMaxV0LifeTime{"cMaxV0LifeTime", 20, "Maximum V0 life time"}; Configurable cSigmaMassKs0{"cSigmaMassKs0", 0.006, "Sigma cut on KS0 mass"}; + Configurable cMinLambdaMass{"cMinLambdaMass", 2.18, "Minimum lambda mass"}; + Configurable cMaxLambdaMass{"cMaxLambdaMass", 2.42, "Maximum lambda mass"}; + // config for V0 daughters Configurable ConfDaughPt{"ConfDaughPt", 0.1f, "V0 Daugh sel: min pt"}; Configurable ConfDaughTPCnclsMin{"ConfDaughTPCnclsMin", 50.f, "V0 Daugh sel: Min. nCls TPC"}; @@ -160,7 +163,7 @@ struct highmasslambdasvx { // using TrackCandidates = soa::Filtered>; // using AllTrackCandidates = soa::Join; - using TrackCandidates = soa::Filtered>; + using TrackCandidates = soa::Filtered>; using AllTrackCandidates = soa::Join; using ResoV0s = soa::Join; @@ -172,10 +175,11 @@ struct highmasslambdasvx { void init(o2::framework::InitContext&) { - std::vector occupancyBinning = {0.0, 500.0, 1500.0, 50000.0}; - std::vector dcaBinning = {0.0, 0.0005, 0.001, 0.002, 0.003, 0.004, 0.006, 0.008, 0.01, 0.015, 0.02, 0.04, 0.08, 0.1, 0.3, 1.0}; - std::vector ptprotonBinning = {0.0, 0.5, 1.0, 1.5, 2.0, 10.0}; + std::vector occupancyBinning = {0.0, 500.0, 1000.0, 1500.0, 2000.0, 3000.0, 4000.0, 5000.0, 50000.0}; + std::vector dcaBinning = {0.0, 0.0005, 0.001, 0.0015, 0.002, 0.0025, 0.003, 0.004, 0.005, 0.006, 0.008, 0.01, 0.02, 0.04, 0.05, 0.06, 0.08, 0.1, 0.3, 1.0}; + std::vector ptProtonBinning = {0.2, 0.3, 0.5, 0.6, 0.8, 1.2, 1.4, 1.6, 2.0, 3.0, 4.0, 6.0}; std::vector ptLambdaBinning = {2.0, 3.0, 4.0, 5.0, 6.0}; + AxisSpec phiAxis = {500, -6.28, 6.28, "phi"}; AxisSpec decaylengthAxis = {configThnAxisDecayLength, "decaylength"}; AxisSpec resAxis = {1000, -10, 10, "Res"}; @@ -187,16 +191,9 @@ struct highmasslambdasvx { AxisSpec occupancyAxis = {occupancyBinning, "occupancy"}; AxisSpec ptAxis = {ptLambdaBinning, "pt"}; AxisSpec dcaAxis = {dcaBinning, "dca"}; - AxisSpec ptProtonAxis = {ptprotonBinning, "daughter pt"}; - - histos.add("hSparseV2SASameEvent_V2_EP", "hSparseV2SASameEvent_V2_EP", HistType::kTHnSparseF, {thnAxisInvMass, ptAxis, thnAxisV2, ptProtonAxis, decaylengthAxis, occupancyAxis}); - histos.add("hSparseV2SASameEventRotational_V2_EP", "hSparseV2SASameEventRotational_V2_EP", HistType::kTHnSparseF, {thnAxisInvMass, ptAxis, thnAxisV2, ptProtonAxis, decaylengthAxis, occupancyAxis}); - histos.add("hSparseV2SAMixedEvent_V2_EP", "hSparseV2SAMixedEvent_V2_EP", HistType::kTHnSparseF, {thnAxisInvMass, ptAxis, thnAxisV2, ptProtonAxis, decaylengthAxis, occupancyAxis}); - - histos.add("hSparseV2SASameEvent_V2_IOP", "hSparseV2SASameEvent_V2_IOP", HistType::kTHnSparseF, {thnAxisInvMass, ptAxis, thnAxisPhiminusPsi, ptProtonAxis, decaylengthAxis, occupancyAxis}); - histos.add("hSparseV2SASameEventRotational_V2_IOP", "hSparseV2SASameEventRotational_V2_IOP", HistType::kTHnSparseF, {thnAxisInvMass, ptAxis, thnAxisPhiminusPsi, ptProtonAxis, decaylengthAxis, occupancyAxis}); - histos.add("hSparseV2SAMixedEvent_V2_IOP", "hSparseV2SAMixedEvent_V2_IOP", HistType::kTHnSparseF, {thnAxisInvMass, ptAxis, thnAxisPhiminusPsi, ptProtonAxis, decaylengthAxis, occupancyAxis}); - + AxisSpec ptProtonAxis = {ptProtonBinning, "daughter pt"}; + histos.add("hSparseV2SASameEvent_V2_EP", "hSparseV2SASameEvent_V2_EP", HistType::kTHnSparseF, {thnAxisInvMass, ptAxis, thnAxisV2, ptProtonAxis, decaylengthAxis, dcaAxis}); + histos.add("hSparseV2SASameEventRotational_V2_EP", "hSparseV2SASameEventRotational_V2_EP", HistType::kTHnSparseF, {thnAxisInvMass, ptAxis, thnAxisV2, ptProtonAxis, decaylengthAxis, dcaAxis}); histos.add("hV0decaylength", "hV0decaylength", kTH1F, {{1000, 0.0f, 1000.0f}}); histos.add("hMomCorr", "hMomCorr", kTH3F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}, {8, 0.0f, 80.0f}}); histos.add("hInvMassKs0", "hInvMassKs0", kTH1F, {{200, 0.4f, 0.6f}}); @@ -275,42 +272,165 @@ struct highmasslambdasvx { } template - bool selectionPID(const T& candidate) + bool rejectPi(const T& candidate) { - if (candidate.pt() < 0.7 && !candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < nsigmaCutTPC) { - return true; + if (candidate.tpcInnerParam() > 0.9 && candidate.tpcInnerParam() < 1.0 && candidate.tpcNSigmaPi() < 6.0) { + return false; } - if (candidate.pt() >= 0.7 && !candidate.hasTOF() && candidate.pt() < 0.8 && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < nsigmaCutTPC) { - return true; + if (candidate.tpcInnerParam() > 1.0 && candidate.tpcInnerParam() < 1.1 && candidate.tpcNSigmaPi() < 4.0) { + return false; } - if (candidate.pt() < 0.8 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < nsigmaCutTPC && TMath::Abs(candidate.tofNSigmaPr()) < 10.0) { - return true; + if (candidate.tpcInnerParam() > 1.1 && candidate.tpcInnerParam() < 1.2 && candidate.tpcNSigmaPi() < 3.0) { + return false; } - if (candidate.pt() >= 0.8 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr() + candidate.tofNSigmaPr() * candidate.tofNSigmaPr()) < 2.0 * nsigmaCutCombined * nsigmaCutCombined && TMath::Abs(candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa() + candidate.tofNSigmaKa() * candidate.tofNSigmaKa()) > 2.0 * nsigmaCutCombinedKaon * nsigmaCutCombinedKaon && TMath::Abs(candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + candidate.tofNSigmaPi() * candidate.tofNSigmaPi()) > 2.0 * nsigmaCutCombinedPion * nsigmaCutCombinedPion) { - return true; + if (candidate.tpcInnerParam() > 1.2 && candidate.tpcInnerParam() < 1.4 && candidate.tpcNSigmaPi() < 1.0) { + return false; } - if (candidate.pt() >= 0.8 && !candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < nsigmaCutCombined && TMath::Abs(candidate.tpcNSigmaKa()) > nsigmaCutCombinedKaon && TMath::Abs(candidate.tpcNSigmaPi()) > nsigmaCutCombinedPion) { - return true; + if (candidate.tpcInnerParam() > 1.4 && candidate.tpcInnerParam() < 1.5 && candidate.tpcNSigmaPi() < 0.5) { + return false; } + return true; + } - return false; + template + bool rejectEl(const T& candidate) + { + + if (candidate.tpcInnerParam() > 0.7 && candidate.tpcInnerParam() < 0.8 && candidate.tpcNSigmaEl() < 2.0) { + return false; + } + if (candidate.tpcInnerParam() > 0.8 && candidate.tpcInnerParam() < 0.9 && candidate.tpcNSigmaEl() < 0.0) { + return false; + } + if (candidate.tpcInnerParam() > 0.9 && candidate.tpcInnerParam() < 1.0 && candidate.tpcNSigmaEl() < -1.0) { + return false; + } + if (candidate.tpcInnerParam() > 1.0 && candidate.tpcInnerParam() < 1.1 && candidate.tpcNSigmaEl() < -2.0) { + return false; + } + if (candidate.tpcInnerParam() > 1.1 && candidate.tpcInnerParam() < 1.2 && candidate.tpcNSigmaEl() < -3.0) { + return false; + } + + return true; + } + + template + bool rejectKa(const T& candidate) + { + if (candidate.tpcInnerParam() > 0.7 && candidate.tpcInnerParam() < 0.8 && candidate.tpcNSigmaKa() < 7.5) { + return false; + } + if (candidate.tpcInnerParam() > 0.8 && candidate.tpcInnerParam() < 0.9 && candidate.tpcNSigmaKa() < 6.0) { + return false; + } + if (candidate.tpcInnerParam() > 0.9 && candidate.tpcInnerParam() < 1.1 && candidate.tpcNSigmaKa() < 5.0) { + return false; + } + if (candidate.tpcInnerParam() > 1.1 && candidate.tpcInnerParam() < 1.2 && candidate.tpcNSigmaKa() < 3.5) { + return false; + } + if (candidate.tpcInnerParam() > 1.2 && candidate.tpcInnerParam() < 1.4 && candidate.tpcNSigmaKa() < 3.0) { + return false; + } + if (candidate.tpcInnerParam() > 1.4 && candidate.tpcInnerParam() < 1.5 && candidate.tpcNSigmaKa() < 2.5) { + return false; + } + return true; } + // TPC TOF template - bool selectionPIDNew(const T& candidate) + bool selectionPID1(const T& candidate) { - if (candidate.pt() < 0.7 && !candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < nsigmaCutTPC) { + if (candidate.tpcInnerParam() < 0.7 && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0) { return true; } - if (candidate.pt() >= 0.7 && !candidate.hasTOF() && candidate.pt() < 0.8 && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < nsigmaCutTPC) { + if (candidate.tpcInnerParam() >= 0.7) { + // printf("I am here: %.3f\n", candidate.tpcInnerParam()); + if (candidate.hasTOF()) { + auto combinedPID = TMath::Sqrt(candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr() + candidate.tofNSigmaPr() * candidate.tofNSigmaPr()) / TMath::Sqrt(2.0); + // printf("combine PIDA: %.3f\n", combinedPID); + if (combinedPID < nsigmaCutCombined) { + return true; + } + } + if (!candidate.hasTOF()) { + if (candidate.tpcInnerParam() < 1.5 && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0) { + return true; + } + if (candidate.tpcInnerParam() >= 1.5 && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < 2.0) { + return true; + } + } + } + return false; + } + + // TOF Veto + template + bool selectionPID2(const T& candidate) + { + if (candidate.tpcInnerParam() < 0.7 && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0) { return true; } - if (candidate.pt() < 0.8 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < nsigmaCutTPC && TMath::Abs(candidate.tofNSigmaPr()) < 10.0) { + if (candidate.tpcInnerParam() >= 0.7) { + if (candidate.hasTOF()) { + auto combinedPID = TMath::Sqrt(candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr() + candidate.tofNSigmaPr() * candidate.tofNSigmaPr()) / TMath::Sqrt(2.0); + if (combinedPID < nsigmaCutCombined) { + return true; + } + } + } + return false; + } + + // TOF veto loose + template + bool selectionPID3(const T& candidate) + { + if (candidate.tpcInnerParam() < 0.7 && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0) { return true; } - if (candidate.pt() >= 0.8 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr() + candidate.tofNSigmaPr() * candidate.tofNSigmaPr()) < 2.0 * nsigmaCutCombined * nsigmaCutCombined && TMath::Abs(candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa() + candidate.tofNSigmaKa() * candidate.tofNSigmaKa()) > 2.0 * nsigmaCutCombinedKaon * nsigmaCutCombinedKaon && TMath::Abs(candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + candidate.tofNSigmaPi() * candidate.tofNSigmaPi()) > 2.0 * nsigmaCutCombinedPion * nsigmaCutCombinedPion) { + if (candidate.tpcInnerParam() >= 0.7) { + if (candidate.hasTOF()) { + auto combinedPID = TMath::Sqrt(candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr() + candidate.tofNSigmaPr() * candidate.tofNSigmaPr()) / TMath::Sqrt(2.0); + if (combinedPID < nsigmaCutCombined) { + return true; + } + } + if (!candidate.hasTOF()) { + if (candidate.tpcInnerParam() < 1.5 && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0) { + return true; + } + } + } + return false; + } + + // TOF veto very loose + template + bool selectionPID4(const T& candidate) + { + if (candidate.tpcInnerParam() < 0.7 && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0) { return true; } + if (candidate.tpcInnerParam() >= 0.7) { + if (candidate.hasTOF()) { + auto combinedPID = TMath::Sqrt(candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr() + candidate.tofNSigmaPr() * candidate.tofNSigmaPr()) / TMath::Sqrt(2.0); + if (combinedPID < nsigmaCutCombined) { + return true; + } + } + if (!candidate.hasTOF()) { + if (candidate.tpcInnerParam() < 1.5 && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0) { + return true; + } + if (candidate.tpcInnerParam() >= 1.5 && candidate.tpcInnerParam() < 1.8 && candidate.tpcNSigmaPr() > -1.5 && candidate.tpcNSigmaPr() < 2.0) { + return true; + } + } + } return false; } @@ -396,7 +516,7 @@ struct highmasslambdasvx { ConfigurableAxis axisEPAngle{"axisEPAngle", {1, -TMath::Pi() / 2, TMath::Pi() / 2}, "event plane angle"}; using BinningTypeVertexContributor = ColumnBinningPolicy; - ROOT::Math::PxPyPzMVector Lambdac, Proton, Kshort, LambdacRot, ProtonRot; + ROOT::Math::PxPyPzMVector Lambdac, Proton, Kshort, LambdacRot, KshortRot; // ROOT::Math::PxPyPzMVector fourVecDauCM; // ROOT::Math::XYZVector threeVecDauCM, threeVecDauCMXY, eventplaneVec, eventplaneVecNorm, beamvector; double massPr = TDatabasePDG::Instance()->GetParticle(kProton)->Mass(); // FIXME: Get from the common header @@ -460,14 +580,32 @@ struct highmasslambdasvx { if (!selectionTrack(track1)) { continue; } + + if (!track1.hasTOF()) { + if (!rejectPi(track1)) { + continue; + } + if (!rejectEl(track1)) { + continue; + } + if (!rejectKa(track1)) { + continue; + } + } + // PID check - if (ispTdepPID && !selectionPIDNew(track1)) { + if (PIDstrategy == 0 && !selectionPID1(track1)) { continue; } - if (!ispTdepPID && !selectionPID(track1)) { + if (PIDstrategy == 1 && !selectionPID2(track1)) { + continue; + } + if (PIDstrategy == 2 && !selectionPID3(track1)) { + continue; + } + if (PIDstrategy == 3 && !selectionPID4(track1)) { continue; } - histos.fill(HIST("hMomCorr"), track1.p() / track1.sign(), track1.p() - track1.tpcInnerParam(), centrality); histos.fill(HIST("hEta"), track1.eta()); histos.fill(HIST("hDcaz"), track1.dcaZ()); @@ -588,9 +726,7 @@ struct highmasslambdasvx { Kshort = ROOT::Math::PxPyPzMVector(pVecV0[0], pVecV0[1], pVecV0[2], massK0s); Proton = ROOT::Math::PxPyPzMVector(pVecBach[0], pVecBach[1], pVecBach[2], massPr); Lambdac = Proton + Kshort; - if (TMath::Abs(Lambdac.Rapidity()) > confRapidity) { - continue; - } + double protonimpactparameter = impactParameter1.getY(); // double kshortimpactparameter=impactParameter0.getY(); @@ -617,14 +753,12 @@ struct highmasslambdasvx { auto phiminuspsi = GetPhiInRange(Lambdac.Phi() - psiFT0C); v2 = TMath::Cos(2.0 * phiminuspsi); // if (TMath::Abs(CPAlambdac) > cutCPAlambdac && Lambdac.M() > 2.18 && Lambdac.M() <= 2.42) { - if (Lambdac.M() > 2.18 && Lambdac.M() <= 2.42) { + if (Lambdac.M() > 2.18 && Lambdac.M() <= 2.42 && TMath::Abs(Lambdac.Rapidity()) < confRapidity && Lambdac.Pt() > 2 && Lambdac.Pt() <= 6.0) { if (!useDecayLengthxy) { - histos.fill(HIST("hSparseV2SASameEvent_V2_EP"), Lambdac.M(), Lambdac.Pt(), v2, Proton.Pt(), decaylength, occupancy); - histos.fill(HIST("hSparseV2SASameEvent_V2_IOP"), Lambdac.M(), Lambdac.Pt(), phiminuspsi, Proton.Pt(), decaylength, occupancy); + histos.fill(HIST("hSparseV2SASameEvent_V2_EP"), Lambdac.M(), Lambdac.Pt(), v2, Proton.Pt(), decaylength, TMath::Abs(track1.dcaXY())); } if (useDecayLengthxy) { - histos.fill(HIST("hSparseV2SASameEvent_V2_EP"), Lambdac.M(), Lambdac.Pt(), v2, Proton.Pt(), decaylengthxy, occupancy); - histos.fill(HIST("hSparseV2SASameEvent_V2_IOP"), Lambdac.M(), Lambdac.Pt(), phiminuspsi, Proton.Pt(), decaylengthxy, occupancy); + histos.fill(HIST("hSparseV2SASameEvent_V2_EP"), Lambdac.M(), Lambdac.Pt(), v2, Proton.Pt(), decaylengthxy, TMath::Abs(track1.dcaXY())); } } for (int nrotbkg = 0; nrotbkg < nBkgRotations; nrotbkg++) { @@ -633,22 +767,20 @@ struct highmasslambdasvx { auto anglestep = (angleend - anglestart) / (1.0 * (nBkgRotations - 1)); auto rotangle = anglestart + nrotbkg * anglestep; histos.fill(HIST("hRotation"), rotangle); - auto rotProtonPx = Proton.Px() * std::cos(rotangle) - Proton.Py() * std::sin(rotangle); - auto rotProtonPy = Proton.Px() * std::sin(rotangle) + Proton.Py() * std::cos(rotangle); - ProtonRot = ROOT::Math::PxPyPzMVector(rotProtonPx, rotProtonPy, Proton.pz(), massPr); - LambdacRot = ProtonRot + Kshort; + auto rotKshortPx = Kshort.Px() * std::cos(rotangle) - Kshort.Py() * std::sin(rotangle); + auto rotKshortPy = Kshort.Px() * std::sin(rotangle) + Kshort.Py() * std::cos(rotangle); + KshortRot = ROOT::Math::PxPyPzMVector(rotKshortPx, rotKshortPy, Kshort.pz(), massK0s); + LambdacRot = Proton + KshortRot; auto phiminuspsiRot = GetPhiInRange(LambdacRot.Phi() - psiFT0C); v2Rot = TMath::Cos(2.0 * phiminuspsiRot); // double CPAlambdacRot = (decaylengthx * LambdacRot.Px() + decaylengthy * LambdacRot.Py() + decaylengthz * LambdacRot.Pz()) / (decaylength * LambdacRot.P()); // if (TMath::Abs(CPAlambdacRot) > cutCPAlambdac && LambdacRot.M() > 2.18 && LambdacRot.M() <= 2.42) { - if (LambdacRot.M() > 2.18 && LambdacRot.M() <= 2.42) { + if (LambdacRot.M() > 2.18 && LambdacRot.M() <= 2.42 && TMath::Abs(LambdacRot.Rapidity()) < confRapidity && LambdacRot.Pt() > 2 && LambdacRot.Pt() <= 6.0) { if (!useDecayLengthxy) { - histos.fill(HIST("hSparseV2SASameEventRotational_V2_EP"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, Proton.Pt(), decaylength, occupancy); - histos.fill(HIST("hSparseV2SASameEventRotational_V2_IOP"), LambdacRot.M(), LambdacRot.Pt(), phiminuspsiRot, Proton.Pt(), decaylength, occupancy); + histos.fill(HIST("hSparseV2SASameEventRotational_V2_EP"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, Proton.Pt(), decaylength, TMath::Abs(track1.dcaXY())); } if (useDecayLengthxy) { - histos.fill(HIST("hSparseV2SASameEventRotational_V2_EP"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, Proton.Pt(), decaylengthxy, occupancy); - histos.fill(HIST("hSparseV2SASameEventRotational_V2_IOP"), LambdacRot.M(), LambdacRot.Pt(), phiminuspsiRot, Proton.Pt(), decaylengthxy, occupancy); + histos.fill(HIST("hSparseV2SASameEventRotational_V2_EP"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, Proton.Pt(), decaylengthxy, TMath::Abs(track1.dcaXY())); } } } From 228e3187ba8eaf61a435711e0e611280aeb41650 Mon Sep 17 00:00:00 2001 From: nzardosh Date: Sat, 31 Aug 2024 02:50:51 +0200 Subject: [PATCH 10/16] PWGJE: Adding angularity to substructure task for model dependence systematic (#7521) --- PWGJE/DataModel/JetSubstructure.h | 55 +++++++++++++------------ PWGJE/Tasks/jetsubstructure.cxx | 25 ++++++++--- PWGJE/Tasks/jetsubstructurehf.cxx | 34 +++++++++++---- PWGJE/Tasks/jetsubstructurehfoutput.cxx | 2 +- PWGJE/Tasks/jetsubstructureoutput.cxx | 2 +- 5 files changed, 76 insertions(+), 42 deletions(-) diff --git a/PWGJE/DataModel/JetSubstructure.h b/PWGJE/DataModel/JetSubstructure.h index 8ea838bda5a..51bbbe69f6b 100644 --- a/PWGJE/DataModel/JetSubstructure.h +++ b/PWGJE/DataModel/JetSubstructure.h @@ -46,6 +46,7 @@ DECLARE_SOA_COLUMN(NSub2, nSub2, float); //! DECLARE_SOA_COLUMN(PairPt, pairPt, std::vector); //! DECLARE_SOA_COLUMN(PairEnergy, pairEnergy, std::vector); //! DECLARE_SOA_COLUMN(PairTheta, pairTheta, std::vector); //! +DECLARE_SOA_COLUMN(Angularity, angularity, float); //! } // namespace jetsubstructure namespace jetoutput @@ -60,33 +61,33 @@ DECLARE_SOA_COLUMN(JetNConstituents, jetNConstituents, int); //! } // namespace jetoutput // Defines the jet substrcuture table definition -#define JETSUBSTRUCTURE_TABLE_DEF(_jet_type_, _jet_description_, _name_, _cand_type_, _cand_description_) \ - \ - namespace _name_##collisionoutput \ - { \ - DECLARE_SOA_DYNAMIC_COLUMN(Dummy##_jet_type_, dummy##_jet_type_, []() -> int { return 0; }); \ - } \ - \ - DECLARE_SOA_TABLE(_jet_type_##COs, "AOD", _jet_description_ "CO", jetcollision::PosZ, jetcollision::Centrality, jetcollision::EventSel, _name_##collisionoutput::Dummy##_jet_type_<>); \ - using _jet_type_##CO = _jet_type_##COs::iterator; \ - \ - namespace _name_##jetoutput \ - { \ - DECLARE_SOA_INDEX_COLUMN_CUSTOM(_jet_type_##CO, collision, _jet_description_ "COS"); \ - DECLARE_SOA_INDEX_COLUMN_FULL_CUSTOM(Candidate, candidate, int, _cand_type_, _cand_description_ "S", "_0"); \ - } \ - DECLARE_SOA_TABLE(_jet_type_##Os, "AOD", _jet_description_ "O", _name_##jetoutput::_jet_type_##COId, _name_##jetoutput::CandidateId, jetoutput::JetPt, jetoutput::JetPhi, jetoutput::JetEta, jetoutput::JetY, jetoutput::JetR, jetoutput::JetNConstituents); \ - using _jet_type_##O = _jet_type_##Os::iterator; \ - namespace _name_##substructure \ - { \ - DECLARE_SOA_INDEX_COLUMN_CUSTOM(_jet_type_##O, outputTable, _jet_description_ "OS"); \ - DECLARE_SOA_DYNAMIC_COLUMN(Dummy##_jet_type_, dummy##_jet_type_, []() -> int { return 0; }); \ - } \ - \ - DECLARE_SOA_TABLE(_jet_type_##SSs, "AOD", _jet_description_ "SS", jetsubstructure::EnergyMother, jetsubstructure::PtLeading, jetsubstructure::PtSubLeading, jetsubstructure::Theta, jetsubstructure::NSub2DR, jetsubstructure::NSub1, jetsubstructure::NSub2, jetsubstructure::PairPt, jetsubstructure::PairEnergy, jetsubstructure::PairTheta, _name_##substructure::Dummy##_jet_type_<>); \ - DECLARE_SOA_TABLE(_jet_type_##SSOs, "AOD", _jet_description_ "SSO", _name_##substructure::_jet_type_##OId, jetsubstructure::EnergyMother, jetsubstructure::PtLeading, jetsubstructure::PtSubLeading, jetsubstructure::Theta, jetsubstructure::NSub2DR, jetsubstructure::NSub1, jetsubstructure::NSub2, jetsubstructure::PairPt, jetsubstructure::PairEnergy, jetsubstructure::PairTheta); \ - \ - using _jet_type_##O = _jet_type_##Os::iterator; \ +#define JETSUBSTRUCTURE_TABLE_DEF(_jet_type_, _jet_description_, _name_, _cand_type_, _cand_description_) \ + \ + namespace _name_##collisionoutput \ + { \ + DECLARE_SOA_DYNAMIC_COLUMN(Dummy##_jet_type_, dummy##_jet_type_, []() -> int { return 0; }); \ + } \ + \ + DECLARE_SOA_TABLE(_jet_type_##COs, "AOD", _jet_description_ "CO", jetcollision::PosZ, jetcollision::Centrality, jetcollision::EventSel, _name_##collisionoutput::Dummy##_jet_type_<>); \ + using _jet_type_##CO = _jet_type_##COs::iterator; \ + \ + namespace _name_##jetoutput \ + { \ + DECLARE_SOA_INDEX_COLUMN_CUSTOM(_jet_type_##CO, collision, _jet_description_ "COS"); \ + DECLARE_SOA_INDEX_COLUMN_FULL_CUSTOM(Candidate, candidate, int, _cand_type_, _cand_description_ "S", "_0"); \ + } \ + DECLARE_SOA_TABLE(_jet_type_##Os, "AOD", _jet_description_ "O", _name_##jetoutput::_jet_type_##COId, _name_##jetoutput::CandidateId, jetoutput::JetPt, jetoutput::JetPhi, jetoutput::JetEta, jetoutput::JetY, jetoutput::JetR, jetoutput::JetNConstituents); \ + using _jet_type_##O = _jet_type_##Os::iterator; \ + namespace _name_##substructure \ + { \ + DECLARE_SOA_INDEX_COLUMN_CUSTOM(_jet_type_##O, outputTable, _jet_description_ "OS"); \ + DECLARE_SOA_DYNAMIC_COLUMN(Dummy##_jet_type_, dummy##_jet_type_, []() -> int { return 0; }); \ + } \ + \ + DECLARE_SOA_TABLE(_jet_type_##SSs, "AOD", _jet_description_ "SS", jetsubstructure::EnergyMother, jetsubstructure::PtLeading, jetsubstructure::PtSubLeading, jetsubstructure::Theta, jetsubstructure::NSub2DR, jetsubstructure::NSub1, jetsubstructure::NSub2, jetsubstructure::PairPt, jetsubstructure::PairEnergy, jetsubstructure::PairTheta, jetsubstructure::Angularity, _name_##substructure::Dummy##_jet_type_<>); \ + DECLARE_SOA_TABLE(_jet_type_##SSOs, "AOD", _jet_description_ "SSO", _name_##substructure::_jet_type_##OId, jetsubstructure::EnergyMother, jetsubstructure::PtLeading, jetsubstructure::PtSubLeading, jetsubstructure::Theta, jetsubstructure::NSub2DR, jetsubstructure::NSub1, jetsubstructure::NSub2, jetsubstructure::PairPt, jetsubstructure::PairEnergy, jetsubstructure::PairTheta, jetsubstructure::Angularity); \ + \ + using _jet_type_##O = _jet_type_##Os::iterator; \ using _jet_type_##SSO = _jet_type_##SSOs::iterator; // define the mathcing table definition diff --git a/PWGJE/Tasks/jetsubstructure.cxx b/PWGJE/Tasks/jetsubstructure.cxx index bd564e4bc65..ebf9d4c34f2 100644 --- a/PWGJE/Tasks/jetsubstructure.cxx +++ b/PWGJE/Tasks/jetsubstructure.cxx @@ -49,6 +49,8 @@ struct JetSubstructureTask { Configurable zCut{"zCut", 0.1, "soft drop z cut"}; Configurable beta{"beta", 0.0, "soft drop beta"}; + Configurable kappa{"kappa", 1.0, "angularity kappa"}; + Configurable alpha{"alpha", 1.0, "angularity alpha"}; Configurable pairConstituentPtMin{"pairConstituentPtMin", 1.0, "pt cut off for constituents going into pairs"}; Service pdg; @@ -64,6 +66,7 @@ struct JetSubstructureTask { std::vector pairPtVec; std::vector pairEnergyVec; std::vector pairThetaVec; + float angularity; HistogramRegistry registry; @@ -159,9 +162,9 @@ struct JetSubstructureTask { tracksVec.push_back(constituent); } } - if (tracksVec.size() >= 2) { - for (typename std::vector::size_type track1Index = 0; track1Index < tracksVec.size() - 1; track1Index++) { - for (typename std::vector::size_type track2Index = track1Index + 1; track2Index < tracksVec.size(); track2Index++) { + if (tracksVec.size() >= 1) { + for (typename std::vector::size_type track1Index = 0; track1Index < tracksVec.size(); track1Index++) { + for (typename std::vector::size_type track2Index = 0; track2Index < tracksVec.size(); track2Index++) { pairPtVec.push_back(tracksVec.at(track1Index).pt() * tracksVec.at(track2Index).pt()); pairEnergyVec.push_back(tracksVec.at(track1Index).energy() * tracksVec.at(track2Index).energy()); pairThetaVec.push_back(jetutilities::deltaR(tracksVec.at(track1Index), tracksVec.at(track2Index))); @@ -170,6 +173,16 @@ struct JetSubstructureTask { } } + template + void jetSubstructureSimple(T const& jet, U const& /*tracks*/) + { + angularity = 0.0; + for (auto& constituent : jet.template tracks_as()) { + angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent), alpha); + } + angularity /= (jet.pt() * (jet.r() / 100.f)); + } + template void analyseCharged(T const& jet, U const& tracks, V& outputTable) { @@ -180,7 +193,8 @@ struct JetSubstructureTask { nSub = jetsubstructureutilities::getNSubjettiness(jet, tracks, tracks, tracks, 2, fastjet::contrib::CA_Axes(), true, zCut, beta); jetReclustering(jet); jetPairing(jet, tracks); - outputTable(energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec, nSub[0], nSub[1], nSub[2], pairPtVec, pairEnergyVec, pairThetaVec); + jetSubstructureSimple(jet, tracks); + outputTable(energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec, nSub[0], nSub[1], nSub[2], pairPtVec, pairEnergyVec, pairThetaVec, angularity); } void processDummy(JetTracks const&) @@ -219,7 +233,8 @@ struct JetSubstructureTask { nSub = jetsubstructureutilities::getNSubjettiness(jet, particles, particles, particles, 2, fastjet::contrib::CA_Axes(), true, zCut, beta); jetReclustering(jet); jetPairing(jet, particles); - jetSubstructureMCPTable(energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec, nSub[0], nSub[1], nSub[2], pairPtVec, pairEnergyVec, pairThetaVec); + jetSubstructureSimple(jet, particles); + jetSubstructureMCPTable(energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec, nSub[0], nSub[1], nSub[2], pairPtVec, pairEnergyVec, pairThetaVec, angularity); } PROCESS_SWITCH(JetSubstructureTask, processChargedJetsMCP, "charged jet substructure on MC particle level", false); }; diff --git a/PWGJE/Tasks/jetsubstructurehf.cxx b/PWGJE/Tasks/jetsubstructurehf.cxx index 07eb5b9120b..47bda670c42 100644 --- a/PWGJE/Tasks/jetsubstructurehf.cxx +++ b/PWGJE/Tasks/jetsubstructurehf.cxx @@ -53,6 +53,8 @@ struct JetSubstructureHFTask { // Jet level configurables Configurable zCut{"zCut", 0.1, "soft drop z cut"}; Configurable beta{"beta", 0.0, "soft drop beta"}; + Configurable kappa{"kappa", 1.0, "angularity kappa"}; + Configurable alpha{"alpha", 1.0, "angularity alpha"}; Configurable pairConstituentPtMin{"pairConstituentPtMin", 1.0, "pt cut off for constituents going into pairs"}; Service pdg; @@ -70,6 +72,7 @@ struct JetSubstructureHFTask { std::vector pairPtVec; std::vector pairEnergyVec; std::vector pairThetaVec; + float angularity; HistogramRegistry registry; void init(InitContext const&) @@ -176,18 +179,18 @@ struct JetSubstructureHFTask { for (auto& candidate : jet.template candidates_as()) { candidatesVec.push_back(candidate); } - if (tracksVec.size() >= 2) { - for (typename std::vector>::size_type track1Index = 0; track1Index < tracksVec.size() - 1; track1Index++) { - for (typename std::vector>::size_type track2Index = track1Index + 1; track2Index < tracksVec.size(); track2Index++) { + if (tracksVec.size() >= 1) { + for (typename std::vector>::size_type track1Index = 0; track1Index < tracksVec.size(); track1Index++) { + for (typename std::vector>::size_type track2Index = 0; track2Index < tracksVec.size(); track2Index++) { pairPtVec.push_back(tracksVec.at(track1Index).pt() * tracksVec.at(track2Index).pt()); pairEnergyVec.push_back(tracksVec.at(track1Index).energy() * tracksVec.at(track2Index).energy()); pairThetaVec.push_back(jetutilities::deltaR(tracksVec.at(track1Index), tracksVec.at(track2Index))); } } } - if (candidatesVec.size() >= 2) { - for (typename std::vector>::size_type candidate1Index = 0; candidate1Index < candidatesVec.size() - 1; candidate1Index++) { - for (typename std::vector>::size_type candidate2Index = candidate1Index + 1; candidate2Index < candidatesVec.size(); candidate2Index++) { + if (candidatesVec.size() >= 1) { + for (typename std::vector>::size_type candidate1Index = 0; candidate1Index < candidatesVec.size(); candidate1Index++) { + for (typename std::vector>::size_type candidate2Index = 0; candidate2Index < candidatesVec.size(); candidate2Index++) { pairPtVec.push_back(candidatesVec.at(candidate1Index).pt() * candidatesVec.at(candidate2Index).pt()); auto candidate1Energy = std::sqrt((candidatesVec.at(candidate1Index).p() * candidatesVec.at(candidate1Index).p()) + (candMass * candMass)); auto candidate2Energy = std::sqrt((candidatesVec.at(candidate2Index).p() * candidatesVec.at(candidate2Index).p()) + (candMass * candMass)); @@ -208,6 +211,19 @@ struct JetSubstructureHFTask { } } + template + void jetSubstructureSimple(T const& jet, U const& /*tracks*/, V const& /*candidates*/) + { + angularity = 0.0; + for (auto& candidate : jet.template candidates_as()) { + angularity += std::pow(candidate.pt(), kappa) * std::pow(jetutilities::deltaR(jet, candidate), alpha); + } + for (auto& constituent : jet.template tracks_as()) { + angularity += std::pow(constituent.pt(), kappa) * std::pow(jetutilities::deltaR(jet, constituent), alpha); + } + angularity /= (jet.pt() * (jet.r() / 100.f)); + } + template void analyseCharged(T const& jet, U const& tracks, V const& candidates, M& outputTable) { @@ -221,7 +237,8 @@ struct JetSubstructureHFTask { nSub = jetsubstructureutilities::getNSubjettiness(jet, tracks, tracks, candidates, 2, fastjet::contrib::CA_Axes(), true, zCut, beta); jetReclustering(jet); jetPairing(jet, tracks, candidates); - outputTable(energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec, nSub[0], nSub[1], nSub[2], pairPtVec, pairEnergyVec, pairThetaVec); + jetSubstructureSimple(jet, tracks, candidates); + outputTable(energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec, nSub[0], nSub[1], nSub[2], pairPtVec, pairEnergyVec, pairThetaVec, angularity); } void processDummy(JetTracks const&) @@ -267,7 +284,8 @@ struct JetSubstructureHFTask { nSub = jetsubstructureutilities::getNSubjettiness(jet, particles, particles, candidates, 2, fastjet::contrib::CA_Axes(), true, zCut, beta); jetReclustering(jet); jetPairing(jet, particles, candidates); - jetSubstructureMCPTable(energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec, nSub[0], nSub[1], nSub[2], pairPtVec, pairEnergyVec, pairThetaVec); + jetSubstructureSimple(jet, particles, candidates); + jetSubstructureMCPTable(energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec, nSub[0], nSub[1], nSub[2], pairPtVec, pairEnergyVec, pairThetaVec, angularity); } PROCESS_SWITCH(JetSubstructureHFTask, processChargedJetsMCP, "HF jet substructure on MC particle level", false); }; diff --git a/PWGJE/Tasks/jetsubstructurehfoutput.cxx b/PWGJE/Tasks/jetsubstructurehfoutput.cxx index 970716feada..291d123d9d8 100644 --- a/PWGJE/Tasks/jetsubstructurehfoutput.cxx +++ b/PWGJE/Tasks/jetsubstructurehfoutput.cxx @@ -133,7 +133,7 @@ struct JetSubstructureHFOutputTask { std::copy(pairEnergySpan.begin(), pairEnergySpan.end(), std::back_inserter(pairEnergyVec)); std::copy(pairThetaSpan.begin(), pairThetaSpan.end(), std::back_inserter(pairThetaVec)); jetOutputTable(collisionIndex, candidateIndex, jet.pt(), jet.phi(), jet.eta(), jet.y(), jet.r(), jet.tracksIds().size() + jet.candidatesIds().size()); // here we take the decision to keep the collision index consistent with the JE framework in case it is later needed to join to other tables. The candidate Index however can be linked to the HF tables - jetSubstructureOutputTable(jetOutputTable.lastIndex(), energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec, jet.nSub2DR(), jet.nSub1(), jet.nSub2(), pairPtVec, pairEnergyVec, pairThetaVec); + jetSubstructureOutputTable(jetOutputTable.lastIndex(), energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec, jet.nSub2DR(), jet.nSub1(), jet.nSub2(), pairPtVec, pairEnergyVec, pairThetaVec, jet.angularity()); jetMap.insert(std::make_pair(jet.globalIndex(), jetOutputTable.lastIndex())); } diff --git a/PWGJE/Tasks/jetsubstructureoutput.cxx b/PWGJE/Tasks/jetsubstructureoutput.cxx index 46855f2a72d..a5ce1525c31 100644 --- a/PWGJE/Tasks/jetsubstructureoutput.cxx +++ b/PWGJE/Tasks/jetsubstructureoutput.cxx @@ -106,7 +106,7 @@ struct JetSubstructureOutputTask { std::copy(pairEnergySpan.begin(), pairEnergySpan.end(), std::back_inserter(pairEnergyVec)); std::copy(pairThetaSpan.begin(), pairThetaSpan.end(), std::back_inserter(pairThetaVec)); jetOutputTable(collisionIndex, collisionIndex, jet.pt(), jet.phi(), jet.eta(), jet.y(), jet.r(), jet.tracksIds().size()); // second collision index is a dummy coloumn mirroring the hf candidate - jetSubstructureOutputTable(jetOutputTable.lastIndex(), energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec, jet.nSub2DR(), jet.nSub1(), jet.nSub2(), pairPtVec, pairEnergyVec, pairThetaVec); + jetSubstructureOutputTable(jetOutputTable.lastIndex(), energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec, jet.nSub2DR(), jet.nSub1(), jet.nSub2(), pairPtVec, pairEnergyVec, pairThetaVec, jet.angularity()); jetMapping.insert(std::make_pair(jet.globalIndex(), jetOutputTable.lastIndex())); } From 31479093773f2799bcd62ce896a8ae29534297ec Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Sat, 31 Aug 2024 05:26:51 +0200 Subject: [PATCH 11/16] PWGEM/Dilepton: add a skimming task for OTS (#7523) * PWGEM/Dilepton: add a skimming task for OTS * PWGEM/Dilepton: update dilepton task for flow analysis --- PWGEM/Dilepton/Core/Dilepton.h | 46 ++- PWGEM/Dilepton/Core/PhotonHBT.h | 30 +- PWGEM/Dilepton/DataModel/dileptonTables.h | 7 +- PWGEM/Dilepton/TableProducer/CMakeLists.txt | 11 +- .../TableProducer/createEMEventDilepton.cxx | 138 +++----- .../TableProducer/filterDielectronEvent.cxx | 296 ++++++++++++------ PWGEM/Dilepton/TableProducer/skimmerOTS.cxx | 128 ++++++++ .../TableProducer/skimmerPrimaryElectron.cxx | 115 ++++--- .../TableProducer/skimmerPrimaryMuon.cxx | 156 +++++++-- .../PhotonMeson/TableProducer/CMakeLists.txt | 2 +- .../TableProducer/photonconversionbuilder.cxx | 48 +-- 11 files changed, 677 insertions(+), 300 deletions(-) create mode 100644 PWGEM/Dilepton/TableProducer/skimmerOTS.cxx diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 6ba38a36d52..1acf3739ae6 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -25,6 +25,7 @@ #include #include #include +#include "TH1D.h" #include "TString.h" #include "Math/Vector4D.h" @@ -93,6 +94,8 @@ struct Dilepton { Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + Configurable spresoPath{"spresoPath", "Users/d/dsekihat/PWGEM/dilepton/Qvector/resolution/LHC23zzh/pass3/test", "Path of SP resolution file"}; + Configurable cfgApplySPresolution{"cfgApplySPresolution", false, "flag to apply resolution correction for flow analysis"}; Configurable cfgAnalysisType{"cfgAnalysisType", static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC), "kQC:0, kUPC:1, kFlowV2:2, kFlowV3:3, kPolarization:4, kVM:5, kHFll:6"}; Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5"}; @@ -244,6 +247,7 @@ struct Dilepton { float beamE2 = 0.f; // beam energy float beamP1 = 0.f; // beam momentum float beamP2 = 0.f; // beam momentum + TH1D* h1sp_resolution = nullptr; void init(InitContext& /*context*/) { @@ -420,6 +424,12 @@ struct Dilepton { LOGF(info, "total inspected TVX events = %d in run number %d", collision.nInspectedTVX(), collision.runNumber()); fRegistry.fill(HIST("Event/hNInspectedTVX"), collision.runNumber(), collision.nInspectedTVX()); } + + if (cfgApplySPresolution) { + auto list = ccdb->getForTimeStamp(spresoPath, 10); + h1sp_resolution = reinterpret_cast(list->FindObject("histo_SP_R2_FT0M_BPos_BNeg")); + LOGF(info, "h1sp_resolution.GetBinContent(40) = %f", h1sp_resolution->GetBinContent(40)); + } } ~Dilepton() @@ -429,7 +439,7 @@ struct Dilepton { delete emh_neg; emh_neg = 0x0; - // map_mixed_eventId_to_centrality.clear(); + map_mixed_eventId_to_centrality.clear(); map_mixed_eventId_to_qvector.clear(); map_mixed_eventId_to_globalBC.clear(); @@ -439,6 +449,7 @@ struct Dilepton { if (eid_bdt) { delete eid_bdt; } + delete h1sp_resolution; } void addhistograms() @@ -684,6 +695,15 @@ struct Dilepton { return is_good; } + float getSPresolution(const float centrality) + { + if (h1sp_resolution == nullptr) { + return 1.f; + } else { + return h1sp_resolution->GetBinContent(h1sp_resolution->FindBin(centrality)); + } + } + template bool fillPairInfo(TCollision const& collision, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut) { @@ -832,7 +852,9 @@ struct Dilepton { }; if constexpr (ev_id == 0) { - float sp = RecoDecay::dotProd(std::array{static_cast(std::cos(nmod * v12.Phi())), static_cast(std::sin(nmod * v12.Phi()))}, qvectors[nmod][cfgQvecEstimator]); + // LOGF(info, "collision.centFT0C() = %f, getSPresolution = %f", collision.centFT0C(), getSPresolution(collision.centFT0C())); + + float sp = RecoDecay::dotProd(std::array{static_cast(std::cos(nmod * v12.Phi())), static_cast(std::sin(nmod * v12.Phi()))}, qvectors[nmod][cfgQvecEstimator]) / getSPresolution(collision.centFT0C()); if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hPrfUQ"), v12.M(), v12.Pt(), pair_dca, sp, weight); @@ -995,7 +1017,7 @@ struct Dilepton { TEMH* emh_pos = nullptr; TEMH* emh_neg = nullptr; std::map, std::vector>>> map_mixed_eventId_to_qvector; - // std::map, float> map_mixed_eventId_to_centrality; + std::map, float> map_mixed_eventId_to_centrality; std::map, uint64_t> map_mixed_eventId_to_globalBC; std::vector> used_trackIds; @@ -1207,7 +1229,7 @@ struct Dilepton { continue; } - // auto centrality_mix = map_mixed_eventId_to_centrality[mix_dfId_collisionId]; + auto centrality_mix = map_mixed_eventId_to_centrality[mix_dfId_collisionId]; auto qvectors_mix = map_mixed_eventId_to_qvector[mix_dfId_collisionId]; auto globalBC_mix = map_mixed_eventId_to_globalBC[mix_dfId_collisionId]; uint64_t diffBC = std::max(collision.globalBC(), globalBC_mix) - std::min(collision.globalBC(), globalBC_mix); @@ -1225,25 +1247,25 @@ struct Dilepton { for (auto& pos : selected_posTracks_in_this_event) { // ULS mix for (auto& neg : negTracks_from_event_pool) { - fillMixedPairInfoForFlow(pos, neg, cut, qvectors, qvectors_mix); + fillMixedPairInfoForFlow(pos, neg, cut, qvectors, qvectors_mix, collision.centFT0C(), centrality_mix); } } for (auto& neg : selected_negTracks_in_this_event) { // ULS mix for (auto& pos : posTracks_from_event_pool) { - fillMixedPairInfoForFlow(neg, pos, cut, qvectors, qvectors_mix); + fillMixedPairInfoForFlow(neg, pos, cut, qvectors, qvectors_mix, collision.centFT0C(), centrality_mix); } } for (auto& pos1 : selected_posTracks_in_this_event) { // LS++ mix for (auto& pos2 : posTracks_from_event_pool) { - fillMixedPairInfoForFlow(pos1, pos2, cut, qvectors, qvectors_mix); + fillMixedPairInfoForFlow(pos1, pos2, cut, qvectors, qvectors_mix, collision.centFT0C(), centrality_mix); } } for (auto& neg1 : selected_negTracks_in_this_event) { // LS-- mix for (auto& neg2 : negTracks_from_event_pool) { - fillMixedPairInfoForFlow(neg1, neg2, cut, qvectors, qvectors_mix); + fillMixedPairInfoForFlow(neg1, neg2, cut, qvectors, qvectors_mix, collision.centFT0C(), centrality_mix); } } } // end of loop over mixed event pool @@ -1255,7 +1277,7 @@ struct Dilepton { if (nuls > 0 || nlspp > 0 || nlsmm > 0) { if (nmod > 0) { map_mixed_eventId_to_qvector[key_df_collision] = qvectors; - // map_mixed_eventId_to_centrality[key_df_collision] = collision.centFT0C(); + map_mixed_eventId_to_centrality[key_df_collision] = collision.centFT0C(); } map_mixed_eventId_to_globalBC[key_df_collision] = collision.globalBC(); emh_pos->AddCollisionIdAtLast(key_bin, key_df_collision); @@ -1268,7 +1290,7 @@ struct Dilepton { } // end of DF template - bool fillMixedPairInfoForFlow(TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TQvectors const& qvectors, TMixedQvectors const& qvectors_mix) + bool fillMixedPairInfoForFlow(TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TQvectors const& qvectors, TMixedQvectors const& qvectors_mix, const float centrality, const float centrality_mix) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { auto v1ambIds = t1.ambiguousElectronsIds(); @@ -1309,8 +1331,8 @@ struct Dilepton { pair_dca = std::sqrt((dca_t1 * dca_t1 + dca_t2 * dca_t2) / 2.); } - float sp1 = RecoDecay::dotProd(std::array{static_cast(std::cos(nmod * v1.Phi())), static_cast(std::sin(nmod * v1.Phi()))}, qvectors[nmod][cfgQvecEstimator]); - float sp2 = RecoDecay::dotProd(std::array{static_cast(std::cos(nmod * v2.Phi())), static_cast(std::sin(nmod * v2.Phi()))}, qvectors_mix[nmod][cfgQvecEstimator]); + float sp1 = RecoDecay::dotProd(std::array{static_cast(std::cos(nmod * v1.Phi())), static_cast(std::sin(nmod * v1.Phi()))}, qvectors[nmod][cfgQvecEstimator]) / getSPresolution(centrality); + float sp2 = RecoDecay::dotProd(std::array{static_cast(std::cos(nmod * v2.Phi())), static_cast(std::sin(nmod * v2.Phi()))}, qvectors_mix[nmod][cfgQvecEstimator]) / getSPresolution(centrality_mix); float cos_dphi1 = std::cos(nmod * (v1.Phi() - v12.Phi())); float cos_dphi2 = std::cos(nmod * (v2.Phi() - v12.Phi())); float cos_dphi12 = std::cos(nmod * (v1.Phi() - v2.Phi())); diff --git a/PWGEM/Dilepton/Core/PhotonHBT.h b/PWGEM/Dilepton/Core/PhotonHBT.h index 821e0417d4e..2491ba70d96 100644 --- a/PWGEM/Dilepton/Core/PhotonHBT.h +++ b/PWGEM/Dilepton/Core/PhotonHBT.h @@ -72,7 +72,7 @@ using namespace o2::aod::pwgem::dilepton::core::photonhbt; using MyCollisions = soa::Join; using MyCollision = MyCollisions::iterator; -using MyCollisionsWithSWT = soa::Join; +using MyCollisionsWithSWT = soa::Join; using MyCollisionWithSWT = MyCollisionsWithSWT::iterator; using MyV0Photons = soa::Join; @@ -98,8 +98,8 @@ struct PhotonHBT { Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2, NTPV:3"}; Configurable cfgCentMin{"cfgCentMin", 0, "min. centrality"}; Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; - Configurable cfgSpherocityMin{"cfgSpherocityMin", -999.f, "min. spherocity"}; - Configurable cfgSpherocityMax{"cfgSpherocityMax", +999.f, "max. spherocity"}; + // Configurable cfgSpherocityMin{"cfgSpherocityMin", -999.f, "min. spherocity"}; + // Configurable cfgSpherocityMax{"cfgSpherocityMax", +999.f, "max. spherocity"}; Configurable maxY{"maxY", 0.8, "maximum rapidity for reconstructed particles"}; Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; Configurable ndepth{"ndepth", 100, "depth for event mixing"}; @@ -162,7 +162,7 @@ struct PhotonHBT { struct : ConfigurableGroup { std::string prefix = "dielectroncut_group"; Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 2.5, "max mass"}; // this is valid, because only ULS is used. + Configurable cfg_max_mass{"cfg_max_mass", 0.015, "max mass"}; // this is valid, because only ULS is used. Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; @@ -635,10 +635,10 @@ struct PhotonHBT { if (!collision.swtalias_bit(o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value))) { continue; } - if (collision.spherocity_ptunweighted() < cfgSpherocityMin || cfgSpherocityMax < collision.spherocity_ptunweighted()) { - continue; - } - fRegistry.fill(HIST("Event/after/hSpherocity"), collision.spherocity_ptunweighted()); + // if (collision.spherocity_ptunweighted() < cfgSpherocityMin || cfgSpherocityMax < collision.spherocity_ptunweighted()) { + // continue; + // } + // fRegistry.fill(HIST("Event/after/hSpherocity"), collision.spherocity_ptunweighted()); } const float eventplanes_2_for_mix[6] = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; float ep2 = eventplanes_2_for_mix[cfgEP2Estimator_for_Mix]; @@ -859,7 +859,7 @@ struct PhotonHBT { } } } // end of g2 loop - } // end of g1 loop + } // end of g1 loop used_pairs_per_collision.clear(); used_pairs_per_collision.shrink_to_fit(); } else if constexpr (pairtype == ggHBTPairType::kPCMEE) { @@ -932,7 +932,7 @@ struct PhotonHBT { used_dileptonIds.emplace_back(tuple_tmp_id2); } } // end of g2 loop - } // end of g1 loop + } // end of g1 loop } // event mixing @@ -1041,7 +1041,7 @@ struct PhotonHBT { fillPairHistogram<1>(collision, v1, v2, 1.f); } } - } // end of loop over mixed event pool + } // end of loop over mixed event pool } else if constexpr (pairtype == ggHBTPairType::kPCMEE) { // [photon1 from event1, photon2 from event2] and [photon1 from event2, photon2 from event1] for (auto& mix_dfId_collisionId : collisionIds1_in_mixing_pool) { int mix_dfId = mix_dfId_collisionId.first; @@ -1135,9 +1135,9 @@ struct PhotonHBT { if (!collision.swtalias_bit(o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value))) { continue; } - if (collision.spherocity_ptunweighted() < cfgSpherocityMin || cfgSpherocityMax < collision.spherocity_ptunweighted()) { - continue; - } + // if (collision.spherocity_ptunweighted() < cfgSpherocityMin || cfgSpherocityMax < collision.spherocity_ptunweighted()) { + // continue; + // } } if (!fEMEventCut.IsSelected(collision)) { continue; @@ -1164,7 +1164,7 @@ struct PhotonHBT { } passed_pairIds.emplace_back(std::make_pair(pos.globalIndex(), ele.globalIndex())); } // end of dielectron pairing loop - } // end of collision loop + } // end of collision loop for (auto& pairId : passed_pairIds) { auto t1 = tracks.rawIteratorAt(std::get<0>(pairId)); diff --git a/PWGEM/Dilepton/DataModel/dileptonTables.h b/PWGEM/Dilepton/DataModel/dileptonTables.h index 541362c6ee0..3744f609519 100644 --- a/PWGEM/Dilepton/DataModel/dileptonTables.h +++ b/PWGEM/Dilepton/DataModel/dileptonTables.h @@ -58,7 +58,8 @@ const std::unordered_map aliasLabels = { namespace emevent { DECLARE_SOA_COLUMN(CollisionId, collisionId, int); -DECLARE_SOA_BITMAP_COLUMN(SWTAlias, swtalias, 16); //! Bitmask of fired trigger aliases (see above for definitions) +DECLARE_SOA_BITMAP_COLUMN(SWTAliasTmp, swtaliastmp, 16); //! Bitmask of fired trigger aliases (see above for definitions) to be join to aod::Collisions for skimming +DECLARE_SOA_BITMAP_COLUMN(SWTAlias, swtalias, 16); //! Bitmask of fired trigger aliases (see above for definitions) to be join to aod::EMEvents for analysis DECLARE_SOA_COLUMN(NInspectedTVX, nInspectedTVX, uint64_t); DECLARE_SOA_COLUMN(NeeULS, neeuls, int); DECLARE_SOA_COLUMN(NeeLSpp, neelspp, int); @@ -181,6 +182,10 @@ DECLARE_SOA_TABLE(EMSWTriggerInfos, "AOD", "EMSWTRIGGERINFO", //! joinable to EM emevent::SWTAlias, emevent::NInspectedTVX); using EMSWTriggerInfo = EMSWTriggerInfos::iterator; +DECLARE_SOA_TABLE(EMSWTriggerInfosTMP, "AOD", "EMSWTTMP", //! joinable to aod::Collisions + emevent::SWTAliasTmp, emevent::NInspectedTVX); +using EMSWTriggerInfoTMP = EMSWTriggerInfosTMP::iterator; + DECLARE_SOA_TABLE(EMEventsProperty, "AOD", "EMEVENTPROP", //! joinable to EMEvents emevent::SpherocityPtWeighted, emevent::SpherocityPtUnWeighted, emevent::NtrackSpherocity); using EMEventProperty = EMEventsProperty::iterator; diff --git a/PWGEM/Dilepton/TableProducer/CMakeLists.txt b/PWGEM/Dilepton/TableProducer/CMakeLists.txt index d0daf2c914f..9765839318d 100644 --- a/PWGEM/Dilepton/TableProducer/CMakeLists.txt +++ b/PWGEM/Dilepton/TableProducer/CMakeLists.txt @@ -32,12 +32,12 @@ o2physics_add_dpl_workflow(tree-creator-single-electron-qa o2physics_add_dpl_workflow(skimmer-primary-electron SOURCES skimmerPrimaryElectron.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::EventFilteringUtils + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(skimmer-primary-muon SOURCES skimmerPrimaryMuon.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::GlobalTracking O2Physics::EventFilteringUtils + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::GlobalTracking COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(skimmer-secondary-electron @@ -47,6 +47,11 @@ o2physics_add_dpl_workflow(skimmer-secondary-electron o2physics_add_dpl_workflow(create-emevent-dilepton SOURCES createEMEventDilepton.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(skimmer-ots + SOURCES skimmerOTS.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) @@ -57,6 +62,6 @@ o2physics_add_dpl_workflow(associate-mc-info-dilepton o2physics_add_dpl_workflow(filter-dielectron-event SOURCES filterDielectronEvent.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::EventFilteringUtils + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) diff --git a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx index 3006dacce05..f1258581cea 100644 --- a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx +++ b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx @@ -24,7 +24,6 @@ #include "DataFormatsParameters/GRPObject.h" #include "DataFormatsParameters/GRPMagField.h" #include "CCDB/BasicCCDBManager.h" -#include "EventFiltering/Zorro.h" #include "Common/Core/TableHelper.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" @@ -42,6 +41,10 @@ using MyCollisions = soa::Join; using MyCollisions_Cent = soa::Join; // centrality table has dependency on multiplicity table. using MyCollisions_Cent_Qvec = soa::Join; +using MyCollisionsWithSWT = soa::Join; +using MyCollisionsWithSWT_Cent = soa::Join; // centrality table has dependency on multiplicity table. +using MyCollisionsWithSWT_Cent_Qvec = soa::Join; + using MyCollisionsMC = soa::Join; using MyCollisionsMC_Cent = soa::Join; // centrality table has dependency on multiplicity table. using MyCollisionsMC_Cent_Qvec = soa::Join; @@ -67,8 +70,6 @@ struct CreateEMEventDilepton { Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; Configurable applyEveSel_at_skimming{"applyEveSel_at_skimming", false, "flag to apply minimal event selection at the skimming level"}; - Configurable enable_swt{"enable_swt", false, "flag to process skimmed data (swt triggered)"}; - Configurable cfg_swt_names{"cfg_swt_names", "fHighTrackMult,fHighFt0Mult", "comma-separated software trigger names"}; // !trigger names have to be pre-registered in dileptonTable.h for bit operation! HistogramRegistry registry{"registry"}; void init(o2::framework::InitContext&) @@ -80,16 +81,7 @@ struct CreateEMEventDilepton { registry.add("hNInspectedTVX", "N inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true); } - ~CreateEMEventDilepton() - { - swt_names.clear(); - swt_names.shrink_to_fit(); - } - - Zorro zorro; - std::vector mTOIidx; - std::vector swt_names; - uint64_t mNinspectedTVX{0}; + ~CreateEMEventDilepton() {} int mRunNumber; float d_bz; @@ -102,22 +94,6 @@ struct CreateEMEventDilepton { return; } - if (enable_swt) { - LOGF(info, "enable software triggers : %s", cfg_swt_names.value.data()); - mTOIidx = zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), cfg_swt_names.value); - std::stringstream tokenizer(cfg_swt_names.value); - std::string token; - while (std::getline(tokenizer, token, ',')) { - swt_names.emplace_back(token); - } - for (auto& idx : mTOIidx) { - LOGF(info, "Trigger of Interest : index = %d", idx); - } - mNinspectedTVX = zorro.getInspectedTVX()->GetBinContent(1); - LOGF(info, "total inspected TVX events = %d in run number %d", mNinspectedTVX, bc.runNumber()); - registry.fill(HIST("hNInspectedTVX"), bc.runNumber(), mNinspectedTVX); - } - // In case override, don't proceed, please - no CCDB access required if (d_bz_input > -990) { d_bz = d_bz_input; @@ -154,7 +130,7 @@ struct CreateEMEventDilepton { PresliceUnsorted perCollision_el = aod::emprimaryelectron::collisionId; PresliceUnsorted perCollision_mu = aod::emprimarymuon::collisionId; - template + template void skimEvent(TCollisions const& collisions, TBCs const&) { for (auto& collision : collisions) { @@ -171,21 +147,11 @@ struct CreateEMEventDilepton { continue; } - if (enable_swt) { - if (zorro.isSelected(bc.globalBC())) { // triggered event - auto swt_bitset = zorro.getLastResult(); // this has to be called after zorro::isSelected, or simply call zorro.fetch - // LOGF(info, "swt_bitset.to_string().c_str() = %s", swt_bitset.to_string().c_str()); - uint16_t trigger_bitmap = 0; - for (size_t idx = 0; idx < mTOIidx.size(); idx++) { - if (swt_bitset.test(mTOIidx[idx])) { - auto swtname = swt_names[idx]; - trigger_bitmap |= BIT(o2::aod::pwgem::dilepton::swt::aliasLabels.at(swtname)); - // LOGF(info, "swtname = %s is fired. swt index in original swt table = %d, swt index for EM table = %d", swtname.data(), mTOIidx[idx], o2::aod::pwgem::dilepton::swt::aliasLabels.at(swtname)); - } - } - emswtbit(trigger_bitmap, mNinspectedTVX); - } else { // rejected + if constexpr (isTriggerAnalysis) { + if (collision.swtaliastmp_raw() == 0) { continue; + } else { + emswtbit(collision.swtaliastmp_raw(), collision.nInspectedTVX()); } } @@ -235,41 +201,65 @@ struct CreateEMEventDilepton { 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f); } } // end of collision loop - } // end of skimEvent + } // end of skimEvent + + //---------- for data ---------- void processEvent(MyCollisions const& collisions, MyBCs const& bcs) { - skimEvent(collisions, bcs); + skimEvent(collisions, bcs); } PROCESS_SWITCH(CreateEMEventDilepton, processEvent, "process event info", false); void processEvent_Cent(MyCollisions_Cent const& collisions, MyBCs const& bcs) { - skimEvent(collisions, bcs); + skimEvent(collisions, bcs); } PROCESS_SWITCH(CreateEMEventDilepton, processEvent_Cent, "process event info", false); void processEvent_Cent_Qvec(MyCollisions_Cent_Qvec const& collisions, MyBCs const& bcs) { - skimEvent(collisions, bcs); + skimEvent(collisions, bcs); } PROCESS_SWITCH(CreateEMEventDilepton, processEvent_Cent_Qvec, "process event info", false); + //---------- for data with swt---------- + + void processEvent_SWT(MyCollisionsWithSWT const& collisions, MyBCs const& bcs) + { + skimEvent(collisions, bcs); + } + PROCESS_SWITCH(CreateEMEventDilepton, processEvent_SWT, "process event info", false); + + void processEvent_SWT_Cent(MyCollisionsWithSWT_Cent const& collisions, MyBCs const& bcs) + { + skimEvent(collisions, bcs); + } + PROCESS_SWITCH(CreateEMEventDilepton, processEvent_SWT_Cent, "process event info", false); + + void processEvent_SWT_Cent_Qvec(MyCollisionsWithSWT_Cent_Qvec const& collisions, MyBCs const& bcs) + { + skimEvent(collisions, bcs); + } + PROCESS_SWITCH(CreateEMEventDilepton, processEvent_SWT_Cent_Qvec, "process event info", false); + + //---------- for MC ---------- + void processEventMC(MyCollisionsMC const& collisions, MyBCs const& bcs) { - skimEvent(collisions, bcs); + skimEvent(collisions, bcs); } PROCESS_SWITCH(CreateEMEventDilepton, processEventMC, "process event info", false); void processEventMC_Cent(MyCollisionsMC_Cent const& collisions, MyBCs const& bcs) { - skimEvent(collisions, bcs); + skimEvent(collisions, bcs); } PROCESS_SWITCH(CreateEMEventDilepton, processEventMC_Cent, "process event info", false); void processEventMC_Cent_Qvec(MyCollisionsMC_Cent_Qvec const& collisions, MyBCs const& bcs) { - skimEvent(collisions, bcs); + skimEvent(collisions, bcs); } PROCESS_SWITCH(CreateEMEventDilepton, processEventMC_Cent_Qvec, "process event info", false); @@ -297,7 +287,7 @@ struct AssociateDileptonToEMEvent { for (int il = 0; il < nl; il++) { eventIds(collision.globalIndex()); } // end of photon loop - } // end of collision loop + } // end of collision loop } // This struct is for both data and MC. @@ -329,12 +319,9 @@ struct EMEventPropertyTask { SliceCache cache; Preslice perCollision = aod::track::collisionId; using Run3Tracks = soa::Join; - Zorro zorro; Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable applyEveSel_at_skimming{"applyEveSel_at_skimming", false, "flag to apply minimal event selection at the skimming level"}; - Configurable enable_swt{"enable_swt", false, "flag to process skimmed data (swt triggered)"}; - Configurable cfg_swt_names{"cfg_swt_names", "", "comma-separated software trigger names"}; Configurable fillQAHistogram{"fillQAHistogram", false, "flag to fill QA histograms"}; Produces evprop; @@ -355,8 +342,6 @@ struct EMEventPropertyTask { void init(InitContext& initContext) { getTaskOptionValue(initContext, "create-emevent-dilepton", "applyEveSel_at_skimming", applyEveSel_at_skimming.value, true); // for EM users. - getTaskOptionValue(initContext, "create-emevent-dilepton", "enable_swt", enable_swt.value, true); // for EM users. - getTaskOptionValue(initContext, "create-emevent-dilepton", "cfg_swt_names", cfg_swt_names.value, true); // for EM users. if (fillQAHistogram) { fRegistry.add("Spherocity/hPt", "pT;p_{T} (GeV/c)", kTH1F, {{200, 0.0f, 10}}, false); @@ -367,17 +352,6 @@ struct EMEventPropertyTask { } Service ccdb; - int mRunNumber = 0; - void initCCDB(aod::BCsWithTimestamps::iterator const& bc) - { - if (mRunNumber == bc.runNumber()) { - return; - } - if (enable_swt) { - zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), cfg_swt_names.value); - } - mRunNumber = bc.runNumber(); - } template int getSpherocity(TTracks const& tracks, float& spherocity_ptweighted, float& spherocity_ptunweighted) @@ -441,21 +415,10 @@ struct EMEventPropertyTask { Partition tracks_for_spherocity = spherocity_cuts.min_pt < aod::track::pt && spherocity_cuts.min_eta < o2::aod::track::eta && o2::aod::track::eta < spherocity_cuts.max_eta && nabs(o2::aod::track::dcaXY) < spherocity_cuts.max_dcaxy && nabs(o2::aod::track::dcaZ) < spherocity_cuts.max_dcaz && ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::ITS) == true && ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::TPC) == true && o2::aod::track::tpcChi2NCl < spherocity_cuts.max_chi2tpc; // ITS-TPC matched tracks - void processProp(soa::Join const& collisions, Run3Tracks const&, aod::BCsWithTimestamps const&) + void processProp(aod::EMEvents const& collisions, Run3Tracks const&) { for (auto& collision : collisions) { - - auto bc = collision.template foundBC_as(); - initCCDB(bc); - - if (applyEveSel_at_skimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { - continue; - } - if (enable_swt && !zorro.isSelected(bc.globalBC())) { - continue; - } - - auto tracks_for_spherocity_per_collision = tracks_for_spherocity->sliceByCached(o2::aod::track::collisionId, collision.globalIndex(), cache); + auto tracks_for_spherocity_per_collision = tracks_for_spherocity->sliceByCached(o2::aod::track::collisionId, collision.collisionId(), cache); float spherocity_ptweighted = -1.f, spherocity_ptunweighted = -1.f; int ntrack = getSpherocity(tracks_for_spherocity_per_collision, spherocity_ptweighted, spherocity_ptunweighted); if (fillQAHistogram) { @@ -467,18 +430,9 @@ struct EMEventPropertyTask { } PROCESS_SWITCH(EMEventPropertyTask, processProp, "process event property", true); - void processDummy(soa::Join const& collisions, aod::BCsWithTimestamps const&) + void processDummy(aod::EMEvents const& collisions) { - for (auto& collision : collisions) { - auto bc = collision.template foundBC_as(); - initCCDB(bc); - - if (applyEveSel_at_skimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { - continue; - } - if (enable_swt && !zorro.isSelected(bc.globalBC())) { - continue; - } + for (int i = 0; i < collisions.size(); i++) { evprop(-1.f, -1.f, 0); } // end of collision loop } diff --git a/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx b/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx index ea15648f708..ccaae1051e4 100644 --- a/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx +++ b/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx @@ -26,7 +26,6 @@ #include "CommonConstants/PhysicsConstants.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/Core/TableHelper.h" -#include "EventFiltering/Zorro.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" @@ -49,6 +48,9 @@ using MyTracksMC = soa::Join; using MyTrackMC = MyTracksMC::iterator; struct filterDielectronEvent { + using MyCollisions = soa::Join; + using MyCollisionsWithSWT = soa::Join; + SliceCache cache; Preslice perCol = o2::aod::track::collisionId; Produces emprimaryelectrons; @@ -62,8 +64,6 @@ struct filterDielectronEvent { Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; // for software triggers - Configurable enable_swt{"enable_swt", false, "flag to process skimmed data (swt triggered)"}; - Configurable cfg_swt_names{"cfg_swt_names", "", "comma-separated software trigger names"}; Configurable applyEveSel_at_skimming{"applyEveSel_at_skimming", false, "flag to apply minimal event selection at the skimming level"}; // Operation and minimisation criteria @@ -95,7 +95,6 @@ struct filterDielectronEvent { std::pair> itsRequirement = {1, {0, 1, 2}}; // any hits on 3 ITS ib layers. - Zorro zorro; int mRunNumber; float d_bz; Service ccdb; @@ -114,6 +113,7 @@ struct filterDielectronEvent { if (fillQAHistogram) { fRegistry.add("Track/hPt", "pT;p_{T} (GeV/c)", kTH1F, {{1000, 0.0f, 10}}, false); fRegistry.add("Track/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{400, -20, 20}}, false); + fRegistry.add("Track/hRelSigma1Pt", "relative p_{T} resolution;p_{T} (GeV/c);#sigma_{1/p_{T}} #times p_{T}", kTH2F, {{1000, 0, 10}, {100, 0, 0.1}}, false); fRegistry.add("Track/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{180, 0, 2 * M_PI}, {20, -1.0f, 1.0f}}, false); fRegistry.add("Track/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -1.0f, 1.0f}, {200, -1.0f, 1.0f}}, false); fRegistry.add("Track/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); @@ -153,10 +153,6 @@ struct filterDielectronEvent { return; } - if (enable_swt) { - zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), cfg_swt_names.value); - } - // In case override, don't proceed, please - no CCDB access required if (d_bz_input > -990) { d_bz = d_bz_input; @@ -348,6 +344,7 @@ struct filterDielectronEvent { fRegistry.fill(HIST("Track/hPt"), pt_recalc); fRegistry.fill(HIST("Track/hQoverPt"), track.sign() / pt_recalc); + fRegistry.fill(HIST("Track/hRelSigma1Pt"), pt_recalc, std::sqrt(track_par_cov_recalc.getSigma1Pt2()) * pt_recalc); fRegistry.fill(HIST("Track/hEtaPhi"), phi_recalc, eta_recalc); fRegistry.fill(HIST("Track/hDCAxyz"), dcaXY, dcaZ); fRegistry.fill(HIST("Track/hDCAxyzSigma"), dcaXY / sqrt(track_par_cov_recalc.getSigmaY2()), dcaZ / sqrt(track_par_cov_recalc.getSigmaZ2())); @@ -405,7 +402,158 @@ struct filterDielectronEvent { // ---------- for data ---------- - void processRec_SA(Join const& collisions, aod::BCsWithTimestamps const&, MyFilteredTracks const&) + void processRec_SA(MyCollisions const& collisions, aod::BCsWithTimestamps const&, MyFilteredTracks const&) + { + stored_trackIds.reserve(posTracks.size() + negTracks.size()); + + for (auto& collision : collisions) { + auto bc = collision.template foundBC_as(); + initCCDB(bc); + + if (applyEveSel_at_skimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { + filter(0, 0, 0); + continue; + } + + int nee_uls = 0; + auto posTracks_per_coll = posTracks->sliceByCached(o2::aod::track::collisionId, collision.globalIndex(), cache); + auto negTracks_per_coll = negTracks->sliceByCached(o2::aod::track::collisionId, collision.globalIndex(), cache); + + for (auto& [pos, ele] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { + if (!checkTrack(collision, pos) || !checkTrack(collision, ele)) { + continue; + } + if (!isElectron(pos) || !isElectron(ele)) { + continue; + } + + ROOT::Math::PtEtaPhiMVector v1(pos.pt(), pos.eta(), pos.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v2(ele.pt(), ele.eta(), ele.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; + float phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(pos.px(), pos.py(), pos.pz(), ele.px(), ele.py(), ele.pz(), pos.sign(), ele.sign(), d_bz); + + if (fillQAHistogram) { + fRegistry.fill(HIST("Pair/before/hMvsPt"), v12.M(), v12.Pt()); + fRegistry.fill(HIST("Pair/before/hMvsPhiV"), phiv, v12.M()); + } + if (apply_phiv ? (v12.M() < maxMee && slope * phiv + intercept < v12.M()) : (v12.M() < maxMee)) { + fillTrackTable(collision, pos); + fillTrackTable(collision, ele); + if (fillQAHistogram) { + fRegistry.fill(HIST("Pair/after/hMvsPt"), v12.M(), v12.Pt()); + fRegistry.fill(HIST("Pair/after/hMvsPhiV"), phiv, v12.M()); + } + nee_uls++; + } + + } // end of pairing loop + + if (nee_uls < 1) { + filter(nee_uls, 0, 0); + continue; + } + filter(nee_uls, 0, 0); + + } // end of collision loop + + stored_trackIds.clear(); + stored_trackIds.shrink_to_fit(); + stored_pairIds.clear(); + stored_pairIds.shrink_to_fit(); + } + PROCESS_SWITCH(filterDielectronEvent, processRec_SA, "process reconstructed info only", true); // standalone + + Preslice trackIndicesPerCollision = aod::track_association::collisionId; + void processRec_TTCA(MyCollisions const& collisions, aod::BCsWithTimestamps const&, MyTracks const& tracks, aod::TrackAssoc const& trackIndices) + { + stored_trackIds.reserve(tracks.size() * 2); + + for (auto& collision : collisions) { + auto bc = collision.template foundBC_as(); + initCCDB(bc); + + if (applyEveSel_at_skimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { + filter(0, 0, 0); + continue; + } + + int nee_uls = 0; + auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, collision.globalIndex()); + std::vector posTracks_per_coll; + std::vector negTracks_per_coll; + posTracks_per_coll.reserve(trackIdsThisCollision.size()); + negTracks_per_coll.reserve(trackIdsThisCollision.size()); + + for (auto& trackId : trackIdsThisCollision) { + auto track = trackId.template track_as(); + if (!checkTrack(collision, track) || !isElectron(track)) { + continue; + } + + if (track.sign() > 0) { + posTracks_per_coll.emplace_back(track); + } else { + negTracks_per_coll.emplace_back(track); + } + } // end of track loop + + for (auto& pos : posTracks_per_coll) { + for (auto& ele : negTracks_per_coll) { + + auto pos_prop = propagateTrack(collision, pos); + auto ele_prop = propagateTrack(collision, ele); + + std::array pVec_pos = {0, 0, 0}; // px, py, pz + getPxPyPz(pos_prop, pVec_pos); + std::array pVec_ele = {0, 0, 0}; // px, py, pz + getPxPyPz(ele_prop, pVec_ele); + + ROOT::Math::PtEtaPhiMVector v1(pos_prop.getPt(), pos_prop.getEta(), pos_prop.getPhi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v2(ele_prop.getPt(), ele_prop.getEta(), ele_prop.getPhi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; + float phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(pVec_pos[0], pVec_pos[1], pVec_pos[2], pVec_ele[0], pVec_ele[1], pVec_ele[2], pos.sign(), ele.sign(), d_bz); + + if (fillQAHistogram) { + fRegistry.fill(HIST("Pair/before/hMvsPt"), v12.M(), v12.Pt()); + fRegistry.fill(HIST("Pair/before/hMvsPhiV"), phiv, v12.M()); + } + if (apply_phiv ? (v12.M() < maxMee && slope * phiv + intercept < v12.M()) : (v12.M() < maxMee)) { + fillTrackTable(collision, pos); + fillTrackTable(collision, ele); + if (fillQAHistogram) { + fRegistry.fill(HIST("Pair/after/hMvsPt"), v12.M(), v12.Pt()); + fRegistry.fill(HIST("Pair/after/hMvsPhiV"), phiv, v12.M()); + } + nee_uls++; + } + + } // end of negative track loop + } // end of postive track loop + + if (nee_uls < 1) { + filter(nee_uls, 0, 0); + continue; + } + + filter(nee_uls, 0, 0); + + posTracks_per_coll.clear(); + negTracks_per_coll.clear(); + posTracks_per_coll.shrink_to_fit(); + negTracks_per_coll.shrink_to_fit(); + + } // end of collision loop + + stored_trackIds.clear(); + stored_trackIds.shrink_to_fit(); + stored_pairIds.clear(); + stored_pairIds.shrink_to_fit(); + } + PROCESS_SWITCH(filterDielectronEvent, processRec_TTCA, "process reconstructed info only", false); // with TTCA + + // ---------- for data ---------- + + void processRec_SA_SWT(MyCollisionsWithSWT const& collisions, aod::BCsWithTimestamps const&, MyFilteredTracks const&) { stored_trackIds.reserve(posTracks.size() + negTracks.size()); @@ -417,7 +565,7 @@ struct filterDielectronEvent { filter(0, 0, 0); continue; } - if (enable_swt && !zorro.isSelected(bc.globalBC())) { + if (collision.swtaliastmp_raw() == 0) { filter(0, 0, 0); continue; } @@ -468,10 +616,9 @@ struct filterDielectronEvent { stored_pairIds.clear(); stored_pairIds.shrink_to_fit(); } - PROCESS_SWITCH(filterDielectronEvent, processRec_SA, "process reconstructed info only", true); // standalone + PROCESS_SWITCH(filterDielectronEvent, processRec_SA_SWT, "process reconstructed info only", false); // standalone - Preslice trackIndicesPerCollision = aod::track_association::collisionId; - void processRec_TTCA(Join const& collisions, aod::BCsWithTimestamps const&, MyTracks const& tracks, aod::TrackAssoc const& trackIndices) + void processRec_TTCA_SWT(MyCollisionsWithSWT const& collisions, aod::BCsWithTimestamps const&, MyTracks const& tracks, aod::TrackAssoc const& trackIndices) { stored_trackIds.reserve(tracks.size() * 2); @@ -483,7 +630,7 @@ struct filterDielectronEvent { filter(0, 0, 0); continue; } - if (enable_swt && !zorro.isSelected(bc.globalBC())) { + if (collision.swtaliastmp_raw() == 0) { filter(0, 0, 0); continue; } @@ -539,7 +686,7 @@ struct filterDielectronEvent { } } // end of negative track loop - } // end of postive track loop + } // end of postive track loop if (nee_uls < 1) { filter(nee_uls, 0, 0); @@ -560,14 +707,14 @@ struct filterDielectronEvent { stored_pairIds.clear(); stored_pairIds.shrink_to_fit(); } - PROCESS_SWITCH(filterDielectronEvent, processRec_TTCA, "process reconstructed info only", false); // with TTCA + PROCESS_SWITCH(filterDielectronEvent, processRec_TTCA_SWT, "process reconstructed info only", false); // with TTCA // ---------- for MC ---------- using MyFilteredTracksMC = soa::Filtered; Partition posTracksMC = o2::aod::track::signed1Pt > 0.f; Partition negTracksMC = o2::aod::track::signed1Pt < 0.f; - void processMC_SA(soa::Join const& collisions, aod::McCollisions const&, aod::BCsWithTimestamps const&, MyFilteredTracksMC const& tracks) + void processMC_SA(soa::Join const& collisions, aod::McCollisions const&, aod::BCsWithTimestamps const&, MyFilteredTracksMC const& tracks) { stored_trackIds.reserve(tracks.size()); @@ -582,10 +729,6 @@ struct filterDielectronEvent { filter(0, 0, 0); continue; } - if (enable_swt && !zorro.isSelected(bc.globalBC())) { - filter(0, 0, 0); - continue; - } int nee_uls = 0; auto posTracks_per_coll = posTracksMC->sliceByCached(o2::aod::track::collisionId, collision.globalIndex(), cache); @@ -633,7 +776,7 @@ struct filterDielectronEvent { } PROCESS_SWITCH(filterDielectronEvent, processMC_SA, "process reconstructed and MC info ", false); - void processMC_TTCA(soa::Join const& collisions, aod::McCollisions const&, aod::BCsWithTimestamps const&, MyTracksMC const& tracks, aod::TrackAssoc const& trackIndices) + void processMC_TTCA(soa::Join const& collisions, aod::McCollisions const&, aod::BCsWithTimestamps const&, MyTracksMC const& tracks, aod::TrackAssoc const& trackIndices) { stored_trackIds.reserve(tracks.size() * 2); @@ -648,10 +791,6 @@ struct filterDielectronEvent { filter(0, 0, 0); continue; } - if (enable_swt && !zorro.isSelected(bc.globalBC())) { - filter(0, 0, 0); - continue; - } int nee_uls = 0; auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, collision.globalIndex()); @@ -701,7 +840,7 @@ struct filterDielectronEvent { } } // end of negative track loop - } // end of postive track loop + } // end of postive track loop if (nee_uls < 1) { filter(nee_uls, 0, 0); @@ -764,6 +903,10 @@ struct createEMEvent2VP { using MyCollisions_Cent = soa::Join; // centrality table has dependency on multiplicity table. using MyCollisions_Cent_Qvec = soa::Join; + using MyCollisionsWithSWT = soa::Join; + using MyCollisionsWithSWT_Cent = soa::Join; // centrality table has dependency on multiplicity table. + using MyCollisionsWithSWT_Cent_Qvec = soa::Join; + using MyCollisionsMC = soa::Join; using MyCollisionsMC_Cent = soa::Join; // centrality table has dependency on multiplicity table. using MyCollisionsMC_Cent_Qvec = soa::Join; @@ -781,20 +924,14 @@ struct createEMEvent2VP { kEvent_Cent_Qvec = 2, }; - // CCDB options - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable inherit_from_filter_dielectron_event{"inherit_from_filter_dielectron_event", true, "flag to inherit task options from filter-dielectron-event"}; Configurable applyEveSel_at_skimming{"applyEveSel_at_skimming", false, "flag to apply minimal event selection at the skimming level"}; - Configurable enable_swt{"enable_swt", false, "flag to process skimmed data (swt triggered)"}; - Configurable cfg_swt_names{"cfg_swt_names", "fHighTrackMult,fHighFt0Mult", "comma-separated software trigger names"}; // !trigger names have to be pre-registered in dileptonTable.h for bit operation! HistogramRegistry registry{"registry"}; void init(o2::framework::InitContext& initContext) { if (inherit_from_filter_dielectron_event) { getTaskOptionValue(initContext, "filter-dielectron-event", "applyEveSel_at_skimming", applyEveSel_at_skimming.value, true); // for EM users. - getTaskOptionValue(initContext, "filter-dielectron-event", "enable_swt", enable_swt.value, true); // for EM users. - getTaskOptionValue(initContext, "filter-dielectron-event", "cfg_swt_names", cfg_swt_names.value, true); // for EM users. } auto hEventCounter = registry.add("hEventCounter", "hEventCounter", kTH1I, {{7, 0.5f, 7.5f}}); @@ -810,40 +947,13 @@ struct createEMEvent2VP { swt_names.shrink_to_fit(); } - Zorro zorro; std::vector mTOIidx; std::vector swt_names; uint64_t mNinspectedTVX{0}; int mRunNumber; - Service ccdb; - - template - void initCCDB(TBC const& bc) - { - if (mRunNumber == bc.runNumber()) { - return; - } - - if (enable_swt) { - LOGF(info, "enable software triggers : %s", cfg_swt_names.value.data()); - mTOIidx = zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), cfg_swt_names.value); - std::stringstream tokenizer(cfg_swt_names.value); - std::string token; - while (std::getline(tokenizer, token, ',')) { - swt_names.emplace_back(token); - } - for (auto& idx : mTOIidx) { - LOGF(info, "Trigger of Interest : index = %d", idx); - } - mNinspectedTVX = zorro.getInspectedTVX()->GetBinContent(1); - LOGF(info, "total inspected TVX events = %d in run number %d", mNinspectedTVX, bc.runNumber()); - registry.fill(HIST("hNInspectedTVX"), bc.runNumber(), mNinspectedTVX); - } - mRunNumber = bc.runNumber(); - } - template + template void skimEvent(TCollisions const& collisions, TBCs const&) { for (auto& collision : collisions) { @@ -853,37 +963,27 @@ struct createEMEvent2VP { } } + if constexpr (isTriggerAnalysis) { + if (collision.swtaliastmp_raw() == 0) { + continue; + } + } + auto bc = collision.template foundBC_as(); - initCCDB(bc); if (applyEveSel_at_skimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { continue; } - if (enable_swt) { - if (zorro.isSelected(bc.globalBC())) { // triggered event - auto swt_bitset = zorro.getLastResult(); // this has to be called after zorro::isSelected, or simply call zorro.fetch - // LOGF(info, "swt_bitset.to_string().c_str() = %s", swt_bitset.to_string().c_str()); - uint16_t trigger_bitmap = 0; - for (size_t idx = 0; idx < mTOIidx.size(); idx++) { - if (swt_bitset.test(mTOIidx[idx])) { - auto swtname = swt_names[idx]; - trigger_bitmap |= BIT(o2::aod::pwgem::dilepton::swt::aliasLabels.at(swtname)); - // LOGF(info, "swtname = %s is fired. swt index in original swt table = %d, swt index for EM table = %d", swtname.data(), mTOIidx[idx], o2::aod::pwgem::dilepton::swt::aliasLabels.at(swtname)); - } - } - emswtbit(trigger_bitmap, mNinspectedTVX); - } else { // rejected - continue; - } - } - if (!(collision.neeuls() >= 1 || collision.neeuls() + collision.ngpcm() >= 2)) { continue; } - // LOGF(info, "collision.neeuls() = %d, collision.ngpcm() = %d", collision.neeuls(), collision.ngpcm()); + if constexpr (isTriggerAnalysis) { + emswtbit(collision.swtaliastmp_raw(), collision.nInspectedTVX()); + } + // LOGF(info, "collision.neeuls() = %d, collision.ngpcm() = %d", collision.neeuls(), collision.ngpcm()); // LOGF(info, "collision.multNTracksPV() = %d, collision.multFT0A() = %f, collision.multFT0C() = %f", collision.multNTracksPV(), collision.multFT0A(), collision.multFT0C()); registry.fill(HIST("hEventCounter"), 1); @@ -930,41 +1030,59 @@ struct createEMEvent2VP { 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f); } } // end of collision loop - } // end of skimEvent + } // end of skimEvent void processEvent(MyCollisions const& collisions, MyBCs const& bcs) { - skimEvent(collisions, bcs); + skimEvent(collisions, bcs); } PROCESS_SWITCH(createEMEvent2VP, processEvent, "process event info", false); void processEvent_Cent(MyCollisions_Cent const& collisions, MyBCs const& bcs) { - skimEvent(collisions, bcs); + skimEvent(collisions, bcs); } PROCESS_SWITCH(createEMEvent2VP, processEvent_Cent, "process event info", false); void processEvent_Cent_Qvec(MyCollisions_Cent_Qvec const& collisions, MyBCs const& bcs) { - skimEvent(collisions, bcs); + skimEvent(collisions, bcs); } PROCESS_SWITCH(createEMEvent2VP, processEvent_Cent_Qvec, "process event info", false); + void processEvent_SWT(MyCollisionsWithSWT const& collisions, MyBCs const& bcs) + { + skimEvent(collisions, bcs); + } + PROCESS_SWITCH(createEMEvent2VP, processEvent_SWT, "process event info", false); + + void processEvent_SWT_Cent(MyCollisionsWithSWT_Cent const& collisions, MyBCs const& bcs) + { + skimEvent(collisions, bcs); + } + PROCESS_SWITCH(createEMEvent2VP, processEvent_SWT_Cent, "process event info", false); + + void processEvent_SWT_Cent_Qvec(MyCollisionsWithSWT_Cent_Qvec const& collisions, MyBCs const& bcs) + { + skimEvent(collisions, bcs); + } + PROCESS_SWITCH(createEMEvent2VP, processEvent_SWT_Cent_Qvec, "process event info", false); + void processEventMC(MyCollisionsMC const& collisions, MyBCs const& bcs) { - skimEvent(collisions, bcs); + skimEvent(collisions, bcs); } PROCESS_SWITCH(createEMEvent2VP, processEventMC, "process event info", false); void processEventMC_Cent(MyCollisionsMC_Cent const& collisions, MyBCs const& bcs) { - skimEvent(collisions, bcs); + skimEvent(collisions, bcs); } PROCESS_SWITCH(createEMEvent2VP, processEventMC_Cent, "process event info", false); void processEventMC_Cent_Qvec(MyCollisionsMC_Cent_Qvec const& collisions, MyBCs const& bcs) { - skimEvent(collisions, bcs); + skimEvent(collisions, bcs); } PROCESS_SWITCH(createEMEvent2VP, processEventMC_Cent_Qvec, "process event info", false); @@ -990,7 +1108,7 @@ struct AssociateDileptonToEMEvent2VP { for (int il = 0; il < nl; il++) { eventIds(collision.globalIndex()); } // end of photon loop - } // end of collision loop + } // end of collision loop } // This struct is for both data and MC. diff --git a/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx b/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx new file mode 100644 index 00000000000..3ea6dc842d8 --- /dev/null +++ b/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx @@ -0,0 +1,128 @@ +// 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. +// +// ======================== +// +// This code produces trigger information. OTS = offline trigger selection. +// Please write to: daiki.sekihata@cern.ch + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" + +#include "CCDB/BasicCCDBManager.h" +#include "EventFiltering/Zorro.h" +#include "Common/Core/TableHelper.h" + +#include "PWGEM/Dilepton/DataModel/dileptonTables.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; + +struct skimmerOTS { + Produces swt_tmp; + + // CCDB options + Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable cfg_swt_names{"cfg_swt_names", "fHighTrackMult,fHighFt0Mult", "comma-separated software trigger names"}; // !trigger names have to be pre-registered in dileptonTable.h for bit operation! + + std::vector swt_names; + int mRunNumber; + Service ccdb; + + HistogramRegistry registry{"registry"}; + void init(o2::framework::InitContext&) + { + ccdb->setURL(ccdburl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setFatalWhenNull(false); + + LOGF(info, "enable software triggers : %s", cfg_swt_names.value.data()); + std::stringstream tokenizer(cfg_swt_names.value); + std::string token; + while (std::getline(tokenizer, token, ',')) { + swt_names.emplace_back(token); + } + + const int nbin = swt_names.size(); + auto hEventCounter = registry.add("hEventCounter", "hEventCounter;;Number of Events", kTH1D, {{nbin + 1, 0.5f, nbin + 1 + 0.5f}}); + hEventCounter->GetXaxis()->SetBinLabel(1, "all"); + for (int idx = 0; idx < nbin; idx++) { + hEventCounter->GetXaxis()->SetBinLabel(idx + 2, swt_names[idx].data()); + } + + registry.add("hNInspectedTVX", "N inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true); + } + + ~skimmerOTS() + { + swt_names.clear(); + swt_names.shrink_to_fit(); + } + + Zorro zorro; + std::vector mTOIidx; + uint64_t mNinspectedTVX{0}; + + template + void initCCDB(TBC const& bc) + { + if (mRunNumber == bc.runNumber()) { + return; + } + + mTOIidx = zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), cfg_swt_names.value); + for (auto& idx : mTOIidx) { + LOGF(info, "Trigger of Interest : index = %d", idx); + } + mNinspectedTVX = zorro.getInspectedTVX()->GetBinContent(1); + LOGF(info, "total inspected TVX events = %d in run number %d", mNinspectedTVX, bc.runNumber()); + registry.fill(HIST("hNInspectedTVX"), bc.runNumber(), mNinspectedTVX); + + mRunNumber = bc.runNumber(); + } + + using MyBCs = soa::Join; + using MyCollisions = soa::Join; + + void process(MyCollisions const& collisions, MyBCs const&) + { + for (auto& collision : collisions) { + auto bc = collision.template foundBC_as(); + initCCDB(bc); + + uint16_t trigger_bitmap = 0; + registry.fill(HIST("hEventCounter"), 1); // all + if (zorro.isSelected(bc.globalBC())) { // triggered event + auto swt_bitset = zorro.getLastResult(); // this has to be called after zorro::isSelected, or simply call zorro.fetch + // LOGF(info, "swt_bitset.to_string().c_str() = %s", swt_bitset.to_string().c_str()); + for (size_t idx = 0; idx < mTOIidx.size(); idx++) { + if (swt_bitset.test(mTOIidx[idx])) { + auto swtname = swt_names[idx]; + trigger_bitmap |= BIT(o2::aod::pwgem::dilepton::swt::aliasLabels.at(swtname)); + // LOGF(info, "swtname = %s is fired. swt index in original swt table = %d, swt index for EM table = %d", swtname.data(), mTOIidx[idx], o2::aod::pwgem::dilepton::swt::aliasLabels.at(swtname)); + registry.fill(HIST("hEventCounter"), idx + 2); // fired trigger + } + } + } + // LOGF(info, "trigger_bitmap = %d, mNinspectedTVX = %d", trigger_bitmap, mNinspectedTVX); + swt_tmp(trigger_bitmap, mNinspectedTVX); + } // end of collision loop + } +}; +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"skimmer-ots"})}; +} diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx index 66a6aaf3303..3c677f3a6b5 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx @@ -26,7 +26,6 @@ #include "CommonConstants/PhysicsConstants.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/Core/TableHelper.h" -#include "EventFiltering/Zorro.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" @@ -37,6 +36,9 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::constants::physics; +using MyCollisions = soa::Join; +using MyCollisionsWithSWT = soa::Join; + using MyTracks = soa::Join; @@ -45,12 +47,6 @@ using MyTracksMC = soa::Join; using MyTrackMC = MyTracksMC::iterator; struct skimmerPrimaryElectron { - enum class EM_EEPairType : int { - kULS = 0, - kLSpp = +1, - kLSmm = -1, - }; - SliceCache cache; Preslice perCol = o2::aod::track::collisionId; Produces emprimaryelectrons; @@ -61,13 +57,11 @@ struct skimmerPrimaryElectron { Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable enable_swt{"enable_swt", false, "flag to process skimmed data (swt triggered)"}; - Configurable cfg_swt_names{"cfg_swt_names", "", "comma-separated software trigger names"}; Configurable inherit_from_emevent_dilepton{"inherit_from_emevent_dilepton", false, "flag to inherit task options from emevent-dilepton"}; + Configurable applyEveSel_at_skimming{"applyEveSel_at_skimming", false, "flag to apply minimal event selection at the skimming level"}; // Operation and minimisation criteria Configurable fillQAHistogram{"fillQAHistogram", false, "flag to fill QA histograms"}; - Configurable applyEveSel_at_skimming{"applyEveSel_at_skimming", false, "flag to apply minimal event selection at the skimming level"}; Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; Configurable min_ncluster_tpc{"min_ncluster_tpc", 10, "min ncluster tpc"}; Configurable mincrossedrows{"mincrossedrows", 70, "min. crossed rows"}; @@ -98,7 +92,6 @@ struct skimmerPrimaryElectron { std::pair> itsRequirement = {1, {0, 1, 2}}; // any hits on 3 ITS ib layers. - Zorro zorro; int mRunNumber; float d_bz; Service ccdb; @@ -116,8 +109,6 @@ struct skimmerPrimaryElectron { if (inherit_from_emevent_dilepton) { getTaskOptionValue(initContext, "create-emevent-dilepton", "applyEveSel_at_skimming", applyEveSel_at_skimming.value, true); // for EM users. - getTaskOptionValue(initContext, "create-emevent-dilepton", "enable_swt", enable_swt.value, true); // for EM users. - getTaskOptionValue(initContext, "create-emevent-dilepton", "cfg_swt_names", cfg_swt_names.value, true); // for EM users. } if (fillQAHistogram) { @@ -158,10 +149,6 @@ struct skimmerPrimaryElectron { return; } - if (enable_swt) { - zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), cfg_swt_names.value); - } - // In case override, don't proceed, please - no CCDB access required if (d_bz_input > -990) { d_bz = d_bz_input; @@ -420,6 +407,7 @@ struct skimmerPrimaryElectron { } } + Preslice trackIndicesPerCollision = aod::track_association::collisionId; std::vector> stored_trackIds; Filter trackFilter = o2::aod::track::pt > minpt&& nabs(o2::aod::track::eta) < maxeta&& o2::aod::track::tpcChi2NCl < maxchi2tpc&& o2::aod::track::itsChi2NCl < maxchi2its&& ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::ITS) == true && ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::TPC) == true; Filter pidFilter = minTPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < maxTPCNsigmaEl && ((minTOFbeta < o2::aod::pidtofbeta::beta && o2::aod::pidtofbeta::beta < maxTOFbeta) || o2::aod::pidtofbeta::beta < 0.f) && (o2::aod::pidtpc::tpcNSigmaPi < minTPCNsigmaPi || maxTPCNsigmaPi < o2::aod::pidtpc::tpcNSigmaPi); @@ -430,7 +418,7 @@ struct skimmerPrimaryElectron { // ---------- for data ---------- - void processRec_SA(Join const& collisions, aod::BCsWithTimestamps const&, MyFilteredTracks const& tracks) + void processRec_SA(MyCollisions const& collisions, aod::BCsWithTimestamps const&, MyFilteredTracks const& tracks) { stored_trackIds.reserve(tracks.size()); @@ -441,7 +429,63 @@ struct skimmerPrimaryElectron { if (applyEveSel_at_skimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { continue; } - if (enable_swt && !zorro.isSelected(bc.globalBC())) { + + auto tracks_per_coll = tracks.sliceBy(perCol, collision.globalIndex()); + for (auto& track : tracks_per_coll) { + if (!checkTrack(collision, track) || !isElectron(track)) { + continue; + } + fillTrackTable(collision, track); + } + + } // end of collision loop + + stored_trackIds.clear(); + stored_trackIds.shrink_to_fit(); + } + PROCESS_SWITCH(skimmerPrimaryElectron, processRec_SA, "process reconstructed info only", true); // standalone + + void processRec_TTCA(MyCollisions const& collisions, aod::BCsWithTimestamps const&, MyTracks const& tracks, aod::TrackAssoc const& trackIndices) + { + stored_trackIds.reserve(tracks.size() * 2); + + for (auto& collision : collisions) { + auto bc = collision.template foundBC_as(); + initCCDB(bc); + + if (applyEveSel_at_skimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { + continue; + } + + auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, collision.globalIndex()); + + for (auto& trackId : trackIdsThisCollision) { + auto track = trackId.template track_as(); + if (!checkTrack(collision, track) || !isElectron(track)) { + continue; + } + fillTrackTable(collision, track); + } + } // end of collision loop + + stored_trackIds.clear(); + stored_trackIds.shrink_to_fit(); + } + PROCESS_SWITCH(skimmerPrimaryElectron, processRec_TTCA, "process reconstructed info only", false); // with TTCA + + void processRec_SA_SWT(MyCollisionsWithSWT const& collisions, aod::BCsWithTimestamps const&, MyFilteredTracks const& tracks) + { + stored_trackIds.reserve(tracks.size()); + + for (auto& collision : collisions) { + auto bc = collision.template foundBC_as(); + initCCDB(bc); + + if (applyEveSel_at_skimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { + continue; + } + + if (collision.swtaliastmp_raw() == 0) { continue; } @@ -458,10 +502,9 @@ struct skimmerPrimaryElectron { stored_trackIds.clear(); stored_trackIds.shrink_to_fit(); } - PROCESS_SWITCH(skimmerPrimaryElectron, processRec_SA, "process reconstructed info only", true); // standalone + PROCESS_SWITCH(skimmerPrimaryElectron, processRec_SA_SWT, "process reconstructed info only", false); // standalone with swt - Preslice trackIndicesPerCollision = aod::track_association::collisionId; - void processRec_TTCA(Join const& collisions, aod::BCsWithTimestamps const&, MyTracks const& tracks, aod::TrackAssoc const& trackIndices) + void processRec_TTCA_SWT(MyCollisionsWithSWT const& collisions, aod::BCsWithTimestamps const&, MyTracks const& tracks, aod::TrackAssoc const& trackIndices) { stored_trackIds.reserve(tracks.size() * 2); @@ -472,15 +515,11 @@ struct skimmerPrimaryElectron { if (applyEveSel_at_skimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { continue; } - if (enable_swt && !zorro.isSelected(bc.globalBC())) { + if (collision.swtaliastmp_raw() == 0) { continue; } auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, collision.globalIndex()); - // std::vector posTracks_per_coll; - // std::vector negTracks_per_coll; - // posTracks_per_coll.reserve(trackIdsThisCollision.size()); - // negTracks_per_coll.reserve(trackIdsThisCollision.size()); for (auto& trackId : trackIdsThisCollision) { auto track = trackId.template track_as(); @@ -489,23 +528,19 @@ struct skimmerPrimaryElectron { } fillTrackTable(collision, track); } - // posTracks_per_coll.clear(); - // negTracks_per_coll.clear(); - // posTracks_per_coll.shrink_to_fit(); - // negTracks_per_coll.shrink_to_fit(); } // end of collision loop stored_trackIds.clear(); stored_trackIds.shrink_to_fit(); } - PROCESS_SWITCH(skimmerPrimaryElectron, processRec_TTCA, "process reconstructed info only", false); // with TTCA + PROCESS_SWITCH(skimmerPrimaryElectron, processRec_TTCA_SWT, "process reconstructed info only", false); // with TTCA with swt // ---------- for MC ---------- using MyFilteredTracksMC = soa::Filtered; Partition posTracksMC = o2::aod::track::signed1Pt > 0.f; Partition negTracksMC = o2::aod::track::signed1Pt < 0.f; - void processMC_SA(soa::Join const& collisions, aod::McCollisions const&, aod::BCsWithTimestamps const&, MyFilteredTracksMC const& tracks) + void processMC_SA(soa::Join const& collisions, aod::McCollisions const&, aod::BCsWithTimestamps const&, MyFilteredTracksMC const& tracks) { stored_trackIds.reserve(tracks.size()); @@ -534,7 +569,7 @@ struct skimmerPrimaryElectron { } PROCESS_SWITCH(skimmerPrimaryElectron, processMC_SA, "process reconstructed and MC info ", false); - void processMC_TTCA(soa::Join const& collisions, aod::McCollisions const&, aod::BCsWithTimestamps const&, MyFilteredTracksMC const& tracks, aod::TrackAssoc const& trackIndices) + void processMC_TTCA(soa::Join const& collisions, aod::McCollisions const&, aod::BCsWithTimestamps const&, MyFilteredTracksMC const& tracks, aod::TrackAssoc const& trackIndices) { stored_trackIds.reserve(tracks.size() * 2); @@ -550,10 +585,6 @@ struct skimmerPrimaryElectron { } auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, collision.globalIndex()); - // std::vector posTracks_per_coll; - // std::vector negTracks_per_coll; - // posTracks_per_coll.reserve(trackIdsThisCollision.size()); - // negTracks_per_coll.reserve(trackIdsThisCollision.size()); for (auto& trackId : trackIdsThisCollision) { auto track = trackId.template track_as(); @@ -562,10 +593,6 @@ struct skimmerPrimaryElectron { } fillTrackTable(collision, track); } - // posTracks_per_coll.clear(); - // negTracks_per_coll.clear(); - // posTracks_per_coll.shrink_to_fit(); - // negTracks_per_coll.shrink_to_fit(); } // end of collision loop stored_trackIds.clear(); @@ -822,7 +849,7 @@ struct prefilterPrimaryElectron { pfb_map[empos.globalIndex()] |= (uint8_t(1) << static_cast(EM_Electron_PF::kElFromPC)); } } // end of loose electron loop - } // end of signal positon loop + } // end of signal positon loop for (auto& emele : electrons_per_coll) { // auto ele = tracks.rawIteratorAt(emele.trackId()); // use rawIterator, if the table is filtered. @@ -838,7 +865,7 @@ struct prefilterPrimaryElectron { pfb_map[emele.globalIndex()] |= (uint8_t(1) << static_cast(EM_Electron_PF::kElFromPC)); } } // end of loose positon loop - } // end of signal electron loop + } // end of signal electron loop posTracks_per_coll.clear(); negTracks_per_coll.clear(); diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx index 812b046adf7..823c4b1ff5a 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx @@ -22,7 +22,6 @@ #include "CommonConstants/PhysicsConstants.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/Core/TableHelper.h" -#include "EventFiltering/Zorro.h" #include "CCDB/BasicCCDBManager.h" #include "DataFormatsParameters/GRPMagField.h" @@ -43,6 +42,9 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::constants::physics; +using MyCollisions = soa::Join; +using MyCollisionsWithSWT = soa::Join; + using MyTracks = soa::Join; // muon tracks are repeated. i.e. not exclusive. using MyTrack = MyTracks::iterator; @@ -71,7 +73,6 @@ struct skimmerPrimaryMuon { // Configurables Configurable fillQAHistogram{"fillQAHistogram", false, "flag to fill QA histograms"}; - Configurable applyEveSel_at_skimming{"applyEveSel_at_skimming", false, "flag to apply minimal event selection at the skimming level"}; Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; @@ -83,11 +84,9 @@ struct skimmerPrimaryMuon { Configurable maxeta_mft{"maxeta_mft", -2.5, "eta acceptance"}; Configurable minRabs{"minRabs", 17.6, "min. R at absorber end"}; Configurable maxRabs{"maxRabs", 89.5, "max. R at absorber end"}; - Configurable enable_swt{"enable_swt", false, "flag to process skimmed data (swt triggered)"}; - Configurable cfg_swt_names{"cfg_swt_names", "", "comma-separated software trigger names"}; Configurable inherit_from_emevent_dilepton{"inherit_from_emevent_dilepton", false, "flag to inherit task options from emevent-dilepton"}; + Configurable applyEveSel_at_skimming{"applyEveSel_at_skimming", false, "flag to apply minimal event selection at the skimming level"}; - Zorro zorro; o2::ccdb::CcdbApi ccdbApi; Service ccdb; int mRunNumber; @@ -111,8 +110,6 @@ struct skimmerPrimaryMuon { if (inherit_from_emevent_dilepton) { getTaskOptionValue(initContext, "create-emevent-dilepton", "applyEveSel_at_skimming", applyEveSel_at_skimming.value, true); // for EM users. - getTaskOptionValue(initContext, "create-emevent-dilepton", "enable_swt", enable_swt.value, true); // for EM users. - getTaskOptionValue(initContext, "create-emevent-dilepton", "cfg_swt_names", cfg_swt_names.value, true); // for EM users. } } @@ -122,10 +119,6 @@ struct skimmerPrimaryMuon { return; } - if (enable_swt) { - zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), cfg_swt_names.value); - } - mRunNumber = bc.runNumber(); std::map metadata; auto soreor = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, mRunNumber); @@ -417,10 +410,11 @@ struct skimmerPrimaryMuon { // Preslice fwdtrackIndicesPerMFTsa = aod::fwdtrack::matchMFTTrackId; + Preslice fwdtrackIndicesPerCollision = aod::track_association::collisionId; Partition global_muons = o2::aod::fwdtrack::trackType == uint8_t(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack); // MFT-MCH-MID Partition sa_muons = o2::aod::fwdtrack::trackType == uint8_t(o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack); // MCH-MID - void processRec_SA(Join const& collisions, aod::BCsWithTimestamps const&, MyTracks const& tracks, aod::MFTTracks const&) + void processRec_SA(MyCollisions const& collisions, aod::BCsWithTimestamps const&, MyTracks const& tracks, aod::MFTTracks const&) { for (auto& collision : collisions) { auto bc = collision.template foundBC_as(); @@ -429,7 +423,128 @@ struct skimmerPrimaryMuon { if (applyEveSel_at_skimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { continue; } - if (enable_swt && !zorro.isSelected(bc.globalBC())) { + + auto sa_muons_per_coll = sa_muons->sliceByCached(o2::aod::fwdtrack::collisionId, collision.globalIndex(), cache); + auto global_muons_per_coll = global_muons->sliceByCached(o2::aod::fwdtrack::collisionId, collision.globalIndex(), cache); + + int counter = 0; + int offset = emprimarymuons.lastIndex() + 1; + + for (auto& track : sa_muons_per_coll) { + if (fillQAHistogram) { + fillTrackHistogram<3>(track, collision); + } + if (isSelected(track, collision)) { + map_new_sa_muon_index[std::make_pair(collision.globalIndex(), track.globalIndex())] = counter + offset; + counter++; + } + } // end of standalone muon loop + for (auto& track : global_muons_per_coll) { + if (fillQAHistogram) { + fillTrackHistogram<0>(track, collision); + } + + if (map_new_sa_muon_index.find(std::make_pair(collision.globalIndex(), track.matchMCHTrackId())) == map_new_sa_muon_index.end()) { // don't apply muon selection to MCH-MID track in MFT-MCH-MID track + map_new_sa_muon_index[std::make_pair(collision.globalIndex(), track.matchMCHTrackId())] = counter + offset; + counter++; + } + if (isSelected(track, collision)) { + map_new_sa_muon_index[std::make_pair(collision.globalIndex(), track.globalIndex())] = counter + offset; + counter++; + } + } // end of global muon loop + + // fill table after mapping + for (const auto& [key, value] : map_new_sa_muon_index) { + // int collisionId = std::get<0>(key); + // int fwdtrackId = std::get<1>(key); + // int new_fwdtrackId = value; + // LOGF(info, "collisionId = %d, fwdtrackId = %d, new_fwdtrackId = %d", collisionId, fwdtrackId, new_fwdtrackId); + auto track = tracks.iteratorAt(std::get<1>(key)); + if (track.trackType() == static_cast(o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack)) { + fillMuonTable(track, collision, value); + } else if (track.trackType() == static_cast(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack)) { + fillMuonTable(track, collision, map_new_sa_muon_index[std::make_pair(collision.globalIndex(), track.matchMCHTrackId())]); + } + } + + map_new_sa_muon_index.clear(); + } // end of collision loop + } + PROCESS_SWITCH(skimmerPrimaryMuon, processRec_SA, "process reconstructed info only with standalone", true); + + void processRec_TTCA(MyCollisions const& collisions, aod::BCsWithTimestamps const&, MyTracks const& tracks, aod::MFTTracks const&, aod::FwdTrackAssoc const& fwdtrackIndices) + { + for (auto& collision : collisions) { + auto bc = collision.template foundBC_as(); + initCCDB(bc); + fRegistry.fill(HIST("Event/hCollisionCounter"), 0.f); + if (applyEveSel_at_skimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { + continue; + } + + int counter = 0; + int offset = emprimarymuons.lastIndex() + 1; + + auto fwdtrackIdsThisCollision = fwdtrackIndices.sliceBy(fwdtrackIndicesPerCollision, collision.globalIndex()); + for (auto& fwdtrackId : fwdtrackIdsThisCollision) { + auto track = fwdtrackId.template fwdtrack_as(); + // LOGF(info, "TTCA | collision.globalIndex() = %d, track.globalIndex() = %d, track.trackType() = %d, track.matchMFTTrackId() = %d, track.matchMCHTrackId() = %d, track.offsets() = %d", collision.globalIndex(), track.globalIndex(), track.trackType(), track.matchMFTTrackId(), track.matchMCHTrackId(), track.offsets()); + + // auto collision_in_track = track.collision_as(); + // auto bc_in_track = collision_in_track.bc_as(); + // LOGF(info, "track.globalIndex() = %d , bc_in_track.globalBC() = %lld", track.globalIndex(), bc_in_track.globalBC()); + + if (track.trackType() == static_cast(o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack)) { + if (fillQAHistogram) { + fillTrackHistogram<3>(track, collision); + } + if (isSelected(track, collision)) { + map_new_sa_muon_index[std::make_pair(collision.globalIndex(), track.globalIndex())] = counter + offset; + counter++; + } + } else if (track.trackType() == static_cast(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack)) { + if (fillQAHistogram) { + fillTrackHistogram<0>(track, collision); + } + if (map_new_sa_muon_index.find(std::make_pair(collision.globalIndex(), track.matchMCHTrackId())) == map_new_sa_muon_index.end()) { + map_new_sa_muon_index[std::make_pair(collision.globalIndex(), track.matchMCHTrackId())] = counter + offset; + counter++; + } + if (isSelected(track, collision)) { + map_new_sa_muon_index[std::make_pair(collision.globalIndex(), track.globalIndex())] = counter + offset; + counter++; + } + } + } // end of track loop + + for (const auto& [key, value] : map_new_sa_muon_index) { + // int collisionId = std::get<0>(key); + // int fwdtrackId = std::get<1>(key); + // int new_fwdtrackId = value; + auto track = tracks.iteratorAt(std::get<1>(key)); + if (track.trackType() == static_cast(o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack)) { + fillMuonTable(track, collision, value); + } else if (track.trackType() == static_cast(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack)) { + fillMuonTable(track, collision, map_new_sa_muon_index[std::make_pair(collision.globalIndex(), track.matchMCHTrackId())]); + } + } + + map_new_sa_muon_index.clear(); + } // end of collision loop + } + PROCESS_SWITCH(skimmerPrimaryMuon, processRec_TTCA, "process reconstructed info only with TTCA", false); + + void processRec_SA_SWT(MyCollisionsWithSWT const& collisions, aod::BCsWithTimestamps const&, MyTracks const& tracks, aod::MFTTracks const&) + { + for (auto& collision : collisions) { + auto bc = collision.template foundBC_as(); + initCCDB(bc); + fRegistry.fill(HIST("Event/hCollisionCounter"), 0.f); + if (applyEveSel_at_skimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { + continue; + } + if (collision.swtaliastmp_raw() == 0) { continue; } @@ -480,10 +595,9 @@ struct skimmerPrimaryMuon { map_new_sa_muon_index.clear(); } // end of collision loop } - PROCESS_SWITCH(skimmerPrimaryMuon, processRec_SA, "process reconstructed info only with standalone", true); + PROCESS_SWITCH(skimmerPrimaryMuon, processRec_SA_SWT, "process reconstructed info only with standalone", false); - Preslice fwdtrackIndicesPerCollision = aod::track_association::collisionId; - void processRec_TTCA(Join const& collisions, aod::BCsWithTimestamps const&, MyTracks const& tracks, aod::MFTTracks const&, aod::FwdTrackAssoc const& fwdtrackIndices) + void processRec_TTCA_SWT(MyCollisionsWithSWT const& collisions, aod::BCsWithTimestamps const&, MyTracks const& tracks, aod::MFTTracks const&, aod::FwdTrackAssoc const& fwdtrackIndices) { for (auto& collision : collisions) { auto bc = collision.template foundBC_as(); @@ -492,7 +606,7 @@ struct skimmerPrimaryMuon { if (applyEveSel_at_skimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { continue; } - if (enable_swt && !zorro.isSelected(bc.globalBC())) { + if (collision.swtaliastmp_raw() == 0) { continue; } @@ -504,7 +618,7 @@ struct skimmerPrimaryMuon { auto track = fwdtrackId.template fwdtrack_as(); // LOGF(info, "TTCA | collision.globalIndex() = %d, track.globalIndex() = %d, track.trackType() = %d, track.matchMFTTrackId() = %d, track.matchMCHTrackId() = %d, track.offsets() = %d", collision.globalIndex(), track.globalIndex(), track.trackType(), track.matchMFTTrackId(), track.matchMCHTrackId(), track.offsets()); - // auto collision_in_track = track.collision_as(); + // auto collision_in_track = track.collision_as(); // auto bc_in_track = collision_in_track.bc_as(); // LOGF(info, "track.globalIndex() = %d , bc_in_track.globalBC() = %lld", track.globalIndex(), bc_in_track.globalBC()); @@ -546,12 +660,12 @@ struct skimmerPrimaryMuon { map_new_sa_muon_index.clear(); } // end of collision loop } - PROCESS_SWITCH(skimmerPrimaryMuon, processRec_TTCA, "process reconstructed info only with TTCA", false); + PROCESS_SWITCH(skimmerPrimaryMuon, processRec_TTCA_SWT, "process reconstructed info only with TTCA", false); Partition global_muons_mc = o2::aod::fwdtrack::trackType == uint8_t(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack); // MFT-MCH-MID Partition sa_muons_mc = o2::aod::fwdtrack::trackType == uint8_t(o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack); // MCH-MID - void processMC_SA(soa::Join const& collisions, aod::BCsWithTimestamps const&, MyTracksMC const& tracks, MFTTracksMC const&) + void processMC_SA(soa::Join const& collisions, aod::BCsWithTimestamps const&, MyTracksMC const& tracks, MFTTracksMC const&) { for (auto& collision : collisions) { if (!collision.has_mcCollision()) { @@ -616,7 +730,7 @@ struct skimmerPrimaryMuon { } PROCESS_SWITCH(skimmerPrimaryMuon, processMC_SA, "process reconstructed and MC info", false); - void processMC_TTCA(soa::Join const& collisions, aod::BCsWithTimestamps const&, MyTracksMC const& tracks, MFTTracksMC const&, aod::FwdTrackAssoc const& fwdtrackIndices) + void processMC_TTCA(soa::Join const& collisions, aod::BCsWithTimestamps const&, MyTracksMC const& tracks, MFTTracksMC const&, aod::FwdTrackAssoc const& fwdtrackIndices) { for (auto& collision : collisions) { if (!collision.has_mcCollision()) { diff --git a/PWGEM/PhotonMeson/TableProducer/CMakeLists.txt b/PWGEM/PhotonMeson/TableProducer/CMakeLists.txt index 4ddadeea3f5..a468376a761 100644 --- a/PWGEM/PhotonMeson/TableProducer/CMakeLists.txt +++ b/PWGEM/PhotonMeson/TableProducer/CMakeLists.txt @@ -21,7 +21,7 @@ o2physics_add_dpl_workflow(skimmer-gamma-conversion-truthonlymc o2physics_add_dpl_workflow(photon-conversion-builder SOURCES photonconversionbuilder.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2::DCAFitter O2Physics::AnalysisCore KFParticle::KFParticle O2Physics::EventFilteringUtils + PUBLIC_LINK_LIBRARIES O2::Framework O2::DCAFitter O2Physics::AnalysisCore KFParticle::KFParticle COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(create-pcm diff --git a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx index 738c3d4df76..f3d3b3c6985 100644 --- a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx +++ b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx @@ -40,7 +40,6 @@ #include "DataFormatsParameters/GRPMagField.h" #include "CCDB/BasicCCDBManager.h" #include "Common/Core/TableHelper.h" -#include "EventFiltering/Zorro.h" #include "Tools/KFparticle/KFUtilities.h" @@ -56,7 +55,8 @@ using namespace o2::constants::physics; using namespace o2::pwgem::photonmeson; using std::array; -using MyCollisions = Join; +using MyCollisions = soa::Join; +using MyCollisionsWithSWT = soa::Join; using MyCollisionsMC = soa::Join; using MyTracksIU = soa::Join; @@ -77,8 +77,6 @@ struct PhotonConversionBuilder { Configurable inherit_from_filter_dielectron_event{"inherit_from_filter_dielectron_event", false, "flag to inherit task options from filter-dielectron-event"}; Configurable inherit_from_emevent_dilepton{"inherit_from_emevent_dilepton", false, "flag to inherit task options from emevent-dilepton"}; Configurable inherit_from_emevent_photon{"inherit_from_emevent_photon", false, "flag to inherit task options from emevent-photon"}; - Configurable enable_swt{"enable_swt", false, "flag to process skimmed data (swt triggered)"}; - Configurable cfg_swt_names{"cfg_swt_names", "", "comma-separated software trigger names"}; // Operation and minimisation criteria Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; @@ -125,7 +123,6 @@ struct PhotonConversionBuilder { Configurable max_dcatopv_z_v0{"max_dcatopv_z_v0", +1e+10, "max. DCAz to PV for V0"}; Configurable reject_v0_on_itsib{"reject_v0_on_itsib", true, "flag to reject v0s on ITSib"}; - Zorro zorro; int mRunNumber; float d_bz; float maxSnp; // max sine phi for propagation @@ -184,12 +181,8 @@ struct PhotonConversionBuilder { if (inherit_from_emevent_dilepton) { getTaskOptionValue(initContext, "create-emevent-dilepton", "applyEveSel_at_skimming", applyEveSel_at_skimming.value, true); // for EM users. - getTaskOptionValue(initContext, "create-emevent-dilepton", "enable_swt", enable_swt.value, true); // for EM users. - getTaskOptionValue(initContext, "create-emevent-dilepton", "cfg_swt_names", cfg_swt_names.value, true); // for EM users. } else if (inherit_from_filter_dielectron_event) { getTaskOptionValue(initContext, "filter-dielectron-event", "applyEveSel_at_skimming", applyEveSel_at_skimming.value, true); // for EM users. - getTaskOptionValue(initContext, "filter-dielectron-event", "enable_swt", enable_swt.value, true); // for EM users. - getTaskOptionValue(initContext, "filter-dielectron-event", "cfg_swt_names", cfg_swt_names.value, true); // for EM users. } if (useMatCorrType == 1) { @@ -215,10 +208,6 @@ struct PhotonConversionBuilder { return; } - if (enable_swt) { - zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), cfg_swt_names.value); - } - // In case override, don't proceed, please - no CCDB access required if (d_bz_input > -990) { d_bz = d_bz_input; @@ -653,7 +642,7 @@ struct PhotonConversionBuilder { fillTrackTable(pos, kfp_pos_DecayVtx, posdcaXY, posdcaZ); // positive leg first fillTrackTable(ele, kfp_ele_DecayVtx, eledcaXY, eledcaZ); // negative leg second - } // end of fill table + } // end of fill table } Preslice perCollision = o2::aod::v0::collisionId; @@ -663,7 +652,7 @@ struct PhotonConversionBuilder { std::vector> stored_fullv0Ids; // (v0.globalIndex(), collision.globalIndex(), pos.globalIndex(), ele.globalIndex()) std::unordered_map nv0_map; // map collisionId -> nv0 - template + template void build(TCollisions const& collisions, TV0s const& v0s, TTracks const&, TBCs const&) { for (auto& collision : collisions) { @@ -673,6 +662,12 @@ struct PhotonConversionBuilder { } } + if constexpr (isTriggerAnalysis) { + if (collision.swtaliastmp_raw() == 0) { + continue; + } + } + nv0_map[collision.globalIndex()] = 0; auto bc = collision.template foundBC_as(); @@ -682,9 +677,6 @@ struct PhotonConversionBuilder { if (applyEveSel_at_skimming && (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { continue; } - if (enable_swt && !zorro.isSelected(bc.globalBC())) { - continue; - } auto v0s_per_coll = v0s.sliceBy(perCollision, collision.globalIndex()); // LOGF(info, "n v0 = %d", v0s_per_coll.size()); @@ -692,7 +684,7 @@ struct PhotonConversionBuilder { // LOGF(info, "collision.globalIndex() = %d, v0.globalIndex() = %d, v0.posTrackId() = %d, v0.negTrackId() = %d", collision.globalIndex(), v0.globalIndex(), v0.posTrackId() , v0.negTrackId()); fillV0Table(v0, false); } // end of v0 loop - } // end of collision loop + } // end of collision loop stored_v0Ids.reserve(pca_map.size()); // number of photon candidates per DF stored_fullv0Ids.reserve(pca_map.size()); // number of photon candidates per DF @@ -792,21 +784,33 @@ struct PhotonConversionBuilder { void processRec(MyCollisions const& collisions, filteredV0s const& v0s, MyTracksIU const& tracks, aod::BCsWithTimestamps const& bcs) { - build(collisions, v0s, tracks, bcs); + build(collisions, v0s, tracks, bcs); } PROCESS_SWITCH(PhotonConversionBuilder, processRec, "process reconstructed info for data", true); + void processRec_SWT(MyCollisionsWithSWT const& collisions, filteredV0s const& v0s, MyTracksIU const& tracks, aod::BCsWithTimestamps const& bcs) + { + build(collisions, v0s, tracks, bcs); + } + PROCESS_SWITCH(PhotonConversionBuilder, processRec_SWT, "process reconstructed info for data", false); + void processMC(MyCollisionsMC const& collisions, filteredV0s const& v0s, MyTracksIUMC const& tracks, aod::BCsWithTimestamps const& bcs) { - build(collisions, v0s, tracks, bcs); + build(collisions, v0s, tracks, bcs); } PROCESS_SWITCH(PhotonConversionBuilder, processMC, "process reconstructed info for MC", false); void processRec_OnlyIfDielectron(soa::Join const& collisions, filteredV0s const& v0s, MyTracksIU const& tracks, aod::BCsWithTimestamps const& bcs) { - build(collisions, v0s, tracks, bcs); + build(collisions, v0s, tracks, bcs); } PROCESS_SWITCH(PhotonConversionBuilder, processRec_OnlyIfDielectron, "process reconstructed info for data", false); + + void processRec_SWT_OnlyIfDielectron(soa::Join const& collisions, filteredV0s const& v0s, MyTracksIU const& tracks, aod::BCsWithTimestamps const& bcs) + { + build(collisions, v0s, tracks, bcs); + } + PROCESS_SWITCH(PhotonConversionBuilder, processRec_SWT_OnlyIfDielectron, "process reconstructed info for data", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 290b20a6567c7006f18b794868c2caa9d9914820 Mon Sep 17 00:00:00 2001 From: skundu692 <86804743+skundu692@users.noreply.github.com> Date: Sat, 31 Aug 2024 16:10:37 +0200 Subject: [PATCH 12/16] PWGLF: Update background estimation (#7525) * Add resolution histogram and fix abs() function * Optimize PID * Improved rotational background * improved background --- PWGLF/Tasks/Resonances/highmasslambda.cxx | 3 --- PWGLF/Tasks/Resonances/highmasslambdasvx.cxx | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/Resonances/highmasslambda.cxx b/PWGLF/Tasks/Resonances/highmasslambda.cxx index c0885d814a2..bcb275a39e4 100644 --- a/PWGLF/Tasks/Resonances/highmasslambda.cxx +++ b/PWGLF/Tasks/Resonances/highmasslambda.cxx @@ -727,9 +727,6 @@ struct highmasslambda { Proton = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massPr); Kshort = ROOT::Math::PxPyPzMVector(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); Lambdac = Proton + Kshort; - if (Lambdac.Pt() > 6.0 || Lambdac.Pt() < 2.0) { - continue; - } auto phiminuspsi = GetPhiInRange(Lambdac.Phi() - psiFT0C); if (useSP) { diff --git a/PWGLF/Tasks/Resonances/highmasslambdasvx.cxx b/PWGLF/Tasks/Resonances/highmasslambdasvx.cxx index 5bc0cc483dc..d6405483d13 100644 --- a/PWGLF/Tasks/Resonances/highmasslambdasvx.cxx +++ b/PWGLF/Tasks/Resonances/highmasslambdasvx.cxx @@ -176,8 +176,8 @@ struct highmasslambdasvx { void init(o2::framework::InitContext&) { std::vector occupancyBinning = {0.0, 500.0, 1000.0, 1500.0, 2000.0, 3000.0, 4000.0, 5000.0, 50000.0}; - std::vector dcaBinning = {0.0, 0.0005, 0.001, 0.0015, 0.002, 0.0025, 0.003, 0.004, 0.005, 0.006, 0.008, 0.01, 0.02, 0.04, 0.05, 0.06, 0.08, 0.1, 0.3, 1.0}; - std::vector ptProtonBinning = {0.2, 0.3, 0.5, 0.6, 0.8, 1.2, 1.4, 1.6, 2.0, 3.0, 4.0, 6.0}; + std::vector dcaBinning = {0.0, 0.0005, 0.001, 0.002, 0.003, 0.004, 0.006, 0.3}; + std::vector ptProtonBinning = {0.0, 0.3, 0.5, 0.8, 1.2, 6.0}; std::vector ptLambdaBinning = {2.0, 3.0, 4.0, 5.0, 6.0}; AxisSpec phiAxis = {500, -6.28, 6.28, "phi"}; From 669cd695ddc7f75d327c9dd14e45670985f278c2 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Mon, 2 Sep 2024 00:37:59 +0200 Subject: [PATCH 13/16] PWGEM/Dilepton: replace abs with fabs (#7527) --- .../TableProducer/filterDielectronEvent.cxx | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx b/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx index ccaae1051e4..af05c043e3d 100644 --- a/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx +++ b/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx @@ -73,7 +73,8 @@ struct filterDielectronEvent { Configurable mincrossedrows{"mincrossedrows", 70, "min. crossed rows"}; Configurable min_tpc_cr_findable_ratio{"min_tpc_cr_findable_ratio", 0.8, "min. TPC Ncr/Nf ratio"}; Configurable max_mean_its_cluster_size{"max_mean_its_cluster_size", 16.f, "max. x cos(lambda)"}; - Configurable max_p_for_its_cluster_size{"max_p_for_its_cluster_size", 0.2, "its cluster size cut is applied below this track momentum"}; + Configurable max_p_for_its_cluster_size{"max_p_for_its_cluster_size", 0.2, "its cluster size cut is applied below this p"}; + Configurable max_pin_for_pion_rejection{"max_pin_for_pion_rejection", -1, "pion rejection is applied below this pin"}; Configurable minitsncls{"minitsncls", 4, "min. number of ITS clusters"}; Configurable maxchi2tpc{"maxchi2tpc", 5.0, "max. chi2/NclsTPC"}; Configurable maxchi2its{"maxchi2its", 6.0, "max. chi2/NclsITS"}; @@ -85,6 +86,8 @@ struct filterDielectronEvent { Configurable minTPCNsigmaEl{"minTPCNsigmaEl", -2.5, "min. TPC n sigma for electron inclusion"}; Configurable maxTPCNsigmaEl{"maxTPCNsigmaEl", 3.5, "max. TPC n sigma for electron inclusion"}; Configurable maxTOFNsigmaEl{"maxTOFNsigmaEl", 3.5, "max. TOF n sigma for electron inclusion"}; + Configurable minTPCNsigmaPi{"minTPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; + Configurable maxTPCNsigmaPi{"maxTPCNsigmaPi", 2.0, "max. TPC n sigma for pion exclusion"}; Configurable maxMee{"maxMee", 0.02, "max mee for virtual photon selection"}; Configurable apply_phiv{"apply_phiv", true, "flag to apply phiv cut"}; @@ -129,18 +132,17 @@ struct filterDielectronEvent { fRegistry.add("Track/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTOFbeta", "TOF beta;p_{pv} (GeV/c);#beta", kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); - fRegistry.add("Track/hTOFNsigmaEl", "TOF n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/hTOFNsigmaMu", "TOF n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/hTOFNsigmaPi", "TOF n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/hTOFNsigmaKa", "TOF n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/hTOFNsigmaPr", "TOF n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/hTOFNsigmaKa", "TOF n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/hTOFNsigmaPr", "TOF n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTPCNcr2Nf", "TPC Ncr/Nfindable", kTH1F, {{200, 0, 2}}, false); fRegistry.add("Track/hTPCNcls2Nf", "TPC Ncls/Nfindable", kTH1F, {{200, 0, 2}}, false); fRegistry.add("Track/hNclsITS", "number of ITS clusters", kTH1F, {{8, -0.5, 7.5}}, false); fRegistry.add("Track/hChi2ITS", "chi2/number of ITS clusters", kTH1F, {{100, 0, 10}}, false); fRegistry.add("Track/hITSClusterMap", "ITS cluster map", kTH1F, {{128, -0.5, 127.5}}, false); fRegistry.add("Track/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda)", kTH2F, {{1000, 0, 10}, {160, 0, 16}}, false); - fRegistry.add("Track/hMeanClusterSizeITS_TPCNsigmaEl", "mean cluster size ITS vs. n #sigma_{e}^{TPC} in p_{pv} < 0.2 GeV/c;n #sigma_{e}^{TPC}; on ITS #times cos(#lambda)", kTH2F, {{100, -5, 5}, {160, 0, 16}}, false); fRegistry.add("Pair/before/hMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", kTH2F, {{100, 0, 0.1}, {100, 0, 1}}, false); fRegistry.add("Pair/before/hMvsPhiV", "mee vs. phiv;#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{90, 0, M_PI}, {100, 0, 0.1}}, false); fRegistry.addClone("Pair/before/", "Pair/after/"); @@ -251,11 +253,11 @@ struct filterDielectronEvent { float dcaXY = dcaInfo[0]; float dcaZ = dcaInfo[1]; - if (abs(dcaXY) > dca_xy_max || abs(dcaZ) > dca_z_max) { + if (fabs(dcaXY) > dca_xy_max || fabs(dcaZ) > dca_z_max) { return false; } - if (track_par_cov_recalc.getPt() < minpt || abs(track_par_cov_recalc.getEta()) > maxeta) { + if (track_par_cov_recalc.getPt() < minpt || fabs(track_par_cov_recalc.getEta()) > maxeta) { return false; } @@ -265,7 +267,7 @@ struct filterDielectronEvent { dca_3d = 999.f; } else { float chi2 = (dcaXY * dcaXY * track_par_cov_recalc.getSigmaZ2() + dcaZ * dcaZ * track_par_cov_recalc.getSigmaY2() - 2. * dcaXY * dcaZ * track_par_cov_recalc.getSigmaZY()) / det; - dca_3d = std::sqrt(std::abs(chi2) / 2.); + dca_3d = std::sqrt(fabs(chi2) / 2.); } if (dca_3d > dca_3d_sigma_max) { return false; @@ -277,8 +279,11 @@ struct filterDielectronEvent { template bool isElectron(TTrack const& track) { + if (track.tpcInnerParam() < max_pin_for_pion_rejection && (minTPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < maxTPCNsigmaPi)) { + return false; + } if (track.hasTOF()) { - return minTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < maxTPCNsigmaEl && abs(track.tofNSigmaEl()) < maxTOFNsigmaEl; + return minTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < maxTPCNsigmaEl && fabs(track.tofNSigmaEl()) < maxTOFNsigmaEl; } else { return minTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < maxTPCNsigmaEl; } @@ -366,15 +371,11 @@ struct filterDielectronEvent { fRegistry.fill(HIST("Track/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa()); fRegistry.fill(HIST("Track/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr()); fRegistry.fill(HIST("Track/hTOFbeta"), track.p(), track.beta()); - fRegistry.fill(HIST("Track/hTOFNsigmaEl"), track.tpcInnerParam(), track.tofNSigmaEl()); - fRegistry.fill(HIST("Track/hTOFNsigmaMu"), track.tpcInnerParam(), track.tofNSigmaMu()); - fRegistry.fill(HIST("Track/hTOFNsigmaPi"), track.tpcInnerParam(), track.tofNSigmaPi()); - fRegistry.fill(HIST("Track/hTOFNsigmaKa"), track.tpcInnerParam(), track.tofNSigmaKa()); - fRegistry.fill(HIST("Track/hTOFNsigmaPr"), track.tpcInnerParam(), track.tofNSigmaPr()); - - if (track.p() < 0.2) { - fRegistry.fill(HIST("Track/hMeanClusterSizeITS_TPCNsigmaEl"), track.tpcNSigmaEl(), static_cast(total_cluster_size) / static_cast(nl) * std::cos(std::atan(track.tgl()))); - } + fRegistry.fill(HIST("Track/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl()); + fRegistry.fill(HIST("Track/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu()); + fRegistry.fill(HIST("Track/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi()); + fRegistry.fill(HIST("Track/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa()); + fRegistry.fill(HIST("Track/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr()); } } } From 89cdf0af1f09a20fdff132e7270b3495c379d389 Mon Sep 17 00:00:00 2001 From: upasanasharma31 <84681984+upasanasharma31@users.noreply.github.com> Date: Mon, 2 Sep 2024 13:22:47 +0530 Subject: [PATCH 14/16] Add prod. radius of the primary, secondary ans tertiary particle (#7528) * Add prod. radius of the primary, secondary ans tertiary particle --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index 24f8d2ce9ce..ca4b78ac20f 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -159,6 +159,21 @@ std::array, nParticles> hPtRadiusTrkItsTpc; std::array, nParticles> hPtRadiusItsTpcTof; std::array, nParticles> hPtRadiusGenerated; +std::array, nParticles> hPtRadiusItsTpcPrm; +std::array, nParticles> hPtRadiusTrkItsTpcPrm; +std::array, nParticles> hPtRadiusItsTpcTofPrm; +std::array, nParticles> hPtRadiusGeneratedPrm; + +std::array, nParticles> hPtRadiusItsTpcStr; +std::array, nParticles> hPtRadiusTrkItsTpcStr; +std::array, nParticles> hPtRadiusItsTpcTofStr; +std::array, nParticles> hPtRadiusGeneratedStr; + +std::array, nParticles> hPtRadiusItsTpcTer; +std::array, nParticles> hPtRadiusTrkItsTpcTer; +std::array, nParticles> hPtRadiusItsTpcTofTer; +std::array, nParticles> hPtRadiusGeneratedTer; + struct QaEfficiency { // Track/particle selection Configurable numSameCollision{"numSameCollision", false, "Flag to ask that the numerator is in the same collision as the denominator"}; @@ -396,6 +411,18 @@ struct QaEfficiency { hPtRadiusItsTpc[histogramIndex] = histos.add(Form("MC/pdg%i/pt/radius/its_tpc", PDGs[histogramIndex]), "ITS-TPC tracks " + tagPt + " vs Radius", kTH2D, {axisPt, axisRadius}); hPtRadiusItsTpcTof[histogramIndex] = histos.add(Form("MC/pdg%i/pt/radius/its_tpc_tof", PDGs[histogramIndex]), "ITS-TPC-TOF tracks " + tagPt + " vs Radius", kTH2D, {axisPt, axisRadius}); hPtRadiusGenerated[histogramIndex] = histos.add(Form("MC/pdg%i/pt/radius/generated", PDGs[histogramIndex]), "Generated " + tagPt + " vs Radius", kTH2D, {axisPt, axisRadius}); + + hPtRadiusItsTpcPrm[histogramIndex] = histos.add(Form("MC/pdg%i/pt/prm/radius/its_tpc", PDGs[histogramIndex]), "ITS-TPC tracks " + tagPt + " vs Radius", kTH2D, {axisPt, axisRadius}); + hPtRadiusItsTpcTofPrm[histogramIndex] = histos.add(Form("MC/pdg%i/pt/prm/radius/its_tpc_tof", PDGs[histogramIndex]), "ITS-TPC-TOF tracks " + tagPt + " vs Radius", kTH2D, {axisPt, axisRadius}); + hPtRadiusGeneratedPrm[histogramIndex] = histos.add(Form("MC/pdg%i/pt/prm/radius/generated", PDGs[histogramIndex]), "Generated " + tagPt + " vs Radius", kTH2D, {axisPt, axisRadius}); + + hPtRadiusItsTpcStr[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/radius/its_tpc", PDGs[histogramIndex]), "ITS-TPC tracks " + tagPt + " vs Radius", kTH2D, {axisPt, axisRadius}); + hPtRadiusItsTpcTofStr[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/radius/its_tpc_tof", PDGs[histogramIndex]), "ITS-TPC-TOF tracks " + tagPt + " vs Radius", kTH2D, {axisPt, axisRadius}); + hPtRadiusGeneratedStr[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/radius/generated", PDGs[histogramIndex]), "Generated " + tagPt + " vs Radius", kTH2D, {axisPt, axisRadius}); + + hPtRadiusItsTpcTer[histogramIndex] = histos.add(Form("MC/pdg%i/pt/ter/radius/its_tpc", PDGs[histogramIndex]), "ITS-TPC tracks " + tagPt + " vs Radius", kTH2D, {axisPt, axisRadius}); + hPtRadiusItsTpcTofTer[histogramIndex] = histos.add(Form("MC/pdg%i/pt/ter/radius/its_tpc_tof", PDGs[histogramIndex]), "ITS-TPC-TOF tracks " + tagPt + " vs Radius", kTH2D, {axisPt, axisRadius}); + hPtRadiusGeneratedTer[histogramIndex] = histos.add(Form("MC/pdg%i/pt/ter/radius/generated", PDGs[histogramIndex]), "Generated " + tagPt + " vs Radius", kTH2D, {axisPt, axisRadius}); } LOG(info) << "Done with making histograms for particle: " << partName; @@ -515,6 +542,12 @@ struct QaEfficiency { if (doPtRadius) { makeEfficiency2D("ITS-TPC_vsPt_vsRadius", hPtRadiusItsTpc[histogramIndex]); makeEfficiency2D("ITS-TPC-TOF_vsPt_vsRadius", hPtRadiusItsTpcTof[histogramIndex]); + makeEfficiency2D("ITS-TPC_vsPt_vsRadius", hPtRadiusItsTpcPrm[histogramIndex]); + makeEfficiency2D("ITS-TPC-TOF_vsPt_vsRadius", hPtRadiusItsTpcTofPrm[histogramIndex]); + makeEfficiency2D("ITS-TPC_vsPt_vsRadius", hPtRadiusItsTpcStr[histogramIndex]); + makeEfficiency2D("ITS-TPC-TOF_vsPt_vsRadius", hPtRadiusItsTpcTofStr[histogramIndex]); + makeEfficiency2D("ITS-TPC_vsPt_vsRadius", hPtRadiusItsTpcTer[histogramIndex]); + makeEfficiency2D("ITS-TPC-TOF_vsPt_vsRadius", hPtRadiusItsTpcTofTer[histogramIndex]); } LOG(info) << "Done with making histograms for particle: " << partName << " for efficiencies"; @@ -1017,8 +1050,15 @@ struct QaEfficiency { } if (doPtRadius) { hPtRadiusItsTpc[histogramIndex]->Fill(mcParticle.pt(), radius); + hPtRadiusItsTpcPrm[histogramIndex]->Fill(mcParticle.pt(), radius); + hPtRadiusItsTpcStr[histogramIndex]->Fill(mcParticle.pt(), radius); + hPtRadiusItsTpcTer[histogramIndex]->Fill(mcParticle.pt(), radius); + if (passedTOF) { hPtRadiusItsTpcTof[histogramIndex]->Fill(mcParticle.pt(), radius); + hPtRadiusItsTpcTofPrm[histogramIndex]->Fill(mcParticle.pt(), radius); + hPtRadiusItsTpcTofStr[histogramIndex]->Fill(mcParticle.pt(), radius); + hPtRadiusItsTpcTofTer[histogramIndex]->Fill(mcParticle.pt(), radius); } } } @@ -1181,6 +1221,9 @@ struct QaEfficiency { } if (doPtRadius) { hPtRadiusGenerated[histogramIndex]->Fill(mcParticle.pt(), radius); + hPtRadiusGeneratedPrm[histogramIndex]->Fill(mcParticle.pt(), radius); + hPtRadiusGeneratedStr[histogramIndex]->Fill(mcParticle.pt(), radius); + hPtRadiusGeneratedTer[histogramIndex]->Fill(mcParticle.pt(), radius); } } @@ -1303,6 +1346,12 @@ struct QaEfficiency { } fillEfficiency2D("ITS-TPC_vsPt_vsRadius", hPtRadiusItsTpc[histogramIndex], hPtRadiusGenerated[histogramIndex]); fillEfficiency2D("ITS-TPC-TOF_vsPt_vsRadius", hPtRadiusItsTpcTof[histogramIndex], hPtRadiusGenerated[histogramIndex]); + fillEfficiency2D("ITS-TPC_vsPt_vsRadius", hPtRadiusItsTpcPrm[histogramIndex], hPtRadiusGeneratedPrm[histogramIndex]); + fillEfficiency2D("ITS-TPC-TOF_vsPt_vsRadius", hPtRadiusItsTpcTofPrm[histogramIndex], hPtRadiusGeneratedPrm[histogramIndex]); + fillEfficiency2D("ITS-TPC_vsPt_vsRadius", hPtRadiusItsTpcStr[histogramIndex], hPtRadiusGeneratedStr[histogramIndex]); + fillEfficiency2D("ITS-TPC-TOF_vsPt_vsRadius", hPtRadiusItsTpcTofStr[histogramIndex], hPtRadiusGeneratedStr[histogramIndex]); + fillEfficiency2D("ITS-TPC_vsPt_vsRadius", hPtRadiusItsTpcTer[histogramIndex], hPtRadiusGeneratedTer[histogramIndex]); + fillEfficiency2D("ITS-TPC-TOF_vsPt_vsRadius", hPtRadiusItsTpcTofTer[histogramIndex], hPtRadiusGeneratedTer[histogramIndex]); } template bool isCollisionSelected(const CollType& collision) From 93c4d2ac17189996a40bcd347286c12d9bddd6e6 Mon Sep 17 00:00:00 2001 From: Marek Mytkowski <101755133+mytkom@users.noreply.github.com> Date: Mon, 2 Sep 2024 10:49:36 +0200 Subject: [PATCH 15/16] PIDML: add hasTOF and hasTRD columns to batchEffAndPurProducer task (#7396) * add partitions for tpc only and with tof tracks + process switches * formatting * fix typo in comment * fix compile warning * add hasTOF and hasTRD instead of partitions (it will be paritioned in hists generation script) --- Tools/PIDML/pidMLBatchEffAndPurProducer.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tools/PIDML/pidMLBatchEffAndPurProducer.cxx b/Tools/PIDML/pidMLBatchEffAndPurProducer.cxx index fe4d591e590..9a611ded269 100644 --- a/Tools/PIDML/pidMLBatchEffAndPurProducer.cxx +++ b/Tools/PIDML/pidMLBatchEffAndPurProducer.cxx @@ -45,11 +45,13 @@ DECLARE_SOA_COLUMN(Pt, pt, float); //! particle's pt DECLARE_SOA_COLUMN(MlCertainty, mlCertainty, float); //! Machine learning model certainty value for track and pid DECLARE_SOA_COLUMN(NSigma, nSigma, float); //! nSigma value for track and pid DECLARE_SOA_COLUMN(IsPidMC, isPidMc, bool); //! Is track's mcParticle recognized as "Pid" +DECLARE_SOA_COLUMN(HasTOF, hasTof, bool); //! Does track have TOF detector signal +DECLARE_SOA_COLUMN(HasTRD, hasTrd, bool); //! Does track have TRD detector signal } // namespace effandpurpidresult DECLARE_SOA_TABLE(EffAndPurPidResult, "AOD", "PIDEFFANDPURRES", o2::soa::Index<>, effandpurpidresult::TrackId, effandpurpidresult::Pid, effandpurpidresult::Pt, effandpurpidresult::MlCertainty, - effandpurpidresult::NSigma, effandpurpidresult::IsPidMC); + effandpurpidresult::NSigma, effandpurpidresult::IsPidMC, effandpurpidresult::HasTOF, effandpurpidresult::HasTRD); } // namespace o2::aod struct PidMlBatchEffAndPurProducer { @@ -229,7 +231,7 @@ struct PidMlBatchEffAndPurProducer { nSigma_t nSigma = getNSigma(track, cfgPids.value[i]); bool isMCPid = mcPart.pdgCode() == cfgPids.value[i]; - effAndPurPIDResult(track.index(), cfgPids.value[i], track.pt(), mlCertainty, nSigma.composed, isMCPid); + effAndPurPIDResult(track.index(), cfgPids.value[i], track.pt(), mlCertainty, nSigma.composed, isMCPid, track.hasTOF(), track.hasTRD()); } } } From 9251df9ca31031994176b41277ac616a40557e6d Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Mon, 2 Sep 2024 11:01:24 +0200 Subject: [PATCH 16/16] clean up (#7480) Co-authored-by: junleekim --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 37 ++++++++++++++---------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index 09dc7bb583f..3353fbebbab 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -33,8 +33,6 @@ using namespace o2::constants::physics; struct f0980analysis { SliceCache cache; - Preslice perRCol = aod::resodaughter::resoCollisionId; - Preslice perCollision = aod::track::collisionId; HistogramRegistry histos{ "histos", {}, @@ -111,13 +109,14 @@ struct f0980analysis { AxisSpec EPqaAxis = {200, -constants::math::PI, constants::math::PI}; AxisSpec EPresAxis = {200, -2, 2}; - histos.add("hInvMass_f0980_US", "unlike invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, RTAxis, LptAxis}}); - histos.add("hInvMass_f0980_LSpp", "++ invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, RTAxis, LptAxis}}); - histos.add("hInvMass_f0980_LSmm", "-- invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, RTAxis, LptAxis}}); - + if (cfgFindRT) { + histos.add("hInvMass_f0980_US", "unlike invariant mass", + {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, RTAxis, LptAxis}}); + histos.add("hInvMass_f0980_LSpp", "++ invariant mass", + {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, RTAxis, LptAxis}}); + histos.add("hInvMass_f0980_LSmm", "-- invariant mass", + {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, RTAxis, LptAxis}}); + } histos.add("hInvMass_f0980_US_EPA", "unlike invariant mass", {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, EPAxis}}); histos.add("hInvMass_f0980_LSpp_EPA", "++ invariant mass", @@ -246,7 +245,7 @@ struct f0980analysis { TLorentzVector Pion1, Pion2, Reco; for (auto& [trk1, trk2] : - combinations(CombinationsUpperIndexPolicy(dTracks, dTracks))) { + combinations(CombinationsStrictlyUpperIndexPolicy(dTracks, dTracks))) { if (trk1.index() == trk2.index()) { if (!SelTrack(trk1)) continue; @@ -274,8 +273,10 @@ struct f0980analysis { } if (trk1.sign() * trk2.sign() < 0) { - histos.fill(HIST("hInvMass_f0980_US"), Reco.M(), Reco.Pt(), - collision.cent(), RTIndex(Reco.Phi(), LHphi), LHpt); + if (cfgFindRT) { + histos.fill(HIST("hInvMass_f0980_US"), Reco.M(), Reco.Pt(), + collision.cent(), RTIndex(Reco.Phi(), LHphi), LHpt); + } histos.fill(HIST("hInvMass_f0980_US_EPA"), Reco.M(), Reco.Pt(), collision.cent(), relPhi); if constexpr (IsMC) { @@ -289,13 +290,17 @@ struct f0980analysis { collision.cent()); } } else if (trk1.sign() > 0 && trk2.sign() > 0) { - histos.fill(HIST("hInvMass_f0980_LSpp"), Reco.M(), Reco.Pt(), - collision.cent(), RTIndex(Reco.Phi(), LHphi), LHpt); + if (cfgFindRT) { + histos.fill(HIST("hInvMass_f0980_LSpp"), Reco.M(), Reco.Pt(), + collision.cent(), RTIndex(Reco.Phi(), LHphi), LHpt); + } histos.fill(HIST("hInvMass_f0980_LSpp_EPA"), Reco.M(), Reco.Pt(), collision.cent(), relPhi); } else if (trk1.sign() < 0 && trk2.sign() < 0) { - histos.fill(HIST("hInvMass_f0980_LSmm"), Reco.M(), Reco.Pt(), - collision.cent(), RTIndex(Reco.Phi(), LHphi), LHpt); + if (cfgFindRT) { + histos.fill(HIST("hInvMass_f0980_LSmm"), Reco.M(), Reco.Pt(), + collision.cent(), RTIndex(Reco.Phi(), LHphi), LHpt); + } histos.fill(HIST("hInvMass_f0980_LSmm_EPA"), Reco.M(), Reco.Pt(), collision.cent(), relPhi); }