Skip to content

Commit

Permalink
Merge pull request #8570 from arizzi/fixchargefrom-CMSSW_7_4_0_pre9
Browse files Browse the repository at this point in the history
MiniAOD: fix bug in charge()
  • Loading branch information
davidlange6 committed Mar 29, 2015
2 parents 2e8e3ef + 1c8155f commit d536e09
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions DataFormats/PatCandidates/interface/PackedCandidate.h
Expand Up @@ -70,10 +70,10 @@ namespace pat {
virtual int charge() const {
switch (abs(pdgId_)) {
case 211: return (pdgId_>0)-(pdgId_<0);
case 11: return (-1)*(pdgId_>0)-(pdgId_<0); //e
case 13: return (-1)*(pdgId_>0)-(pdgId_<0); //mu
case 15: return (-1)*(pdgId_>0)-(pdgId_<0); //tau
case 24: return (-1)*(pdgId_>0)-(pdgId_<0); //W
case 11: return (-1)*(pdgId_>0)+(pdgId_<0); //e
case 13: return (-1)*(pdgId_>0)+(pdgId_<0); //mu
case 15: return (-1)*(pdgId_>0)+(pdgId_<0); //tau
case 24: return (pdgId_>0)-(pdgId_<0); //W
default: return 0; //FIXME: charge is not defined
}
}
Expand Down

0 comments on commit d536e09

Please sign in to comment.