Skip to content

Commit

Permalink
Merge pull request cms-sw#91 from l-cadamuro/nanoAOD-genparts-status-…
Browse files Browse the repository at this point in the history
…flags

Nano aod genparts status flags
  • Loading branch information
arizzi authored Jan 10, 2018
2 parents f3dbe0a + d3c4f2e commit b8a0c86
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
41 changes: 37 additions & 4 deletions PhysicsTools/NanoAOD/python/genparticles_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,46 @@
phi = Var("phi", float,precision=8),
eta = Var("eta", float,precision=8),
mass = Var("?mass>10 || (pdgId==22 && mass > 1)?mass:0", float,precision=8,doc="Mass stored for all particles with mass > 10 GeV and photons with mass > 1 GeV. For other particles you can lookup from PDGID"),
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"),

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"),
statusFlags = (Var(
"statusFlags().isLastCopyBeforeFSR() * 16384 +"
"statusFlags().isLastCopy() * 8192 +"
"statusFlags().isFirstCopy() * 4096 +"
"statusFlags().fromHardProcessBeforeFSR() * 2048 +"
"statusFlags().isDirectHardProcessTauDecayProduct() * 1024 +"
"statusFlags().isHardProcessTauDecayProduct() * 512 +"
"statusFlags().fromHardProcess() * 256 +"
"statusFlags().isHardProcess() * 128 +"
"statusFlags().isDirectHadronDecayProduct() * 64 +"
"statusFlags().isDirectPromptTauDecayProduct() * 32 +"
"statusFlags().isDirectTauDecayProduct() * 16 +"
"statusFlags().isPromptTauDecayProduct() * 8 +"
"statusFlags().isTauDecayProduct() * 4 +"
"statusFlags().isDecayedLeptonHadron() * 2 +"
"statusFlags().isPrompt() * 1 ",
int, doc=("gen status flags stored bitwise, bits are: "
"0 : isPrompt, "
"1 : isDecayedLeptonHadron, "
"2 : isTauDecayProduct, "
"3 : isPromptTauDecayProduct, "
"4 : isDirectTauDecayProduct, "
"5 : isDirectPromptTauDecayProduct, "
"6 : isDirectHadronDecayProduct, "
"7 : isHardProcess, "
"8 : fromHardProcess, "
"9 : isHardProcessTauDecayProduct, "
"10 : isDirectHardProcessTauDecayProduct, "
"11 : fromHardProcessBeforeFSR, "
"12 : isFirstCopy, "
"13 : isLastCopy, "
"14 : isLastCopyBeforeFSR, ")
)),
)
)


genParticleSequence = cms.Sequence(finalGenParticles)
genParticleTables = cms.Sequence(genParticleTable)

1 change: 1 addition & 0 deletions PhysicsTools/NanoAOD/python/nanoDQM_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
Plot1D('phi', 'phi', 20, -3.14159, 3.14159, 'phi'),
Plot1D('pt', 'pt', 20, 0, 200, 'pt'),
Plot1D('status', 'status', 20, 0, 100, 'Particle status. 1=stable'),
Plot1D('statusFlags', 'statusFlags', 32768, 0, 32768, 'gen status flags stored bitwise, bits are: 0 : isPrompt, 1 : isDecayedLeptonHadron, 2 : isTauDecayProduct, 3 : isPromptTauDecayProduct, 4 : isDirectTauDecayProduct, 5 : isDirectPromptTauDecayProduct, 6 : isDirectHadronDecayProduct, 7 : isHardProcess, 8 : fromHardProcess, 9 : isHardProcessTauDecayProduct, 10 : isDirectHardProcessTauDecayProduct, 11 : fromHardProcessBeforeFSR, 12 : isFirstCopy, 13 : isLastCopy, 14 : isLastCopyBeforeFSR, '),
)
),
GenVisTau = cms.PSet(
Expand Down

0 comments on commit b8a0c86

Please sign in to comment.