CMS 3D CMS Logo

particlelevel_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
3 
4 
5 
6 
7 
8 mergedGenParticles = cms.EDProducer("MergedGenParticleProducer",
9  inputPruned = cms.InputTag("prunedGenParticles"),
10  inputPacked = cms.InputTag("packedGenParticles"),
11 )
12 
13 genParticles2HepMC = cms.EDProducer("GenParticles2HepMCConverter",
14  genParticles = cms.InputTag("mergedGenParticles"),
15  genEventInfo = cms.InputTag("generator"),
16  signalParticlePdgIds = cms.vint32(),
17 )
18 
19 genParticles2HepMCHiggsVtx = cms.EDProducer("GenParticles2HepMCConverter",
20  genParticles = cms.InputTag("mergedGenParticles"),
21  genEventInfo = cms.InputTag("generator"),
22  signalParticlePdgIds = cms.vint32(25),
23 )
24 
25 
26 particleLevel = cms.EDProducer("ParticleLevelProducer",
27  src = cms.InputTag("genParticles2HepMC:unsmeared"),
28 
29  doJetClustering = cms.bool(False), # Not needed as Rivet jets aren't used currently
30  usePromptFinalStates = cms.bool(True), # for leptons, photons, neutrinos
31  excludePromptLeptonsFromJetClustering = cms.bool(False),
32  excludeNeutrinosFromJetClustering = cms.bool(True),
33 
34  particleMinPt = cms.double(0.),
35  particleMaxEta = cms.double(5.), # HF range. Maximum 6.0 on MiniAOD
36 
37  lepConeSize = cms.double(0.1), # for photon dressing
38  lepMinPt = cms.double(1.),
39  lepMaxEta = cms.double(2.5),
40 
41  jetConeSize = cms.double(0.4),
42  jetMinPt = cms.double(10.),
43  jetMaxEta = cms.double(999.),
44 
45  fatJetConeSize = cms.double(0.8),
46  fatJetMinPt = cms.double(170.),
47  fatJetMaxEta = cms.double(999.),
48 
49  phoIsoConeSize = cms.double(0.4),
50  phoMaxRelIso = cms.double(0.5),
51  phoMinPt = cms.double(1.),
52  phoMaxEta = cms.double(2.5),
53 )
54 
55 rivetProducerHTXS = cms.EDProducer('HTXSRivetProducer',
56  HepMCCollection = cms.InputTag('genParticles2HepMCHiggsVtx','unsmeared'),
57  LHERunInfo = cms.InputTag('externalLHEProducer'),
58  ProductionMode = cms.string('AUTO'),
59 )
60 
61 
62 
63 rivetLeptonTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
64  src = cms.InputTag("particleLevel:leptons"),
65  cut = cms.string("pt > 15"),
66  name= cms.string("GenDressedLepton"),
67  doc = cms.string("Dressed leptons from Rivet-based ParticleLevelProducer"),
68  singleton = cms.bool(False), # the number of entries is variable
69  extension = cms.bool(False), # this is the main table
70  externalVariables = cms.PSet(
71  hasTauAnc = ExtVar(cms.InputTag("tautagger"),bool, doc="true if Dressed lepton has a tau as ancestor"),
72  ),
73  variables = cms.PSet(
74  P4Vars,
75  pdgId = Var("pdgId", int, doc="PDG id"),
76  )
77 )
78 
79 rivetPhotonTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
80  src = cms.InputTag("particleLevel:photons"),
81  cut = cms.string("pt > 10"),
82  name= cms.string("GenIsolatedPhoton"),
83  doc = cms.string("Isolated photons from Rivet-based ParticleLevelProducer"),
84  singleton = cms.bool(False), # the number of entries is variable
85  extension = cms.bool(False), # this is the main table
86  variables = cms.PSet(
87  P4Vars
88  )
89 )
90 
91 tautagger = cms.EDProducer("GenJetTauTaggerProducer",
92  src = rivetLeptonTable.src,
93 )
94 
95 #rivetJetTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
96 # src = cms.InputTag("particleLevel:jets"),
97 # cut = cms.string(""),
98 # name= cms.string("RivetJet"),
99 # doc = cms.string("AK4 jets from Rivet-based ParticleLevelProducer"),
100 # singleton = cms.bool(False), # the number of entries is variable
101 # extension = cms.bool(False),
102 # variables = cms.PSet(
103 # # Identical to GenJets, so we just extend their flavor information
104 # P4Vars,
105 # hadronFlavour = Var("pdgId", int, doc="PDG id"),
106 # )
107 #)
108 
109 #rivetFatJetTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
110 # src = cms.InputTag("particleLevel:fatjets"),
111 # cut = cms.string(""),
112 # name= cms.string("GenFatJet"),
113 # doc = cms.string("AK8 jets from Rivet-based ParticleLevelProducer"),
114 # singleton = cms.bool(False), # the number of entries is variable
115 # extension = cms.bool(False), # this is the main table
116 # variables = cms.PSet(
117 # P4Vars,
118 # hadronFlavour = Var("pdgId", int, doc="PDG id"),
119 # )
120 #)
121 
122 #rivetTagTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
123 # src = cms.InputTag("particleLevel:tags"),
124 # cut = cms.string(""),
125 # name= cms.string("RivetTag"),
126 # doc = cms.string("Tag particles from Rivet-based ParticleLevelProducer, momenta scaled down by 10e-20"),
127 # singleton = cms.bool(False), # the number of entries is variable
128 # extension = cms.bool(False), # this is the main table
129 # variables = cms.PSet(
130 # P4Vars,
131 # pdgId = Var("pdgId", int, doc="PDG id"),
132 # )
133 #)
134 
135 rivetMetTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
136  src = cms.InputTag("particleLevel:mets"),
137  name = cms.string("MET"),
138  doc = cms.string("MET from Rivet-based ParticleLevelProducer in fiducial volume abs(eta)<5"),
139  singleton = cms.bool(True), # there's always exactly one MET per event
140  extension = cms.bool(True), # this is the main table
141  variables = cms.PSet(
142  fiducialGenPt = Var("pt", float, precision=10),
143  fiducialGenPhi = Var("phi", float, precision=10),
144  ),
145 )
146 
147 HTXSCategoryTable = cms.EDProducer("SimpleHTXSFlatTableProducer",
148  src = cms.InputTag("rivetProducerHTXS","HiggsClassification"),
149  cut = cms.string(""),
150  name = cms.string("HTXS"),
151  doc = cms.string("HTXS classification"),
152  singleton = cms.bool(True),
153  extension = cms.bool(False),
154  variables=cms.PSet(
155  stage_0 = Var("stage0_cat",int, doc="HTXS stage-0 category"),
156  stage_1_pTjet30 = Var("stage1_cat_pTjet30GeV",int, doc="HTXS stage-1 category (jet pt>30 GeV)"),
157  stage_1_pTjet25 = Var("stage1_cat_pTjet25GeV",int, doc="HTXS stage-1 category (jet pt>25 GeV)"),
158  stage1_1_cat_pTjet30GeV = Var("stage1_1_cat_pTjet30GeV",int,doc="HTXS stage-1.1 category(jet pt>30 GeV)"),
159  stage1_1_cat_pTjet25GeV = Var("stage1_1_cat_pTjet25GeV",int,doc="HTXS stage-1.1 category(jet pt>25 GeV)"),
160  stage1_1_fine_cat_pTjet30GeV = Var("stage1_1_fine_cat_pTjet30GeV",int,doc="HTXS stage-1.1-fine category(jet pt>30 GeV)"),
161  stage1_1_fine_cat_pTjet25GeV = Var("stage1_1_fine_cat_pTjet25GeV",int,doc="HTXS stage-1.1-fine category(jet pt>25 GeV)"),
162  stage1_2_cat_pTjet30GeV = Var("stage1_2_cat_pTjet30GeV",int,doc="HTXS stage-1.2 category(jet pt>30 GeV)"),
163  stage1_2_cat_pTjet25GeV = Var("stage1_2_cat_pTjet25GeV",int,doc="HTXS stage-1.2 category(jet pt>25 GeV)"),
164  stage1_2_fine_cat_pTjet30GeV = Var("stage1_2_fine_cat_pTjet30GeV",int,doc="HTXS stage-1.2-fine category(jet pt>30 GeV)"),
165  stage1_2_fine_cat_pTjet25GeV = Var("stage1_2_fine_cat_pTjet25GeV",int,doc="HTXS stage-1.2-fine category(jet pt>25 GeV)"),
166  Higgs_pt = Var("higgs.Pt()",float, doc="pt of the Higgs boson as identified in HTXS", precision=14),
167  Higgs_y = Var("higgs.Rapidity()",float, doc="rapidity of the Higgs boson as identified in HTXS", precision=12),
168  njets30 = Var("jets30.size()","uint8", doc="number of jets with pt>30 GeV as identified in HTXS"),
169  njets25 = Var("jets25.size()","uint8", doc="number of jets with pt>25 GeV as identified in HTXS"),
170  )
171 )
172 
173 lheInfoTable = cms.EDProducer("LHETablesProducer",
174  lheInfo = cms.VInputTag(cms.InputTag("externalLHEProducer"), cms.InputTag("source")),
175  precision = cms.int32(14),
176  storeLHEParticles = cms.bool(True)
177  )
178 
179 particleLevelTask = cms.Task(mergedGenParticles,genParticles2HepMC,particleLevel,tautagger,genParticles2HepMCHiggsVtx,rivetProducerHTXS)
180 particleLevelTablesTask = cms.Task(rivetLeptonTable,rivetPhotonTable,rivetMetTable,HTXSCategoryTable,lheInfoTable)
def ExtVar(tag, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:31
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:20