1 import FWCore.ParameterSet.Config
as cms
8 finalGenParticles = cms.EDProducer(
"GenParticlePruner",
9 src = cms.InputTag(
"prunedGenParticles"),
12 "keep++ abs(pdgId) == 15 & (pt > 15 || isPromptDecayed() )",
14 "keep+ abs(pdgId) == 15 ",
15 "+keep pdgId == 22 && status == 1 && (pt > 10 || isPromptFinalState())",
16 "+keep abs(pdgId) == 11 || abs(pdgId) == 13 || abs(pdgId) == 15",
17 "drop abs(pdgId)= 2212 && abs(pz) > 1000",
18 "keep (400 < abs(pdgId) < 600) || (4000 < abs(pdgId) < 6000)",
19 "keep abs(pdgId) == 12 || abs(pdgId) == 14 || abs(pdgId) == 16",
20 "keep status == 3 || (status > 20 && status < 30)",
21 "keep isHardProcess() || fromHardProcessDecayed() || fromHardProcessFinalState() || (statusFlags().fromHardProcess() && statusFlags().isLastCopy())",
22 "keep (status > 70 && status < 80 && pt > 15) ",
23 "keep abs(pdgId) == 23 || abs(pdgId) == 24 || abs(pdgId) == 25 || abs(pdgId) == 37 ",
25 "keep (1000001 <= abs(pdgId) <= 1000039 ) || ( 2000001 <= abs(pdgId) <= 2000015)",
33 genParticleTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
34 src = cms.InputTag(
"finalGenParticles"),
36 name= cms.string(
"GenPart"),
37 doc = cms.string(
"interesting gen particles "),
38 singleton = cms.bool(
False),
39 extension = cms.bool(
False),
41 pt =
Var(
"pt", float,precision=8),
42 phi =
Var(
"phi", float,precision=8),
43 eta =
Var(
"eta", float,precision=8),
44 mass =
Var(
"?mass>10 || (pdgId==22 && mass > 1) || abs(pdgId)==24 || pdgId==23?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"),
45 pdgId =
Var(
"pdgId", int, doc=
"PDG id"),
46 status =
Var(
"status", int, doc=
"Particle status. 1=stable"),
47 genPartIdxMother =
Var(
"?numberOfMothers>0?motherRef(0).key():-1", int, doc=
"index of the mother particle"),
49 "statusFlags().isLastCopyBeforeFSR() * 16384 +" 50 "statusFlags().isLastCopy() * 8192 +" 51 "statusFlags().isFirstCopy() * 4096 +" 52 "statusFlags().fromHardProcessBeforeFSR() * 2048 +" 53 "statusFlags().isDirectHardProcessTauDecayProduct() * 1024 +" 54 "statusFlags().isHardProcessTauDecayProduct() * 512 +" 55 "statusFlags().fromHardProcess() * 256 +" 56 "statusFlags().isHardProcess() * 128 +" 57 "statusFlags().isDirectHadronDecayProduct() * 64 +" 58 "statusFlags().isDirectPromptTauDecayProduct() * 32 +" 59 "statusFlags().isDirectTauDecayProduct() * 16 +" 60 "statusFlags().isPromptTauDecayProduct() * 8 +" 61 "statusFlags().isTauDecayProduct() * 4 +" 62 "statusFlags().isDecayedLeptonHadron() * 2 +" 63 "statusFlags().isPrompt() * 1 ",
64 int, doc=(
"gen status flags stored bitwise, bits are: " 66 "1 : isDecayedLeptonHadron, " 67 "2 : isTauDecayProduct, " 68 "3 : isPromptTauDecayProduct, " 69 "4 : isDirectTauDecayProduct, " 70 "5 : isDirectPromptTauDecayProduct, " 71 "6 : isDirectHadronDecayProduct, " 73 "8 : fromHardProcess, " 74 "9 : isHardProcessTauDecayProduct, " 75 "10 : isDirectHardProcessTauDecayProduct, " 76 "11 : fromHardProcessBeforeFSR, " 79 "14 : isLastCopyBeforeFSR, ")
85 genParticleSequence = cms.Sequence(finalGenParticles)
86 genParticleTables = cms.Sequence(genParticleTable)
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)