From 4fd72eed23ac2c9e7540ab19bac7063464b071b7 Mon Sep 17 00:00:00 2001 From: Shingo Sakai Date: Mon, 7 Jul 2025 14:35:17 +0900 Subject: [PATCH 01/20] 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/20] 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/20] 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/20] 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/20] 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/20] 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/20] 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/20] 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/20] 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/20] 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/20] 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/20] 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/20] 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/20] 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/20] 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/20] 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/20] 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/20] 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/20] 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/20] 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"};