Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for increased mass precision in NanoGen + increase mass precision of SUSY particles in NanoAod #33637

Merged
merged 2 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion PhysicsTools/NanoAOD/python/genparticles_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
pt = Var("pt", float, precision=8),
phi = Var("phi", float,precision=8),
eta = Var("eta", float,precision=8),
mass = Var("?!((abs(pdgId)>=1 && abs(pdgId)<=5) || (abs(pdgId)>=11 && abs(pdgId)<=16) || pdgId==21 || pdgId==111 || abs(pdgId)==211 || abs(pdgId)==421 || abs(pdgId)==411 || (pdgId==22 && mass<1))?mass:0", float,precision="?(abs(pdgId)==6 && statusFlags().isLastCopy())?20:8",doc="Mass stored for all particles with the exception of quarks (except top), leptons/neutrinos, photons with mass < 1 GeV, gluons, pi0(111), pi+(211), D0(421), and D+(411). For these particles, you can lookup the value from PDG."),
mass = Var("?!((abs(pdgId)>=1 && abs(pdgId)<=5) || (abs(pdgId)>=11 && abs(pdgId)<=16) || pdgId==21 || pdgId==111 || abs(pdgId)==211 || abs(pdgId)==421 || abs(pdgId)==411 || (pdgId==22 && mass<1))?mass:0", float,precision="?((abs(pdgId)==6 || abs(pdgId)>1000000) && statusFlags().isLastCopy())?20:8",doc="Mass stored for all particles with the exception of quarks (except top), leptons/neutrinos, photons with mass < 1 GeV, gluons, pi0(111), pi+(211), D0(421), and D+(411). For these particles, you can lookup the value from PDG."),
pdgId = Var("pdgId", int, doc="PDG id"),
status = Var("status", int, doc="Particle status. 1=stable"),
genPartIdxMother = Var("?numberOfMothers>0?motherRef(0).key():-1", int, doc="index of the mother particle"),
Expand Down
14 changes: 11 additions & 3 deletions PhysicsTools/NanoAOD/python/nanogen_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def nanoGenCommonCustomize(process):
setGenPtPrecision(process, CandVars.pt.precision)
setGenEtaPrecision(process, CandVars.eta.precision)
setGenPhiPrecision(process, CandVars.phi.precision)
setGenMassPrecision(process, CandVars.mass.precision)

def customizeNanoGENFromMini(process):
process.nanogenSequence.insert(0, process.genParticles2HepMCHiggsVtx)
Expand Down Expand Up @@ -126,9 +127,11 @@ def pruneGenParticlesMini(process):
return process

def setGenFullPrecision(process):
setGenPtPrecision(process, 23)
setGenEtaPrecision(process, 23)
setGenPhiPrecision(process, 23)
process = setGenPtPrecision(process, 23)
process = setGenEtaPrecision(process, 23)
process = setGenPhiPrecision(process, 23)
process = setGenMassPrecision(process, 23)
return process

def setGenPtPrecision(process, precision):
process.genParticleTable.variables.pt.precision = precision
Expand All @@ -147,6 +150,11 @@ def setGenPhiPrecision(process, precision):
process.metMCTable.variables.phi.precision = precision
return process

def setGenMassPrecision(process, precision):
process.genParticleTable.variables.mass.precision = precision
process.genJetTable.variables.mass.precision = precision
return process

def setLHEFullPrecision(process):
process.lheInfoTable.precision = 23
return process
Expand Down