Skip to content
Merged
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
26 changes: 19 additions & 7 deletions PWGEM/Dilepton/Core/DileptonMC.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,9 @@
o2::framework::Configurable<float> cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"};
o2::framework::Configurable<bool> requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"};
o2::framework::Configurable<std::vector<int>> requiredMFTDisks{"requiredMFTDisks", std::vector<int>{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"};
o2::framework::Configurable<bool> acceptOnlyCorrectMatch{"acceptOnlyCorrectMatch", false, "flag to accept only correct match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data.
o2::framework::Configurable<bool> acceptOnlyWrongMatch{"acceptOnlyWrongMatch", false, "flag to accept only wrong match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data.
o2::framework::Configurable<bool> acceptOnlyCorrectMatch{"acceptOnlyCorrectMatch", false, "flag to accept only correct match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data.
o2::framework::Configurable<bool> acceptOnlyWrongMatch{"acceptOnlyWrongMatch", false, "flag to accept only wrong match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data.
o2::framework::Configurable<bool> acceptOnlyXORMatching{"acceptOnlyXORMatching", false, "flag to accept only correct-wrong XOR pairs between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data.
} dimuoncuts;

o2::aod::rctsel::RCTFlagsChecker rctChecker;
Expand Down Expand Up @@ -625,12 +626,12 @@
DefineDielectronCut();
leptonM1 = o2::constants::physics::MassElectron;
leptonM2 = o2::constants::physics::MassElectron;
pdg_lepton = 11;

Check failure on line 629 in PWGEM/Dilepton/Core/DileptonMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
} else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) {
DefineDimuonCut();
leptonM1 = o2::constants::physics::MassMuon;
leptonM2 = o2::constants::physics::MassMuon;
pdg_lepton = 13;

Check failure on line 634 in PWGEM/Dilepton/Core/DileptonMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
}
if (doprocessNorm) {
fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter");
Expand Down Expand Up @@ -922,7 +923,7 @@
}

if (dilepton_source_types[sourceId].find("ccbar") != std::string_view::npos && cfgFillSeparateCharmHadronPairs) {
if (std::abs(pdgMotherC1) == 411 && std::abs(pdgMotherC2) == 411) {

Check failure on line 926 in PWGEM/Dilepton/Core/DileptonMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
if (sign1 * sign2 < 0) { // ULS
fRegistry.fill(HIST("Generated/ccbar/Dplus_Dminus/uls/hs"), mass, pt, rapidity, dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, dphi_e_ee, weight);
} else if (sign1 > 0 && sign2 > 0) { // LS++
Expand All @@ -930,7 +931,7 @@
} else if (sign1 < 0 && sign2 < 0) { // LS--
fRegistry.fill(HIST("Generated/ccbar/Dplus_Dminus/lsmm/hs"), mass, pt, rapidity, dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, dphi_e_ee, weight);
}
} else if (std::abs(pdgMotherC1) == 421 && std::abs(pdgMotherC2) == 421) {

Check failure on line 934 in PWGEM/Dilepton/Core/DileptonMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
if (sign1 * sign2 < 0) { // ULS
fRegistry.fill(HIST("Generated/ccbar/D0_D0bar/uls/hs"), mass, pt, rapidity, dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, dphi_e_ee, weight);
} else if (sign1 > 0 && sign2 > 0) { // LS++
Expand All @@ -938,7 +939,7 @@
} else if (sign1 < 0 && sign2 < 0) { // LS--
fRegistry.fill(HIST("Generated/ccbar/D0_D0bar/lsmm/hs"), mass, pt, rapidity, dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, dphi_e_ee, weight);
}
} else if (std::abs(pdgMotherC1) == 431 && std::abs(pdgMotherC2) == 431) {

Check failure on line 942 in PWGEM/Dilepton/Core/DileptonMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
if (sign1 * sign2 < 0) { // ULS
fRegistry.fill(HIST("Generated/ccbar/Dsplus_Dsminus/uls/hs"), mass, pt, rapidity, dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, dphi_e_ee, weight);
} else if (sign1 > 0 && sign2 > 0) { // LS++
Expand All @@ -946,7 +947,7 @@
} else if (sign1 < 0 && sign2 < 0) { // LS--
fRegistry.fill(HIST("Generated/ccbar/Dsplus_Dsminus/lsmm/hs"), mass, pt, rapidity, dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, dphi_e_ee, weight);
}
} else if ((std::abs(pdgMotherC1) == 411 && std::abs(pdgMotherC2) == 421) || (std::abs(pdgMotherC2) == 411 && std::abs(pdgMotherC1) == 421)) {

Check failure on line 950 in PWGEM/Dilepton/Core/DileptonMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
if (sign1 * sign2 < 0) { // ULS
fRegistry.fill(HIST("Generated/ccbar/Dpm_D0/uls/hs"), mass, pt, rapidity, dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, dphi_e_ee, weight);
} else if (sign1 > 0 && sign2 > 0) { // LS++
Expand All @@ -954,7 +955,7 @@
} else if (sign1 < 0 && sign2 < 0) { // LS--
fRegistry.fill(HIST("Generated/ccbar/Dpm_D0/lsmm/hs"), mass, pt, rapidity, dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, dphi_e_ee, weight);
}
} else if ((std::abs(pdgMotherC1) == 411 && std::abs(pdgMotherC2) == 431) || (std::abs(pdgMotherC2) == 411 && std::abs(pdgMotherC1) == 431)) {

Check failure on line 958 in PWGEM/Dilepton/Core/DileptonMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
if (sign1 * sign2 < 0) { // ULS
fRegistry.fill(HIST("Generated/ccbar/Dpm_Dspm/uls/hs"), mass, pt, rapidity, dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, dphi_e_ee, weight);
} else if (sign1 > 0 && sign2 > 0) { // LS++
Expand All @@ -962,7 +963,7 @@
} else if (sign1 < 0 && sign2 < 0) { // LS--
fRegistry.fill(HIST("Generated/ccbar/Dpm_Dspm/lsmm/hs"), mass, pt, rapidity, dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, dphi_e_ee, weight);
}
} else if ((std::abs(pdgMotherC1) == 421 && std::abs(pdgMotherC2) == 431) || (std::abs(pdgMotherC2) == 421 && std::abs(pdgMotherC1) == 431)) {

Check failure on line 966 in PWGEM/Dilepton/Core/DileptonMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
if (sign1 * sign2 < 0) { // ULS
fRegistry.fill(HIST("Generated/ccbar/D0_Dspm/uls/hs"), mass, pt, rapidity, dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, dphi_e_ee, weight);
} else if (sign1 > 0 && sign2 > 0) { // LS++
Expand All @@ -970,7 +971,7 @@
} else if (sign1 < 0 && sign2 < 0) { // LS--
fRegistry.fill(HIST("Generated/ccbar/D0_Dspm/lsmm/hs"), mass, pt, rapidity, dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, dphi_e_ee, weight);
}
} else if (std::abs(pdgMotherC1) == 4122 && std::abs(pdgMotherC2) == 4122) {

Check failure on line 974 in PWGEM/Dilepton/Core/DileptonMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
if (sign1 * sign2 < 0) { // ULS
fRegistry.fill(HIST("Generated/ccbar/Lcplus_Lcminus/uls/hs"), mass, pt, rapidity, dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, dphi_e_ee, weight);
} else if (sign1 > 0 && sign2 > 0) { // LS++
Expand All @@ -978,7 +979,7 @@
} else if (sign1 < 0 && sign2 < 0) { // LS--
fRegistry.fill(HIST("Generated/ccbar/Lcplus_Lcminus/lsmm/hs"), mass, pt, rapidity, dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, dphi_e_ee, weight);
}
} else if (std::abs(pdgMotherC1) == 4232 && std::abs(pdgMotherC2) == 4232) {

Check failure on line 982 in PWGEM/Dilepton/Core/DileptonMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
if (sign1 * sign2 < 0) { // ULS
fRegistry.fill(HIST("Generated/ccbar/Xicplus_Xicminus/uls/hs"), mass, pt, rapidity, dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, dphi_e_ee, weight);
} else if (sign1 > 0 && sign2 > 0) { // LS++
Expand Down Expand Up @@ -1436,22 +1437,33 @@
// if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch<false>(t2, cut, tracks)) {
// return false;
// }

bool isCorrectMatch1 = t1.emmcparticleId() == t1.emmftmcparticleId();
bool isCorrectMatch2 = t2.emmcparticleId() == t2.emmftmcparticleId();

if (dimuoncuts.acceptOnlyCorrectMatch) {
if (t1.trackType() == static_cast<uint8_t>(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) && t1.emmcparticleId() != t1.emmftmcparticleId()) {
if (t1.trackType() == static_cast<uint8_t>(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) && !isCorrectMatch1) {
return false;
}
if (t2.trackType() == static_cast<uint8_t>(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) && t2.emmcparticleId() != t2.emmftmcparticleId()) {
if (t2.trackType() == static_cast<uint8_t>(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) && !isCorrectMatch2) {
return false;
}
}
if (dimuoncuts.acceptOnlyWrongMatch) { // reject correctly matched MFT-MCH-MID for bkg estimation
if (t1.trackType() == static_cast<uint8_t>(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) && t1.emmcparticleId() == t1.emmftmcparticleId()) {
if (dimuoncuts.acceptOnlyWrongMatch) {
if (t1.trackType() == static_cast<uint8_t>(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) && isCorrectMatch1) {
return false;
}
if (t2.trackType() == static_cast<uint8_t>(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) && t2.emmcparticleId() == t2.emmftmcparticleId()) {
if (t2.trackType() == static_cast<uint8_t>(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) && isCorrectMatch2) {
return false;
}
}
if (dimuoncuts.acceptOnlyXORMatching) { // this is dummy comment.
if (t1.trackType() == static_cast<uint8_t>(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) && t2.trackType() == static_cast<uint8_t>(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack)) {
if (!(isCorrectMatch1 ^ isCorrectMatch2)) {
return false;
}
}
}

if (!cut.IsSelectedPair(t1, t2)) {
return false;
Expand Down
Loading