From 4fd72eed23ac2c9e7540ab19bac7063464b071b7 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Mon, 7 Jul 2025 14:35:17 +0900 Subject: [PATCH 01/31] implememted Z-h correlation --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 132 +++++++++++++++------- 1 file changed, 93 insertions(+), 39 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 4539149c69d..2085f393ec9 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -12,47 +12,44 @@ /// \file taskElectronWeakBoson.cxx /// \brief task for WeakBoson (W/Z) based on electron in mid-rapidity /// \author S. Sakai & S. Ito (Univ. of Tsukuba) - #ifndef HomogeneousField #define HomogeneousField // o2-linter: disable=name/macro (required by KFParticle) #endif +#include "PWGHF/Core/HfHelper.h" #include "PWGJE/DataModel/EMCALClusters.h" #include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/TrackSelectionTables.h" #include "EventFiltering/Zorro.h" -#include "EventFiltering/ZorroSummary.h" #include "Tools/KFparticle/KFUtilities.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include +#include "CCDB/BasicCCDBManager.h" +#include "DataFormatsEMCAL/AnalysisCluster.h" +#include "DataFormatsEMCAL/Cell.h" +#include "DataFormatsEMCAL/Constants.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" +#include "DetectorsBase/GeometryManager.h" +#include "DetectorsBase/Propagator.h" +#include "EMCALBase/Geometry.h" +#include "EMCALCalib/BadChannelMap.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include "TPDGCode.h" + +#include "KFPTrack.h" +#include "KFPVertex.h" +#include "KFParticle.h" +#include "KFParticleBase.h" +#include "KFVertex.h" + #include #include @@ -70,12 +67,14 @@ struct HfTaskElectronWeakBoson { Configurable vtxZ{"vtxZ", 10.f, ""}; - Configurable etaTrMim{"etaTrMim", -1.0f, "minimun track eta"}; + Configurable etaTrMin{"etaTrMin", -1.0f, "minimun track eta"}; Configurable etaTrMax{"etaTrMax", 1.0f, "maximum track eta"}; Configurable etaEmcMax{"etaEmcMax", 0.6f, "maximum track eta"}; Configurable dcaxyMax{"dcaxyMax", 2.0f, "mximum DCA xy"}; Configurable chi2ItsMax{"chi2ItsMax", 15.0f, "its chi2 cut"}; Configurable ptMin{"ptMin", 3.0f, "minimum pT cut"}; + Configurable ptAssMin{"ptAssMin", 0.15, "minimum pT cut for associated hadrons"}; + Configurable ptMatch{"ptMatch", 0.001, "pT match in Z->ee and associated tracks"}; Configurable ptZeeMin{"ptZeeMin", 20.0f, "minimum pT cut for Zee"}; Configurable chi2TpcMax{"chi2TpcMax", 4.0f, "tpc chi2 cut"}; Configurable nclItsMin{"nclItsMin", 2.0f, "its # of cluster cut"}; @@ -100,6 +99,10 @@ struct HfTaskElectronWeakBoson { Configurable energyIsolationMax{"energyIsolationMax", 0.1, "isolation cut on energy"}; Configurable trackIsolationMax{"trackIsolationMax", 3, "Maximum number of tracks in isolation cone"}; + Configurable zMassMin{"zMassMin", 60.0, "Minimum Z mass (GeV/c^2)"}; + Configurable zMassMax{"zMassMax", 120.0, "Maximum Z mass (GeV/c^2)"}; + Configurable hadronPtMin{"hadronPtMin", 0.5, "Minimum hadron pT for correlation"}; + // flag for THn Configurable isTHnElectron{"isTHnElectron", true, "Enables THn for electrons"}; Configurable ptTHnThresh{"ptTHnThresh", 5.0, "Threshold for THn make"}; @@ -129,7 +132,14 @@ struct HfTaskElectronWeakBoson { }; std::vector selectedElectronsIso; std::vector selectedElectronsAss; - std::vector reconstructedZ; + + struct ZeeCandidate { + float pt, eta, phi, mass, ptchild0, ptchild1; + int charge; + ZeeCandidate(float ptr, float e, float ph, float m, int ch, float ptzee0, float ptzee1) + : pt(ptr), eta(e), phi(ph), mass(m), ptchild0(ptzee0), ptchild1(ptzee1), charge(ch) {} + }; + std::vector reconstructedZ; using SelectedClusters = o2::aod::EMCALClusters; // PbPb @@ -143,7 +153,7 @@ struct HfTaskElectronWeakBoson { Filter eventFilter = (o2::aod::evsel::sel8 == true); Filter posZFilter = (nabs(o2::aod::collision::posZ) < vtxZ); - Filter etafilter = (aod::track::eta < etaTrMax) && (aod::track::eta > etaTrMim); + Filter etafilter = (aod::track::eta < etaTrMax) && (aod::track::eta > etaTrMin); Filter dcaxyfilter = (nabs(aod::track::dcaXY) < dcaxyMax); Filter filterGlobalTr = requireGlobalTrackInFilter(); @@ -200,6 +210,9 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisIsoTrack{15, -0.5, 14.5, "Isolation Track"}; const AxisSpec axisInvMassZ{150, 0, 150, "M_{ee} (GeV/c^{2})"}; const AxisSpec axisTrigger{3, -0.5, 2.5, "Trigger status of zorro"}; + const AxisSpec axisDPhiZh{64, -TMath::Pi() / 2, 3 * TMath::Pi() / 2, "#Delta#phi(Z-h)"}; + const AxisSpec axisPtHadron{50, 0, 50, "p_{T,hadron} (GeV/c)"}; + const AxisSpec axisZpt{150, 0, 150, "p_{T,Z} (GeV/c)"}; // create registrygrams registry.add("hZvtx", "Z vertex", kTH1F, {axisZvtx}); @@ -233,6 +246,10 @@ struct HfTaskElectronWeakBoson { registry.add("hTHnElectrons", "electron info", HistType::kTHnSparseF, {axisPt, axisNsigma, axisM02, axisEop, axisIsoEnergy, axisIsoTrack}); registry.add("hTHnTrMatch", "Track EMC Match", HistType::kTHnSparseF, {axisPt, axisdPhi, axisdEta}); + // Z-hadron correlation histograms + registry.add("hZHadronDphi", "Z-hadron #Delta#phi correlation", kTH2F, {{axisZpt}, {axisDPhiZh}}); + registry.add("hZptSpectrum", "Z boson p_{T} spectrum", kTH1F, {axisZpt}); + // hisotgram for EMCal trigger registry.add("hEMCalTrigger", "EMCal trigger", kTH1F, {axisTrigger}); } @@ -316,6 +333,12 @@ struct HfTaskElectronWeakBoson { KFPTrack kfpTrackAssEle = createKFPTrackFromTrack(track); KFParticle kfpAssEle(kfpTrackAssEle, pdgAss); + // reco by RecoDecay + auto arr1 = RecoDecayPtEtaPhi::pVector(kfpIsoEle.GetPt(), kfpIsoEle.GetEta(), kfpIsoEle.GetPhi()); + auto arr2 = RecoDecayPtEtaPhi::pVector(kfpAssEle.GetPt(), kfpAssEle.GetEta(), kfpAssEle.GetPhi()); + double massZeeRecoDecay = RecoDecay::m(std::array{arr1, arr2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); + + // reco by KFparticle const KFParticle* electronPairs[2] = {&kfpIsoEle, &kfpAssEle}; KFParticle zeeKF; zeeKF.SetConstructMethod(kfConstructMethod); @@ -329,11 +352,14 @@ struct HfTaskElectronWeakBoson { float massZee, massZeeErr; zeeKF.GetMass(massZee, massZeeErr); // LOG(info) << "Invarimass cal by KF particle mass = " << massZee; + // LOG(info) << "Invarimass cal by RecoDecay = " << massZeeRecoDecay; if (track.sign() * charge > 0) { registry.fill(HIST("hKfInvMassZeeLs"), kfpIsoEle.GetPt(), massZee); + registry.fill(HIST("hInvMassZeeLs"), kfpIsoEle.GetPt(), massZeeRecoDecay); } else { registry.fill(HIST("hKfInvMassZeeUls"), kfpIsoEle.GetPt(), massZee); + registry.fill(HIST("hInvMassZeeUls"), kfpIsoEle.GetPt(), massZeeRecoDecay); } reconstructedZ.emplace_back( @@ -341,7 +367,9 @@ struct HfTaskElectronWeakBoson { zeeKF.GetEta(), zeeKF.GetPhi(), massZee, - track.sign() * charge); + track.sign() * charge, + kfpIsoEle.GetPt(), + kfpAssEle.GetPt()); } } @@ -423,8 +451,6 @@ struct HfTaskElectronWeakBoson { continue; if (track.itsNCls() < nclItsMin) continue; - if (track.pt() < ptMin) - continue; registry.fill(HIST("hEta"), track.eta()); registry.fill(HIST("hITSchi2"), track.itsChi2NCl()); @@ -437,7 +463,7 @@ struct HfTaskElectronWeakBoson { float energyTrk = 0.0; - if (track.tpcNSigmaEl() > nsigTpcMinLose && track.tpcNSigmaEl() < nsigTpcMax && track.pt() > ptZeeMin) { + if (track.pt() > ptAssMin) { selectedElectronsAss.emplace_back( track.pt(), track.eta(), @@ -446,6 +472,9 @@ struct HfTaskElectronWeakBoson { track.sign()); } + if (track.pt() < ptMin) + continue; + // track - match // continue; @@ -550,7 +579,6 @@ struct HfTaskElectronWeakBoson { } } } - nMatch++; } } @@ -561,14 +589,17 @@ struct HfTaskElectronWeakBoson { } } // end of track loop - + /* // calculate inv. mass if (selectedElectronsIso.size() > 0) { for (size_t i = 0; i < selectedElectronsIso.size(); i++) { const auto& e1 = selectedElectronsIso[i]; for (size_t j = 0; j < selectedElectronsAss.size(); j++) { const auto& e2 = selectedElectronsAss[j]; - + if (std::abs(e2.nSigEl) > nsigTpcMax) + continue; + if (e2.pt < ptZeeMin) + continue; float ptIso = e1.pt; float ptAss = e2.pt; if (ptIso == ptAss) @@ -585,6 +616,29 @@ struct HfTaskElectronWeakBoson { } } } // end of inv. mass calculation + */ + // Z-hadron + if (reconstructedZ.size() > 0) { + for (const auto& zBoson : reconstructedZ) { + // Z boson selection + if (zBoson.mass < zMassMin || zBoson.mass > zMassMax) + continue; + registry.fill(HIST("hZptSpectrum"), zBoson.pt); + for (const auto& trackAss : selectedElectronsAss) { + if (std::abs(trackAss.pt - zBoson.ptchild0) < ptMatch) + continue; + if (std::abs(trackAss.pt - zBoson.ptchild1) < ptMatch) + continue; + // calculate Z-h correlation + double deltaPhi = trackAss.phi - zBoson.phi; + while (deltaPhi < -TMath::Pi() / 2) + deltaPhi += 2 * TMath::Pi(); + while (deltaPhi > 3 * TMath::Pi() / 2) + deltaPhi -= 2 * TMath::Pi(); + registry.fill(HIST("hZHadronDphi"), zBoson.pt, deltaPhi); + } + } + } // end of Z-hadron correlation } }; From 32c13416da5b8e34c9e85c214b0ef09effdbe513 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Mon, 7 Jul 2025 16:04:56 +0900 Subject: [PATCH 02/31] fixed O2 linter error --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 2085f393ec9..2aec96c6050 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -630,11 +630,14 @@ struct HfTaskElectronWeakBoson { if (std::abs(trackAss.pt - zBoson.ptchild1) < ptMatch) continue; // calculate Z-h correlation + /* double deltaPhi = trackAss.phi - zBoson.phi; while (deltaPhi < -TMath::Pi() / 2) deltaPhi += 2 * TMath::Pi(); while (deltaPhi > 3 * TMath::Pi() / 2) deltaPhi -= 2 * TMath::Pi(); + */ + double deltaPhi = RecoDecay::constrainAngle(trackAss.phi - zBoson.phi, -o2::constants::math::PIHalf); registry.fill(HIST("hZHadronDphi"), zBoson.pt, deltaPhi); } } From 187dfc93061e91d84c3100d0161aec9aec0244a7 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Mon, 7 Jul 2025 17:20:33 +0900 Subject: [PATCH 03/31] fixed O2 linter errors --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 2aec96c6050..8fea0af6d86 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -133,13 +133,13 @@ struct HfTaskElectronWeakBoson { std::vector selectedElectronsIso; std::vector selectedElectronsAss; - struct ZeeCandidate { + struct HfZeeCandidate { float pt, eta, phi, mass, ptchild0, ptchild1; int charge; - ZeeCandidate(float ptr, float e, float ph, float m, int ch, float ptzee0, float ptzee1) + HfZeeCandidate(float ptr, float e, float ph, float m, int ch, float ptzee0, float ptzee1) : pt(ptr), eta(e), phi(ph), mass(m), ptchild0(ptzee0), ptchild1(ptzee1), charge(ch) {} }; - std::vector reconstructedZ; + std::vector reconstructedZ; using SelectedClusters = o2::aod::EMCALClusters; // PbPb @@ -210,7 +210,7 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisIsoTrack{15, -0.5, 14.5, "Isolation Track"}; const AxisSpec axisInvMassZ{150, 0, 150, "M_{ee} (GeV/c^{2})"}; const AxisSpec axisTrigger{3, -0.5, 2.5, "Trigger status of zorro"}; - const AxisSpec axisDPhiZh{64, -TMath::Pi() / 2, 3 * TMath::Pi() / 2, "#Delta#phi(Z-h)"}; + const AxisSpec axisDPhiZh{64, -o2::constants::math::PIHalf, 3 * o2::constants::math::PIHalf, "#Delta#phi(Z-h)"}; const AxisSpec axisPtHadron{50, 0, 50, "p_{T,hadron} (GeV/c)"}; const AxisSpec axisZpt{150, 0, 150, "p_{T,Z} (GeV/c)"}; @@ -630,13 +630,6 @@ struct HfTaskElectronWeakBoson { if (std::abs(trackAss.pt - zBoson.ptchild1) < ptMatch) continue; // calculate Z-h correlation - /* - double deltaPhi = trackAss.phi - zBoson.phi; - while (deltaPhi < -TMath::Pi() / 2) - deltaPhi += 2 * TMath::Pi(); - while (deltaPhi > 3 * TMath::Pi() / 2) - deltaPhi -= 2 * TMath::Pi(); - */ double deltaPhi = RecoDecay::constrainAngle(trackAss.phi - zBoson.phi, -o2::constants::math::PIHalf); registry.fill(HIST("hZHadronDphi"), zBoson.pt, deltaPhi); } From 1101165736fe492ac00d47c454d7346f7d4cec18 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Mon, 7 Jul 2025 22:14:11 +0900 Subject: [PATCH 04/31] implemetned comments by Vit --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 8fea0af6d86..4ac3db736ea 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -99,9 +99,8 @@ struct HfTaskElectronWeakBoson { Configurable energyIsolationMax{"energyIsolationMax", 0.1, "isolation cut on energy"}; Configurable trackIsolationMax{"trackIsolationMax", 3, "Maximum number of tracks in isolation cone"}; - Configurable zMassMin{"zMassMin", 60.0, "Minimum Z mass (GeV/c^2)"}; - Configurable zMassMax{"zMassMax", 120.0, "Maximum Z mass (GeV/c^2)"}; - Configurable hadronPtMin{"hadronPtMin", 0.5, "Minimum hadron pT for correlation"}; + Configurable massZMin{"massZMin", 60.0, "Minimum Z mass (GeV/c^2)"}; + Configurable massZMax{"massZMax", 120.0, "Maximum Z mass (GeV/c^2)"}; // flag for THn Configurable isTHnElectron{"isTHnElectron", true, "Enables THn for electrons"}; @@ -621,7 +620,7 @@ struct HfTaskElectronWeakBoson { if (reconstructedZ.size() > 0) { for (const auto& zBoson : reconstructedZ) { // Z boson selection - if (zBoson.mass < zMassMin || zBoson.mass > zMassMax) + if (zBoson.mass < massZMin || zBoson.mass > massZMax) continue; registry.fill(HIST("hZptSpectrum"), zBoson.pt); for (const auto& trackAss : selectedElectronsAss) { From e6d27ccbb6a5b7cf27c37749e8c1aac3ef1ea149 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Tue, 8 Jul 2025 01:41:48 +0900 Subject: [PATCH 05/31] revert the changes --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 54 ++++++++++++----------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 4ac3db736ea..31783aedfc4 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -16,40 +16,42 @@ #define HomogeneousField // o2-linter: disable=name/macro (required by KFParticle) #endif -#include "PWGHF/Core/HfHelper.h" #include "PWGJE/DataModel/EMCALClusters.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" #include "EventFiltering/Zorro.h" +#include "EventFiltering/ZorroSummary.h" #include "Tools/KFparticle/KFUtilities.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsEMCAL/AnalysisCluster.h" -#include "DataFormatsEMCAL/Cell.h" -#include "DataFormatsEMCAL/Constants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "EMCALBase/Geometry.h" -#include "EMCALCalib/BadChannelMap.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TPDGCode.h" - -#include "KFPTrack.h" -#include "KFPVertex.h" -#include "KFParticle.h" -#include "KFParticleBase.h" -#include "KFVertex.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include #include #include From ae09c84f49920dbbded65376822591a8ce4dfeb0 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Tue, 8 Jul 2025 11:45:14 +0900 Subject: [PATCH 06/31] minor corrections --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 72 +++++++++-------------- 1 file changed, 28 insertions(+), 44 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 31783aedfc4..2fffe98f1db 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -12,6 +12,7 @@ /// \file taskElectronWeakBoson.cxx /// \brief task for WeakBoson (W/Z) based on electron in mid-rapidity /// \author S. Sakai & S. Ito (Univ. of Tsukuba) + #ifndef HomogeneousField #define HomogeneousField // o2-linter: disable=name/macro (required by KFParticle) #endif @@ -320,13 +321,15 @@ struct HfTaskElectronWeakBoson { // LOG(info) << "Invarimass cal by KF particle "; for (const auto& track : tracks) { - if (track.pt() < ptZeeMin) + if (track.pt() < ptZeeMin) { continue; - if (std::abs(track.tpcNSigmaEl()) > nsigTpcMax) + } + if (std::abs(track.tpcNSigmaEl()) > nsigTpcMax) { continue; - if (std::abs(track.eta()) > etaTrMax) + } + if (std::abs(track.eta()) > etaTrMax) { continue; - + } int pdgAss = kElectron; if (track.sign() > 0) { pdgAss = kPositron; @@ -335,9 +338,9 @@ struct HfTaskElectronWeakBoson { KFPTrack kfpTrackAssEle = createKFPTrackFromTrack(track); KFParticle kfpAssEle(kfpTrackAssEle, pdgAss); // reco by RecoDecay - auto arr1 = RecoDecayPtEtaPhi::pVector(kfpIsoEle.GetPt(), kfpIsoEle.GetEta(), kfpIsoEle.GetPhi()); - auto arr2 = RecoDecayPtEtaPhi::pVector(kfpAssEle.GetPt(), kfpAssEle.GetEta(), kfpAssEle.GetPhi()); - double massZeeRecoDecay = RecoDecay::m(std::array{arr1, arr2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); + auto child1 = RecoDecayPtEtaPhi::pVector(kfpIsoEle.GetPt(), kfpIsoEle.GetEta(), kfpIsoEle.GetPhi()); + auto child2 = RecoDecayPtEtaPhi::pVector(kfpAssEle.GetPt(), kfpAssEle.GetEta(), kfpAssEle.GetPhi()); + double massZeeRecoDecay = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); // reco by KFparticle const KFParticle* electronPairs[2] = {&kfpIsoEle, &kfpAssEle}; @@ -346,10 +349,12 @@ struct HfTaskElectronWeakBoson { zeeKF.Construct(electronPairs, 2); // LOG(info) << "Invarimass cal by KF particle Chi2/NDF = " << zeeKF.GetChi2()/zeeKF.GetNDF(); float massZeeChi2 = zeeKF.GetChi2() / zeeKF.GetNDF(); - if (zeeKF.GetNDF() < 1) + if (zeeKF.GetNDF() < 1) { continue; - if (std::abs(massZeeChi2) > kfChisqMassMax) + } + if (std::abs(massZeeChi2) > kfChisqMassMax) { continue; + } float massZee, massZeeErr; zeeKF.GetMass(massZee, massZeeErr); // LOG(info) << "Invarimass cal by KF particle mass = " << massZee; @@ -438,20 +443,27 @@ struct HfTaskElectronWeakBoson { for (const auto& track : tracks) { - if (std::abs(track.eta()) > etaTrMax) + if (std::abs(track.eta()) > etaTrMax) { continue; - if (track.tpcNClsCrossedRows() < nclcrossTpcMin) + } + if (track.tpcNClsCrossedRows() < nclcrossTpcMin) { continue; - if (std::abs(track.dcaXY()) > dcaxyMax) + } + if (std::abs(track.dcaXY()) > dcaxyMax) { continue; - if (track.itsChi2NCl() > chi2ItsMax) + } + if (track.itsChi2NCl() > chi2ItsMax) { continue; - if (track.tpcChi2NCl() > chi2TpcMax) + } + if (track.tpcChi2NCl() > chi2TpcMax) { continue; - if (track.tpcNClsFound() < nclTpcMin) + } + if (track.tpcNClsFound() < nclTpcMin) { continue; - if (track.itsNCls() < nclItsMin) + } + if (track.itsNCls() < nclItsMin) { continue; + } registry.fill(HIST("hEta"), track.eta()); registry.fill(HIST("hITSchi2"), track.itsChi2NCl()); @@ -590,34 +602,6 @@ struct HfTaskElectronWeakBoson { } } // end of track loop - /* - // calculate inv. mass - if (selectedElectronsIso.size() > 0) { - for (size_t i = 0; i < selectedElectronsIso.size(); i++) { - const auto& e1 = selectedElectronsIso[i]; - for (size_t j = 0; j < selectedElectronsAss.size(); j++) { - const auto& e2 = selectedElectronsAss[j]; - if (std::abs(e2.nSigEl) > nsigTpcMax) - continue; - if (e2.pt < ptZeeMin) - continue; - float ptIso = e1.pt; - float ptAss = e2.pt; - if (ptIso == ptAss) - continue; - auto arr1 = RecoDecayPtEtaPhi::pVector(e1.pt, e1.eta, e1.phi); - auto arr2 = RecoDecayPtEtaPhi::pVector(e2.pt, e2.eta, e2.phi); - double mass = RecoDecay::m(std::array{arr1, arr2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); - - if (e1.sign() * e2.sign() > 0) { - registry.fill(HIST("hInvMassZeeLs"), ptIso, mass); - } else { - registry.fill(HIST("hInvMassZeeUls"), ptIso, mass); - } - } - } - } // end of inv. mass calculation - */ // Z-hadron if (reconstructedZ.size() > 0) { for (const auto& zBoson : reconstructedZ) { From 3033f8da7e490acccc1773fa7e005cc29723b8bb Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Tue, 8 Jul 2025 23:10:22 +0900 Subject: [PATCH 07/31] modified some name of parameters --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 2fffe98f1db..5a22a5db109 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -119,7 +119,7 @@ struct HfTaskElectronWeakBoson { // KFParticle Configurable kfConstructMethod{"kfConstructMethod", 2, "KF Construct Method"}; - Configurable kfChisqMassMax{"kfChisqMassMax", 10, "Chi2 Max for mass reco by KF particle"}; + Configurable ChiSqNdfMax{"ChiSqNdfMax", 10, "Chi2 Max for mass reco by KF particle"}; // CCDB service object Service ccdb; @@ -340,7 +340,7 @@ struct HfTaskElectronWeakBoson { // reco by RecoDecay auto child1 = RecoDecayPtEtaPhi::pVector(kfpIsoEle.GetPt(), kfpIsoEle.GetEta(), kfpIsoEle.GetPhi()); auto child2 = RecoDecayPtEtaPhi::pVector(kfpAssEle.GetPt(), kfpAssEle.GetEta(), kfpAssEle.GetPhi()); - double massZeeRecoDecay = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); + double invMassEE = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); // reco by KFparticle const KFParticle* electronPairs[2] = {&kfpIsoEle, &kfpAssEle}; @@ -348,24 +348,24 @@ struct HfTaskElectronWeakBoson { zeeKF.SetConstructMethod(kfConstructMethod); zeeKF.Construct(electronPairs, 2); // LOG(info) << "Invarimass cal by KF particle Chi2/NDF = " << zeeKF.GetChi2()/zeeKF.GetNDF(); - float massZeeChi2 = zeeKF.GetChi2() / zeeKF.GetNDF(); + float ChiSqNdf = zeeKF.GetChi2() / zeeKF.GetNDF(); if (zeeKF.GetNDF() < 1) { continue; } - if (std::abs(massZeeChi2) > kfChisqMassMax) { + if (ChiSqNdf > ChiSqNdfMax) { continue; } float massZee, massZeeErr; zeeKF.GetMass(massZee, massZeeErr); // LOG(info) << "Invarimass cal by KF particle mass = " << massZee; - // LOG(info) << "Invarimass cal by RecoDecay = " << massZeeRecoDecay; + // LOG(info) << "Invarimass cal by RecoDecay = " << invMassEE; if (track.sign() * charge > 0) { registry.fill(HIST("hKfInvMassZeeLs"), kfpIsoEle.GetPt(), massZee); - registry.fill(HIST("hInvMassZeeLs"), kfpIsoEle.GetPt(), massZeeRecoDecay); + registry.fill(HIST("hInvMassZeeLs"), kfpIsoEle.GetPt(), invMassEE); } else { registry.fill(HIST("hKfInvMassZeeUls"), kfpIsoEle.GetPt(), massZee); - registry.fill(HIST("hInvMassZeeUls"), kfpIsoEle.GetPt(), massZeeRecoDecay); + registry.fill(HIST("hInvMassZeeUls"), kfpIsoEle.GetPt(), invMassEE); } reconstructedZ.emplace_back( From a7ceea5360dfe493387656d4405dc2183002a822 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Tue, 8 Jul 2025 23:17:23 +0900 Subject: [PATCH 08/31] fixed O2 linter errors --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 5a22a5db109..19c6d831643 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -119,7 +119,7 @@ struct HfTaskElectronWeakBoson { // KFParticle Configurable kfConstructMethod{"kfConstructMethod", 2, "KF Construct Method"}; - Configurable ChiSqNdfMax{"ChiSqNdfMax", 10, "Chi2 Max for mass reco by KF particle"}; + Configurable chiSqNdfMax{"chiSqNdfMax", 10, "Chi2 Max for mass reco by KF particle"}; // CCDB service object Service ccdb; @@ -348,11 +348,11 @@ struct HfTaskElectronWeakBoson { zeeKF.SetConstructMethod(kfConstructMethod); zeeKF.Construct(electronPairs, 2); // LOG(info) << "Invarimass cal by KF particle Chi2/NDF = " << zeeKF.GetChi2()/zeeKF.GetNDF(); - float ChiSqNdf = zeeKF.GetChi2() / zeeKF.GetNDF(); + float chiSqNdf = zeeKF.GetChi2() / zeeKF.GetNDF(); if (zeeKF.GetNDF() < 1) { continue; } - if (ChiSqNdf > ChiSqNdfMax) { + if (chiSqNdf > chiSqNdfMax) { continue; } float massZee, massZeeErr; From 848325732d2dbdcc7558d983d9461d5ac8abaafc Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Wed, 9 Jul 2025 20:43:12 +0900 Subject: [PATCH 09/31] implemented comment --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 19c6d831643..f3086cac6a7 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -485,9 +485,9 @@ struct HfTaskElectronWeakBoson { track.sign()); } - if (track.pt() < ptMin) + if (track.pt() < ptMin) { continue; - + } // track - match // continue; From 2dddc15a6d6e903dc790c975b1e3acc7e1b4e99a Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Thu, 10 Jul 2025 15:07:47 +0900 Subject: [PATCH 10/31] adding missing braces --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index f3086cac6a7..9ea3763b482 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -610,10 +610,12 @@ struct HfTaskElectronWeakBoson { continue; registry.fill(HIST("hZptSpectrum"), zBoson.pt); for (const auto& trackAss : selectedElectronsAss) { - if (std::abs(trackAss.pt - zBoson.ptchild0) < ptMatch) + if (std::abs(trackAss.pt - zBoson.ptchild0) < ptMatch) { continue; - if (std::abs(trackAss.pt - zBoson.ptchild1) < ptMatch) + } + if (std::abs(trackAss.pt - zBoson.ptchild1) < ptMatch) { continue; + } // calculate Z-h correlation double deltaPhi = RecoDecay::constrainAngle(trackAss.phi - zBoson.phi, -o2::constants::math::PIHalf); registry.fill(HIST("hZHadronDphi"), zBoson.pt, deltaPhi); From 8a9aab484a737a2ba5cd352bf52a13aa668aee68 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Tue, 15 Jul 2025 23:11:56 +0900 Subject: [PATCH 11/31] included charge info in histogrmas for Z measurement --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 2abdfe9eea5..97e62c0bad0 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -214,6 +214,7 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisDPhiZh{64, -o2::constants::math::PIHalf, 3 * o2::constants::math::PIHalf, "#Delta#phi(Z-h)"}; const AxisSpec axisPtHadron{50, 0, 50, "p_{T,hadron} (GeV/c)"}; const AxisSpec axisZpt{150, 0, 150, "p_{T,Z} (GeV/c)"}; + const AxisSpec axisSign{2, -2, 2, "charge sign"}; // create registrygrams registry.add("hZvtx", "Z vertex", kTH1F, {axisZvtx}); @@ -248,8 +249,8 @@ struct HfTaskElectronWeakBoson { registry.add("hTHnTrMatch", "Track EMC Match", HistType::kTHnSparseF, {axisPt, axisdPhi, axisdEta}); // Z-hadron correlation histograms - registry.add("hZHadronDphi", "Z-hadron #Delta#phi correlation", kTH2F, {{axisZpt}, {axisDPhiZh}}); - registry.add("hZptSpectrum", "Z boson p_{T} spectrum", kTH1F, {axisZpt}); + registry.add("hZHadronDphi", "Z-hadron #Delta#phi correlation", HistType::kTHnSparseF, {axisSign, axisZpt, axisDPhiZh}); + registry.add("hZptSpectrum", "Z boson p_{T} spectrum", kTH2F, {{axisSign}, {axisZpt}}); // hisotgram for EMCal trigger registry.add("hEMCalTrigger", "EMCal trigger", kTH1F, {axisTrigger}); @@ -351,6 +352,9 @@ struct HfTaskElectronWeakBoson { if (zeeKF.GetNDF() < 1) { continue; } + if (zeeKF.GetChi2() < 0) { + continue; + } if (chiSqNdf > chiSqNdfMax) { continue; } @@ -605,9 +609,10 @@ struct HfTaskElectronWeakBoson { if (reconstructedZ.size() > 0) { for (const auto& zBoson : reconstructedZ) { // Z boson selection - if (zBoson.mass < massZMin || zBoson.mass > massZMax) + if (zBoson.mass < massZMin || zBoson.mass > massZMax) { continue; - registry.fill(HIST("hZptSpectrum"), zBoson.pt); + } + registry.fill(HIST("hZptSpectrum"), zBoson.charge, zBoson.pt); for (const auto& trackAss : selectedElectronsAss) { if (std::abs(trackAss.pt - zBoson.ptchild0) < ptMatch) { continue; @@ -617,7 +622,7 @@ struct HfTaskElectronWeakBoson { } // calculate Z-h correlation double deltaPhi = RecoDecay::constrainAngle(trackAss.phi - zBoson.phi, -o2::constants::math::PIHalf); - registry.fill(HIST("hZHadronDphi"), zBoson.pt, deltaPhi); + registry.fill(HIST("hZHadronDphi"), zBoson.charge, zBoson.pt, deltaPhi); } } } // end of Z-hadron correlation From c3b7601db0f3a2fac82e00f4658d0e59595f44a7 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Tue, 15 Jul 2025 23:46:14 +0900 Subject: [PATCH 12/31] changed name of axis for Z pt histogram --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 97e62c0bad0..a2f59f59840 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -213,7 +213,7 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisTrigger{3, -0.5, 2.5, "Trigger status of zorro"}; const AxisSpec axisDPhiZh{64, -o2::constants::math::PIHalf, 3 * o2::constants::math::PIHalf, "#Delta#phi(Z-h)"}; const AxisSpec axisPtHadron{50, 0, 50, "p_{T,hadron} (GeV/c)"}; - const AxisSpec axisZpt{150, 0, 150, "p_{T,Z} (GeV/c)"}; + const AxisSpec axisPtZ{150, 0, 150, "p_{T,Z} (GeV/c)"}; const AxisSpec axisSign{2, -2, 2, "charge sign"}; // create registrygrams @@ -249,8 +249,8 @@ struct HfTaskElectronWeakBoson { registry.add("hTHnTrMatch", "Track EMC Match", HistType::kTHnSparseF, {axisPt, axisdPhi, axisdEta}); // Z-hadron correlation histograms - registry.add("hZHadronDphi", "Z-hadron #Delta#phi correlation", HistType::kTHnSparseF, {axisSign, axisZpt, axisDPhiZh}); - registry.add("hZptSpectrum", "Z boson p_{T} spectrum", kTH2F, {{axisSign}, {axisZpt}}); + registry.add("hZHadronDphi", "Z-hadron #Delta#phi correlation", HistType::kTHnSparseF, {axisSign, axisPtZ, axisDPhiZh}); + registry.add("hZptSpectrum", "Z boson p_{T} spectrum", kTH2F, {{axisSign}, {axisPtZ}}); // hisotgram for EMCal trigger registry.add("hEMCalTrigger", "EMCal trigger", kTH1F, {axisTrigger}); From 144dfe4be92ba63214bf1718e724ebe53c146d3a Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Wed, 16 Jul 2025 21:41:18 +0900 Subject: [PATCH 13/31] changed TH1F to TH1D for histograms of event counters --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index a2f59f59840..40739b9be59 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -217,9 +217,9 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisSign{2, -2, 2, "charge sign"}; // create registrygrams - registry.add("hZvtx", "Z vertex", kTH1F, {axisZvtx}); - registry.add("hEventCounterInit", "hEventCounterInit", kTH1F, {axisCounter}); - registry.add("hEventCounter", "hEventCounter", kTH1F, {axisCounter}); + registry.add("hZvtx", "Z vertex", kTH1D, {axisZvtx}); + registry.add("hEventCounterInit", "hEventCounterInit", kTH1D, {axisCounter}); + registry.add("hEventCounter", "hEventCounter", kTH1D, {axisCounter}); registry.add("hITSchi2", "ITS #chi^{2}", kTH1F, {axisChi2}); registry.add("hTPCchi2", "TPC #chi^{2}", kTH1F, {axisChi2}); registry.add("hTPCnCls", "TPC NCls", kTH1F, {axisCluster}); @@ -253,7 +253,7 @@ struct HfTaskElectronWeakBoson { registry.add("hZptSpectrum", "Z boson p_{T} spectrum", kTH2F, {{axisSign}, {axisPtZ}}); // hisotgram for EMCal trigger - registry.add("hEMCalTrigger", "EMCal trigger", kTH1F, {axisTrigger}); + registry.add("hEMCalTrigger", "EMCal trigger", kTH1D, {axisTrigger}); } double getIsolatedCluster(const o2::aod::EMCALCluster& cluster, From 953b290a9d67b608d84e656795a7b0cc9241b1eb Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Tue, 29 Jul 2025 16:41:35 +0900 Subject: [PATCH 14/31] updated to check eID --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 40739b9be59..8b01f302228 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -103,6 +103,7 @@ struct HfTaskElectronWeakBoson { Configurable massZMin{"massZMin", 60.0, "Minimum Z mass (GeV/c^2)"}; Configurable massZMax{"massZMax", 120.0, "Maximum Z mass (GeV/c^2)"}; + Configurable ptZeeCorrfac{"ptZeeCorrfac", 1.0, "momenctum corrrection fac. for Z boson"}; // flag for THn Configurable isTHnElectron{"isTHnElectron", true, "Enables THn for electrons"}; @@ -195,6 +196,7 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisEta{20, -1.0, 1.0, "#eta"}; const AxisSpec axisPt{nBinsPt, 0, binPtmax, "p_{T}"}; const AxisSpec axisNsigma{100, -5, 5, "N#sigma"}; + const AxisSpec axisDedx{150, 0, 150, "dEdx"}; const AxisSpec axisE{nBinsE, 0, binEmax, "Energy"}; const AxisSpec axisM02{100, 0, 1, "M02"}; const AxisSpec axisdPhi{100, -0.5, 0.5, "dPhi"}; @@ -245,7 +247,7 @@ struct HfTaskElectronWeakBoson { registry.add("hInvMassZeeUls", "invariant mass for Z ULS pair", kTH2F, {{axisPt}, {axisInvMassZ}}); registry.add("hKfInvMassZeeLs", "invariant mass for Z LS pair KFp", kTH2F, {{axisPt}, {axisInvMassZ}}); registry.add("hKfInvMassZeeUls", "invariant mass for Z ULS pair KFp", kTH2F, {{axisPt}, {axisInvMassZ}}); - registry.add("hTHnElectrons", "electron info", HistType::kTHnSparseF, {axisPt, axisNsigma, axisM02, axisEop, axisIsoEnergy, axisIsoTrack}); + registry.add("hTHnElectrons", "electron info", HistType::kTHnSparseF, {axisPt, axisNsigma, axisM02, axisEop, axisIsoEnergy, axisIsoTrack, axisEta, axisDedx}); registry.add("hTHnTrMatch", "Track EMC Match", HistType::kTHnSparseF, {axisPt, axisdPhi, axisdEta}); // Z-hadron correlation histograms @@ -338,8 +340,8 @@ struct HfTaskElectronWeakBoson { KFPTrack kfpTrackAssEle = createKFPTrackFromTrack(track); KFParticle kfpAssEle(kfpTrackAssEle, pdgAss); // reco by RecoDecay - auto child1 = RecoDecayPtEtaPhi::pVector(kfpIsoEle.GetPt(), kfpIsoEle.GetEta(), kfpIsoEle.GetPhi()); - auto child2 = RecoDecayPtEtaPhi::pVector(kfpAssEle.GetPt(), kfpAssEle.GetEta(), kfpAssEle.GetPhi()); + auto child1 = RecoDecayPtEtaPhi::pVector(kfpIsoEle.GetPt() * ptZeeCorrfac, kfpIsoEle.GetEta(), kfpIsoEle.GetPhi()); + auto child2 = RecoDecayPtEtaPhi::pVector(kfpAssEle.GetPt() * ptZeeCorrfac, kfpAssEle.GetEta(), kfpAssEle.GetPhi()); double invMassEE = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); // reco by KFparticle @@ -556,7 +558,7 @@ struct HfTaskElectronWeakBoson { int trackCount = getIsolatedTrack(track.eta(), track.phi(), track.pt(), tracks) - 1; if (match.track_as().pt() > ptTHnThresh && isTHnElectron) { - registry.fill(HIST("hTHnElectrons"), match.track_as().pt(), match.track_as().tpcNSigmaEl(), m02Emc, eop, isoEnergy, trackCount); + registry.fill(HIST("hTHnElectrons"), match.track_as().pt(), match.track_as().tpcNSigmaEl(), m02Emc, eop, isoEnergy, trackCount, track.eta(), track.tpcSignal()); } // LOG(info) << "E/p" << eop; registry.fill(HIST("hEopNsigTPC"), match.track_as().tpcNSigmaEl(), eop); From 37da52b54f0d0c2af96aa5ca96bdf6e75928da34 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Wed, 30 Jul 2025 00:56:32 +0900 Subject: [PATCH 15/31] changed ptZeeCorrfac to ptEleCorrfac --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 8b01f302228..71db450f920 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -103,7 +103,7 @@ struct HfTaskElectronWeakBoson { Configurable massZMin{"massZMin", 60.0, "Minimum Z mass (GeV/c^2)"}; Configurable massZMax{"massZMax", 120.0, "Maximum Z mass (GeV/c^2)"}; - Configurable ptZeeCorrfac{"ptZeeCorrfac", 1.0, "momenctum corrrection fac. for Z boson"}; + Configurable ptEleCorrfac{"ptEleCorrfac", 1.0, "momenctum corrrection factor for decay electrons from Z boson"}; // flag for THn Configurable isTHnElectron{"isTHnElectron", true, "Enables THn for electrons"}; @@ -340,8 +340,8 @@ struct HfTaskElectronWeakBoson { KFPTrack kfpTrackAssEle = createKFPTrackFromTrack(track); KFParticle kfpAssEle(kfpTrackAssEle, pdgAss); // reco by RecoDecay - auto child1 = RecoDecayPtEtaPhi::pVector(kfpIsoEle.GetPt() * ptZeeCorrfac, kfpIsoEle.GetEta(), kfpIsoEle.GetPhi()); - auto child2 = RecoDecayPtEtaPhi::pVector(kfpAssEle.GetPt() * ptZeeCorrfac, kfpAssEle.GetEta(), kfpAssEle.GetPhi()); + auto child1 = RecoDecayPtEtaPhi::pVector(kfpIsoEle.GetPt() * ptEleCorrfac, kfpIsoEle.GetEta(), kfpIsoEle.GetPhi()); + auto child2 = RecoDecayPtEtaPhi::pVector(kfpAssEle.GetPt() * ptEleCorrfac, kfpAssEle.GetEta(), kfpAssEle.GetPhi()); double invMassEE = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); // reco by KFparticle From 513652126a011005c654097dbc4b57a1c0536e41 Mon Sep 17 00:00:00 2001 From: sashingo Date: Wed, 30 Jul 2025 09:02:17 +0900 Subject: [PATCH 16/31] Update taskElectronWeakBoson.cxx correct minor typo in the parameter detail --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 71db450f920..a581d38bc0f 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -103,7 +103,7 @@ struct HfTaskElectronWeakBoson { Configurable massZMin{"massZMin", 60.0, "Minimum Z mass (GeV/c^2)"}; Configurable massZMax{"massZMax", 120.0, "Maximum Z mass (GeV/c^2)"}; - Configurable ptEleCorrfac{"ptEleCorrfac", 1.0, "momenctum corrrection factor for decay electrons from Z boson"}; + Configurable ptEleCorrfac{"ptEleCorrfac", 1.0, "momentum corrrection factor for decay electrons from Z boson"}; // flag for THn Configurable isTHnElectron{"isTHnElectron", true, "Enables THn for electrons"}; From f80040bd839aa490df404e77bdd3448387f68e66 Mon Sep 17 00:00:00 2001 From: sashingo Date: Wed, 30 Jul 2025 18:09:03 +0900 Subject: [PATCH 17/31] Update taskElectronWeakBoson.cxx - change the parameter name -- ptZeeCorrfac => correctionPtElectron - fixed a typo --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index a581d38bc0f..a9b15ce7a0f 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -103,7 +103,7 @@ struct HfTaskElectronWeakBoson { Configurable massZMin{"massZMin", 60.0, "Minimum Z mass (GeV/c^2)"}; Configurable massZMax{"massZMax", 120.0, "Maximum Z mass (GeV/c^2)"}; - Configurable ptEleCorrfac{"ptEleCorrfac", 1.0, "momentum corrrection factor for decay electrons from Z boson"}; + Configurable correctionPtElectron{"correctionPtElectron", 1.0, "momentum correction factor for decay electrons from Z boson"}; // flag for THn Configurable isTHnElectron{"isTHnElectron", true, "Enables THn for electrons"}; @@ -340,8 +340,8 @@ struct HfTaskElectronWeakBoson { KFPTrack kfpTrackAssEle = createKFPTrackFromTrack(track); KFParticle kfpAssEle(kfpTrackAssEle, pdgAss); // reco by RecoDecay - auto child1 = RecoDecayPtEtaPhi::pVector(kfpIsoEle.GetPt() * ptEleCorrfac, kfpIsoEle.GetEta(), kfpIsoEle.GetPhi()); - auto child2 = RecoDecayPtEtaPhi::pVector(kfpAssEle.GetPt() * ptEleCorrfac, kfpAssEle.GetEta(), kfpAssEle.GetPhi()); + auto child1 = RecoDecayPtEtaPhi::pVector(kfpIsoEle.GetPt() * correctionPtElectron, kfpIsoEle.GetEta(), kfpIsoEle.GetPhi()); + auto child2 = RecoDecayPtEtaPhi::pVector(kfpAssEle.GetPt() * correctionPtElectron, kfpAssEle.GetEta(), kfpAssEle.GetPhi()); double invMassEE = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); // reco by KFparticle From 6192bf76e4b559e82dd6e940e93642e91220611c Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Mon, 11 Aug 2025 16:25:12 +0900 Subject: [PATCH 18/31] add centrality selection, and calculate pT ratio in Z-h analysis --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 65 ++++++++++++++++------- 1 file changed, 47 insertions(+), 18 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index a9b15ce7a0f..fd2ff1f5c79 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -17,10 +17,13 @@ #define HomogeneousField // o2-linter: disable=name/macro (required by KFParticle) #endif +#include "PWGHF/Core/CentralityEstimation.h" #include "PWGJE/DataModel/EMCALClusters.h" #include "Common/Core/RecoDecay.h" +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" #include "EventFiltering/Zorro.h" @@ -58,6 +61,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace o2::hf_centrality; struct HfTaskElectronWeakBoson { @@ -121,6 +125,12 @@ struct HfTaskElectronWeakBoson { Configurable kfConstructMethod{"kfConstructMethod", 2, "KF Construct Method"}; Configurable chiSqNdfMax{"chiSqNdfMax", 10, "Chi2 Max for mass reco by KF particle"}; + // Centrality estimator configuration + Configurable centralityEstimator{"centralityEstimator", 2, "Centrality estimator (0=FT0A, 1=FT0C, 2=FT0M, 3=FV0A, 4=NTracksPV)"}; + Configurable enableCentralityAnalysis{"enableCentralityAnalysis", true, "Enable centrality-dependent analysis"}; + Configurable centralityMin{"centralityMin", -1, "minimum cut on centrality selection"}; + Configurable centralityMax{"centralityMax", 101, "maximum cut on centrality selection"}; + // CCDB service object Service ccdb; @@ -142,7 +152,7 @@ struct HfTaskElectronWeakBoson { : pt(ptr), eta(e), phi(ph), mass(m), ptchild0(ptzee0), ptchild1(ptzee1), charge(ch) {} }; std::vector reconstructedZ; - + using CollisionsWithCent = soa::Join; using SelectedClusters = o2::aod::EMCALClusters; // PbPb // using TrackEle = o2::soa::Join; @@ -217,11 +227,14 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisPtHadron{50, 0, 50, "p_{T,hadron} (GeV/c)"}; const AxisSpec axisPtZ{150, 0, 150, "p_{T,Z} (GeV/c)"}; const AxisSpec axisSign{2, -2, 2, "charge sign"}; + const AxisSpec axisCentrality{10, 0, 100, "Centrality (%)"}; + const AxisSpec axisPtRatio{200, 0, 2.0, "pt ratio for h and Z"}; // create registrygrams registry.add("hZvtx", "Z vertex", kTH1D, {axisZvtx}); registry.add("hEventCounterInit", "hEventCounterInit", kTH1D, {axisCounter}); registry.add("hEventCounter", "hEventCounter", kTH1D, {axisCounter}); + registry.add("hCentrality", "Centrality distribution", kTH1F, {axisCentrality}); registry.add("hITSchi2", "ITS #chi^{2}", kTH1F, {axisChi2}); registry.add("hTPCchi2", "TPC #chi^{2}", kTH1F, {axisChi2}); registry.add("hTPCnCls", "TPC NCls", kTH1F, {axisCluster}); @@ -243,21 +256,27 @@ struct HfTaskElectronWeakBoson { registry.add("hEMCtime", "EMC timing", kTH1F, {axisEMCtime}); registry.add("hIsolationEnergy", "Isolation Energy", kTH2F, {{axisE}, {axisIsoEnergy}}); registry.add("hIsolationTrack", "Isolation Track", kTH2F, {{axisE}, {axisIsoTrack}}); - registry.add("hInvMassZeeLs", "invariant mass for Z LS pair", kTH2F, {{axisPt}, {axisInvMassZ}}); - registry.add("hInvMassZeeUls", "invariant mass for Z ULS pair", kTH2F, {{axisPt}, {axisInvMassZ}}); - registry.add("hKfInvMassZeeLs", "invariant mass for Z LS pair KFp", kTH2F, {{axisPt}, {axisInvMassZ}}); - registry.add("hKfInvMassZeeUls", "invariant mass for Z ULS pair KFp", kTH2F, {{axisPt}, {axisInvMassZ}}); + registry.add("hInvMassZee", "invariant mass for Z ULS pair", HistType::kTHnSparseF, {axisSign, axisPt, axisInvMassZ}); + registry.add("hKfInvMassZee", "invariant mass for Z ULS pair KFp", HistType::kTHnSparseF, {axisSign, axisPt, axisInvMassZ}); registry.add("hTHnElectrons", "electron info", HistType::kTHnSparseF, {axisPt, axisNsigma, axisM02, axisEop, axisIsoEnergy, axisIsoTrack, axisEta, axisDedx}); registry.add("hTHnTrMatch", "Track EMC Match", HistType::kTHnSparseF, {axisPt, axisdPhi, axisdEta}); // Z-hadron correlation histograms - registry.add("hZHadronDphi", "Z-hadron #Delta#phi correlation", HistType::kTHnSparseF, {axisSign, axisPtZ, axisDPhiZh}); + registry.add("hZHadronDphi", "Z-hadron #Delta#phi correlation", HistType::kTHnSparseF, {axisSign, axisPtZ, axisDPhiZh, axisPtRatio, axisPtHadron}); registry.add("hZptSpectrum", "Z boson p_{T} spectrum", kTH2F, {{axisSign}, {axisPtZ}}); // hisotgram for EMCal trigger registry.add("hEMCalTrigger", "EMCal trigger", kTH1D, {axisTrigger}); } + // Centrality estimation function + template + float getCentrality(const CollType& collision) + { + // Use PWGHF centrality estimation framework + return o2::hf_centrality::getCentralityColl(collision, centralityEstimator); + } + double getIsolatedCluster(const o2::aod::EMCALCluster& cluster, const SelectedClusters& clusters) { @@ -323,6 +342,9 @@ struct HfTaskElectronWeakBoson { // LOG(info) << "Invarimass cal by KF particle "; for (const auto& track : tracks) { + if (std::abs(track.pt() - kfpIsoEle.GetPt()) < ptMatch) { + continue; + } if (track.pt() < ptZeeMin) { continue; } @@ -344,6 +366,8 @@ struct HfTaskElectronWeakBoson { auto child2 = RecoDecayPtEtaPhi::pVector(kfpAssEle.GetPt() * correctionPtElectron, kfpAssEle.GetEta(), kfpAssEle.GetPhi()); double invMassEE = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); + registry.fill(HIST("hInvMassZee"), track.sign() * charge, kfpIsoEle.GetPt(), invMassEE); + // reco by KFparticle const KFParticle* electronPairs[2] = {&kfpIsoEle, &kfpAssEle}; KFParticle zeeKF; @@ -362,17 +386,9 @@ struct HfTaskElectronWeakBoson { } float massZee, massZeeErr; zeeKF.GetMass(massZee, massZeeErr); + registry.fill(HIST("hKfInvMassZee"), track.sign() * charge, kfpIsoEle.GetPt(), massZee); // LOG(info) << "Invarimass cal by KF particle mass = " << massZee; // LOG(info) << "Invarimass cal by RecoDecay = " << invMassEE; - - if (track.sign() * charge > 0) { - registry.fill(HIST("hKfInvMassZeeLs"), kfpIsoEle.GetPt(), massZee); - registry.fill(HIST("hInvMassZeeLs"), kfpIsoEle.GetPt(), invMassEE); - } else { - registry.fill(HIST("hKfInvMassZeeUls"), kfpIsoEle.GetPt(), massZee); - registry.fill(HIST("hInvMassZeeUls"), kfpIsoEle.GetPt(), invMassEE); - } - reconstructedZ.emplace_back( zeeKF.GetPt(), zeeKF.GetEta(), @@ -384,7 +400,8 @@ struct HfTaskElectronWeakBoson { } } - void process(soa::Filtered::iterator const& collision, + // void process(soa::Filtered::iterator const& collision, + void process(soa::Filtered::iterator const& collision, aod::BCsWithTimestamps const&, SelectedClusters const& emcClusters, TrackEle const& tracks, @@ -446,6 +463,16 @@ struct HfTaskElectronWeakBoson { registry.fill(HIST("hZvtx"), collision.posZ()); + // Calculate centrality + if (enableCentralityAnalysis) { + float centrality = getCentrality(collision); + // LOG(info) << centrality; + if (centrality < centralityMin || centrality > centralityMax) { + return; + } + registry.fill(HIST("hCentrality"), centrality); + } + for (const auto& track : tracks) { if (std::abs(track.eta()) > etaTrMax) { @@ -562,8 +589,9 @@ struct HfTaskElectronWeakBoson { } // LOG(info) << "E/p" << eop; registry.fill(HIST("hEopNsigTPC"), match.track_as().tpcNSigmaEl(), eop); - if (match.emcalcluster_as().m02() < m02Min || match.emcalcluster_as().m02() > m02Max) + if (match.emcalcluster_as().m02() < m02Min || match.emcalcluster_as().m02() > m02Max) { continue; + } if (match.track_as().tpcNSigmaEl() > nsigTpcMin && match.track_as().tpcNSigmaEl() < nsigTpcMax) { registry.fill(HIST("hEop"), match.track_as().pt(), eop); @@ -624,7 +652,8 @@ struct HfTaskElectronWeakBoson { } // calculate Z-h correlation double deltaPhi = RecoDecay::constrainAngle(trackAss.phi - zBoson.phi, -o2::constants::math::PIHalf); - registry.fill(HIST("hZHadronDphi"), zBoson.charge, zBoson.pt, deltaPhi); + double ptRatio = trackAss.pt / zBoson.pt; + registry.fill(HIST("hZHadronDphi"), zBoson.charge, zBoson.pt, deltaPhi, ptRatio, trackAss.pt); } } } // end of Z-hadron correlation From 1383ef636a9d4e56ddaf0db3b20f19f0244db162 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Tue, 12 Aug 2025 00:55:30 +0900 Subject: [PATCH 19/31] updated with suggestions --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index fd2ff1f5c79..abac35b485c 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -126,7 +126,7 @@ struct HfTaskElectronWeakBoson { Configurable chiSqNdfMax{"chiSqNdfMax", 10, "Chi2 Max for mass reco by KF particle"}; // Centrality estimator configuration - Configurable centralityEstimator{"centralityEstimator", 2, "Centrality estimator (0=FT0A, 1=FT0C, 2=FT0M, 3=FV0A, 4=NTracksPV)"}; + Configurable centralityEstimator{"centralityEstimator", CentralityEstimator::FT0M, "Centrality estimator"}; Configurable enableCentralityAnalysis{"enableCentralityAnalysis", true, "Enable centrality-dependent analysis"}; Configurable centralityMin{"centralityMin", -1, "minimum cut on centrality selection"}; Configurable centralityMax{"centralityMax", 101, "maximum cut on centrality selection"}; @@ -196,6 +196,10 @@ struct HfTaskElectronWeakBoson { if (cfgSkimmedProcessing) { zorroSummary.setObject(zorro.getZorroSummary()); } + // check centrality + if (centralityEstimator < CentralityEstimator::FT0A || centralityEstimator > CentralityEstimator::FV0A) { + LOGF(fatal, "Invalid centrality estimator: %d", static_cast(centralityEstimator.value)); + } // add configurable for CCDB path zorro.setBaseCCDBPath(cfgCCDBPath.value); @@ -234,7 +238,7 @@ struct HfTaskElectronWeakBoson { registry.add("hZvtx", "Z vertex", kTH1D, {axisZvtx}); registry.add("hEventCounterInit", "hEventCounterInit", kTH1D, {axisCounter}); registry.add("hEventCounter", "hEventCounter", kTH1D, {axisCounter}); - registry.add("hCentrality", "Centrality distribution", kTH1F, {axisCentrality}); + registry.add("hCentrality", "Centrality distribution", kTH1D, {axisCentrality}); registry.add("hITSchi2", "ITS #chi^{2}", kTH1F, {axisChi2}); registry.add("hTPCchi2", "TPC #chi^{2}", kTH1F, {axisChi2}); registry.add("hTPCnCls", "TPC NCls", kTH1F, {axisCluster}); @@ -269,14 +273,6 @@ struct HfTaskElectronWeakBoson { registry.add("hEMCalTrigger", "EMCal trigger", kTH1D, {axisTrigger}); } - // Centrality estimation function - template - float getCentrality(const CollType& collision) - { - // Use PWGHF centrality estimation framework - return o2::hf_centrality::getCentralityColl(collision, centralityEstimator); - } - double getIsolatedCluster(const o2::aod::EMCALCluster& cluster, const SelectedClusters& clusters) { @@ -465,7 +461,7 @@ struct HfTaskElectronWeakBoson { // Calculate centrality if (enableCentralityAnalysis) { - float centrality = getCentrality(collision); + float centrality = o2::hf_centrality::getCentralityColl(collision, centralityEstimator); // LOG(info) << centrality; if (centrality < centralityMin || centrality > centralityMax) { return; From 1a99e9fb3fbbc8db62483b12a8bdab541dd7c5a3 Mon Sep 17 00:00:00 2001 From: sashingo Date: Tue, 12 Aug 2025 23:18:52 +0900 Subject: [PATCH 20/31] Update PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index abac35b485c..3f10c0462fa 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -126,7 +126,7 @@ struct HfTaskElectronWeakBoson { Configurable chiSqNdfMax{"chiSqNdfMax", 10, "Chi2 Max for mass reco by KF particle"}; // Centrality estimator configuration - Configurable centralityEstimator{"centralityEstimator", CentralityEstimator::FT0M, "Centrality estimator"}; + Configurable centralityEstimator{"centralityEstimator", CentralityEstimator::FT0M, "Centrality estimator. See CentralityEstimator for valid values."}; Configurable enableCentralityAnalysis{"enableCentralityAnalysis", true, "Enable centrality-dependent analysis"}; Configurable centralityMin{"centralityMin", -1, "minimum cut on centrality selection"}; Configurable centralityMax{"centralityMax", 101, "maximum cut on centrality selection"}; From 1b1d65cc8fe8260c66738762c323acdc9164837d Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Tue, 26 Aug 2025 13:27:19 +0900 Subject: [PATCH 21/31] updated QA for Z->ee & non-linear centrality bin selections --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 178 +++++++++++++++------- 1 file changed, 119 insertions(+), 59 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 3f10c0462fa..8302254a9b7 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -1,4 +1,3 @@ -// 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. // @@ -113,9 +112,10 @@ struct HfTaskElectronWeakBoson { Configurable isTHnElectron{"isTHnElectron", true, "Enables THn for electrons"}; Configurable ptTHnThresh{"ptTHnThresh", 5.0, "Threshold for THn make"}; - // Skimmed dataset processing configurations + // Skimmed (trigger) dataset processing configurations Configurable cfgSkimmedProcessing{"cfgSkimmedProcessing", true, "Enables processing of skimmed datasets"}; Configurable cfgTriggerName{"cfgTriggerName", "fGammaHighPtEMCAL", "Trigger of interest (comma separated for multiple)"}; + Configurable applySel8{"applySel8", true, "Apply sel8 filter or not"}; // CCDB service configurations Configurable cfgCCDBPath{"cfgCCDBPath", "Users/m/mpuccio/EventFiltering/OTS/", "Path to CCDB for trigger data"}; @@ -130,19 +130,20 @@ struct HfTaskElectronWeakBoson { Configurable enableCentralityAnalysis{"enableCentralityAnalysis", true, "Enable centrality-dependent analysis"}; Configurable centralityMin{"centralityMin", -1, "minimum cut on centrality selection"}; Configurable centralityMax{"centralityMax", 101, "maximum cut on centrality selection"}; + Configurable> centralityBins{"centalityBins", {0, 20, 60, 100}, "centrality bins"}; + // QA for Z->ee + Configurable enableZeeRecoQA{"enableZeeRecoQA", false, "Enable QA for Z->ee reconstruction"}; // CCDB service object Service ccdb; struct HfElectronCandidate { - float pt, eta, phi, energy; - int charge; - HfElectronCandidate(float ptr, float e, float ph, float en, int ch) - : pt(ptr), eta(e), phi(ph), energy(en), charge(ch) {} - - int sign() const { return charge; } + float pt, eta, phi, eop, energyIso, momIso, ntrackIso; + HfElectronCandidate(float ptr, float e, float ph, float ep, float eiso, float piso, int ntrkiso) + : pt(ptr), eta(e), phi(ph), eop(ep), energyIso(eiso), momIso(piso), ntrackIso(ntrkiso) {} }; std::vector selectedElectronsIso; + std::vector selectedPositronsIso; std::vector selectedElectronsAss; struct HfZeeCandidate { @@ -161,8 +162,7 @@ struct HfTaskElectronWeakBoson { // pp // using TrackEle = o2::soa::Filtered>; - // Filter - Filter eventFilter = (o2::aod::evsel::sel8 == true); + Filter eventFilter = (applySel8 ? (o2::aod::evsel::sel8 == true) : (o2::aod::evsel::sel8 == o2::aod::evsel::sel8)); Filter posZFilter = (nabs(o2::aod::collision::posZ) < vtxZ); Filter etafilter = (aod::track::eta < etaTrMax) && (aod::track::eta > etaTrMin); @@ -209,6 +209,9 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisCounter{1, 0, 1, "events"}; const AxisSpec axisEta{20, -1.0, 1.0, "#eta"}; const AxisSpec axisPt{nBinsPt, 0, binPtmax, "p_{T}"}; + const AxisSpec axisPtZee{60, 20, 80, "p_{T}"}; + const AxisSpec axisPtZele{60, 20, 80, "p_{T,ele} (GeV/c)"}; + const AxisSpec axisPtZpos{60, 20, 80, "p_{T,pos} (GeV/c)"}; const AxisSpec axisNsigma{100, -5, 5, "N#sigma"}; const AxisSpec axisDedx{150, 0, 150, "dEdx"}; const AxisSpec axisE{nBinsE, 0, binEmax, "Energy"}; @@ -218,20 +221,30 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisdR{20, 0.0, 0.2, "dR"}; const AxisSpec axisNcell{50, 0.0, 50.0, "Ncell"}; const AxisSpec axisPhi{350, 0, 7, "Phi"}; - const AxisSpec axisEop{200, 0, 2, "Eop"}; + const AxisSpec axisEop{200, 0, 2, "E/p"}; + const AxisSpec axisEopZele{200, 0, 2, "E/p electon"}; + const AxisSpec axisEopZpos{200, 0, 2, "E/p positron"}; const AxisSpec axisChi2{250, 0.0, 25.0, "#chi^{2}"}; const AxisSpec axisCluster{100, 0.0, 200.0, "counts"}; const AxisSpec axisITSNCls{10, 0.0, 10, "counts"}; const AxisSpec axisEMCtime{100, -50.0, 50, "EMC time"}; - const AxisSpec axisIsoEnergy{100, 0, 1.0, "Isolation energy(GeV/C)"}; - const AxisSpec axisIsoTrack{15, -0.5, 14.5, "Isolation Track"}; - const AxisSpec axisInvMassZ{150, 0, 150, "M_{ee} (GeV/c^{2})"}; + const AxisSpec axisIsoEnergy{100, 0, 1.0, "E_{iso}"}; + const AxisSpec axisIsoEnergyZele{100, 0, 1.0, "E_{iso,ele}"}; + const AxisSpec axisIsoEnergyZpos{100, 0, 1.0, "E_{iso,pos}"}; + const AxisSpec axisIsoMomentum{100, 0, 10.0, "Isolation momentum(GeV/C)"}; + const AxisSpec axisIsoMomentumZele{100, 0, 10.0, "p_{iso,ele}"}; + const AxisSpec axisIsoMomentumZpos{100, 0, 10.0, "p_{iso,pos}"}; + const AxisSpec axisIsoTrack{25, -0.5, 24.5, "Isolation Track"}; + const AxisSpec axisIsoTrackZele{25, -0.5, 24.5, "N_{isotrk,ele}"}; + const AxisSpec axisIsoTrackZpos{25, -0.5, 24.5, "N_{isotrk,pos}"}; + const AxisSpec axisInvMassZgamma{150, 0, 150, "M_{ee} (GeV/c^{2})"}; + const AxisSpec axisInvMassZ{130, 20, 150, "M_{ee} (GeV/c^{2})"}; const AxisSpec axisTrigger{3, -0.5, 2.5, "Trigger status of zorro"}; const AxisSpec axisDPhiZh{64, -o2::constants::math::PIHalf, 3 * o2::constants::math::PIHalf, "#Delta#phi(Z-h)"}; const AxisSpec axisPtHadron{50, 0, 50, "p_{T,hadron} (GeV/c)"}; const AxisSpec axisPtZ{150, 0, 150, "p_{T,Z} (GeV/c)"}; const AxisSpec axisSign{2, -2, 2, "charge sign"}; - const AxisSpec axisCentrality{10, 0, 100, "Centrality (%)"}; + const AxisSpec axisCentrality{centralityBins}; const AxisSpec axisPtRatio{200, 0, 2.0, "pt ratio for h and Z"}; // create registrygrams @@ -259,14 +272,14 @@ struct HfTaskElectronWeakBoson { registry.add("hEopNsigTPC", "Eop vs. Nsigma", kTH2F, {{axisNsigma}, {axisEop}}); registry.add("hEMCtime", "EMC timing", kTH1F, {axisEMCtime}); registry.add("hIsolationEnergy", "Isolation Energy", kTH2F, {{axisE}, {axisIsoEnergy}}); - registry.add("hIsolationTrack", "Isolation Track", kTH2F, {{axisE}, {axisIsoTrack}}); - registry.add("hInvMassZee", "invariant mass for Z ULS pair", HistType::kTHnSparseF, {axisSign, axisPt, axisInvMassZ}); - registry.add("hKfInvMassZee", "invariant mass for Z ULS pair KFp", HistType::kTHnSparseF, {axisSign, axisPt, axisInvMassZ}); + registry.add("hInvMassZee", "invariant mass for Z ULS pair", HistType::kTHnSparseF, {axisCentrality, axisSign, axisPt, axisInvMassZgamma}); + registry.add("hKfInvMassZee", "invariant mass for Z ULS pair KFp", HistType::kTHnSparseF, {axisCentrality, axisSign, axisPt, axisInvMassZgamma}); + registry.add("hInvMassZeeQA", "QA for invariant mass for Z", HistType::kTHnSparseF, {axisInvMassZ, axisPtZele, axisPtZpos, axisEopZele, axisEopZpos, axisIsoEnergyZele, axisIsoEnergyZpos, axisIsoMomentumZele, axisIsoMomentumZpos, axisIsoTrackZele, axisIsoTrackZpos}); registry.add("hTHnElectrons", "electron info", HistType::kTHnSparseF, {axisPt, axisNsigma, axisM02, axisEop, axisIsoEnergy, axisIsoTrack, axisEta, axisDedx}); registry.add("hTHnTrMatch", "Track EMC Match", HistType::kTHnSparseF, {axisPt, axisdPhi, axisdEta}); // Z-hadron correlation histograms - registry.add("hZHadronDphi", "Z-hadron #Delta#phi correlation", HistType::kTHnSparseF, {axisSign, axisPtZ, axisDPhiZh, axisPtRatio, axisPtHadron}); + registry.add("hZHadronDphi", "Z-hadron #Delta#phi correlation", HistType::kTHnSparseF, {axisCentrality, axisSign, axisPtZ, axisDPhiZh, axisPtRatio, axisPtHadron}); registry.add("hZptSpectrum", "Z boson p_{T} spectrum", kTH2F, {{axisSign}, {axisPtZ}}); // hisotgram for EMCal trigger @@ -306,12 +319,15 @@ struct HfTaskElectronWeakBoson { return (isoEnergy); } - int getIsolatedTrack(double etaEle, - double phiEle, - float ptEle, - TrackEle const& tracks) + std::pair getIsolatedTrack(double etaEle, + double phiEle, + float pEle, + TrackEle const& tracks) { int trackCount = 0; + double isoMomentum = 10; + double pSum = 0.0; + // LOG(info) << "track p = " << pEle; for (const auto& track : tracks) { @@ -323,16 +339,22 @@ struct HfTaskElectronWeakBoson { if (deltaR < rIsolation) { trackCount++; + pSum += track.p(); } } - registry.fill(HIST("hIsolationTrack"), ptEle, trackCount); + // LOG(info) << "momSun = " << pSum; + if (pSum > 0) { + isoMomentum = pSum / pEle - 1.0; + } - return (trackCount); + // LOG(info) << "isop = " << isoMomentum; + return std::make_pair(trackCount - 1, isoMomentum); } void recoMassZee(KFParticle kfpIsoEle, int charge, + float centrality, TrackEle const& tracks) { // LOG(info) << "Invarimass cal by KF particle "; @@ -362,7 +384,7 @@ struct HfTaskElectronWeakBoson { auto child2 = RecoDecayPtEtaPhi::pVector(kfpAssEle.GetPt() * correctionPtElectron, kfpAssEle.GetEta(), kfpAssEle.GetPhi()); double invMassEE = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); - registry.fill(HIST("hInvMassZee"), track.sign() * charge, kfpIsoEle.GetPt(), invMassEE); + registry.fill(HIST("hInvMassZee"), centrality, track.sign() * charge, kfpIsoEle.GetPt(), invMassEE); // reco by KFparticle const KFParticle* electronPairs[2] = {&kfpIsoEle, &kfpAssEle}; @@ -382,7 +404,7 @@ struct HfTaskElectronWeakBoson { } float massZee, massZeeErr; zeeKF.GetMass(massZee, massZeeErr); - registry.fill(HIST("hKfInvMassZee"), track.sign() * charge, kfpIsoEle.GetPt(), massZee); + registry.fill(HIST("hKfInvMassZee"), centrality, track.sign() * charge, kfpIsoEle.GetPt(), massZee); // LOG(info) << "Invarimass cal by KF particle mass = " << massZee; // LOG(info) << "Invarimass cal by RecoDecay = " << invMassEE; reconstructedZ.emplace_back( @@ -448,6 +470,7 @@ struct HfTaskElectronWeakBoson { } // initialze for inclusive-electron selectedElectronsIso.clear(); + selectedPositronsIso.clear(); selectedElectronsAss.clear(); reconstructedZ.clear(); @@ -460,8 +483,9 @@ struct HfTaskElectronWeakBoson { registry.fill(HIST("hZvtx"), collision.posZ()); // Calculate centrality + float centrality = 1.0; if (enableCentralityAnalysis) { - float centrality = o2::hf_centrality::getCentralityColl(collision, centralityEstimator); + centrality = o2::hf_centrality::getCentralityColl(collision, centralityEstimator); // LOG(info) << centrality; if (centrality < centralityMin || centrality > centralityMax) { return; @@ -502,38 +526,46 @@ struct HfTaskElectronWeakBoson { registry.fill(HIST("hPt"), track.pt()); registry.fill(HIST("hTPCNsigma"), track.p(), track.tpcNSigmaEl()); - float energyTrk = 0.0; + float eop = 0.0; + float isoEnergy = 1.0; + // track isolation + auto [trackCount, isoMomentum] = getIsolatedTrack(track.eta(), track.phi(), track.p(), tracks); + // LOG(info) << "isoMomentum = " << isoMomentum; if (track.pt() > ptAssMin) { selectedElectronsAss.emplace_back( track.pt(), track.eta(), track.phi(), - energyTrk, - track.sign()); + eop, + isoEnergy, + isoMomentum, + trackCount); } if (track.pt() < ptMin) { continue; } - // track - match - // continue; - if (track.phi() < phiEmcMin || track.phi() > phiEmcMax) - continue; - if (std::abs(track.eta()) > etaEmcMax) - continue; + // LOG(info) << "tr phi, eta = " << track.phi() << " ; " << track.eta(); + // EMC acc + bool isEMCacceptance = true; + if (track.phi() < phiEmcMin || track.phi() > phiEmcMax) { + isEMCacceptance = false; + } + if (std::abs(track.eta()) > etaEmcMax) { + isEMCacceptance = false; + } + // LOG(info) << "EMC acc = " << isEMCacceptance; auto tracksofcluster = matchedtracks.sliceBy(perClusterMatchedTracks, track.globalIndex()); - // LOGF(info, "Number of matched track: %d", tracksofcluster.size()); - double rMin = 999.9; double dPhiMin = 999.9; double dEtaMin = 999.9; bool isIsolated = false; bool isIsolatedTr = false; - if (tracksofcluster.size()) { + if (tracksofcluster.size() && isEMCacceptance) { int nMatch = 0; for (const auto& match : tracksofcluster) { if (match.emcalcluster_as().time() < timeEmcMin || match.emcalcluster_as().time() > timeEmcMax) @@ -557,6 +589,7 @@ struct HfTaskElectronWeakBoson { registry.fill(HIST("hMatchEta"), etaEmc, match.track_as().trackEtaEmcal()); double r = RecoDecay::sqrtSumOfSquares(dPhi, dEta); + // LOG(info) << "r match = " << r; if (r < rMin) { rMin = r; dPhiMin = dPhi; @@ -574,11 +607,10 @@ struct HfTaskElectronWeakBoson { const auto& cluster = match.emcalcluster_as(); - double eop = energyEmc / match.track_as().p(); + eop = energyEmc / match.track_as().p(); + // LOG(info) << "eop = " << eop; - double isoEnergy = getIsolatedCluster(cluster, emcClusters); - - int trackCount = getIsolatedTrack(track.eta(), track.phi(), track.pt(), tracks) - 1; + isoEnergy = getIsolatedCluster(cluster, emcClusters); if (match.track_as().pt() > ptTHnThresh && isTHnElectron) { registry.fill(HIST("hTHnElectrons"), match.track_as().pt(), match.track_as().tpcNSigmaEl(), m02Emc, eop, isoEnergy, trackCount, track.eta(), track.tpcSignal()); @@ -606,29 +638,44 @@ struct HfTaskElectronWeakBoson { } KFPTrack kfpTrackIsoEle = createKFPTrackFromTrack(match.track_as()); KFParticle kfpIsoEle(kfpTrackIsoEle, pdgIso); - recoMassZee(kfpIsoEle, match.track_as().sign(), tracks); - - selectedElectronsIso.emplace_back( - match.track_as().pt(), - match.track_as().eta(), - match.track_as().phi(), - energyEmc, - match.track_as().sign()); - } - } + recoMassZee(kfpIsoEle, match.track_as().sign(), centrality, tracks); + + } // end of pt cut for e from Z + } // end if isolation cut if (isIsolatedTr) { registry.fill(HIST("hEopIsolationTr"), match.track_as().pt(), eop); } - } - } + } // end of PID cut + } // end of nmatch == 0 nMatch++; - } - } + } // end of cluster match + } // end of cluster if (rMin < rMatchMax) { // LOG(info) << "R mim = " << rMin; registry.fill(HIST("hTrMatch_mim"), dPhiMin, dEtaMin); } + if (enableZeeRecoQA && track.pt() > ptZeeMin) { + if (track.sign() < 0) { + selectedElectronsIso.emplace_back( + track.pt(), + track.eta(), + track.phi(), + eop, + isoEnergy, + isoMomentum, + trackCount); + } else { + selectedPositronsIso.emplace_back( + track.pt(), + track.eta(), + track.phi(), + eop, + isoEnergy, + isoMomentum, + trackCount); + } + } } // end of track loop // Z-hadron @@ -649,10 +696,23 @@ struct HfTaskElectronWeakBoson { // calculate Z-h correlation double deltaPhi = RecoDecay::constrainAngle(trackAss.phi - zBoson.phi, -o2::constants::math::PIHalf); double ptRatio = trackAss.pt / zBoson.pt; - registry.fill(HIST("hZHadronDphi"), zBoson.charge, zBoson.pt, deltaPhi, ptRatio, trackAss.pt); + registry.fill(HIST("hZHadronDphi"), centrality, zBoson.charge, zBoson.pt, deltaPhi, ptRatio, trackAss.pt); } } } // end of Z-hadron correlation + // Z->ee QA + if (enableZeeRecoQA) { + if (selectedElectronsIso.size() > 0 && selectedPositronsIso.size() > 0) { + for (const auto& trackEle : selectedElectronsIso) { + for (const auto& trackPos : selectedPositronsIso) { + auto child1 = RecoDecayPtEtaPhi::pVector(trackEle.pt, trackEle.eta, trackEle.phi); + auto child2 = RecoDecayPtEtaPhi::pVector(trackPos.pt, trackPos.eta, trackPos.phi); + double invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); + registry.fill(HIST("hInvMassZeeQA"), invMass, trackEle.pt, trackPos.pt, trackEle.eop, trackPos.eop, trackEle.energyIso, trackPos.energyIso, trackEle.momIso, trackPos.momIso, trackEle.ntrackIso, trackPos.ntrackIso); + } + } + } + } // end of Z->ee QA } }; From 52634e01df02b527c537c77e6a28e6f417dc46f0 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Tue, 26 Aug 2025 14:47:05 +0900 Subject: [PATCH 22/31] fixed linter errors --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 8302254a9b7..86d73eaac16 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -1,4 +1,4 @@ -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders of ALICE O2. // All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public @@ -55,6 +55,7 @@ #include #include #include +#include #include using namespace o2; @@ -130,7 +131,7 @@ struct HfTaskElectronWeakBoson { Configurable enableCentralityAnalysis{"enableCentralityAnalysis", true, "Enable centrality-dependent analysis"}; Configurable centralityMin{"centralityMin", -1, "minimum cut on centrality selection"}; Configurable centralityMax{"centralityMax", 101, "maximum cut on centrality selection"}; - Configurable> centralityBins{"centalityBins", {0, 20, 60, 100}, "centrality bins"}; + Configurable> centralityBins{"centralityBins", {0, 20, 60, 100}, "centrality bins"}; // QA for Z->ee Configurable enableZeeRecoQA{"enableZeeRecoQA", false, "Enable QA for Z->ee reconstruction"}; From 9d34038e934f655a6540d0dedfb025ba36fa0ac9 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Tue, 26 Aug 2025 14:56:59 +0900 Subject: [PATCH 23/31] fixed copylight headers --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 86d73eaac16..baca2b26b99 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -1,4 +1,5 @@ -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders of ALICE O2. +// 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 From ded7348e53fddf6de8ad067df783fb61b29a4c2d Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Mon, 15 Sep 2025 15:27:40 +0900 Subject: [PATCH 24/31] added additional parameters in Z->ee QA histograms --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 64 +++++++++++++++++------ 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index baca2b26b99..260995fd3c0 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -136,13 +136,15 @@ struct HfTaskElectronWeakBoson { // QA for Z->ee Configurable enableZeeRecoQA{"enableZeeRecoQA", false, "Enable QA for Z->ee reconstruction"}; + Configurable massZMinQA{"massZMinQA", 0.1, "minimum mass cut for Zee Reco QA"}; // CCDB service object Service ccdb; struct HfElectronCandidate { - float pt, eta, phi, eop, energyIso, momIso, ntrackIso; - HfElectronCandidate(float ptr, float e, float ph, float ep, float eiso, float piso, int ntrkiso) - : pt(ptr), eta(e), phi(ph), eop(ep), energyIso(eiso), momIso(piso), ntrackIso(ntrkiso) {} + float pt, eta, phi, dcaxyTrk, dcazTrk, eop, energyIso, momIso; + int ntrackIso, nclusterTPC, nclusterITS; + HfElectronCandidate(float ptr, float e, float ph, float dcaxy, float dcaz, float ep, float eiso, float piso, int ntrkiso, int nclstpc, int nclsits) + : pt(ptr), eta(e), phi(ph), dcaxyTrk(dcaxy), dcazTrk(dcaz), eop(ep), energyIso(eiso), momIso(piso), ntrackIso(ntrkiso), nclusterTPC(nclstpc), nclusterITS(nclsits) {} }; std::vector selectedElectronsIso; std::vector selectedPositronsIso; @@ -212,8 +214,18 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisEta{20, -1.0, 1.0, "#eta"}; const AxisSpec axisPt{nBinsPt, 0, binPtmax, "p_{T}"}; const AxisSpec axisPtZee{60, 20, 80, "p_{T}"}; - const AxisSpec axisPtZele{60, 20, 80, "p_{T,ele} (GeV/c)"}; + const AxisSpec axisPtZneg{60, 20, 80, "p_{T,neg} (GeV/c)"}; const AxisSpec axisPtZpos{60, 20, 80, "p_{T,pos} (GeV/c)"}; + const AxisSpec axisDCAxyneg{150, 0, 0.3, "DCAxy_{neg}"}; + const AxisSpec axisDCAxypos{150, 0, 0.3, "DCAxy_{pos}"}; + const AxisSpec axisDCAzneg{150, 0, 0.3, "DCAz_{neg}"}; + const AxisSpec axisDCAzpos{150, 0, 0.3, "DCAz_{neg}"}; + const AxisSpec axisNclsTPCneg{20, 79.5, 159.5, "nClsTpc_{neg}"}; + const AxisSpec axisNclsTPCpos{20, 79.5, 159.5, "nClsTpc_{neg}"}; + const AxisSpec axisNclsITSneg{9, -0.5, 8.5, "nClsIts_{neg}"}; + const AxisSpec axisNclsITSpos{9, -0.5, 8.5, "nClsIts_{neg}"}; + const AxisSpec axisSectorTPCneg{360, 0, 18, "TPCsector_{neg}"}; + const AxisSpec axisSectorTPCpos{360, 0, 18, "TPCsector_{pos}"}; const AxisSpec axisNsigma{100, -5, 5, "N#sigma"}; const AxisSpec axisDedx{150, 0, 150, "dEdx"}; const AxisSpec axisE{nBinsE, 0, binEmax, "Energy"}; @@ -224,20 +236,20 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisNcell{50, 0.0, 50.0, "Ncell"}; const AxisSpec axisPhi{350, 0, 7, "Phi"}; const AxisSpec axisEop{200, 0, 2, "E/p"}; - const AxisSpec axisEopZele{200, 0, 2, "E/p electon"}; - const AxisSpec axisEopZpos{200, 0, 2, "E/p positron"}; + const AxisSpec axisEopZneg{200, 0, 2, "E/p neg"}; + const AxisSpec axisEopZpos{200, 0, 2, "E/p pos"}; const AxisSpec axisChi2{250, 0.0, 25.0, "#chi^{2}"}; const AxisSpec axisCluster{100, 0.0, 200.0, "counts"}; const AxisSpec axisITSNCls{10, 0.0, 10, "counts"}; const AxisSpec axisEMCtime{100, -50.0, 50, "EMC time"}; const AxisSpec axisIsoEnergy{100, 0, 1.0, "E_{iso}"}; - const AxisSpec axisIsoEnergyZele{100, 0, 1.0, "E_{iso,ele}"}; + const AxisSpec axisIsoEnergyZneg{100, 0, 1.0, "E_{iso,neg}"}; const AxisSpec axisIsoEnergyZpos{100, 0, 1.0, "E_{iso,pos}"}; const AxisSpec axisIsoMomentum{100, 0, 10.0, "Isolation momentum(GeV/C)"}; - const AxisSpec axisIsoMomentumZele{100, 0, 10.0, "p_{iso,ele}"}; + const AxisSpec axisIsoMomentumZneg{100, 0, 10.0, "p_{iso,neg}"}; const AxisSpec axisIsoMomentumZpos{100, 0, 10.0, "p_{iso,pos}"}; const AxisSpec axisIsoTrack{25, -0.5, 24.5, "Isolation Track"}; - const AxisSpec axisIsoTrackZele{25, -0.5, 24.5, "N_{isotrk,ele}"}; + const AxisSpec axisIsoTrackZneg{25, -0.5, 24.5, "N_{isotrk,neg}"}; const AxisSpec axisIsoTrackZpos{25, -0.5, 24.5, "N_{isotrk,pos}"}; const AxisSpec axisInvMassZgamma{150, 0, 150, "M_{ee} (GeV/c^{2})"}; const AxisSpec axisInvMassZ{130, 20, 150, "M_{ee} (GeV/c^{2})"}; @@ -276,7 +288,7 @@ struct HfTaskElectronWeakBoson { registry.add("hIsolationEnergy", "Isolation Energy", kTH2F, {{axisE}, {axisIsoEnergy}}); registry.add("hInvMassZee", "invariant mass for Z ULS pair", HistType::kTHnSparseF, {axisCentrality, axisSign, axisPt, axisInvMassZgamma}); registry.add("hKfInvMassZee", "invariant mass for Z ULS pair KFp", HistType::kTHnSparseF, {axisCentrality, axisSign, axisPt, axisInvMassZgamma}); - registry.add("hInvMassZeeQA", "QA for invariant mass for Z", HistType::kTHnSparseF, {axisInvMassZ, axisPtZele, axisPtZpos, axisEopZele, axisEopZpos, axisIsoEnergyZele, axisIsoEnergyZpos, axisIsoMomentumZele, axisIsoMomentumZpos, axisIsoTrackZele, axisIsoTrackZpos}); + registry.add("hInvMassZeeQA", "QA for invariant mass for Z", HistType::kTHnSparseF, {axisInvMassZ, axisPtZneg, axisPtZpos, axisDCAxyneg, axisDCAxypos, axisDCAzpos, axisNclsTPCneg, axisNclsTPCpos, axisNclsITSneg, axisNclsITSpos, axisSectorTPCneg, axisSectorTPCneg, axisEopZneg, axisEopZpos, axisIsoEnergyZneg, axisIsoEnergyZpos, axisIsoMomentumZneg, axisIsoMomentumZpos, axisIsoTrackZneg, axisIsoTrackZpos}); registry.add("hTHnElectrons", "electron info", HistType::kTHnSparseF, {axisPt, axisNsigma, axisM02, axisEop, axisIsoEnergy, axisIsoTrack, axisEta, axisDedx}); registry.add("hTHnTrMatch", "Track EMC Match", HistType::kTHnSparseF, {axisPt, axisdPhi, axisdEta}); @@ -539,10 +551,14 @@ struct HfTaskElectronWeakBoson { track.pt(), track.eta(), track.phi(), + track.dcaXY(), + track.dcaZ(), eop, isoEnergy, isoMomentum, - trackCount); + trackCount, + track.tpcNClsCrossedRows(), + track.itsNCls()); } if (track.pt() < ptMin) { @@ -663,19 +679,27 @@ struct HfTaskElectronWeakBoson { track.pt(), track.eta(), track.phi(), + track.dcaXY(), + track.dcaZ(), eop, isoEnergy, isoMomentum, - trackCount); + trackCount, + track.tpcNClsFound(), + track.itsNCls()); } else { selectedPositronsIso.emplace_back( track.pt(), track.eta(), track.phi(), + track.dcaXY(), + track.dcaZ(), eop, isoEnergy, isoMomentum, - trackCount); + trackCount, + track.tpcNClsFound(), + track.itsNCls()); } } @@ -710,13 +734,21 @@ struct HfTaskElectronWeakBoson { auto child1 = RecoDecayPtEtaPhi::pVector(trackEle.pt, trackEle.eta, trackEle.phi); auto child2 = RecoDecayPtEtaPhi::pVector(trackPos.pt, trackPos.eta, trackPos.phi); double invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); - registry.fill(HIST("hInvMassZeeQA"), invMass, trackEle.pt, trackPos.pt, trackEle.eop, trackPos.eop, trackEle.energyIso, trackPos.energyIso, trackEle.momIso, trackPos.momIso, trackEle.ntrackIso, trackPos.ntrackIso); + if (invMass > massZMinQA) { + float sectorneg = 18.0 * trackEle.phi / (2.0 * o2::constants::math::PI); + float sectorpos = 18.0 * trackPos.phi / (2.0 * o2::constants::math::PI); + // float dsectorneg = std::abs(sectorneg - TMath::Nint(sectorneg)); + // float dsectorpos = std::abs(sectorpos - TMath::Nint(sectorpos)); + // LOG(info) << "TPC sector= " << sectorneg << " ; " << sectorpos; + // LOG(info) << "TPC sector= " << dsectorneg << " ; " << dsectorpos; + registry.fill(HIST("hInvMassZeeQA"), invMass, trackEle.pt, trackPos.pt, trackEle.dcaxyTrk, trackPos.dcaxyTrk, trackPos.dcazTrk, trackEle.nclusterTPC, trackPos.nclusterTPC, trackEle.nclusterITS, trackPos.nclusterITS, sectorneg, sectorpos, trackEle.eop, trackPos.eop, trackEle.energyIso, trackPos.energyIso, trackEle.momIso, trackPos.momIso, trackEle.ntrackIso, trackPos.ntrackIso); + } } } } } // end of Z->ee QA - } -}; + } // process +}; // struct HfTaskElectronWeakBoson WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From c057fe8f2bd5f3d81dbafcff0c6aadce0427bcac Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Mon, 15 Sep 2025 15:45:20 +0900 Subject: [PATCH 25/31] fixed O2 linter error --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 260995fd3c0..41fa2efeb98 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -735,8 +735,8 @@ struct HfTaskElectronWeakBoson { auto child2 = RecoDecayPtEtaPhi::pVector(trackPos.pt, trackPos.eta, trackPos.phi); double invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); if (invMass > massZMinQA) { - float sectorneg = 18.0 * trackEle.phi / (2.0 * o2::constants::math::PI); - float sectorpos = 18.0 * trackPos.phi / (2.0 * o2::constants::math::PI); + float sectorneg = 18.0 * trackEle.phi / (o2::constants::math::TwoPI); + float sectorpos = 18.0 * trackPos.phi / (o2::constants::math::TwoPI); // float dsectorneg = std::abs(sectorneg - TMath::Nint(sectorneg)); // float dsectorpos = std::abs(sectorpos - TMath::Nint(sectorpos)); // LOG(info) << "TPC sector= " << sectorneg << " ; " << sectorpos; From b5e37a354c04011c4f9a318e5c9101128d0776dd Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Mon, 15 Sep 2025 22:45:11 +0900 Subject: [PATCH 26/31] use o2::constants::math::SectorSpanRad --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 41fa2efeb98..068cac4030c 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -735,12 +735,9 @@ struct HfTaskElectronWeakBoson { auto child2 = RecoDecayPtEtaPhi::pVector(trackPos.pt, trackPos.eta, trackPos.phi); double invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); if (invMass > massZMinQA) { - float sectorneg = 18.0 * trackEle.phi / (o2::constants::math::TwoPI); - float sectorpos = 18.0 * trackPos.phi / (o2::constants::math::TwoPI); - // float dsectorneg = std::abs(sectorneg - TMath::Nint(sectorneg)); - // float dsectorpos = std::abs(sectorpos - TMath::Nint(sectorpos)); + float sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad; + float sectorpos = trackPos.phi / o2::constants::math::SectorSpanRad; // LOG(info) << "TPC sector= " << sectorneg << " ; " << sectorpos; - // LOG(info) << "TPC sector= " << dsectorneg << " ; " << dsectorpos; registry.fill(HIST("hInvMassZeeQA"), invMass, trackEle.pt, trackPos.pt, trackEle.dcaxyTrk, trackPos.dcaxyTrk, trackPos.dcazTrk, trackEle.nclusterTPC, trackPos.nclusterTPC, trackEle.nclusterITS, trackPos.nclusterITS, sectorneg, sectorpos, trackEle.eop, trackPos.eop, trackEle.energyIso, trackPos.energyIso, trackEle.momIso, trackPos.momIso, trackEle.ntrackIso, trackPos.ntrackIso); } } From ec18869799e8d86da96d834f662b62b6107f7a02 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Mon, 29 Sep 2025 09:02:27 +0200 Subject: [PATCH 27/31] updated to Z->ee trig. study --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 62 ++++++++++++++++++----- 1 file changed, 50 insertions(+), 12 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 068cac4030c..73f47711282 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -104,6 +104,7 @@ struct HfTaskElectronWeakBoson { Configurable rIsolation{"rIsolation", 0.3, "cone radius for isolation cut"}; Configurable energyIsolationMax{"energyIsolationMax", 0.1, "isolation cut on energy"}; + Configurable momentumIsolationMax{"momentumIsolationMax", 0.1, "isolation cut on momentum"}; Configurable trackIsolationMax{"trackIsolationMax", 3, "Maximum number of tracks in isolation cone"}; Configurable massZMin{"massZMin", 60.0, "Minimum Z mass (GeV/c^2)"}; @@ -236,18 +237,18 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisNcell{50, 0.0, 50.0, "Ncell"}; const AxisSpec axisPhi{350, 0, 7, "Phi"}; const AxisSpec axisEop{200, 0, 2, "E/p"}; - const AxisSpec axisEopZneg{200, 0, 2, "E/p neg"}; - const AxisSpec axisEopZpos{200, 0, 2, "E/p pos"}; + const AxisSpec axisEopZneg{300, -0.01, 1.49, "E/p neg"}; + const AxisSpec axisEopZpos{300, -0.01, 1.49, "E/p pos"}; const AxisSpec axisChi2{250, 0.0, 25.0, "#chi^{2}"}; const AxisSpec axisCluster{100, 0.0, 200.0, "counts"}; const AxisSpec axisITSNCls{10, 0.0, 10, "counts"}; const AxisSpec axisEMCtime{100, -50.0, 50, "EMC time"}; const AxisSpec axisIsoEnergy{100, 0, 1.0, "E_{iso}"}; - const AxisSpec axisIsoEnergyZneg{100, 0, 1.0, "E_{iso,neg}"}; - const AxisSpec axisIsoEnergyZpos{100, 0, 1.0, "E_{iso,pos}"}; + const AxisSpec axisIsoEnergyZneg{255, 0, 1.5, "E_{iso,neg}"}; + const AxisSpec axisIsoEnergyZpos{255, 0, 1.5, "E_{iso,pos}"}; const AxisSpec axisIsoMomentum{100, 0, 10.0, "Isolation momentum(GeV/C)"}; - const AxisSpec axisIsoMomentumZneg{100, 0, 10.0, "p_{iso,neg}"}; - const AxisSpec axisIsoMomentumZpos{100, 0, 10.0, "p_{iso,pos}"}; + const AxisSpec axisIsoMomentumZneg{255, 0, 2.0, "p_{iso,neg}"}; + const AxisSpec axisIsoMomentumZpos{255, 0, 2.0, "p_{iso,pos}"}; const AxisSpec axisIsoTrack{25, -0.5, 24.5, "Isolation Track"}; const AxisSpec axisIsoTrackZneg{25, -0.5, 24.5, "N_{isotrk,neg}"}; const AxisSpec axisIsoTrackZpos{25, -0.5, 24.5, "N_{isotrk,pos}"}; @@ -289,7 +290,8 @@ struct HfTaskElectronWeakBoson { registry.add("hInvMassZee", "invariant mass for Z ULS pair", HistType::kTHnSparseF, {axisCentrality, axisSign, axisPt, axisInvMassZgamma}); registry.add("hKfInvMassZee", "invariant mass for Z ULS pair KFp", HistType::kTHnSparseF, {axisCentrality, axisSign, axisPt, axisInvMassZgamma}); registry.add("hInvMassZeeQA", "QA for invariant mass for Z", HistType::kTHnSparseF, {axisInvMassZ, axisPtZneg, axisPtZpos, axisDCAxyneg, axisDCAxypos, axisDCAzpos, axisNclsTPCneg, axisNclsTPCpos, axisNclsITSneg, axisNclsITSpos, axisSectorTPCneg, axisSectorTPCneg, axisEopZneg, axisEopZpos, axisIsoEnergyZneg, axisIsoEnergyZpos, axisIsoMomentumZneg, axisIsoMomentumZpos, axisIsoTrackZneg, axisIsoTrackZpos}); - registry.add("hTHnElectrons", "electron info", HistType::kTHnSparseF, {axisPt, axisNsigma, axisM02, axisEop, axisIsoEnergy, axisIsoTrack, axisEta, axisDedx}); + registry.add("hInvMassZeeQAbg", "QA for invariant mass for Z", HistType::kTHnSparseF, {axisInvMassZ, axisPtZneg, axisPtZpos, axisDCAxyneg, axisDCAxypos, axisDCAzpos, axisNclsTPCneg, axisNclsTPCpos, axisNclsITSneg, axisNclsITSpos, axisSectorTPCneg, axisSectorTPCneg, axisEopZneg, axisEopZpos, axisIsoEnergyZneg, axisIsoEnergyZpos, axisIsoMomentumZneg, axisIsoMomentumZpos, axisIsoTrackZneg, axisIsoTrackZpos}); + registry.add("hTHnElectrons", "electron info", HistType::kTHnSparseF, {axisPt, axisNsigma, axisM02, axisEop, axisIsoEnergy, axisIsoMomentum, axisIsoTrack, axisEta, axisDedx}); registry.add("hTHnTrMatch", "Track EMC Match", HistType::kTHnSparseF, {axisPt, axisdPhi, axisdEta}); // Z-hadron correlation histograms @@ -390,6 +392,10 @@ struct HfTaskElectronWeakBoson { if (track.sign() > 0) { pdgAss = kPositron; } + auto [trackCount, isoMomentum] = getIsolatedTrack(track.eta(), track.phi(), track.p(), tracks); + if (isoMomentum > momentumIsolationMax) { + continue; + } KFPTrack kfpTrackAssEle = createKFPTrackFromTrack(track); KFParticle kfpAssEle(kfpTrackAssEle, pdgAss); @@ -540,7 +546,7 @@ struct HfTaskElectronWeakBoson { registry.fill(HIST("hPt"), track.pt()); registry.fill(HIST("hTPCNsigma"), track.p(), track.tpcNSigmaEl()); - float eop = 0.0; + float eop = -0.01; float isoEnergy = 1.0; // track isolation auto [trackCount, isoMomentum] = getIsolatedTrack(track.eta(), track.phi(), track.p(), tracks); @@ -631,7 +637,7 @@ struct HfTaskElectronWeakBoson { isoEnergy = getIsolatedCluster(cluster, emcClusters); if (match.track_as().pt() > ptTHnThresh && isTHnElectron) { - registry.fill(HIST("hTHnElectrons"), match.track_as().pt(), match.track_as().tpcNSigmaEl(), m02Emc, eop, isoEnergy, trackCount, track.eta(), track.tpcSignal()); + registry.fill(HIST("hTHnElectrons"), match.track_as().pt(), match.track_as().tpcNSigmaEl(), m02Emc, eop, isoEnergy, isoMomentum, trackCount, track.eta(), track.tpcSignal()); } // LOG(info) << "E/p" << eop; registry.fill(HIST("hEopNsigTPC"), match.track_as().tpcNSigmaEl(), eop); @@ -643,7 +649,7 @@ struct HfTaskElectronWeakBoson { registry.fill(HIST("hEop"), match.track_as().pt(), eop); if (eop > eopMin && eop < eopMax && isoEnergy < energyIsolationMax) isIsolated = true; - if (eop > eopMin && eop < eopMax && trackCount < trackIsolationMax) + if (eop > eopMin && eop < eopMax && trackCount < trackIsolationMax && isoMomentum < momentumIsolationMax) isIsolatedTr = true; if (isIsolated && isIsolatedTr) { @@ -729,6 +735,7 @@ struct HfTaskElectronWeakBoson { // Z->ee QA if (enableZeeRecoQA) { if (selectedElectronsIso.size() > 0 && selectedPositronsIso.size() > 0) { + // signal for (const auto& trackEle : selectedElectronsIso) { for (const auto& trackPos : selectedPositronsIso) { auto child1 = RecoDecayPtEtaPhi::pVector(trackEle.pt, trackEle.eta, trackEle.phi); @@ -737,12 +744,43 @@ struct HfTaskElectronWeakBoson { if (invMass > massZMinQA) { float sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad; float sectorpos = trackPos.phi / o2::constants::math::SectorSpanRad; - // LOG(info) << "TPC sector= " << sectorneg << " ; " << sectorpos; registry.fill(HIST("hInvMassZeeQA"), invMass, trackEle.pt, trackPos.pt, trackEle.dcaxyTrk, trackPos.dcaxyTrk, trackPos.dcazTrk, trackEle.nclusterTPC, trackPos.nclusterTPC, trackEle.nclusterITS, trackPos.nclusterITS, sectorneg, sectorpos, trackEle.eop, trackPos.eop, trackEle.energyIso, trackPos.energyIso, trackEle.momIso, trackPos.momIso, trackEle.ntrackIso, trackPos.ntrackIso); } } } - } + // bg e-e- + for (const auto& trackEle : selectedElectronsIso) { + for (const auto& trackEle2 : selectedElectronsIso) { + if (trackEle.pt == trackEle2.pt) { + continue; + } + auto child1 = RecoDecayPtEtaPhi::pVector(trackEle.pt, trackEle.eta, trackEle.phi); + auto child2 = RecoDecayPtEtaPhi::pVector(trackEle2.pt, trackEle2.eta, trackEle2.phi); + double invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); + if (invMass > massZMinQA) { + float sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad; + float sectorpos = trackEle2.phi / o2::constants::math::SectorSpanRad; + registry.fill(HIST("hInvMassZeeQAbg"), invMass, trackEle.pt, trackEle2.pt, trackEle.dcaxyTrk, trackEle2.dcaxyTrk, trackEle2.dcazTrk, trackEle.nclusterTPC, trackEle2.nclusterTPC, trackEle.nclusterITS, trackEle2.nclusterITS, sectorneg, sectorpos, trackEle.eop, trackEle2.eop, trackEle.energyIso, trackEle2.energyIso, trackEle.momIso, trackEle2.momIso, trackEle.ntrackIso, trackEle2.ntrackIso); + } + } + } + // bg e+e+ + for (const auto& trackPos : selectedPositronsIso) { + for (const auto& trackPos2 : selectedPositronsIso) { + if (trackPos.pt == trackPos2.pt) { + continue; + } + auto child1 = RecoDecayPtEtaPhi::pVector(trackPos.pt, trackPos.eta, trackPos.phi); + auto child2 = RecoDecayPtEtaPhi::pVector(trackPos2.pt, trackPos2.eta, trackPos2.phi); + double invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); + if (invMass > massZMinQA) { + float sectorneg = trackPos.phi / o2::constants::math::SectorSpanRad; + float sectorpos = trackPos2.phi / o2::constants::math::SectorSpanRad; + registry.fill(HIST("hInvMassZeeQAbg"), invMass, trackPos.pt, trackPos2.pt, trackPos.dcaxyTrk, trackPos2.dcaxyTrk, trackPos2.dcazTrk, trackPos.nclusterTPC, trackPos2.nclusterTPC, trackPos.nclusterITS, trackPos2.nclusterITS, sectorneg, sectorpos, trackPos.eop, trackPos2.eop, trackPos.energyIso, trackPos2.energyIso, trackPos.momIso, trackPos2.momIso, trackPos.ntrackIso, trackPos2.ntrackIso); + } + } + } + } // check arrays aren't empty } // end of Z->ee QA } // process }; // struct HfTaskElectronWeakBoson From d3aa8cfca8f46c51b90b648ebd84f8b59f3230ea Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Tue, 30 Sep 2025 10:52:19 +0200 Subject: [PATCH 28/31] implemeqted comments and suggestions --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 67 +++++++++++++++-------- 1 file changed, 44 insertions(+), 23 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 73f47711282..e8e40dd7502 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -69,8 +69,29 @@ struct HfTaskElectronWeakBoson { // configurable parameters Configurable nBinsPt{"nBinsPt", 100, "N bins in pt registry"}; Configurable binPtmax{"binPtmax", 100.0, "maximum pt registry"}; + Configurable nBinsPtZee{"nBinsPtZee", 60, "N bins in pt Zee registry"}; + Configurable binPtZeemin{"binPtZeemin", 20.0, "minimum pt Zee registry"}; + Configurable binPtZeemax{"binPtZeemax", 80.0, "maximum pt Zee registry"}; Configurable nBinsE{"nBinsE", 100, "N bins in E registry"}; Configurable binEmax{"binEmax", 100.0, "maximum E registry"}; + Configurable nBinsEop{"nBinsEop", 300, "N bins in E/p registry"}; + Configurable binEopmin{"binEopmin", -0.01, "minimum E/p registry"}; + Configurable binEopmax{"binEopmax", 1.49, "maximum E/p registry"}; + Configurable nBinsEiso{"nBinsEiso", 255, "N bins in Eiso registry"}; + Configurable binEisomin{"binEisomin", 0, "minimum Eiso registry"}; + Configurable binEisomax{"binEisomax", 2.0, "maximum Eiso registry"}; + Configurable nBinsPiso{"nBinsPiso", 255, "N bins in mom. isolation registry"}; + Configurable binPisomin{"binPisomin", 0, "minimum mom. isolation registry"}; + Configurable binPisomax{"binPisomax", 1.5, "maximum mom. isolation registry"}; + Configurable nBinsTriso{"nBinsTriso", 25, "N bins in Track isolation registry"}; + Configurable binTrisomin{"binTrisomin", -0.5, "minimum Track isolation registry"}; + Configurable binTrisomax{"binTrisomax", 24.5, "maximum Track isolation registry"}; + Configurable nBinsMassZg{"nBinsMassZg", 150, "N bins in Mass Zgamma registry"}; + Configurable binMassZgmax{"binMassZgmax", 150, "maximum Mass Zgamma registry"}; + Configurable nBinsMassZ{"nBinsMassZ", 130, "N bins in Mass Z registry"}; + Configurable binMassZmin{"binMassZmin", 20, "minimum Mass Z registry"}; + Configurable nBinsZfrag{"nBinsZfrag", 200, "N bins in Z frag registry"}; + Configurable binZfragmin{"binZfragmin", 2, "maximum Z frag registry"}; Configurable vtxZ{"vtxZ", 10.f, ""}; @@ -214,9 +235,9 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisCounter{1, 0, 1, "events"}; const AxisSpec axisEta{20, -1.0, 1.0, "#eta"}; const AxisSpec axisPt{nBinsPt, 0, binPtmax, "p_{T}"}; - const AxisSpec axisPtZee{60, 20, 80, "p_{T}"}; - const AxisSpec axisPtZneg{60, 20, 80, "p_{T,neg} (GeV/c)"}; - const AxisSpec axisPtZpos{60, 20, 80, "p_{T,pos} (GeV/c)"}; + const AxisSpec axisPtZee{nBinsPtZee, binPtZeemin, binPtZeemax, "p_{T}"}; + const AxisSpec axisPtZneg{nBinsPtZee, binPtZeemin, binPtZeemax, "p_{T,neg} (GeV/c)"}; + const AxisSpec axisPtZpos{nBinsPtZee, binPtZeemin, binPtZeemax, "p_{T,pos} (GeV/c)"}; const AxisSpec axisDCAxyneg{150, 0, 0.3, "DCAxy_{neg}"}; const AxisSpec axisDCAxypos{150, 0, 0.3, "DCAxy_{pos}"}; const AxisSpec axisDCAzneg{150, 0, 0.3, "DCAz_{neg}"}; @@ -236,31 +257,31 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisdR{20, 0.0, 0.2, "dR"}; const AxisSpec axisNcell{50, 0.0, 50.0, "Ncell"}; const AxisSpec axisPhi{350, 0, 7, "Phi"}; - const AxisSpec axisEop{200, 0, 2, "E/p"}; - const AxisSpec axisEopZneg{300, -0.01, 1.49, "E/p neg"}; - const AxisSpec axisEopZpos{300, -0.01, 1.49, "E/p pos"}; + const AxisSpec axisEop{nBinsEop, binEopmin, binEopmax, "E/p"}; + const AxisSpec axisEopZneg{nBinsEop, binEopmin, binEopmax, "E/p"}; + const AxisSpec axisEopZpos{nBinsEop, binEopmin, binEopmax, "E/p"}; const AxisSpec axisChi2{250, 0.0, 25.0, "#chi^{2}"}; const AxisSpec axisCluster{100, 0.0, 200.0, "counts"}; const AxisSpec axisITSNCls{10, 0.0, 10, "counts"}; const AxisSpec axisEMCtime{100, -50.0, 50, "EMC time"}; - const AxisSpec axisIsoEnergy{100, 0, 1.0, "E_{iso}"}; - const AxisSpec axisIsoEnergyZneg{255, 0, 1.5, "E_{iso,neg}"}; - const AxisSpec axisIsoEnergyZpos{255, 0, 1.5, "E_{iso,pos}"}; - const AxisSpec axisIsoMomentum{100, 0, 10.0, "Isolation momentum(GeV/C)"}; - const AxisSpec axisIsoMomentumZneg{255, 0, 2.0, "p_{iso,neg}"}; - const AxisSpec axisIsoMomentumZpos{255, 0, 2.0, "p_{iso,pos}"}; - const AxisSpec axisIsoTrack{25, -0.5, 24.5, "Isolation Track"}; - const AxisSpec axisIsoTrackZneg{25, -0.5, 24.5, "N_{isotrk,neg}"}; - const AxisSpec axisIsoTrackZpos{25, -0.5, 24.5, "N_{isotrk,pos}"}; - const AxisSpec axisInvMassZgamma{150, 0, 150, "M_{ee} (GeV/c^{2})"}; - const AxisSpec axisInvMassZ{130, 20, 150, "M_{ee} (GeV/c^{2})"}; + const AxisSpec axisIsoEnergy{nBinsEiso, binEisomin, binEisomax, "E_{iso}"}; + const AxisSpec axisIsoEnergyZneg{nBinsEiso, binEisomin, binEisomax, "E_{iso}"}; + const AxisSpec axisIsoEnergyZpos{nBinsEiso, binEisomin, binEisomax, "E_{iso}"}; + const AxisSpec axisIsoMomentum{nBinsPiso, binPisomin, binPisomax, "Isolation momentum(GeV/C)"}; + const AxisSpec axisIsoMomentumZneg{nBinsPiso, binPisomin, binPisomax, "Isolation momentum(GeV/C)"}; + const AxisSpec axisIsoMomentumZpos{nBinsPiso, binPisomin, binPisomax, "Isolation momentum(GeV/C)"}; + const AxisSpec axisIsoTrack{nBinsTriso, binTrisomin, binTrisomax, "Isolation Track"}; + const AxisSpec axisIsoTrackZneg{nBinsTriso, binTrisomin, binTrisomax, "N_{isotrk,neg}"}; + const AxisSpec axisIsoTrackZpos{nBinsTriso, binTrisomin, binTrisomax, "N_{isotrk,pos}"}; + const AxisSpec axisInvMassZgamma{nBinsMassZg, 0, binMassZgmax, "M_{ee} (GeV/c^{2})"}; + const AxisSpec axisInvMassZ{nBinsMassZ, binMassZmin, binMassZgmax, "M_{ee} (GeV/c^{2})"}; const AxisSpec axisTrigger{3, -0.5, 2.5, "Trigger status of zorro"}; const AxisSpec axisDPhiZh{64, -o2::constants::math::PIHalf, 3 * o2::constants::math::PIHalf, "#Delta#phi(Z-h)"}; - const AxisSpec axisPtHadron{50, 0, 50, "p_{T,hadron} (GeV/c)"}; - const AxisSpec axisPtZ{150, 0, 150, "p_{T,Z} (GeV/c)"}; + const AxisSpec axisPtHadron{nBinsPt, 0, binPtmax, "p_{T,hadron} (GeV/c)"}; + const AxisSpec axisPtZ{nBinsPt, 0, binPtmax, "p_{T,Z} (GeV/c)"}; const AxisSpec axisSign{2, -2, 2, "charge sign"}; const AxisSpec axisCentrality{centralityBins}; - const AxisSpec axisPtRatio{200, 0, 2.0, "pt ratio for h and Z"}; + const AxisSpec axisZfrag{nBinsZfrag, 0, binZfragmin, "p_{T,h}/p_{T,Z}"}; // create registrygrams registry.add("hZvtx", "Z vertex", kTH1D, {axisZvtx}); @@ -295,7 +316,7 @@ struct HfTaskElectronWeakBoson { registry.add("hTHnTrMatch", "Track EMC Match", HistType::kTHnSparseF, {axisPt, axisdPhi, axisdEta}); // Z-hadron correlation histograms - registry.add("hZHadronDphi", "Z-hadron #Delta#phi correlation", HistType::kTHnSparseF, {axisCentrality, axisSign, axisPtZ, axisDPhiZh, axisPtRatio, axisPtHadron}); + registry.add("hZHadronDphi", "Z-hadron #Delta#phi correlation", HistType::kTHnSparseF, {axisCentrality, axisSign, axisPtZ, axisDPhiZh, axisZfrag, axisPtHadron}); registry.add("hZptSpectrum", "Z boson p_{T} spectrum", kTH2F, {{axisSign}, {axisPtZ}}); // hisotgram for EMCal trigger @@ -751,7 +772,7 @@ struct HfTaskElectronWeakBoson { // bg e-e- for (const auto& trackEle : selectedElectronsIso) { for (const auto& trackEle2 : selectedElectronsIso) { - if (trackEle.pt == trackEle2.pt) { + if (&trackEle.pt == &trackEle2.pt) { continue; } auto child1 = RecoDecayPtEtaPhi::pVector(trackEle.pt, trackEle.eta, trackEle.phi); @@ -767,7 +788,7 @@ struct HfTaskElectronWeakBoson { // bg e+e+ for (const auto& trackPos : selectedPositronsIso) { for (const auto& trackPos2 : selectedPositronsIso) { - if (trackPos.pt == trackPos2.pt) { + if (&trackPos.pt == &trackPos2.pt) { continue; } auto child1 = RecoDecayPtEtaPhi::pVector(trackPos.pt, trackPos.eta, trackPos.phi); From eb0a1c0b40f98e544d9cbb780af88264e839bec9 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Wed, 1 Oct 2025 11:57:19 +0200 Subject: [PATCH 29/31] use ConfigureAxis and fixed the algorism for like-sign pair calculation --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 99 +++++++++++------------ 1 file changed, 48 insertions(+), 51 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index e8e40dd7502..5a60f18e509 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -69,29 +69,28 @@ struct HfTaskElectronWeakBoson { // configurable parameters Configurable nBinsPt{"nBinsPt", 100, "N bins in pt registry"}; Configurable binPtmax{"binPtmax", 100.0, "maximum pt registry"}; - Configurable nBinsPtZee{"nBinsPtZee", 60, "N bins in pt Zee registry"}; - Configurable binPtZeemin{"binPtZeemin", 20.0, "minimum pt Zee registry"}; - Configurable binPtZeemax{"binPtZeemax", 80.0, "maximum pt Zee registry"}; Configurable nBinsE{"nBinsE", 100, "N bins in E registry"}; Configurable binEmax{"binEmax", 100.0, "maximum E registry"}; - Configurable nBinsEop{"nBinsEop", 300, "N bins in E/p registry"}; - Configurable binEopmin{"binEopmin", -0.01, "minimum E/p registry"}; - Configurable binEopmax{"binEopmax", 1.49, "maximum E/p registry"}; - Configurable nBinsEiso{"nBinsEiso", 255, "N bins in Eiso registry"}; - Configurable binEisomin{"binEisomin", 0, "minimum Eiso registry"}; - Configurable binEisomax{"binEisomax", 2.0, "maximum Eiso registry"}; - Configurable nBinsPiso{"nBinsPiso", 255, "N bins in mom. isolation registry"}; - Configurable binPisomin{"binPisomin", 0, "minimum mom. isolation registry"}; - Configurable binPisomax{"binPisomax", 1.5, "maximum mom. isolation registry"}; - Configurable nBinsTriso{"nBinsTriso", 25, "N bins in Track isolation registry"}; - Configurable binTrisomin{"binTrisomin", -0.5, "minimum Track isolation registry"}; - Configurable binTrisomax{"binTrisomax", 24.5, "maximum Track isolation registry"}; - Configurable nBinsMassZg{"nBinsMassZg", 150, "N bins in Mass Zgamma registry"}; - Configurable binMassZgmax{"binMassZgmax", 150, "maximum Mass Zgamma registry"}; - Configurable nBinsMassZ{"nBinsMassZ", 130, "N bins in Mass Z registry"}; - Configurable binMassZmin{"binMassZmin", 20, "minimum Mass Z registry"}; - Configurable nBinsZfrag{"nBinsZfrag", 200, "N bins in Z frag registry"}; - Configurable binZfragmin{"binZfragmin", 2, "maximum Z frag registry"}; + + ConfigurableAxis confaxisPt{"confaxisPt", {100, 0, 100}, "p_{T}"}; + ConfigurableAxis confaxisPtZee{"confaxisPtZee", {60, 20, 80}, "p_{T}"}; + ConfigurableAxis confaxisPtZneg{"confaxisPtZneg", {60, 20, 80}, "p_{T,neg} (GeV/c)"}; + ConfigurableAxis confaxisPtZpos{"confaxisPtZpos", {60, 20, 80}, "p_{T,pos} (GeV/c)"}; + ConfigurableAxis confaxisEop{"confaxisEop", {300, -0.01, 1.49}, "E/p"}; + ConfigurableAxis confaxisEopZneg{"confaxisEopZneg", {300, -0.01, 1.49}, "E/p_{neg}"}; + ConfigurableAxis confaxisEopZpos{"confaxisEopZpos", {300, -0.01, 1.49}, "E/p_{pos}"}; + ConfigurableAxis confaxisIsoEnergy{"confaxisIsoEnergy", {255, 0, 2.0}, "E_{iso}"}; + ConfigurableAxis confaxisIsoEnergyZneg{"confaxisIsoEnergyZneg", {255, 0, 2.0}, "E_{iso,neg}"}; + ConfigurableAxis confaxisIsoEnergyZpos{"confaxisIsoEnergyZpos", {255, 0, 2.0}, "E_{iso,pos}"}; + ConfigurableAxis confaxisIsoMomentum{"confaxisIsoMomentum", {255, 0, 2.0}, "E_{iso}"}; + ConfigurableAxis confaxisIsoMomentumZneg{"confaxisIsoMomentumZneg", {255, 0, 1.5}, "E_{iso,neg}"}; + ConfigurableAxis confaxisIsoMomentumZpos{"confaxisIsoMomentumZpos", {255, 0, 1.5}, "E_{iso,pos}"}; + ConfigurableAxis confaxisIsoTrack{"confaxisIsoTrack", {25, -0.5, 24.5}, "Isolation Track"}; + ConfigurableAxis confaxisIsoTrackZneg{"confaxisIsoTrackZneg", {25, -0.5, 24.5}, "N_{isotrk,neg}"}; + ConfigurableAxis confaxisIsoTrackZpos{"confaxisIsoTrackZpos", {25, -0.5, 24.5}, "N_{isotrk,pos}"}; + ConfigurableAxis confaxisInvMassZgamma{"confaxisInvMassZgamma", {150, 0, 150}, "M_{ee} (GeV/c^{2})"}; + ConfigurableAxis confaxisInvMassZ{"confaxisInvMassZ", {130, 20, 150}, "M_{ee} (GeV/c^{2})"}; + ConfigurableAxis confaxisZfrag{"confaxisZfrag", {200, 0, 2.0}, "p_{T,h}/p_{T,Z}"}; Configurable vtxZ{"vtxZ", 10.f, ""}; @@ -234,10 +233,6 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisZvtx{40, -20, 20, "Zvtx"}; const AxisSpec axisCounter{1, 0, 1, "events"}; const AxisSpec axisEta{20, -1.0, 1.0, "#eta"}; - const AxisSpec axisPt{nBinsPt, 0, binPtmax, "p_{T}"}; - const AxisSpec axisPtZee{nBinsPtZee, binPtZeemin, binPtZeemax, "p_{T}"}; - const AxisSpec axisPtZneg{nBinsPtZee, binPtZeemin, binPtZeemax, "p_{T,neg} (GeV/c)"}; - const AxisSpec axisPtZpos{nBinsPtZee, binPtZeemin, binPtZeemax, "p_{T,pos} (GeV/c)"}; const AxisSpec axisDCAxyneg{150, 0, 0.3, "DCAxy_{neg}"}; const AxisSpec axisDCAxypos{150, 0, 0.3, "DCAxy_{pos}"}; const AxisSpec axisDCAzneg{150, 0, 0.3, "DCAz_{neg}"}; @@ -257,31 +252,35 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisdR{20, 0.0, 0.2, "dR"}; const AxisSpec axisNcell{50, 0.0, 50.0, "Ncell"}; const AxisSpec axisPhi{350, 0, 7, "Phi"}; - const AxisSpec axisEop{nBinsEop, binEopmin, binEopmax, "E/p"}; - const AxisSpec axisEopZneg{nBinsEop, binEopmin, binEopmax, "E/p"}; - const AxisSpec axisEopZpos{nBinsEop, binEopmin, binEopmax, "E/p"}; const AxisSpec axisChi2{250, 0.0, 25.0, "#chi^{2}"}; const AxisSpec axisCluster{100, 0.0, 200.0, "counts"}; const AxisSpec axisITSNCls{10, 0.0, 10, "counts"}; const AxisSpec axisEMCtime{100, -50.0, 50, "EMC time"}; - const AxisSpec axisIsoEnergy{nBinsEiso, binEisomin, binEisomax, "E_{iso}"}; - const AxisSpec axisIsoEnergyZneg{nBinsEiso, binEisomin, binEisomax, "E_{iso}"}; - const AxisSpec axisIsoEnergyZpos{nBinsEiso, binEisomin, binEisomax, "E_{iso}"}; - const AxisSpec axisIsoMomentum{nBinsPiso, binPisomin, binPisomax, "Isolation momentum(GeV/C)"}; - const AxisSpec axisIsoMomentumZneg{nBinsPiso, binPisomin, binPisomax, "Isolation momentum(GeV/C)"}; - const AxisSpec axisIsoMomentumZpos{nBinsPiso, binPisomin, binPisomax, "Isolation momentum(GeV/C)"}; - const AxisSpec axisIsoTrack{nBinsTriso, binTrisomin, binTrisomax, "Isolation Track"}; - const AxisSpec axisIsoTrackZneg{nBinsTriso, binTrisomin, binTrisomax, "N_{isotrk,neg}"}; - const AxisSpec axisIsoTrackZpos{nBinsTriso, binTrisomin, binTrisomax, "N_{isotrk,pos}"}; - const AxisSpec axisInvMassZgamma{nBinsMassZg, 0, binMassZgmax, "M_{ee} (GeV/c^{2})"}; - const AxisSpec axisInvMassZ{nBinsMassZ, binMassZmin, binMassZgmax, "M_{ee} (GeV/c^{2})"}; const AxisSpec axisTrigger{3, -0.5, 2.5, "Trigger status of zorro"}; const AxisSpec axisDPhiZh{64, -o2::constants::math::PIHalf, 3 * o2::constants::math::PIHalf, "#Delta#phi(Z-h)"}; const AxisSpec axisPtHadron{nBinsPt, 0, binPtmax, "p_{T,hadron} (GeV/c)"}; const AxisSpec axisPtZ{nBinsPt, 0, binPtmax, "p_{T,Z} (GeV/c)"}; const AxisSpec axisSign{2, -2, 2, "charge sign"}; - const AxisSpec axisCentrality{centralityBins}; - const AxisSpec axisZfrag{nBinsZfrag, 0, binZfragmin, "p_{T,h}/p_{T,Z}"}; + const AxisSpec axisCentrality{centralityBins, "centrality"}; + const AxisSpec axisEop{confaxisEop, "E/p"}; + const AxisSpec axisEopZneg{confaxisEopZneg, "E/p_{neg}"}; + const AxisSpec axisEopZpos{confaxisEopZpos, "E/p_{[pos}"}; + const AxisSpec axisPt{confaxisPt, "p_{T}"}; + const AxisSpec axisPtZee{confaxisPtZee, "p_{T}"}; + const AxisSpec axisPtZneg{confaxisPtZneg, "p_{T,neg} (GeV/c)"}; + const AxisSpec axisPtZpos{confaxisPtZpos, "p_{T,pos} (GeV/c)"}; + const AxisSpec axisIsoEnergy{confaxisIsoEnergy, "E_{iso}"}; + const AxisSpec axisIsoEnergyZneg{confaxisIsoEnergyZneg, "E_{iso}"}; + const AxisSpec axisIsoEnergyZpos{confaxisIsoEnergyZpos, "E_{iso}"}; + const AxisSpec axisIsoMomentum{confaxisIsoMomentum, "Isolation momentum(GeV/C)"}; + const AxisSpec axisIsoMomentumZneg{confaxisIsoMomentumZneg, "Isolation momentum(GeV/C)"}; + const AxisSpec axisIsoMomentumZpos{confaxisIsoMomentumZpos, "Isolation momentum(GeV/C)"}; + const AxisSpec axisIsoTrack{confaxisIsoTrack, "Isolation Track"}; + const AxisSpec axisIsoTrackZneg{confaxisIsoTrackZneg, "N_{isotrk,neg}"}; + const AxisSpec axisIsoTrackZpos{confaxisIsoTrackZpos, "N_{isotrk,pos}"}; + const AxisSpec axisInvMassZgamma{confaxisInvMassZgamma, "M_{ee} (GeV/c^{2})"}; + const AxisSpec axisInvMassZ{confaxisInvMassZ, "M_{ee} (GeV/c^{2})"}; + const AxisSpec axisZfrag{confaxisZfrag, "p_{T,h}/p_{T,Z}"}; // create registrygrams registry.add("hZvtx", "Z vertex", kTH1D, {axisZvtx}); @@ -770,11 +769,10 @@ struct HfTaskElectronWeakBoson { } } // bg e-e- - for (const auto& trackEle : selectedElectronsIso) { - for (const auto& trackEle2 : selectedElectronsIso) { - if (&trackEle.pt == &trackEle2.pt) { - continue; - } + for (size_t i = 0; i < selectedElectronsIso.size(); ++i) { + for (size_t j = i + 1; j < selectedElectronsIso.size(); ++j) { + const auto& trackEle = selectedElectronsIso[i]; + const auto& trackEle2 = selectedElectronsIso[j]; auto child1 = RecoDecayPtEtaPhi::pVector(trackEle.pt, trackEle.eta, trackEle.phi); auto child2 = RecoDecayPtEtaPhi::pVector(trackEle2.pt, trackEle2.eta, trackEle2.phi); double invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); @@ -786,11 +784,10 @@ struct HfTaskElectronWeakBoson { } } // bg e+e+ - for (const auto& trackPos : selectedPositronsIso) { - for (const auto& trackPos2 : selectedPositronsIso) { - if (&trackPos.pt == &trackPos2.pt) { - continue; - } + for (size_t i = 0; i < selectedPositronsIso.size(); ++i) { + for (size_t j = i + 1; j < selectedPositronsIso.size(); ++j) { + const auto& trackPos = selectedPositronsIso[i]; + const auto& trackPos2 = selectedPositronsIso[j]; auto child1 = RecoDecayPtEtaPhi::pVector(trackPos.pt, trackPos.eta, trackPos.phi); auto child2 = RecoDecayPtEtaPhi::pVector(trackPos2.pt, trackPos2.eta, trackPos2.phi); double invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); From c81f60f76350940be766106a6f74ad57b02c7cad Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Wed, 1 Oct 2025 12:22:32 +0200 Subject: [PATCH 30/31] modified O2linter error --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 41 ++++++++++++----------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 5a60f18e509..7e08ac70f3c 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -72,26 +72,6 @@ struct HfTaskElectronWeakBoson { Configurable nBinsE{"nBinsE", 100, "N bins in E registry"}; Configurable binEmax{"binEmax", 100.0, "maximum E registry"}; - ConfigurableAxis confaxisPt{"confaxisPt", {100, 0, 100}, "p_{T}"}; - ConfigurableAxis confaxisPtZee{"confaxisPtZee", {60, 20, 80}, "p_{T}"}; - ConfigurableAxis confaxisPtZneg{"confaxisPtZneg", {60, 20, 80}, "p_{T,neg} (GeV/c)"}; - ConfigurableAxis confaxisPtZpos{"confaxisPtZpos", {60, 20, 80}, "p_{T,pos} (GeV/c)"}; - ConfigurableAxis confaxisEop{"confaxisEop", {300, -0.01, 1.49}, "E/p"}; - ConfigurableAxis confaxisEopZneg{"confaxisEopZneg", {300, -0.01, 1.49}, "E/p_{neg}"}; - ConfigurableAxis confaxisEopZpos{"confaxisEopZpos", {300, -0.01, 1.49}, "E/p_{pos}"}; - ConfigurableAxis confaxisIsoEnergy{"confaxisIsoEnergy", {255, 0, 2.0}, "E_{iso}"}; - ConfigurableAxis confaxisIsoEnergyZneg{"confaxisIsoEnergyZneg", {255, 0, 2.0}, "E_{iso,neg}"}; - ConfigurableAxis confaxisIsoEnergyZpos{"confaxisIsoEnergyZpos", {255, 0, 2.0}, "E_{iso,pos}"}; - ConfigurableAxis confaxisIsoMomentum{"confaxisIsoMomentum", {255, 0, 2.0}, "E_{iso}"}; - ConfigurableAxis confaxisIsoMomentumZneg{"confaxisIsoMomentumZneg", {255, 0, 1.5}, "E_{iso,neg}"}; - ConfigurableAxis confaxisIsoMomentumZpos{"confaxisIsoMomentumZpos", {255, 0, 1.5}, "E_{iso,pos}"}; - ConfigurableAxis confaxisIsoTrack{"confaxisIsoTrack", {25, -0.5, 24.5}, "Isolation Track"}; - ConfigurableAxis confaxisIsoTrackZneg{"confaxisIsoTrackZneg", {25, -0.5, 24.5}, "N_{isotrk,neg}"}; - ConfigurableAxis confaxisIsoTrackZpos{"confaxisIsoTrackZpos", {25, -0.5, 24.5}, "N_{isotrk,pos}"}; - ConfigurableAxis confaxisInvMassZgamma{"confaxisInvMassZgamma", {150, 0, 150}, "M_{ee} (GeV/c^{2})"}; - ConfigurableAxis confaxisInvMassZ{"confaxisInvMassZ", {130, 20, 150}, "M_{ee} (GeV/c^{2})"}; - ConfigurableAxis confaxisZfrag{"confaxisZfrag", {200, 0, 2.0}, "p_{T,h}/p_{T,Z}"}; - Configurable vtxZ{"vtxZ", 10.f, ""}; Configurable etaTrMin{"etaTrMin", -1.0f, "minimun track eta"}; @@ -201,6 +181,27 @@ struct HfTaskElectronWeakBoson { Preslice perClusterAmb = o2::aod::emcalclustercell::emcalambiguousclusterId; PresliceUnsorted perClusterMatchedTracks = o2::aod::emcalmatchedtrack::trackId; + // config axis + ConfigurableAxis confaxisPt{"confaxisPt", {100, 0, 100}, "p_{T}"}; + ConfigurableAxis confaxisPtZee{"confaxisPtZee", {60, 20, 80}, "p_{T}"}; + ConfigurableAxis confaxisPtZneg{"confaxisPtZneg", {60, 20, 80}, "p_{T,neg} (GeV/c)"}; + ConfigurableAxis confaxisPtZpos{"confaxisPtZpos", {60, 20, 80}, "p_{T,pos} (GeV/c)"}; + ConfigurableAxis confaxisEop{"confaxisEop", {300, -0.01, 1.49}, "E/p"}; + ConfigurableAxis confaxisEopZneg{"confaxisEopZneg", {300, -0.01, 1.49}, "E/p_{neg}"}; + ConfigurableAxis confaxisEopZpos{"confaxisEopZpos", {300, -0.01, 1.49}, "E/p_{pos}"}; + ConfigurableAxis confaxisIsoEnergy{"confaxisIsoEnergy", {255, 0, 2.0}, "E_{iso}"}; + ConfigurableAxis confaxisIsoEnergyZneg{"confaxisIsoEnergyZneg", {255, 0, 2.0}, "E_{iso,neg}"}; + ConfigurableAxis confaxisIsoEnergyZpos{"confaxisIsoEnergyZpos", {255, 0, 2.0}, "E_{iso,pos}"}; + ConfigurableAxis confaxisIsoMomentum{"confaxisIsoMomentum", {255, 0, 2.0}, "E_{iso}"}; + ConfigurableAxis confaxisIsoMomentumZneg{"confaxisIsoMomentumZneg", {255, 0, 1.5}, "E_{iso,neg}"}; + ConfigurableAxis confaxisIsoMomentumZpos{"confaxisIsoMomentumZpos", {255, 0, 1.5}, "E_{iso,pos}"}; + ConfigurableAxis confaxisIsoTrack{"confaxisIsoTrack", {25, -0.5, 24.5}, "Isolation Track"}; + ConfigurableAxis confaxisIsoTrackZneg{"confaxisIsoTrackZneg", {25, -0.5, 24.5}, "N_{isotrk,neg}"}; + ConfigurableAxis confaxisIsoTrackZpos{"confaxisIsoTrackZpos", {25, -0.5, 24.5}, "N_{isotrk,pos}"}; + ConfigurableAxis confaxisInvMassZgamma{"confaxisInvMassZgamma", {150, 0, 150}, "M_{ee} (GeV/c^{2})"}; + ConfigurableAxis confaxisInvMassZ{"confaxisInvMassZ", {130, 20, 150}, "M_{ee} (GeV/c^{2})"}; + ConfigurableAxis confaxisZfrag{"confaxisZfrag", {200, 0, 2.0}, "p_{T,h}/p_{T,Z}"}; + // Histogram registry: an object to hold your registrygrams HistogramRegistry registry{"registry"}; From a247ac1a733f1d96981b3e3275c41cc007e5bf2e Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Wed, 1 Oct 2025 13:56:15 +0200 Subject: [PATCH 31/31] modified loop for like-sign pair calculation --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 7e08ac70f3c..7d06f3f525d 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -758,43 +758,43 @@ struct HfTaskElectronWeakBoson { if (selectedElectronsIso.size() > 0 && selectedPositronsIso.size() > 0) { // signal for (const auto& trackEle : selectedElectronsIso) { + auto child1 = RecoDecayPtEtaPhi::pVector(trackEle.pt, trackEle.eta, trackEle.phi); + float sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad; for (const auto& trackPos : selectedPositronsIso) { - auto child1 = RecoDecayPtEtaPhi::pVector(trackEle.pt, trackEle.eta, trackEle.phi); auto child2 = RecoDecayPtEtaPhi::pVector(trackPos.pt, trackPos.eta, trackPos.phi); double invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); + float sectorpos = trackPos.phi / o2::constants::math::SectorSpanRad; if (invMass > massZMinQA) { - float sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad; - float sectorpos = trackPos.phi / o2::constants::math::SectorSpanRad; registry.fill(HIST("hInvMassZeeQA"), invMass, trackEle.pt, trackPos.pt, trackEle.dcaxyTrk, trackPos.dcaxyTrk, trackPos.dcazTrk, trackEle.nclusterTPC, trackPos.nclusterTPC, trackEle.nclusterITS, trackPos.nclusterITS, sectorneg, sectorpos, trackEle.eop, trackPos.eop, trackEle.energyIso, trackPos.energyIso, trackEle.momIso, trackPos.momIso, trackEle.ntrackIso, trackPos.ntrackIso); } } } // bg e-e- for (size_t i = 0; i < selectedElectronsIso.size(); ++i) { + const auto& trackEle = selectedElectronsIso[i]; + auto child1 = RecoDecayPtEtaPhi::pVector(trackEle.pt, trackEle.eta, trackEle.phi); + float sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad; for (size_t j = i + 1; j < selectedElectronsIso.size(); ++j) { - const auto& trackEle = selectedElectronsIso[i]; const auto& trackEle2 = selectedElectronsIso[j]; - auto child1 = RecoDecayPtEtaPhi::pVector(trackEle.pt, trackEle.eta, trackEle.phi); auto child2 = RecoDecayPtEtaPhi::pVector(trackEle2.pt, trackEle2.eta, trackEle2.phi); + float sectorpos = trackEle2.phi / o2::constants::math::SectorSpanRad; double invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); if (invMass > massZMinQA) { - float sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad; - float sectorpos = trackEle2.phi / o2::constants::math::SectorSpanRad; registry.fill(HIST("hInvMassZeeQAbg"), invMass, trackEle.pt, trackEle2.pt, trackEle.dcaxyTrk, trackEle2.dcaxyTrk, trackEle2.dcazTrk, trackEle.nclusterTPC, trackEle2.nclusterTPC, trackEle.nclusterITS, trackEle2.nclusterITS, sectorneg, sectorpos, trackEle.eop, trackEle2.eop, trackEle.energyIso, trackEle2.energyIso, trackEle.momIso, trackEle2.momIso, trackEle.ntrackIso, trackEle2.ntrackIso); } } } // bg e+e+ for (size_t i = 0; i < selectedPositronsIso.size(); ++i) { + const auto& trackPos = selectedPositronsIso[i]; + auto child1 = RecoDecayPtEtaPhi::pVector(trackPos.pt, trackPos.eta, trackPos.phi); + float sectorneg = trackPos.phi / o2::constants::math::SectorSpanRad; for (size_t j = i + 1; j < selectedPositronsIso.size(); ++j) { - const auto& trackPos = selectedPositronsIso[i]; const auto& trackPos2 = selectedPositronsIso[j]; - auto child1 = RecoDecayPtEtaPhi::pVector(trackPos.pt, trackPos.eta, trackPos.phi); auto child2 = RecoDecayPtEtaPhi::pVector(trackPos2.pt, trackPos2.eta, trackPos2.phi); + float sectorpos = trackPos2.phi / o2::constants::math::SectorSpanRad; double invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); if (invMass > massZMinQA) { - float sectorneg = trackPos.phi / o2::constants::math::SectorSpanRad; - float sectorpos = trackPos2.phi / o2::constants::math::SectorSpanRad; registry.fill(HIST("hInvMassZeeQAbg"), invMass, trackPos.pt, trackPos2.pt, trackPos.dcaxyTrk, trackPos2.dcaxyTrk, trackPos2.dcazTrk, trackPos.nclusterTPC, trackPos2.nclusterTPC, trackPos.nclusterITS, trackPos2.nclusterITS, sectorneg, sectorpos, trackPos.eop, trackPos2.eop, trackPos.energyIso, trackPos2.energyIso, trackPos.momIso, trackPos2.momIso, trackPos.ntrackIso, trackPos2.ntrackIso); } }