We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d30fc1c + dfa7530 commit 4b07030Copy full SHA for 4b07030
PhysicsTools/NanoAOD/plugins/GenCandMotherTableProducer.cc
@@ -42,10 +42,19 @@ class GenCandMotherTableProducer : public edm::global::EDProducer<> {
42
reco::GenParticleRef motherRef = cands->at(i).motherRef();
43
reco::GenParticleRef match = (*map)[motherRef];
44
45
- if (match.isNull())
46
- continue;
+ if (match.isNonnull())
+ key[i] = match.key();
47
+ else {
48
+ key[i] = -1;
49
+ // try to find the closest mother which is in the map
50
+ while (match.isNull() && motherRef.isNonnull()) {
51
+ motherRef = motherRef->motherRef();
52
+ match = (*map)[motherRef];
53
54
55
+ }
56
57
- key[i] = match.key();
58
fromB[i] = isFromB(cands->at(i));
59
fromC[i] = isFromC(cands->at(i));
60
}
0 commit comments