CMS 3D CMS Logo

particlelevel_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
3 from PhysicsTools.NanoAOD.simpleCandidateFlatTableProducer_cfi import simpleCandidateFlatTableProducer
4 from PhysicsTools.NanoAOD.simpleSingletonCandidateFlatTableProducer_cfi import simpleSingletonCandidateFlatTableProducer
5 from PhysicsTools.NanoAOD.simpleHTXSFlatTableProducer_cfi import simpleHTXSFlatTableProducer
6 
7 
8 
9 mergedGenParticles = cms.EDProducer("MergedGenParticleProducer",
10  inputPruned = cms.InputTag("prunedGenParticles"),
11  inputPacked = cms.InputTag("packedGenParticles"),
12 )
13 
14 genParticles2HepMC = cms.EDProducer("GenParticles2HepMCConverter",
15  genParticles = cms.InputTag("mergedGenParticles"),
16  genEventInfo = cms.InputTag("generator"),
17  signalParticlePdgIds = cms.vint32(),
18 )
19 
20 genParticles2HepMCHiggsVtx = cms.EDProducer("GenParticles2HepMCConverter",
21  genParticles = cms.InputTag("mergedGenParticles"),
22  genEventInfo = cms.InputTag("generator"),
23  signalParticlePdgIds = cms.vint32(25),
24 )
25 
26 
27 particleLevel = cms.EDProducer("ParticleLevelProducer",
28  src = cms.InputTag("genParticles2HepMC:unsmeared"),
29 
30  doJetClustering = cms.bool(False), # Not needed as Rivet jets aren't used currently
31  usePromptFinalStates = cms.bool(True), # for leptons, photons, neutrinos
32  excludePromptLeptonsFromJetClustering = cms.bool(False),
33  excludeNeutrinosFromJetClustering = cms.bool(True),
34 
35  particleMinPt = cms.double(0.),
36  particleMaxEta = cms.double(5.), # HF range. Maximum 6.0 on MiniAOD
37 
38  lepConeSize = cms.double(0.1), # for photon dressing
39  lepMinPt = cms.double(1.),
40  lepMaxEta = cms.double(2.5),
41 
42  jetConeSize = cms.double(0.4),
43  jetMinPt = cms.double(10.),
44  jetMaxEta = cms.double(999.),
45 
46  fatJetConeSize = cms.double(0.8),
47  fatJetMinPt = cms.double(170.),
48  fatJetMaxEta = cms.double(999.),
49 
50  phoIsoConeSize = cms.double(0.4),
51  phoMaxRelIso = cms.double(0.5),
52  phoMinPt = cms.double(1.),
53  phoMaxEta = cms.double(2.5),
54 )
55 
56 rivetProducerHTXS = cms.EDProducer('HTXSRivetProducer',
57  HepMCCollection = cms.InputTag('genParticles2HepMCHiggsVtx','unsmeared'),
58  LHERunInfo = cms.InputTag('externalLHEProducer'),
59  ProductionMode = cms.string('AUTO'),
60 )
61 
62 
63 
64 rivetLeptonTable = simpleCandidateFlatTableProducer.clone(
65  src = cms.InputTag("particleLevel:leptons"),
66  cut = cms.string("pt > 15"),
67  name= cms.string("GenDressedLepton"),
68  doc = cms.string("Dressed leptons from Rivet-based ParticleLevelProducer"),
69  externalVariables = cms.PSet(
70  hasTauAnc = ExtVar(cms.InputTag("tautagger"),bool, doc="true if Dressed lepton has a tau as ancestor"),
71  ),
72  variables = cms.PSet(
73  P4Vars,
74  pdgId = Var("pdgId", int, doc="PDG id"),
75  )
76 )
77 
78 rivetPhotonTable = simpleCandidateFlatTableProducer.clone(
79  src = cms.InputTag("particleLevel:photons"),
80  cut = cms.string("pt > 10"),
81  name= cms.string("GenIsolatedPhoton"),
82  doc = cms.string("Isolated photons from Rivet-based ParticleLevelProducer"),
83  variables = cms.PSet(
84  P4Vars
85  )
86 )
87 
88 tautagger = cms.EDProducer("GenJetTauTaggerProducer",
89  src = rivetLeptonTable.src,
90 )
91 
92 rivetMetTable = simpleSingletonCandidateFlatTableProducer.clone(
93  src = cms.InputTag("particleLevel:mets"),
94  name = cms.string("FiducialMET"),
95  doc = cms.string("MET from Rivet-based ParticleLevelProducer in fiducial volume abs(eta)<5"),
96  variables = cms.PSet(PTVars),
97 )
98 
99 HTXSCategoryTable = simpleHTXSFlatTableProducer.clone(
100  src = cms.InputTag("rivetProducerHTXS","HiggsClassification"),
101  name = cms.string("HTXS"),
102  doc = cms.string("HTXS classification"),
103  variables=cms.PSet(
104  stage_0 = Var("stage0_cat",int, doc="HTXS stage-0 category"),
105  stage_1_pTjet30 = Var("stage1_cat_pTjet30GeV",int, doc="HTXS stage-1 category (jet pt>30 GeV)"),
106  stage_1_pTjet25 = Var("stage1_cat_pTjet25GeV",int, doc="HTXS stage-1 category (jet pt>25 GeV)"),
107  stage1_1_cat_pTjet30GeV = Var("stage1_1_cat_pTjet30GeV",int,doc="HTXS stage-1.1 category(jet pt>30 GeV)"),
108  stage1_1_cat_pTjet25GeV = Var("stage1_1_cat_pTjet25GeV",int,doc="HTXS stage-1.1 category(jet pt>25 GeV)"),
109  stage1_1_fine_cat_pTjet30GeV = Var("stage1_1_fine_cat_pTjet30GeV",int,doc="HTXS stage-1.1-fine category(jet pt>30 GeV)"),
110  stage1_1_fine_cat_pTjet25GeV = Var("stage1_1_fine_cat_pTjet25GeV",int,doc="HTXS stage-1.1-fine category(jet pt>25 GeV)"),
111  stage1_2_cat_pTjet30GeV = Var("stage1_2_cat_pTjet30GeV",int,doc="HTXS stage-1.2 category(jet pt>30 GeV)"),
112  stage1_2_cat_pTjet25GeV = Var("stage1_2_cat_pTjet25GeV",int,doc="HTXS stage-1.2 category(jet pt>25 GeV)"),
113  stage1_2_fine_cat_pTjet30GeV = Var("stage1_2_fine_cat_pTjet30GeV",int,doc="HTXS stage-1.2-fine category(jet pt>30 GeV)"),
114  stage1_2_fine_cat_pTjet25GeV = Var("stage1_2_fine_cat_pTjet25GeV",int,doc="HTXS stage-1.2-fine category(jet pt>25 GeV)"),
115  Higgs_pt = Var("higgs.Pt()",float, doc="pt of the Higgs boson as identified in HTXS", precision=14),
116  Higgs_y = Var("higgs.Rapidity()",float, doc="rapidity of the Higgs boson as identified in HTXS", precision=12),
117  njets30 = Var("jets30.size()","uint8", doc="number of jets with pt>30 GeV as identified in HTXS"),
118  njets25 = Var("jets25.size()","uint8", doc="number of jets with pt>25 GeV as identified in HTXS"),
119  )
120 )
121 
122 lheInfoTable = cms.EDProducer("LHETablesProducer",
123  lheInfo = cms.VInputTag(cms.InputTag("externalLHEProducer"), cms.InputTag("source")),
124  precision = cms.int32(14),
125  storeLHEParticles = cms.bool(True)
126  )
127 
128 particleLevelTask = cms.Task(mergedGenParticles,genParticles2HepMC,particleLevel,tautagger,genParticles2HepMCHiggsVtx,rivetProducerHTXS)
129 particleLevelTablesTask = cms.Task(rivetLeptonTable,rivetPhotonTable,rivetMetTable,HTXSCategoryTable,lheInfoTable)
def Var(expr, valtype, doc=None, precision=-1, lazyEval=False)
Definition: common_cff.py:17
def ExtVar(tag, valtype, doc=None, precision=-1)
Definition: common_cff.py:28