Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion PWGEM/Dilepton/DataModel/dileptonTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ DECLARE_SOA_TABLE(EMAmbiguousMuonSelfIds, "AOD", "EMAMBMUSELFID", emprimarymuon:
// iterators
using EMAmbiguousMuonSelfId = EMAmbiguousMuonSelfIds::iterator;

DECLARE_SOA_TABLE(EMGlobalMuonSelfIds_000, "AOD", "EMGLMUSELFID", emprimarymuon::GlobalMuonsWithSameMFTIds); // To be joined with EMPrimaryMuons table at analysis level.
DECLARE_SOA_TABLE(EMGlobalMuonSelfIds_000, "AOD", "EMGLMUSELFID", emprimarymuon::GlobalMuonsWithSameMFTIds); // To be joined with EMPrimaryMuons table at analysis level.
DECLARE_SOA_TABLE_VERSIONED(EMGlobalMuonSelfIds_001, "AOD", "EMGLMUSELFID", 1, emprimarymuon::GlobalMuonsWithSameMCHMIDIds, emprimarymuon::GlobalMuonsWithSameMFTIds); // To be joined with EMPrimaryMuons table at analysis level.
using EMGlobalMuonSelfIds = EMGlobalMuonSelfIds_001;
// iterators
Expand Down
34 changes: 17 additions & 17 deletions PWGEM/Dilepton/Utils/EMTrackUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,24 +164,24 @@ bool isBestMatch(TTrack const& track, TCut const& cut, TTracks const& tracks)
}
map_chi2MCHMFT.clear();

// find best global muon per MCH-MID tracks. Keep in mind that there are 5 global muons per MCH-MID in pp/OO and 20 global muons per MCH-MID in PbPb.
map_chi2MCHMFT[track.globalIndex()] = track.chi2MatchMCHMFT(); // add myself
for (const auto& glmuonId : track.globalMuonsWithSameMCHMIDIds()) {
auto candidate = tracks.rawIteratorAt(glmuonId);
if (candidate.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && candidate.emeventId() == track.emeventId() && candidate.mfttrackId() != track.mfttrackId()) {
if (cut.template IsSelectedTrack<is_wo_acc>(candidate)) {
map_chi2MCHMFT[candidate.globalIndex()] = candidate.chi2MatchMCHMFT();
}
}
} // end of glmuonId
// find best global muon per MCH-MID tracks. Keep in mind that there are 5 global muons per MCH-MID in pp/OO and 20 global muons per MCH-MID in PbPb.
map_chi2MCHMFT[track.globalIndex()] = track.chi2MatchMCHMFT(); // add myself
for (const auto& glmuonId : track.globalMuonsWithSameMCHMIDIds()) {
auto candidate = tracks.rawIteratorAt(glmuonId);
if (candidate.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && candidate.emeventId() == track.emeventId() && candidate.mfttrackId() != track.mfttrackId()) {
if (cut.template IsSelectedTrack<is_wo_acc>(candidate)) {
map_chi2MCHMFT[candidate.globalIndex()] = candidate.chi2MatchMCHMFT();
}
}
} // end of glmuonId

auto it1 = std::min_element(map_chi2MCHMFT.begin(), map_chi2MCHMFT.end(), [](decltype(map_chi2MCHMFT)::value_type& l, decltype(map_chi2MCHMFT)::value_type& r) -> bool { return l.second < r.second; }); // search for minimum matching-chi2
if (it1->first == track.globalIndex()) {
isBestFromMCHMID2MFT = true;
} else {
isBestFromMCHMID2MFT = false;
}
map_chi2MCHMFT.clear();
auto it1 = std::min_element(map_chi2MCHMFT.begin(), map_chi2MCHMFT.end(), [](decltype(map_chi2MCHMFT)::value_type& l, decltype(map_chi2MCHMFT)::value_type& r) -> bool { return l.second < r.second; }); // search for minimum matching-chi2
if (it1->first == track.globalIndex()) {
isBestFromMCHMID2MFT = true;
} else {
isBestFromMCHMID2MFT = false;
}
map_chi2MCHMFT.clear();

return isBestFromMCHMID2MFT && isBestFromMFT2MCHMID;
} else {
Expand Down
Loading