/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
PhysicsTools/PatAlgos/python/slimming/prunedGenParticles_cfi.py
63 строки
5 KB
Michael Pitt
Keep all status=1 neutrons
23 фев 2026, 05:08
Не верифицирован
23 фев 2026, 05:08
e9e0eb7
Код
Авторство
О чём код?
import FWCore.ParameterSet.Config as cms prunedGenParticles = cms.EDProducer("GenParticlePruner", src = cms.InputTag("genParticles"), select = cms.vstring( "drop *", # this is the default "++keep abs(pdgId) == 11 || abs(pdgId) == 13 || abs(pdgId) == 15", # keep leptons, with history "drop status == 2", # drop the shower part of the history "keep++ (400 < abs(pdgId) < 600) || (4000 < abs(pdgId) < 6000)", # keep decays for BPH studies "drop status == 1", # drop the status=1 from BPH "keep+ (400 < abs(pdgId) < 600) || (4000 < abs(pdgId) < 6000)", # but keep first daughter, to allow lifetime determinations "keep abs(pdgId) == 11 || abs(pdgId) == 13 || abs(pdgId) == 15", # keep leptons (also status1) "keep abs(pdgId) == 12 || abs(pdgId) == 14 || abs(pdgId) == 16", # keep neutrinos "+keep pdgId == 22 && status == 1 && (pt > 10 || isPromptFinalState())", # keep gamma above 10 GeV (or all prompt) and its first parent "+keep abs(pdgId) == 11 && status == 1 && (pt > 3 || isPromptFinalState())", # keep first parent of electrons above 3 GeV (or prompt) "keep++ abs(pdgId) == 15", # but keep keep taus with decays "drop status > 30 && status < 70 ", # remove pythia8 garbage "drop pdgId == 21 && pt < 5", # remove pythia8 garbage "drop status == 2 && abs(pdgId) == 21", # but remove again gluons in the inheritance chain "keep abs(pdgId) == 23 || abs(pdgId) == 24 || abs(pdgId) == 25 || abs(pdgId) == 6 || abs(pdgId) == 37 ", # keep VIP(articles)s "keep++ abs(pdgId) == 310 || abs(pdgId) == 3122", # Keep Kshort, Lambda0 and their daughters "keep+ abs(pdgId) == 310 || abs(pdgId) == 3122", # but keep first daughter, to allow lifetime determinations "+keep abs(pdgId) == 13 && status == 1", # keep muon parents # keep heavy flavour quarks for parton-based jet flavour "keep (4 <= abs(pdgId) <= 5)", # keep light-flavour quarks and gluons for parton-based jet flavour "keep (1 <= abs(pdgId) <= 3 || pdgId = 21) & (status = 2 || status = 11 || status = 71 || status = 72) && pt>5", # keep onia states, phi, X(3872), Z(4430)+ and psi(4040) "keep abs(pdgId) == 323 && abs(eta) < 2.5 && pt > 1", "keep+ abs(pdgId) == 333", "keep+ abs(pdgId) == 9920443 || abs(pdgId) == 9042413 || abs(pdgId) == 9000443 || abs(pdgId) == 100541 || abs(pdgId) == 100543", "keep+ abs(pdgId) == 443 || abs(pdgId) == 100443 || abs(pdgId) == 10441 || abs(pdgId) == 20443 || abs(pdgId) == 445 || abs(pdgId) == 30443", "keep+ abs(pdgId) == 553 || abs(pdgId) == 100553 || abs(pdgId) == 200553 || abs(pdgId) == 10551 || abs(pdgId) == 20553 || abs(pdgId) == 555", # additional c hadrons for jet fragmentation studies "keep abs(pdgId) = 10411 || abs(pdgId) = 10421 || abs(pdgId) = 10413 || abs(pdgId) = 10423 || abs(pdgId) = 20413 || abs(pdgId) = 20423 || abs(pdgId) = 10431 || abs(pdgId) = 10433 || abs(pdgId) = 20433", # additional b hadrons for jet fragmentation studies "keep abs(pdgId) = 10511 || abs(pdgId) = 10521 || abs(pdgId) = 10513 || abs(pdgId) = 10523 || abs(pdgId) = 20513 || abs(pdgId) = 20523 || abs(pdgId) = 10531 || abs(pdgId) = 10533 || abs(pdgId) = 20533 || abs(pdgId) = 10541 || abs(pdgId) = 10543 || abs(pdgId) = 20543", #keep SUSY particles "keep (1000001 <= abs(pdgId) <= 1000039 ) || ( 2000001 <= abs(pdgId) <= 2000015)", # keep hidden valley particles "keep (4900001 <= abs(pdgId) <= 4900991)", # keep dark matter particles "keep (51 <= abs(pdgId) <= 53)", # keep protons "keep pdgId = 2212", "keep status == 3 || ( 21 <= status <= 29) || ( 11 <= status <= 19)", #keep event summary (status=3 for pythia6, 21 <= status <= 29 for pythia8) "keep isHardProcess() || fromHardProcessFinalState() || fromHardProcessDecayed() || fromHardProcessBeforeFSR() || (statusFlags().fromHardProcess() && statusFlags().isLastCopy())", #keep event summary based on status flags ) ) from Configuration.Eras.Modifier_ppRef_2024_cff import ppRef_2024 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA (pp_on_AA | ppRef_2024).toModify(prunedGenParticles.select, func = lambda list: list.append('keep++ abs(pdgId) == 9920443 || abs(pdgId) == 20443 || abs(pdgId) == 511')) from Configuration.Eras.Modifier_run3_upc_cff import run3_upc def _keep_forward_zdc_fsc_truth(lst): # keep neutrons (stable) lst.append("keep abs(pdgId) == 2112 && status == 1") # Nuclear fragments / ions lst.append("keep abs(pdgId) >= 1000000000 && status == 1") run3_upc.toModify(prunedGenParticles.select, func=_keep_forward_zdc_fsc_truth)