Skip to content

Commit 478a8fc

Browse files
author
Maurice Coquet
committed
Fixing event mixing for standalone dimuons
1 parent 81b5d7f commit 478a8fc

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

PWGDQ/Tasks/tableReader_withAssoc.cxx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,6 +1984,7 @@ 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 (fConfigAmbiguousMuonHistograms) {
19871988
if (isAmbiInBunch) {
19881989
fHistMan->FillHistClass(histNames[icut][3 + histIdxOffset].Data(), VarManager::fgValues);
19891990
}
@@ -1993,6 +1994,7 @@ struct AnalysisSameEventPairing {
19931994
if (isUnambiguous) {
19941995
fHistMan->FillHistClass(histNames[icut][3 + histIdxOffset + 6].Data(), VarManager::fgValues);
19951996
}
1997+
}
19961998
}
19971999
if constexpr (TPairType == VarManager::kDecayToEE) {
19982000
fHistMan->FillHistClass(Form("PairsBarrelSEPM_%s", fTrackCuts[icut].Data()), VarManager::fgValues);
@@ -2004,6 +2006,7 @@ struct AnalysisSameEventPairing {
20042006
if (sign1 > 0) {
20052007
if constexpr (TPairType == VarManager::kDecayToMuMu) {
20062008
fHistMan->FillHistClass(histNames[icut][1].Data(), VarManager::fgValues);
2009+
if (fConfigAmbiguousMuonHistograms) {
20072010
if (isAmbiInBunch) {
20082011
fHistMan->FillHistClass(histNames[icut][4 + histIdxOffset].Data(), VarManager::fgValues);
20092012
}
@@ -2013,6 +2016,7 @@ struct AnalysisSameEventPairing {
20132016
if (isUnambiguous) {
20142017
fHistMan->FillHistClass(histNames[icut][4 + histIdxOffset + 6].Data(), VarManager::fgValues);
20152018
}
2019+
}
20162020
}
20172021
if constexpr (TPairType == VarManager::kDecayToEE) {
20182022
fHistMan->FillHistClass(Form("PairsBarrelSEPP_%s", fTrackCuts[icut].Data()), VarManager::fgValues);
@@ -2023,6 +2027,7 @@ struct AnalysisSameEventPairing {
20232027
} else {
20242028
if constexpr (TPairType == VarManager::kDecayToMuMu) {
20252029
fHistMan->FillHistClass(histNames[icut][2].Data(), VarManager::fgValues);
2030+
if (fConfigAmbiguousMuonHistograms) {
20262031
if (isAmbiInBunch) {
20272032
fHistMan->FillHistClass(histNames[icut][5 + histIdxOffset].Data(), VarManager::fgValues);
20282033
}
@@ -2032,6 +2037,7 @@ struct AnalysisSameEventPairing {
20322037
if (isUnambiguous) {
20332038
fHistMan->FillHistClass(histNames[icut][5 + histIdxOffset + 6].Data(), VarManager::fgValues);
20342039
}
2040+
}
20352041
}
20362042
if constexpr (TPairType == VarManager::kDecayToEE) {
20372043
fHistMan->FillHistClass(Form("PairsBarrelSEMM_%s", fTrackCuts[icut].Data()), VarManager::fgValues);
@@ -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,6 +2171,7 @@ struct AnalysisSameEventPairing {
21652171
if (pairSign == 0) {
21662172
if constexpr (TPairType == VarManager::kDecayToMuMu) {
21672173
fHistMan->FillHistClass(histNames[icut][3].Data(), VarManager::fgValues);
2174+
if (fConfigAmbiguousMuonHistograms) {
21682175
if (isAmbiInBunch) {
21692176
fHistMan->FillHistClass(histNames[icut][15].Data(), VarManager::fgValues);
21702177
}
@@ -2174,6 +2181,7 @@ struct AnalysisSameEventPairing {
21742181
if (isUnambiguous) {
21752182
fHistMan->FillHistClass(histNames[icut][21].Data(), VarManager::fgValues);
21762183
}
2184+
}
21772185
}
21782186
if constexpr (TPairType == VarManager::kDecayToEE) {
21792187
fHistMan->FillHistClass(Form("PairsBarrelMEPM_%s", fTrackCuts[icut].Data()), VarManager::fgValues);
@@ -2182,6 +2190,7 @@ struct AnalysisSameEventPairing {
21822190
if (pairSign > 0) {
21832191
if constexpr (TPairType == VarManager::kDecayToMuMu) {
21842192
fHistMan->FillHistClass(histNames[icut][4].Data(), VarManager::fgValues);
2193+
if (fConfigAmbiguousMuonHistograms) {
21852194
if (isAmbiInBunch) {
21862195
fHistMan->FillHistClass(histNames[icut][16].Data(), VarManager::fgValues);
21872196
}
@@ -2191,13 +2200,15 @@ struct AnalysisSameEventPairing {
21912200
if (isUnambiguous) {
21922201
fHistMan->FillHistClass(histNames[icut][22].Data(), VarManager::fgValues);
21932202
}
2203+
}
21942204
}
21952205
if constexpr (TPairType == VarManager::kDecayToEE) {
21962206
fHistMan->FillHistClass(Form("PairsBarrelMEPP_%s", fTrackCuts[icut].Data()), VarManager::fgValues);
21972207
}
21982208
} else {
21992209
if constexpr (TPairType == VarManager::kDecayToMuMu) {
22002210
fHistMan->FillHistClass(histNames[icut][5].Data(), VarManager::fgValues);
2211+
if (fConfigAmbiguousMuonHistograms) {
22012212
if (isAmbiInBunch) {
22022213
fHistMan->FillHistClass(histNames[icut][17].Data(), VarManager::fgValues);
22032214
}
@@ -2207,6 +2218,7 @@ struct AnalysisSameEventPairing {
22072218
if (isUnambiguous) {
22082219
fHistMan->FillHistClass(histNames[icut][23].Data(), VarManager::fgValues);
22092220
}
2221+
}
22102222
}
22112223
if constexpr (TPairType == VarManager::kDecayToEE) {
22122224
fHistMan->FillHistClass(Form("PairsBarrelMEMM_%s", fTrackCuts[icut].Data()), VarManager::fgValues);

0 commit comments

Comments
 (0)