Skip to content

Commit

Permalink
Merge pull request #418 from AndrewLevin/improve_photon_genpartflav
Browse files Browse the repository at this point in the history
Improve photon genpartflav
  • Loading branch information
peruzzim authored Nov 5, 2019
2 parents 9e1351a + 6bb3a64 commit 142e065
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions PhysicsTools/NanoAOD/plugins/CandMCMatchTableProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_ =
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 142e065

Please sign in to comment.