Skip to content

Commit 5912d93

Browse files
mcoquet642Maurice Coquet
andauthored
[PWGDQ] Fixing event mixing for dimuons (#14124)
Co-authored-by: Maurice Coquet <mcoquet@alicecerno2.cern.ch>
1 parent b57a1fd commit 5912d93

File tree

1 file changed

+62
-50
lines changed

1 file changed

+62
-50
lines changed

PWGDQ/Tasks/tableReader_withAssoc.cxx

Lines changed: 62 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,14 +1984,16 @@ struct AnalysisSameEventPairing {
19841984
PromptNonPromptSepTable(VarManager::fgValues[VarManager::kMass], VarManager::fgValues[VarManager::kPt], VarManager::fgValues[VarManager::kVertexingTauxyProjected], VarManager::fgValues[VarManager::kVertexingTauxyProjectedPoleJPsiMass], VarManager::fgValues[VarManager::kVertexingTauzProjected], isAmbiInBunch, isAmbiOutOfBunch, VarManager::fgValues[VarManager::kMultFT0A], VarManager::fgValues[VarManager::kMultFT0C], VarManager::fgValues[VarManager::kCentFT0M], VarManager::fgValues[VarManager::kVtxNcontribReal]);
19851985
if constexpr (TPairType == VarManager::kDecayToMuMu) {
19861986
fHistMan->FillHistClass(histNames[icut][0].Data(), VarManager::fgValues);
1987-
if (isAmbiInBunch) {
1988-
fHistMan->FillHistClass(histNames[icut][3 + histIdxOffset].Data(), VarManager::fgValues);
1989-
}
1990-
if (isAmbiOutOfBunch) {
1991-
fHistMan->FillHistClass(histNames[icut][3 + histIdxOffset + 3].Data(), VarManager::fgValues);
1992-
}
1993-
if (isUnambiguous) {
1994-
fHistMan->FillHistClass(histNames[icut][3 + histIdxOffset + 6].Data(), VarManager::fgValues);
1987+
if (fConfigAmbiguousMuonHistograms) {
1988+
if (isAmbiInBunch) {
1989+
fHistMan->FillHistClass(histNames[icut][3 + histIdxOffset].Data(), VarManager::fgValues);
1990+
}
1991+
if (isAmbiOutOfBunch) {
1992+
fHistMan->FillHistClass(histNames[icut][3 + histIdxOffset + 3].Data(), VarManager::fgValues);
1993+
}
1994+
if (isUnambiguous) {
1995+
fHistMan->FillHistClass(histNames[icut][3 + histIdxOffset + 6].Data(), VarManager::fgValues);
1996+
}
19951997
}
19961998
}
19971999
if constexpr (TPairType == VarManager::kDecayToEE) {
@@ -2004,14 +2006,16 @@ struct AnalysisSameEventPairing {
20042006
if (sign1 > 0) {
20052007
if constexpr (TPairType == VarManager::kDecayToMuMu) {
20062008
fHistMan->FillHistClass(histNames[icut][1].Data(), VarManager::fgValues);
2007-
if (isAmbiInBunch) {
2008-
fHistMan->FillHistClass(histNames[icut][4 + histIdxOffset].Data(), VarManager::fgValues);
2009-
}
2010-
if (isAmbiOutOfBunch) {
2011-
fHistMan->FillHistClass(histNames[icut][4 + histIdxOffset + 3].Data(), VarManager::fgValues);
2012-
}
2013-
if (isUnambiguous) {
2014-
fHistMan->FillHistClass(histNames[icut][4 + histIdxOffset + 6].Data(), VarManager::fgValues);
2009+
if (fConfigAmbiguousMuonHistograms) {
2010+
if (isAmbiInBunch) {
2011+
fHistMan->FillHistClass(histNames[icut][4 + histIdxOffset].Data(), VarManager::fgValues);
2012+
}
2013+
if (isAmbiOutOfBunch) {
2014+
fHistMan->FillHistClass(histNames[icut][4 + histIdxOffset + 3].Data(), VarManager::fgValues);
2015+
}
2016+
if (isUnambiguous) {
2017+
fHistMan->FillHistClass(histNames[icut][4 + histIdxOffset + 6].Data(), VarManager::fgValues);
2018+
}
20152019
}
20162020
}
20172021
if constexpr (TPairType == VarManager::kDecayToEE) {
@@ -2023,14 +2027,16 @@ struct AnalysisSameEventPairing {
20232027
} else {
20242028
if constexpr (TPairType == VarManager::kDecayToMuMu) {
20252029
fHistMan->FillHistClass(histNames[icut][2].Data(), VarManager::fgValues);
2026-
if (isAmbiInBunch) {
2027-
fHistMan->FillHistClass(histNames[icut][5 + histIdxOffset].Data(), VarManager::fgValues);
2028-
}
2029-
if (isAmbiOutOfBunch) {
2030-
fHistMan->FillHistClass(histNames[icut][5 + histIdxOffset + 3].Data(), VarManager::fgValues);
2031-
}
2032-
if (isUnambiguous) {
2033-
fHistMan->FillHistClass(histNames[icut][5 + histIdxOffset + 6].Data(), VarManager::fgValues);
2030+
if (fConfigAmbiguousMuonHistograms) {
2031+
if (isAmbiInBunch) {
2032+
fHistMan->FillHistClass(histNames[icut][5 + histIdxOffset].Data(), VarManager::fgValues);
2033+
}
2034+
if (isAmbiOutOfBunch) {
2035+
fHistMan->FillHistClass(histNames[icut][5 + histIdxOffset + 3].Data(), VarManager::fgValues);
2036+
}
2037+
if (isUnambiguous) {
2038+
fHistMan->FillHistClass(histNames[icut][5 + histIdxOffset + 6].Data(), VarManager::fgValues);
2039+
}
20342040
}
20352041
}
20362042
if constexpr (TPairType == VarManager::kDecayToEE) {
@@ -2094,9 +2100,9 @@ struct AnalysisSameEventPairing {
20942100
}
20952101
auto t1 = a1.template reducedmuon_as<TTracks1>();
20962102
auto t2 = a2.template reducedmuon_as<TTracks2>();
2097-
if (t1.matchMCHTrackId() == t2.matchMCHTrackId())
2103+
if (t1.matchMCHTrackId() == t2.matchMCHTrackId() && t1.matchMCHTrackId() >= 0)
20982104
continue;
2099-
if (t1.matchMFTTrackId() == t2.matchMFTTrackId())
2105+
if (t1.matchMFTTrackId() == t2.matchMFTTrackId() && t1.matchMCHTrackId() >= 0)
21002106
continue;
21012107
VarManager::FillPairME<TEventFillMap, TPairType>(t1, t2);
21022108
if constexpr ((TEventFillMap & VarManager::ObjTypes::ReducedEventQvector) > 0) {
@@ -2165,14 +2171,16 @@ struct AnalysisSameEventPairing {
21652171
if (pairSign == 0) {
21662172
if constexpr (TPairType == VarManager::kDecayToMuMu) {
21672173
fHistMan->FillHistClass(histNames[icut][3].Data(), VarManager::fgValues);
2168-
if (isAmbiInBunch) {
2169-
fHistMan->FillHistClass(histNames[icut][15].Data(), VarManager::fgValues);
2170-
}
2171-
if (isAmbiOutOfBunch) {
2172-
fHistMan->FillHistClass(histNames[icut][18].Data(), VarManager::fgValues);
2173-
}
2174-
if (isUnambiguous) {
2175-
fHistMan->FillHistClass(histNames[icut][21].Data(), VarManager::fgValues);
2174+
if (fConfigAmbiguousMuonHistograms) {
2175+
if (isAmbiInBunch) {
2176+
fHistMan->FillHistClass(histNames[icut][15].Data(), VarManager::fgValues);
2177+
}
2178+
if (isAmbiOutOfBunch) {
2179+
fHistMan->FillHistClass(histNames[icut][18].Data(), VarManager::fgValues);
2180+
}
2181+
if (isUnambiguous) {
2182+
fHistMan->FillHistClass(histNames[icut][21].Data(), VarManager::fgValues);
2183+
}
21762184
}
21772185
}
21782186
if constexpr (TPairType == VarManager::kDecayToEE) {
@@ -2182,14 +2190,16 @@ struct AnalysisSameEventPairing {
21822190
if (pairSign > 0) {
21832191
if constexpr (TPairType == VarManager::kDecayToMuMu) {
21842192
fHistMan->FillHistClass(histNames[icut][4].Data(), VarManager::fgValues);
2185-
if (isAmbiInBunch) {
2186-
fHistMan->FillHistClass(histNames[icut][16].Data(), VarManager::fgValues);
2187-
}
2188-
if (isAmbiOutOfBunch) {
2189-
fHistMan->FillHistClass(histNames[icut][19].Data(), VarManager::fgValues);
2190-
}
2191-
if (isUnambiguous) {
2192-
fHistMan->FillHistClass(histNames[icut][22].Data(), VarManager::fgValues);
2193+
if (fConfigAmbiguousMuonHistograms) {
2194+
if (isAmbiInBunch) {
2195+
fHistMan->FillHistClass(histNames[icut][16].Data(), VarManager::fgValues);
2196+
}
2197+
if (isAmbiOutOfBunch) {
2198+
fHistMan->FillHistClass(histNames[icut][19].Data(), VarManager::fgValues);
2199+
}
2200+
if (isUnambiguous) {
2201+
fHistMan->FillHistClass(histNames[icut][22].Data(), VarManager::fgValues);
2202+
}
21932203
}
21942204
}
21952205
if constexpr (TPairType == VarManager::kDecayToEE) {
@@ -2198,14 +2208,16 @@ struct AnalysisSameEventPairing {
21982208
} else {
21992209
if constexpr (TPairType == VarManager::kDecayToMuMu) {
22002210
fHistMan->FillHistClass(histNames[icut][5].Data(), VarManager::fgValues);
2201-
if (isAmbiInBunch) {
2202-
fHistMan->FillHistClass(histNames[icut][17].Data(), VarManager::fgValues);
2203-
}
2204-
if (isAmbiOutOfBunch) {
2205-
fHistMan->FillHistClass(histNames[icut][20].Data(), VarManager::fgValues);
2206-
}
2207-
if (isUnambiguous) {
2208-
fHistMan->FillHistClass(histNames[icut][23].Data(), VarManager::fgValues);
2211+
if (fConfigAmbiguousMuonHistograms) {
2212+
if (isAmbiInBunch) {
2213+
fHistMan->FillHistClass(histNames[icut][17].Data(), VarManager::fgValues);
2214+
}
2215+
if (isAmbiOutOfBunch) {
2216+
fHistMan->FillHistClass(histNames[icut][20].Data(), VarManager::fgValues);
2217+
}
2218+
if (isUnambiguous) {
2219+
fHistMan->FillHistClass(histNames[icut][23].Data(), VarManager::fgValues);
2220+
}
22092221
}
22102222
}
22112223
if constexpr (TPairType == VarManager::kDecayToEE) {

0 commit comments

Comments
 (0)