CMS 3D CMS Logo

l1trig_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
4 
5 l1_float_precision_=12
6 
7 l1PtVars = cms.PSet(
8  pt = Var("pt", float, precision=l1_float_precision_),
9  phi = Var("phi", float, precision=l1_float_precision_),
10 )
11 l1P3Vars = cms.PSet(
12  l1PtVars,
13  eta = Var("eta", float, precision=l1_float_precision_),
14 )
15 
16 l1ObjVars = cms.PSet(
17  l1P3Vars,
18  hwPt = Var("hwPt()","int16",doc="hardware pt"),
19  hwEta = Var("hwEta()","int16",doc="hardware eta"),
20  hwPhi = Var("hwPhi()","int16",doc="hardware phi"),
21  hwQual = Var("hwQual()","int16",doc="hardware qual"),
22  hwIso = Var("hwIso()","int16",doc="hardware iso")
23 )
24 
25 l1CaloObjVars = cms.PSet(
26  l1ObjVars,
27  towerIEta = Var("towerIEta()","int16",doc="the ieta of the tower"),
28  towerIPhi = Var("towerIPhi()","int16",doc="the iphi of the tower"),
29 )
30 
31 l1JetReducedVars = cms.PSet(
32  l1P3Vars
33 )
34 
35 l1EtSumReducedVars = cms.PSet(
36  l1PtVars,
37  etSumType = Var("getType()",int,doc="et sum type"),
38 )
39 l1EGReducedVars = cms.PSet(
40  l1P3Vars,
41  hwIso = Var("hwIso()","int16",doc="hardware iso")
42 )
43 
44 l1TauReducedVars = cms.PSet(
45  l1P3Vars,
46  hwIso = Var("hwIso()","int16",doc="hardware iso")
47 )
48 
49 l1MuonReducedVars = cms.PSet(
50  l1P3Vars,
51  hwQual = Var("hwQual()",int,doc="hardware qual"),
52  hwCharge = Var("hwCharge()","int16",doc="hardware charge"),
53  etaAtVtx = Var("etaAtVtx()",float,precision=l1_float_precision_,doc="eta estimated at the vertex"),
54  phiAtVtx = Var("phiAtVtx()",float,precision=l1_float_precision_,doc="phi estimated at the vertex"),
55  ptUnconstrained = Var("ptUnconstrained()",float,precision=l1_float_precision_,doc="pt when not constrained to the beamspot"),
56  hwDXY = Var("hwDXY()","int16",doc="hardware impact parameter"),
57 )
58 
59 l1MuTable = cms.EDProducer("SimpleTriggerL1MuonFlatTableProducer",
60  src = cms.InputTag("gmtStage2Digis","Muon"),
61  minBX = cms.int32(-2),
62  maxBX = cms.int32(2),
63  cut = cms.string(""),
64  name= cms.string("L1Mu"),
65  doc = cms.string(""),
66  extension = cms.bool(False),
67  variables = cms.PSet(l1ObjVars,
68  hwCharge = Var("hwCharge()","int16",doc="Charge (can be 0 if the charge measurement was not valid)"),
69  hwChargeValid = Var("hwChargeValid()","int16",doc=""),
70  tfMuonIndex = Var("tfMuonIndex()","uint16",doc="Index of muon at the uGMT input. 3 indices per link/sector/wedge. EMTF+ are 0-17, OMTF+ are 18-35, BMTF are 36-71, OMTF- are 72-89, EMTF- are 90-107"),
71  hwTag = Var("hwTag()","int16",doc="not in L1 ntuples"),
72  hwEtaAtVtx = Var("hwEtaAtVtx()","int16",doc="hardware eta estimated at the vertex"),
73  hwPhiAtVtx = Var("hwPhiAtVtx()","int16",doc="hardware phi estimated at the vertex"),
74  etaAtVtx = Var("etaAtVtx()",float,doc="eta estimated at the vertex"),
75  phiAtVtx = Var("phiAtVtx()",float,doc="phi estimated at the vertex"),
76  hwIsoSum = Var("hwIsoSum()","int16",doc="not in L1 ntuples"),
77  hwDPhiExtra = Var("hwDPhiExtra()","int16",doc="Delta between Pseudo-rapidity at the muon system and the projected coordinate at the vertex in HW unit (for future l1t-integration-tag"),
78  hwDEtaExtra = Var("hwDEtaExtra()","int16",doc="Delta between Azimuth at the muon system and the projected coordinate at the vertex in HW unit (for future l1t-integration-tag)"),
79  hwRank = Var("hwRank()","int16",doc="not in L1Ntuples"),
80  hwPtUnconstrained = Var("hwPtUnconstrained()","int16",doc=""),
81  ptUnconstrained = Var("ptUnconstrained()",float,doc=""),
82  hwDXY = Var("hwDXY()","uint16",doc=""),
83  )
84 )
85 
86 
87 l1JetTable = cms.EDProducer("SimpleTriggerL1JetFlatTableProducer",
88  src = cms.InputTag("caloStage2Digis","Jet"),
89  minBX = cms.int32(-2),
90  maxBX = cms.int32(2),
91  cut = cms.string(""),
92  name= cms.string("L1Jet"),
93  doc = cms.string(""),
94  extension = cms.bool(False),
95  variables = cms.PSet(l1CaloObjVars,
96  rawEt = Var("rawEt()","int16",doc="raw (uncalibrated) et"),
97  seedEt = Var("seedEt()","int16",doc="et of the seed"),
98  puEt = Var("puEt()","int16",doc="pile up et "),
99  puDonutEt0 = Var("puDonutEt(0)","int16",doc=""),
100  puDonutEt1 = Var("puDonutEt(1)","int16",doc=""),
101  puDonutEt2 = Var("puDonutEt(2)","int16",doc=""),
102  puDonutEt3 = Var("puDonutEt(3)","int16",doc=""),
103  )
104 )
105 
106 l1TauTable = cms.EDProducer("SimpleTriggerL1TauFlatTableProducer",
107  src = cms.InputTag("caloStage2Digis","Tau"),
108  minBX = cms.int32(-2),
109  maxBX = cms.int32(2),
110  cut = cms.string(""),
111  name= cms.string("L1Tau"),
112  doc = cms.string(""),
113  extension = cms.bool(False), # this is the main table for L1 EGs
114  variables = cms.PSet(l1CaloObjVars,
115  rawEt = Var("rawEt()","int16",doc="raw Et of tau"),
116  isoEt = Var("isoEt()","int16",doc="raw isolation sum - cluster sum"),
117  nTT = Var("nTT()","int16",doc=" nr towers above threshold"),
118  hasEM = Var("hasEM()",bool,doc="has an em component"),
119  isMerged = Var("isMerged()",bool,doc="is merged"),
120 
121  )
122 )
123 
124 l1EtSumTable = cms.EDProducer("SimpleTriggerL1EtSumFlatTableProducer",
125  src = cms.InputTag("caloStage2Digis","EtSum"),
126  minBX = cms.int32(-2),
127  maxBX = cms.int32(2),
128  cut = cms.string(""),
129  name= cms.string("L1EtSum"),
130  doc = cms.string(""),
131  extension = cms.bool(False),
132  variables = cms.PSet(l1PtVars,
133  hwPt = Var("hwPt()",int,doc="hardware pt"),
134  hwPhi = Var("hwPhi()",int,doc="hardware phi"),
135  etSumType = Var("getType()",int,doc="the type of the ET Sum (https://github.com/cms-sw/cmssw/blob/master/DataFormats/L1Trigger/interface/EtSum.h#L27-L56)"),
136  )
137 )
138 
139 l1EGTable = cms.EDProducer("SimpleTriggerL1EGFlatTableProducer",
140  src = cms.InputTag("caloStage2Digis","EGamma"),
141  minBX = cms.int32(-2),
142  maxBX = cms.int32(2),
143  cut = cms.string(""),
144  name= cms.string("L1EG"),
145  doc = cms.string(""),
146  extension = cms.bool(False),
147  variables = cms.PSet(l1CaloObjVars,
148  rawEt = Var("rawEt()","int16",doc="raw et"),
149  isoEt = Var("isoEt()","int16",doc="iso et"),
150  footprintEt = Var("footprintEt()","int16",doc=" footprint et"),
151  nTT = Var("nTT()","int16",doc="nr trig towers"),
152  shape = Var("shape()","int16",doc="shape"),
153  towerHoE = Var("towerHoE()","int16",doc="tower H/E"),
154  )
155 )
156 
157 l1TablesTask = cms.Task(l1EGTable,l1EtSumTable,l1TauTable,l1JetTable,l1MuTable)
158 
159 def setL1NanoToReduced(process):
160  """
161  sets the L1 objects only have reduced information which is necessary
162  for central nano
163  """
164  #reduce the variables to the core variables
165  #note et sum variables are already reduced
166  process.l1EGTable.variables = cms.PSet(l1EGReducedVars)
167  process.l1MuTable.variables = cms.PSet(l1MuonReducedVars)
168  process.l1JetTable.variables = cms.PSet(l1JetReducedVars)
169  process.l1TauTable.variables = cms.PSet(l1TauReducedVars)
170  process.l1EtSumTable.variables = cms.PSet(l1EtSumReducedVars)
171 
172  #apply cuts
173  process.l1EGTable.cut="pt>=10"
174  process.l1TauTable.cut="pt>=24"
175  process.l1JetTable.cut="pt>=30"
176  process.l1MuTable.cut="pt>=3 && hwQual>=8"
177  process.l1EtSumTable.cut="(getType==8 || getType==1 || getType==2 || getType==3)"
178 
179  return process
def Var(expr, valtype, doc=None, precision=-1)
Definition: common_cff.py:16
def setL1NanoToReduced(process)
Definition: l1trig_cff.py:159