Skip to content
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4fd72ee
implememted Z-h correlation
sashingo Jul 7, 2025
32c1341
fixed O2 linter error
sashingo Jul 7, 2025
187dfc9
fixed O2 linter errors
sashingo Jul 7, 2025
1101165
implemetned comments by Vit
sashingo Jul 7, 2025
e6d27cc
revert the changes
sashingo Jul 7, 2025
ae09c84
minor corrections
sashingo Jul 8, 2025
3033f8d
modified some name of parameters
sashingo Jul 8, 2025
a7ceea5
fixed O2 linter errors
sashingo Jul 8, 2025
8483257
implemented comment
sashingo Jul 9, 2025
2dddc15
adding missing braces
sashingo Jul 10, 2025
da8c3f8
Merge branch 'AliceO2Group:master' into master
sashingo Jul 14, 2025
c934352
Merge branch 'AliceO2Group:master' into master
sashingo Jul 15, 2025
8a9aab4
included charge info in histogrmas for Z measurement
sashingo Jul 15, 2025
c3b7601
changed name of axis for Z pt histogram
sashingo Jul 15, 2025
144dfe4
changed TH1F to TH1D for histograms of event counters
sashingo Jul 16, 2025
7ca039a
Merge branch 'AliceO2Group:master' into master
sashingo Jul 20, 2025
953b290
updated to check eID
sashingo Jul 29, 2025
964a2ed
Merge branch 'AliceO2Group:master' into master
sashingo Jul 29, 2025
37da52b
changed ptZeeCorrfac to ptEleCorrfac
sashingo Jul 29, 2025
5136521
Update taskElectronWeakBoson.cxx
sashingo Jul 30, 2025
f80040b
Update taskElectronWeakBoson.cxx
sashingo Jul 30, 2025
73b8dc1
Merge branch 'AliceO2Group:master' into master
sashingo Aug 4, 2025
347ac46
Merge branch 'AliceO2Group:master' into master
sashingo Aug 4, 2025
f0ceaa4
Merge branch 'AliceO2Group:master' into master
sashingo Aug 6, 2025
b66b4d7
Merge branch 'AliceO2Group:master' into master
sashingo Aug 11, 2025
6192bf7
add centrality selection, and calculate pT ratio in Z-h analysis
sashingo Aug 11, 2025
1383ef6
updated with suggestions
sashingo Aug 11, 2025
1a99e9f
Update PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx
sashingo Aug 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 43 additions & 18 deletions PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -58,6 +61,7 @@
using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::hf_centrality;

struct HfTaskElectronWeakBoson {

Expand Down Expand Up @@ -121,6 +125,12 @@ struct HfTaskElectronWeakBoson {
Configurable<int> kfConstructMethod{"kfConstructMethod", 2, "KF Construct Method"};
Configurable<int> chiSqNdfMax{"chiSqNdfMax", 10, "Chi2 Max for mass reco by KF particle"};

// Centrality estimator configuration
Configurable<int> centralityEstimator{"centralityEstimator", CentralityEstimator::FT0M, "Centrality estimator. See CentralityEstimator for valid values."};
Configurable<bool> enableCentralityAnalysis{"enableCentralityAnalysis", true, "Enable centrality-dependent analysis"};
Configurable<float> centralityMin{"centralityMin", -1, "minimum cut on centrality selection"};
Configurable<float> centralityMax{"centralityMax", 101, "maximum cut on centrality selection"};

// CCDB service object
Service<o2::ccdb::BasicCCDBManager> ccdb;

Expand All @@ -142,7 +152,7 @@ struct HfTaskElectronWeakBoson {
: pt(ptr), eta(e), phi(ph), mass(m), ptchild0(ptzee0), ptchild1(ptzee1), charge(ch) {}
};
std::vector<HfZeeCandidate> reconstructedZ;

using CollisionsWithCent = soa::Join<aod::Collisions, aod::CentFT0As, aod::CentFT0Cs, aod::CentFT0Ms, aod::CentFV0As>;
using SelectedClusters = o2::aod::EMCALClusters;
// PbPb
// using TrackEle = o2::soa::Join<o2::aod::Tracks, o2::aod::FullTracks, o2::aod::TracksExtra, o2::aod::TracksDCA, o2::aod::TrackSelection, o2::aod::pidTPCFullEl>;
Expand Down Expand Up @@ -186,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<int>(centralityEstimator.value));
}

// add configurable for CCDB path
zorro.setBaseCCDBPath(cfgCCDBPath.value);
Expand Down Expand Up @@ -217,11 +231,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", 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});
Expand All @@ -243,15 +260,13 @@ 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
Expand Down Expand Up @@ -323,6 +338,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;
}
Expand All @@ -344,6 +362,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;
Expand All @@ -362,17 +382,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(),
Expand All @@ -384,7 +396,8 @@ struct HfTaskElectronWeakBoson {
}
}

void process(soa::Filtered<aod::Collisions>::iterator const& collision,
// void process(soa::Filtered<aod::Collisions>::iterator const& collision,
void process(soa::Filtered<CollisionsWithCent>::iterator const& collision,
aod::BCsWithTimestamps const&,
SelectedClusters const& emcClusters,
TrackEle const& tracks,
Expand Down Expand Up @@ -446,6 +459,16 @@ struct HfTaskElectronWeakBoson {

registry.fill(HIST("hZvtx"), collision.posZ());

// Calculate centrality
if (enableCentralityAnalysis) {
float centrality = o2::hf_centrality::getCentralityColl(collision, centralityEstimator);
// 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) {
Expand Down Expand Up @@ -562,8 +585,9 @@ struct HfTaskElectronWeakBoson {
}
// LOG(info) << "E/p" << eop;
registry.fill(HIST("hEopNsigTPC"), match.track_as<TrackEle>().tpcNSigmaEl(), eop);
if (match.emcalcluster_as<SelectedClusters>().m02() < m02Min || match.emcalcluster_as<SelectedClusters>().m02() > m02Max)
if (match.emcalcluster_as<SelectedClusters>().m02() < m02Min || match.emcalcluster_as<SelectedClusters>().m02() > m02Max) {
continue;
}

if (match.track_as<TrackEle>().tpcNSigmaEl() > nsigTpcMin && match.track_as<TrackEle>().tpcNSigmaEl() < nsigTpcMax) {
registry.fill(HIST("hEop"), match.track_as<TrackEle>().pt(), eop);
Expand Down Expand Up @@ -624,7 +648,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
Expand Down
Loading