diff --git a/PhysicsTools/NanoAOD/plugins/CandMCMatchTableProducer.cc b/PhysicsTools/NanoAOD/plugins/CandMCMatchTableProducer.cc index 73a9e68805722..ec8efa17b93e7 100644 --- a/PhysicsTools/NanoAOD/plugins/CandMCMatchTableProducer.cc +++ b/PhysicsTools/NanoAOD/plugins/CandMCMatchTableProducer.cc @@ -47,7 +47,7 @@ class CandMCMatchTableProducer : public edm::global::EDProducer<> { "5 = electron from b, 4 = electron from c, 3 = electron from light or unknown, 0 = unmatched"; break; case MPhoton: - flavDoc_ = "1 = prompt photon, 13 = prompt electron, 0 = unknown or unmatched"; + flavDoc_ = "1 = prompt photon, 11 = prompt electron, 0 = unknown or unmatched"; break; case MTau: flavDoc_ = @@ -114,8 +114,11 @@ class CandMCMatchTableProducer : public edm::global::EDProducer<> { flav[i] = getParentHadronFlag(match); // 3 = light, 4 = charm, 5 = b break; case MPhoton: - if (match->isPromptFinalState()) - flav[i] = (match->pdgId() == 22 ? 1 : 13); // prompt electron or photon + if (match->isPromptFinalState() && match->pdgId() == 22) + flav[i] = 1; // prompt photon + else if ((match->isPromptFinalState() || match->isDirectPromptTauDecayProductFinalState()) && + abs(match->pdgId()) == 11) + flav[i] = 11; // prompt electron break; case MTau: // CV: assignment of status codes according to https://twiki.cern.ch/twiki/bin/viewauth/CMS/HiggsToTauTauWorking2016#MC_Matching