Skip to content

Commit 0152ece

Browse files
authored
Fix the bug with internal index after sliceBy in dqEfficiency. Fix the bug to fill the DCA in sigma information for reducedTracks. Change according to Anton the access to the first mother in MCSignal.h (AliceO2Group#825)
1 parent f104ad0 commit 0152ece

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

PWGDQ/Core/MCSignal.h

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
//
1414
/* Schematic Monte Carlo signal definition:
1515
16-
Prong_0: Particle(0,0) <-- Particle(0,1) <-- ... Prong(0,m_0) ... <-- Particle(0, n_0)
17-
|
16+
Prong_0: Particle(0,0) <-- Particle(0,1) <-- ... Prong(0,m_0) ... <-- Particle(0, n_0)
17+
|
1818
Prong_1: Particle(1,0) <-- Particle(1,1) <-- ... Prong(1,m_1) ... <-- Particle(1, n_1)
1919
|
2020
Prong_i: Particle(i,0) <-- Particle(i,1) <-- ... Prong(i,m_i) ... <-- Particle(i, n_i)
2121
|
2222
Prong_N: Particle(N,0) <-- Particle(N,1) <-- ... Prong(N,m_N) ... <-- Particle(N, n_N)
23-
24-
The MC signal model is composed of N prongs (see MCProng.h) with a variable number of generations specified for each prong (n_i, i=1,N).
23+
24+
The MC signal model is composed of N prongs (see MCProng.h) with a variable number of generations specified for each prong (n_i, i=1,N).
2525
At least one prong has to be specified for a valid MCsignal. An optional common ancestor for all prongs can be specified (m_i, i=1,N).
2626
The common ancestor index, m_i, does not need to be the same for all prongs (e.g. some prongs can have a smaller number of generations in the history up to the common ancestor).
2727
When a tuple of MC particles is checked whether it matches the specified signal, all prongs must be matched exactly with the particles in the tuple.
@@ -42,8 +42,8 @@ process(aod::McParticles const& mcTracks) {
4242
...
4343
for (auto& mctrack : mcTracks) {
4444
if(mySignal.CheckSignal(true,mcTracks,mctrack)) {
45-
cout << "Found signal" << endl;
46-
}
45+
cout << "Found signal" << endl;
46+
}
4747
}
4848
for (auto& [mt1, mt2] : combinations(mcTracks, mcTracks)) {
4949
if(mySignal2.CheckSignal(true,mcTracks,mt1,mt2)) {
@@ -155,8 +155,9 @@ bool MCSignal::CheckProng(int i, bool checkSources, const U& mcStack, const T& t
155155
/*for (auto& m : mcParticle.mothers_as<aod::McParticles_001>()) {
156156
LOGF(debug, "M2 %d %d", mcParticle.globalIndex(), m.globalIndex());
157157
}*/
158-
currentMCParticle = mcStack.iteratorAt(currentMCParticle.mothersIds()[0]);
159-
//currentMCParticle = currentMCParticle.template mother0_as<U>();
158+
currentMCParticle = currentMCParticle.template mothers_first_as<U>();
159+
// currentMCParticle = mcStack.iteratorAt(currentMCParticle.mothersIds()[0]);
160+
// currentMCParticle = currentMCParticle.template mother0_as<U>();
160161
}
161162
}
162163

@@ -210,8 +211,9 @@ bool MCSignal::CheckProng(int i, bool checkSources, const U& mcStack, const T& t
210211
/*for (auto& m : mcParticle.mothers_as<aod::McParticles_001>()) {
211212
LOGF(debug, "M2 %d %d", mcParticle.globalIndex(), m.globalIndex());
212213
}*/
213-
currentMCParticle = mcStack.iteratorAt(currentMCParticle.mothersIds()[0]);
214-
//currentMCParticle = currentMCParticle.template mother0_as<U>();
214+
currentMCParticle = currentMCParticle.template mothers_first_as<U>();
215+
// currentMCParticle = mcStack.iteratorAt(currentMCParticle.mothersIds()[0]);
216+
// currentMCParticle = currentMCParticle.template mother0_as<U>();
215217
}
216218
/*if (j < fProngs[i].fNGenerations - 1) {
217219
currentMCParticle = mcStack.iteratorAt(currentMCParticle.mother0Id());

PWGDQ/Core/VarManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ void VarManager::FillTrack(T const& track, float* values)
661661
}
662662
values[kTrackDCAxy] = track.dcaXY();
663663
values[kTrackDCAz] = track.dcaZ();
664-
if constexpr ((fillMap & TrackCov) > 0) {
664+
if constexpr ((fillMap & ReducedTrackBarrelCov) > 0) {
665665
if (fgUsedVars[kTrackDCAsigXY]) {
666666
values[kTrackDCAsigXY] = track.dcaXY() / std::sqrt(track.cYY());
667667
}

PWGDQ/Tasks/dqEfficiency.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@ struct AnalysisSameEventPairing {
791791

792792
runPairing<VarManager::kJpsiToEE, gkEventFillMap, gkMCEventFillMap, gkTrackFillMap>(event, tracks, tracks, eventsMC, tracksMC);
793793
auto groupedMCTracks = tracksMC.sliceBy(aod::reducedtrackMC::reducedMCeventId, event.reducedMCevent().globalIndex());
794+
groupedMCTracks.bindInternalIndicesTo(&tracksMC);
794795
runMCGen(groupedMCTracks);
795796
}
796797

@@ -805,6 +806,7 @@ struct AnalysisSameEventPairing {
805806

806807
runPairing<VarManager::kJpsiToMuMu, gkEventFillMap, gkMCEventFillMap, gkMuonFillMap>(event, muons, muons, eventsMC, tracksMC);
807808
auto groupedMCTracks = tracksMC.sliceBy(aod::reducedtrackMC::reducedMCeventId, event.reducedMCevent().globalIndex());
809+
groupedMCTracks.bindInternalIndicesTo(&tracksMC);
808810
runMCGen(groupedMCTracks);
809811
}
810812

@@ -819,6 +821,7 @@ struct AnalysisSameEventPairing {
819821

820822
runPairing<VarManager::kJpsiToMuMu, gkEventFillMapWithCov, gkMCEventFillMap, gkMuonFillMapWithCov>(event, muons, muons, eventsMC, tracksMC);
821823
auto groupedMCTracks = tracksMC.sliceBy(aod::reducedtrackMC::reducedMCeventId, event.reducedMCevent().globalIndex());
824+
groupedMCTracks.bindInternalIndicesTo(&tracksMC);
822825
runMCGen(groupedMCTracks);
823826
}
824827

@@ -1075,6 +1078,7 @@ struct AnalysisDileptonTrack {
10751078
{
10761079
runDileptonTrack<VarManager::kBcToThreeMuons, gkEventFillMapWithCov, gkMCEventFillMap, gkMuonFillMapWithCov>(event, tracks, dileptons, eventsMC, tracksMC);
10771080
auto groupedMCTracks = tracksMC.sliceBy(aod::reducedtrackMC::reducedMCeventId, event.reducedMCevent().globalIndex());
1081+
groupedMCTracks.bindInternalIndicesTo(&tracksMC);
10781082
runMCGen(groupedMCTracks);
10791083
}
10801084
void processDummy(MyEvents&)

0 commit comments

Comments
 (0)