Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
fe7dfc6
Add files via upload
YazhenLin Mar 10, 2026
c51a7ce
Merge branch 'AliceO2Group:master' into master
YazhenLin Mar 10, 2026
63d41fe
Add files via upload
YazhenLin Mar 10, 2026
cd12616
Add files via upload
YazhenLin Mar 10, 2026
2858919
Add files via upload
YazhenLin Mar 10, 2026
33cd815
Merge branch 'AliceO2Group:master' into master
YazhenLin Mar 12, 2026
b09ee21
Add files via upload
YazhenLin Mar 12, 2026
d3696a1
Add files via upload
YazhenLin Mar 12, 2026
9583c87
Merge branch 'AliceO2Group:master' into master
YazhenLin Mar 19, 2026
3322f92
Add files via upload
YazhenLin Mar 19, 2026
6eed2dd
Add files via upload
YazhenLin Mar 19, 2026
14403e9
Add files via upload
YazhenLin Mar 19, 2026
872e6d7
Merge branch 'AliceO2Group:master' into master
YazhenLin Mar 20, 2026
98b8946
Add files via upload
YazhenLin Mar 20, 2026
af7ba2e
Add files via upload
YazhenLin Mar 20, 2026
03aa1ef
Add files via upload
YazhenLin Mar 20, 2026
6398a68
Merge branch 'AliceO2Group:master' into master
YazhenLin Mar 23, 2026
e0175c3
Add files via upload
YazhenLin Mar 23, 2026
721f2df
Merge branch 'AliceO2Group:master' into master
YazhenLin Apr 3, 2026
63684a9
Add files via upload
YazhenLin Apr 3, 2026
ba1cba1
Add files via upload
YazhenLin Apr 3, 2026
09bac32
Add files via upload
YazhenLin Apr 3, 2026
9160953
Add files via upload
YazhenLin Apr 3, 2026
d2bbf2e
Add files via upload
YazhenLin Apr 3, 2026
58eff73
Add files via upload
YazhenLin Apr 3, 2026
5bf3e44
Merge branch 'AliceO2Group:master' into master
YazhenLin Apr 5, 2026
6ec9d5e
Add files via upload
YazhenLin Apr 5, 2026
59b936f
Add files via upload
YazhenLin Apr 5, 2026
3fc9461
Add files via upload
YazhenLin Apr 5, 2026
8002e1e
Add files via upload
YazhenLin Apr 5, 2026
30ba410
Add files via upload
YazhenLin Apr 6, 2026
abc1f99
Add files via upload
YazhenLin Apr 6, 2026
bafca63
Add files via upload
YazhenLin Apr 6, 2026
45b2cbe
Add files via upload
YazhenLin Apr 9, 2026
d55ce86
Merge branch 'AliceO2Group:master' into master
YazhenLin Apr 10, 2026
b3f0fcf
Add files via upload
YazhenLin Apr 10, 2026
747c4a7
Merge branch 'AliceO2Group:master' into master
YazhenLin Apr 15, 2026
e287b8f
Merge remote-tracking branch 'upstream/master'
Apr 22, 2026
af9b76e
change
Apr 22, 2026
c6ac52f
del
YazhenLin Apr 22, 2026
10180cc
Delete
YazhenLin Apr 22, 2026
5b75eba
Delete
YazhenLin Apr 22, 2026
008030c
Delete
YazhenLin Apr 22, 2026
4b01793
Merge branch 'AliceO2Group:master' into master
YazhenLin Apr 23, 2026
4dc105f
Merge branch 'AliceO2Group:master' into master
YazhenLin Apr 23, 2026
ddc3ae7
Add files via upload
YazhenLin Apr 23, 2026
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
29 changes: 24 additions & 5 deletions PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
TString eventCutJSONStr = fConfigEventOptions.fConfigEventCutsJSON.value;
if (eventCutJSONStr != "") {
std::vector<AnalysisCut*> jsonCuts = dqcuts::GetCutsFromJSON(eventCutJSONStr.Data());
for (auto& cutIt : jsonCuts) {

Check failure on line 218 in PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
fEventCut->AddCut(cutIt);
}
}
Expand All @@ -233,7 +233,7 @@
TString trackCutsJSON = fConfigTrackOptions.fConfigTrackCutsJSON.value;
if (trackCutsJSON != "") {
std::vector<AnalysisCut*> addTrackCuts = dqcuts::GetCutsFromJSON(trackCutsJSON.Data());
for (auto& t : addTrackCuts) {

Check failure on line 236 in PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
fTrackCuts.push_back(reinterpret_cast<AnalysisCompositeCut*>(t));
fTrackCutNames.push_back(t->GetName());
trackCutStr += Form(",%s", t->GetName());
Expand Down Expand Up @@ -273,7 +273,7 @@
TString addMCSignalsStr = fConfigPairOptions.recSignalsJSON.value;
if (addMCSignalsStr != "") {
std::vector<MCSignal*> addMCSignals = dqmcsignals::GetMCSignalsFromJSON(addMCSignalsStr.Data());
for (auto& mcIt : addMCSignals) {

Check failure on line 276 in PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (mcIt->GetNProngs() != 2) { // NOTE: only 2 prong signals
continue;
}
Expand All @@ -285,7 +285,7 @@
TString addMCTripleSignalsStr = fConfigDileptonHadronOptions.fConfigMCRecSignalsJSON.value;
if (addMCTripleSignalsStr != "") {
std::vector<MCSignal*> addMCTripleSignals = dqmcsignals::GetMCSignalsFromJSON(addMCTripleSignalsStr.Data());
for (auto& mcIt : addMCTripleSignals) {

Check failure on line 288 in PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (mcIt->GetNProngs() != 3) {
LOG(fatal) << "Signal at reconstructed level requested (" << mcIt->GetName() << ") " << "does not have 3 prongs! Fix it";
}
Expand All @@ -306,7 +306,7 @@
TString hadronCutsJSON = fConfigDileptonHadronOptions.fConfigHadronCutsJSON.value;
if (hadronCutsJSON != "") {
std::vector<AnalysisCut*> addHadronCuts = dqcuts::GetCutsFromJSON(hadronCutsJSON.Data());
for (auto& t : addHadronCuts) {

Check failure on line 309 in PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
fHadronCuts.push_back(reinterpret_cast<AnalysisCompositeCut*>(t));
fHadronCutNames.push_back(t->GetName());
hadronCutStr += Form(",%s", t->GetName());
Expand All @@ -328,7 +328,7 @@
TString addMCSignalsGenStr = fConfigDileptonHadronOptions.fConfigMCGenSignalsJSON.value;
if (addMCSignalsGenStr != "") {
std::vector<MCSignal*> addMCSignals = dqmcsignals::GetMCSignalsFromJSON(addMCSignalsGenStr.Data());
for (auto& mcIt : addMCSignals) {

Check failure on line 331 in PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (mcIt->GetNProngs() > 2) { // NOTE: only 2 prong signals
continue;
}
Expand All @@ -350,7 +350,7 @@
TString addRecTrackSignalsGenStr = fConfigTrackOptions.fConfigMCRecTrackSignalsJSON.value;
if (addRecTrackSignalsGenStr != "") {
std::vector<MCSignal*> addMCRecTrackSignals = dqmcsignals::GetMCSignalsFromJSON(addRecTrackSignalsGenStr.Data());
for (auto& mcIt : addMCRecTrackSignals) {

Check failure on line 353 in PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (mcIt->GetNProngs() > 2) { // NOTE: only 2 prong signals
continue;
}
Expand All @@ -374,11 +374,11 @@
TString histClasses = "AssocsBarrel_BeforeCuts;";
// Configure histogram classes for each track cut;
// Add histogram classes for each track cut and for each requested MC signal (reconstructed tracks with MC truth)
for (auto& cut : fTrackCuts) {

Check failure on line 377 in PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
TString nameStr = Form("AssocsBarrel_%s", cut->GetName());
fHistNamesReco.push_back(nameStr);
histClasses += Form("%s;", nameStr.Data());
for (auto& sig : fRecMCTrackSignals) {

Check failure on line 381 in PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
TString nameStr2 = Form("AssocsBarrelMatched_%s_%s", cut->GetName(), sig->GetName());
fHistNamesMCMatched.push_back(nameStr2);
histClasses += Form("%s;", nameStr2.Data());
Expand All @@ -401,7 +401,7 @@
Form("PairsBarrelSEPM_%s", objArray->At(icut)->GetName()),
Form("PairsBarrelSEPP_%s", objArray->At(icut)->GetName()),
Form("PairsBarrelSEMM_%s", objArray->At(icut)->GetName())};
for (auto& n : names) {

Check failure on line 404 in PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
histNames += Form("%s;", n.Data());
}
fTrackHistNames[icut] = names;
Expand Down Expand Up @@ -475,6 +475,23 @@
LOG(fatal) << "Problem getting histograms from the TList object with efficiencies!";
}
}

float GetSafeInterpolationWeight(TH2* hEff, float x, float y)
{
if (!hEff)
return 1.0;
float minX = hEff->GetXaxis()->GetBinCenter(1);
float maxX = hEff->GetXaxis()->GetBinCenter(hEff->GetXaxis()->GetNbins());

float minY = hEff->GetYaxis()->GetBinCenter(1);
float maxY = hEff->GetYaxis()->GetBinCenter(hEff->GetYaxis()->GetNbins());

float safeX = std::max(minX, std::min(x, maxX));
float safeY = std::max(minY, std::min(y, maxY));

return hEff->Interpolate(safeX, safeY);
}

template <bool MixedEvent, uint32_t TTrackFillMap, typename TTrack1, typename TTrack2, typename THadron, typename TEvent>
void runDileptonHadron(TTrack1 const& track1, TTrack2 const& track2, int iEleCut,
THadron const& hadron, TEvent const& event, aod::McParticles const& /*mcParticles*/)
Expand Down Expand Up @@ -503,16 +520,18 @@
float Effweight_rec = 1.0f;
float Accweight_gen = 1.0f;
if (fConfigDileptonHadronOptions.fConfigApplyEfficiency) {
float dilepton_pt = VarManager::fgValues[VarManager::kPt];
float dilepton_eta = VarManager::fgValues[VarManager::kEta];
float dilepton_phi = VarManager::fgValues[VarManager::kPhi];
float dilepton_rap = VarManager::fgValues[VarManager::kRap];
float hadron_eta = hadron.eta();
float hadron_phi = hadron.phi();
float deltaphi = RecoDecay::constrainAngle(dilepton_phi - hadron_phi, -0.5 * o2::constants::math::PI);
Effweight_rec = hAcceptance_rec->Interpolate(dilepton_eta - hadron_eta, deltaphi);
Accweight_gen = hAcceptance_gen->Interpolate(dilepton_eta - hadron_eta, deltaphi);
float Effdilepton = hEfficiency_dilepton->Interpolate(VarManager::fgValues[VarManager::kPt], dilepton_eta);
float Masswindow = hMasswindow->Interpolate(VarManager::fgValues[VarManager::kPt]);
float Effhadron = hEfficiency_hadron->Interpolate(hadron.pt(), hadron.eta());
float Effweight_rec = GetSafeInterpolationWeight(hAcceptance_rec, dilepton_eta - hadron_eta, deltaphi);
float Accweight_gen = GetSafeInterpolationWeight(hAcceptance_gen, dilepton_eta - hadron_eta, deltaphi);
float Effdilepton = GetSafeInterpolationWeight(hEfficiency_dilepton, dilepton_rap, dilepton_pt);
float Effhadron = GetSafeInterpolationWeight(hEfficiency_hadron, hadron.pt(), hadron_eta);
float Masswindow = hMasswindow->Interpolate(dilepton_pt);
Accweight_gen = Accweight_gen * Effdilepton * Effhadron;
if (fConfigDileptonHadronOptions.fConfigApplyEfficiencyME) {
Effweight_rec = Effdilepton * Effhadron * Masswindow; // for the moment, apply the efficiency correction also for the mixed event pairs, but this can be changed in case we want to apply it only for the same event pairs
Expand Down
28 changes: 22 additions & 6 deletions PWGDQ/Tasks/tableReader_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3770,6 +3770,22 @@ struct AnalysisDileptonTrack {
}
}

float GetSafeInterpolationWeight(TH2* hEff, float x, float y)
{
if (!hEff)
return 1.0;
float minX = hEff->GetXaxis()->GetBinCenter(1);
float maxX = hEff->GetXaxis()->GetBinCenter(hEff->GetXaxis()->GetNbins());

float minY = hEff->GetYaxis()->GetBinCenter(1);
float maxY = hEff->GetYaxis()->GetBinCenter(hEff->GetYaxis()->GetNbins());

float safeX = std::max(minX, std::min(x, maxX));
float safeY = std::max(minY, std::min(y, maxY));

return hEff->Interpolate(safeX, safeY);
}

// Template function to run pair - hadron combinations
template <int TCandidateType, uint32_t TEventFillMap, uint32_t TTrackFillMap, typename TEvent, typename TTracks, typename TTrackAssocs, typename TDileptons>
void runDileptonHadron(TEvent const& event, TTrackAssocs const& assocs, TTracks const& tracks, TDileptons const& dileptons)
Expand Down Expand Up @@ -3853,10 +3869,10 @@ struct AnalysisDileptonTrack {
float hadron_eta = track.eta();
float hadron_phi = track.phi();
float deltaphi = RecoDecay::constrainAngle(dilepton_phi - hadron_phi, -0.5 * o2::constants::math::PI);
Effweight_rec = hAcceptance_rec->Interpolate(dilepton_eta - hadron_eta, deltaphi);
float Effdilepton = hEfficiency_dilepton->Interpolate(dilepton.pt(), dilepton_eta);
Effweight_rec = GetSafeInterpolationWeight(hAcceptance_rec, dilepton_eta - hadron_eta, deltaphi);
float Effdilepton = GetSafeInterpolationWeight(hEfficiency_dilepton, dilepton.rap(), dilepton.pt());
float Effhadron = GetSafeInterpolationWeight(hEfficiency_hadron, track.eta(), track.pt());
float Masswindow = hMasswindow->Interpolate(dilepton.pt());
float Effhadron = hEfficiency_hadron->Interpolate(track.pt(), hadron_eta);
Effweight_rec = Effweight_rec * Effdilepton * Effhadron * Masswindow;
}
std::vector<float> fTransRange = fConfigTransRange;
Expand Down Expand Up @@ -4087,10 +4103,10 @@ struct AnalysisDileptonTrack {
float hadron_eta = track.eta();
float hadron_phi = track.phi();
float deltaphi = RecoDecay::constrainAngle(dilepton_phi - hadron_phi, -0.5 * o2::constants::math::PI);
Effweight_rec = hAcceptance_rec->Interpolate(dilepton_eta - hadron_eta, deltaphi);
float Effdilepton = hEfficiency_dilepton->Interpolate(dilepton.pt(), dilepton_eta);
Effweight_rec = GetSafeInterpolationWeight(hAcceptance_rec, dilepton_eta - hadron_eta, deltaphi);
float Effdilepton = GetSafeInterpolationWeight(hEfficiency_dilepton, dilepton.rap(), dilepton.pt());
float Effhadron = GetSafeInterpolationWeight(hEfficiency_hadron, track.eta(), track.pt());
float Masswindow = hMasswindow->Interpolate(dilepton.pt());
float Effhadron = hEfficiency_hadron->Interpolate(track.pt(), hadron_eta);
if (fConfigApplyEfficiencyME) {
Effweight_rec = Effdilepton * Effhadron * Masswindow; // for the moment, apply the efficiency correction also for the mixed event pairs, but this can be changed in case we want to apply it only for the same event pairs
} else {
Expand Down
Loading