Created
July 21, 2016 11:28
-
-
Save artlbv/0fd1300a16badf713a460b329a6597d1 to your computer and use it in GitHub Desktop.
ISR jet counting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def countISR(jets, genParts): | |
nISR = 0 | |
for jet in jets: | |
matched = False | |
for genPart in genParts: #use GenPart | |
if matched: break | |
#if genPart.status != 23 or abs(genPart.pdgId) > 5: continue | |
# check particle is quark | |
if abs(genPart.pdgId) > 5: continue | |
momId = genPart.motherId | |
momIdx = genPart.motherIndex | |
# check mother is top, Z, W or SUSY | |
if not (momId == 6 or momId == 23 or momId == 24 or momId > 100000): continue | |
# check mother status is 23 | |
#if genParts[momIdx].status != 23: continue | |
#if genPart.status != 23: continue | |
# check deltaR | |
dR = jet.p4().DeltaR(genPart.p4()) | |
if momId > 100000: | |
print dR, genPart.pdgId, momId | |
if dR < 0.3: | |
matched = True | |
#print genPart.pdgId, momId | |
break | |
if not matched: | |
nISR+=1 | |
print jet.mcMatchId | |
print len(jets), nISR | |
return nISR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment