CMS 3D CMS Logo

l1ctLayer1_patternWriters_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 _eventsPerFile = 12
4 _gttLatency = 156+120
5 _gttNumberOfPVs = 10
6 
7 
9 _barrelWriterOutputOnly = cms.PSet(
10  partition = cms.string("Barrel"),
11  tmuxFactor = cms.uint32(6),
12  outputLinksPuppi = cms.vuint32(*range(6)),
13  outputLinkEgamma = cms.int32(6),
14  nEgammaObjectsOut = cms.uint32(16),
15  nInputFramesPerBX = cms.uint32(9),
16  nOutputFramesPerBX = cms.uint32(9),
17  fileFormat = cms.string("EMPv2"),
18  inputFileExtension = cms.string("txt.gz"),
19  outputFileExtension = cms.string("txt.gz"),
20  maxLinesPerInputFile = cms.uint32(1024),
21  maxLinesPerOutputFile = cms.uint32(1024),
22  eventsPerFile = cms.uint32(_eventsPerFile),
23  tfTimeSlices = cms.VPSet(),
24  gctNLinksEcal = cms.uint32(1),
25  gctNLinksHad = cms.uint32(2),
26  gctSectors = cms.VPSet(),
27  gmtTimeSlices = cms.VPSet(),
28  gmtNumberOfMuons = cms.uint32(12),
29  gttLink = cms.int32(-1),
30  gttLatency = cms.uint32(156+10),
31  gttNumberOfPVs = cms.uint32(_gttNumberOfPVs),
32 )
33 
34 barrelWriterOutputOnlyPhiConfigs = [
35  _barrelWriterOutputOnly.clone(
36  outputRegions = cms.vuint32(*[3*ip+9*ie+i for ie in range(6) for i in range(3) ]),
37  outputBoard = cms.int32(ip),
38  outputFileName = cms.string("l1BarrelPhi%d-outputs" % (ip+1))
39  ) for ip in range(3)
40 ]
41 
42 barrelSerenityPhi1Config = barrelWriterOutputOnlyPhiConfigs[0].clone(
43  tfTimeSlices = cms.VPSet(*[cms.PSet(tfSectors = cms.VPSet(*[ cms.PSet(tfLink = cms.int32(-1)) for s in range(18) ])) for t in range(3)]),
44  gctSectors = cms.VPSet(*[cms.PSet(
45  gctLinksHad = cms.vint32(-1,-1),
46  gctLinksEcal = cms.vint32(-1),
47  ) for s in range(3)]),
48  gmtTimeSlices = cms.VPSet(*[cms.PSet(gmtLink = cms.int32(4*17+t)) for t in range(3)]),
49 )
50 barrelSerenityVU9PPhi1Config = barrelSerenityPhi1Config.clone(
51  gttLink = cms.int32(4*28+3),
52  inputFileName = cms.string("l1BarrelPhi1Serenity-inputs-vu9p"),
53  outputFileName = cms.string("l1BarrelPhi1Serenity-outputs")
54 )
55 barrelSerenityVU13PPhi1Config = barrelSerenityPhi1Config.clone(
56  gttLink = cms.int32(4*25+3),
57  gmtTimeSlices = cms.VPSet(*[cms.PSet(gmtLink = cms.int32(4*18+t)) for t in range(3)]),
58  inputFileName = cms.string("l1BarrelPhi1Serenity-inputs-vu13p"),
59 )
60 for t in range(3):
61  for ie in range(2):
62  for i,s in enumerate([8, 0, 1, 2, 3]):
63  loglink = 3*(i+5*ie)+t
64  physlink = loglink+4*1 if loglink < 15 else (loglink-15)+4*25
65  barrelSerenityVU9PPhi1Config.tfTimeSlices[t].tfSectors[s+9*ie].tfLink = physlink
66  physlink = loglink+4*0 if loglink < 15 else (loglink-15)+4*28
67  barrelSerenityVU13PPhi1Config.tfTimeSlices[t].tfSectors[s+9*ie].tfLink = physlink
68 for i,s in enumerate([0,1]):
69  barrelSerenityVU9PPhi1Config.gctSectors[s].gctLinksHad = [3*i+4*18, 3*i+4*18+1]
70  barrelSerenityVU9PPhi1Config.gctSectors[s].gctLinksEcal = [3*i+4*18+2]
71  gctLinks = list(range(4*17,4*17+4)) + list(range(4*19,4*19+2))
72  barrelSerenityVU13PPhi1Config.gctSectors[s].gctLinksHad = [gctLinks[3*i], gctLinks[3*i+1]]
73  barrelSerenityVU13PPhi1Config.gctSectors[s].gctLinksEcal = [gctLinks[3*i+2]]
74 
75 barrelWriterConfigs = barrelWriterOutputOnlyPhiConfigs
76 
77 
78 
80 _hgcalWriterConfig = cms.PSet(
81  partition = cms.string("HGCal"),
82  tmuxFactor = cms.uint32(6),
83  nEgammaObjectsOut = cms.uint32(16),
84  nInputFramesPerBX = cms.uint32(9),
85  nOutputFramesPerBX = cms.uint32(9),
86  fileFormat = cms.string("EMPv2"),
87  inputFileExtension = cms.string("txt.gz"),
88  outputFileExtension = cms.string("txt.gz"),
89  maxLinesPerInputFile = cms.uint32(1024),
90  maxLinesPerOutputFile = cms.uint32(1024),
91  eventsPerFile = cms.uint32(_eventsPerFile),
92  tfTimeSlices = cms.VPSet(*[cms.PSet(tfSectors = cms.VPSet()) for i in range(3)]),
93  hgcTimeSlices = cms.VPSet(*[cms.PSet(hgcSectors = cms.VPSet()) for i in range(3)]),
94  gmtTimeSlices = cms.VPSet(*[cms.PSet(gmtLink = cms.int32(-1)) for i in range(3)]),
95  gmtNumberOfMuons = cms.uint32(12),
96  gttLink = cms.int32(-1),
97  gttLatency = cms.uint32(_gttLatency),
98  gttNumberOfPVs = cms.uint32(_gttNumberOfPVs),
99  outputLinksPuppi = cms.vuint32(*range(3)),
100  outputLinkEgamma = cms.int32(3),
101 )
102 
103 _hgcalPosWriterConfig = _hgcalWriterConfig.clone(
104  outputRegions = cms.vuint32(*[i+9 for i in range(9)]),
105  outputBoard = cms.int32(1),
106 )
107 _hgcalNegWriterConfig = _hgcalPosWriterConfig.clone(
108  outputRegions = [i for i in range(9)],
109  outputBoard = 0,
110 )
111 hgcalPosOutputWriterConfig = _hgcalPosWriterConfig.clone(
112  outputFileName = cms.string("l1HGCalPos-outputs")
113 )
114 hgcalNegOutputWriterConfig = _hgcalNegWriterConfig.clone(
115  outputFileName = cms.string("l1HGCalNeg-outputs")
116 )
117 
118 hgcalPosVU9PWriterConfig = _hgcalPosWriterConfig.clone()
119 hgcalNegVU9PWriterConfig = _hgcalNegWriterConfig.clone()
120 for t in range(3):
121  hgcalPosVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(-1)) for i in range(9) ] # neg
122  hgcalPosVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*1)) for i in range(4) ] # pos, left quads
123  hgcalPosVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*26)) for i in range(5) ] # pos, right quads
124  hgcalNegVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*1)) for i in range(4) ] # neg, left quads
125  hgcalNegVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*26)) for i in range(5) ] # neg, right quads
126  hgcalNegVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(-1)) for i in range(9) ] # pos
127  hgcQuads = [list(range(4*i,4*i+4)) for i in [10,11,12,13]]
128  hgcQuads += [[4*14+1,4*14+2,4*14+3,4*15+3]] # mixed quad
129  hgcQuads += [list(range(4*i,4*i+4)) for i in [16,17,18,19]]
130  hgcalPosVU9PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(-1,-1,-1,-1)) for i in range(3) ] # neg
131  hgcalPosVU9PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(*hgcQuads[3*i+t])) for i in range(3) ] # pos
132  hgcalNegVU9PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(*hgcQuads[3*i+t])) for i in range(3) ] # neg
133  hgcalNegVU9PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(-1,-1,-1,-1)) for i in range(3) ] # pos
134  hgcalPosVU9PWriterConfig.gmtTimeSlices[t].gmtLink = cms.int32(4*15+((t+2)%3))
135  hgcalNegVU9PWriterConfig.gmtTimeSlices[t].gmtLink = cms.int32(4*15+((t+2)%3))
136 hgcalPosVU9PWriterConfig.gttLink = 4*14+0
137 hgcalNegVU9PWriterConfig.gttLink = 4*14+0
138 hgcalPosVU9PWriterConfig.inputFileName = cms.string("l1HGCalPos-inputs-vu9p")
139 hgcalNegVU9PWriterConfig.inputFileName = cms.string("l1HGCalNeg-inputs-vu9p")
140 
141 hgcalPosVU13PWriterConfig = _hgcalPosWriterConfig.clone()
142 hgcalNegVU13PWriterConfig = _hgcalNegWriterConfig.clone()
143 for t in range(3):
144  hgcalPosVU13PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(-1)) for i in range(9) ] # neg
145  hgcalPosVU13PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*0)) for i in range(5) ] # pos, left quads
146  hgcalPosVU13PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*28)) for i in range(4) ] # pos, right quads
147  hgcalNegVU13PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*0)) for i in range(5) ] # neg, left quads
148  hgcalNegVU13PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*28)) for i in range(4) ] # neg, right quads
149  hgcalNegVU13PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(-1)) for i in range(9) ] # pos
150  hgcQuads = [list(range(4*i,4*i+4)) for i in [12,13,14, 16,17, 19,20,21,22]]
151  hgcalPosVU13PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(-1,-1,-1,-1)) for i in range(3) ] # neg
152  hgcalPosVU13PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(*hgcQuads[3*i+t])) for i in range(3) ] # pos
153  hgcalNegVU13PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(*hgcQuads[3*i+t])) for i in range(3) ] # neg
154  hgcalNegVU13PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(-1,-1,-1,-1)) for i in range(3) ] # pos
155  hgcalPosVU13PWriterConfig.gmtTimeSlices[t].gmtLink = cms.int32(4*18+t)
156  hgcalNegVU13PWriterConfig.gmtTimeSlices[t].gmtLink = cms.int32(4*18+t)
157 hgcalPosVU13PWriterConfig.gttLink = 4*25+3
158 hgcalNegVU13PWriterConfig.gttLink = 4*25+3
159 hgcalPosVU13PWriterConfig.inputFileName = cms.string("l1HGCalPos-inputs-vu13p")
160 hgcalNegVU13PWriterConfig.inputFileName = cms.string("l1HGCalNeg-inputs-vu13p")
161 
162 
163 hgcalWriterConfigs = [
164  hgcalPosOutputWriterConfig,
165  hgcalNegOutputWriterConfig,
166  hgcalPosVU9PWriterConfig,
167  hgcalNegVU9PWriterConfig,
168  hgcalPosVU13PWriterConfig,
169  hgcalNegVU13PWriterConfig
170 ]
171 
172 
174 _hgcalNoTKWriterConfig = cms.PSet(
175  partition = cms.string("HGCalNoTk"),
176  tmuxFactor = cms.uint32(6),
177  outputRegions = cms.vuint32(*range(18)),
178  nInputFramesPerBX = cms.uint32(9),
179  nOutputFramesPerBX = cms.uint32(9),
180  fileFormat = cms.string("EMPv2"),
181  inputFileExtension = cms.string("txt.gz"),
182  outputFileExtension = cms.string("txt.gz"),
183  maxLinesPerInputFile = cms.uint32(1024),
184  maxLinesPerOutputFile = cms.uint32(1024),
185  eventsPerFile = cms.uint32(_eventsPerFile),
186  hgcTimeSlices = cms.VPSet(*[cms.PSet(hgcSectors = cms.VPSet()) for i in range(3)]),
187  gmtTimeSlices = cms.VPSet(*[cms.PSet(gmtLink = cms.int32(-1)) for i in range(3)]),
188  gmtNumberOfMuons = cms.uint32(12),
189  #gttLink = cms.int32(-1),
190  #gttLatency = cms.uint32(_gttLatency),
191  #gttNumberOfPVs = cms.uint32(_gttNumberOfPVs),
192 )
193 hgcalNoTKOutputWriterConfig = _hgcalNoTKWriterConfig.clone(
194  outputLinksPuppi = cms.vuint32(*range(4)),
195  outputFileName = cms.string("l1HGCalNoTK-outputs")
196 )
197 hgcalNoTKVU13PWriterConfig = _hgcalNoTKWriterConfig.clone()
198 for t in range(3):
199  for isec in range(6):
200  q0 = 3*isec + (6 if isec < 3 else 8)
201  hgcalNoTKVU13PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(*[4*q0+4*t+j for j in range(4)])) ]
202 hgcalNoTKVU13PWriterConfig.inputFileName = cms.string("l1HGCalNoTK-inputs-vu13p") # vu9p uses the same cabling for now
203 
204 hgcalNoTKWriterConfigs = [
205  hgcalNoTKOutputWriterConfig,
206  hgcalNoTKVU13PWriterConfig
207 ]
208 
209 
211 _barrelSerenityTM18 = _barrelWriterOutputOnly.clone(
212  tmuxFactor = cms.uint32(18),
213  tfTimeSlices = None,
214  tfSectors = cms.VPSet(*[cms.PSet(tfLink = cms.int32(-1)) for i in range(18)]),
215  gmtTimeSlices = None,
216  gmtLink = cms.int32(4*18+0),
217  gttLink = 4*28+3,
218  eventsPerFile = 4,
219 )
220 barrelSerenityOutputTM18WriterConfig = _barrelSerenityTM18.clone(
221  outputRegions = cms.vuint32(*range(54)),
222  outputBoard = cms.int32(0),
223  outputFileName = cms.string("l1BarrelSerenityTM18-outputs")
224 )
225 barrelSerenityVU13PTM18WriterConfig = _barrelSerenityTM18.clone(
226  inputFileName = cms.string("l1BarrelSerenityTM18-inputs-vu13p"),
227  gttLatency = cms.uint32(167), # shorter, to fit 6 events in 1024 lines
228  maxLinesPerInputFile = cms.uint32(1024+167), # anything beyond 986 will be nulls
229  gctNLinksEcal = 1,
230  gctNLinksHad = 1,
231  gctSectors = cms.VPSet(*[cms.PSet(
232  gctLinksHad = cms.vint32(4*18+1+s),
233  gctLinksEcal = cms.vint32(4*18+1+s),
234  ) for s in range(3)]),
235 )
236 for ie in range(2):
237  for iphi in range(9):
238  isec = 9*ie+iphi
239  barrelSerenityVU13PTM18WriterConfig.tfSectors[isec].tfLink = (isec if isec < 12 else (4*30+(isec-12)))
240 
241 barrelSerenityTM18WriterConfigs = [
242  barrelSerenityOutputTM18WriterConfig,
243  barrelSerenityVU13PTM18WriterConfig
244 ]
245 
246 _hgcalWriterTM18 = _hgcalWriterConfig.clone(
247  tmuxFactor = cms.uint32(18),
248  tfTimeSlices = None,
249  tfSectors = cms.VPSet(*[cms.PSet(tfLink = cms.int32(-1)) for i in range(18)]),
250  hgcTimeSlices = None,
251  hgcSectors = cms.VPSet(*[cms.PSet(hgcLinks = cms.vint32()) for i in range(6)]),
252  gmtTimeSlices = None,
253  gmtLink = cms.int32(4*27+0),
254  gttLink = 4*27+3,
255  eventsPerFile = 4,
256 )
257 hgcalWriterOutputTM18WriterConfig = _hgcalWriterTM18.clone(
258  outputFileName = cms.string("l1HGCalTM18-outputs"),
259  outputRegions = cms.vuint32(*range(18)),
260  outputLinksPuppi = cms.vuint32(*range(2)),
261  outputLinkEgamma = cms.int32(2),
262 )
263 hgcalWriterVU9PTM18WriterConfig = _hgcalWriterTM18.clone(
264  inputFileName = cms.string("l1HGCalTM18-inputs-vu9p"),
265  gttLatency = cms.uint32(167), # shorter, to fit 6 events in 1024 lines
266  maxLinesPerInputFile = cms.uint32(1024+167), # anything beyond 986 will be nulls
267  gmtLink = 4*15+2,
268  gttLink = 0,
269 )
270 hgcalWriterVU13PTM18WriterConfig = hgcalWriterVU9PTM18WriterConfig.clone(
271  inputFileName = cms.string("l1HGCalTM18-inputs-vu13p"),
272  gmtLink = 4*18+0,
273  gttLink = 4*28+3,
274 )
275 for ie in range(2):
276  for iphi in range(9):
277  isec, ilink = 9*ie+iphi, 2*iphi+ie
278  hgcalWriterVU9PTM18WriterConfig.tfSectors[isec].tfLink = (ilink+2 if ilink < 10 else (4*28+(ilink-10)))
279  hgcalWriterVU13PTM18WriterConfig.tfSectors[isec].tfLink = (ilink if ilink < 12 else (4*30+(ilink-12)))
280  for iphi in range(3):
281  isec, ilink = 3*ie+iphi, 2*iphi+ie
282  if ilink < 2:
283  hgcalWriterVU9PTM18WriterConfig.hgcSectors[isec].hgcLinks += range(4*(12+ilink),4*(12+ilink)+4)
284  else:
285  hgcalWriterVU9PTM18WriterConfig.hgcSectors[isec].hgcLinks += range(4*(14+ilink),4*(14+ilink)+4)
286  if ilink < 3:
287  hgcalWriterVU13PTM18WriterConfig.hgcSectors[isec].hgcLinks += range(4*(12+ilink),4*(12+ilink)+4)
288  elif ilink < 5:
289  hgcalWriterVU13PTM18WriterConfig.hgcSectors[isec].hgcLinks += range(4*(13+ilink),4*(13+ilink)+4)
290  else:
291  hgcalWriterVU13PTM18WriterConfig.hgcSectors[isec].hgcLinks += range(4*(14+ilink),4*(14+ilink)+4)
292 
293 hgcalTM18WriterConfigs = [
294  hgcalWriterOutputTM18WriterConfig,
295  hgcalWriterVU9PTM18WriterConfig,
296  hgcalWriterVU13PTM18WriterConfig
297 ]
298 hgcalNoTKOutputTM18WriterConfig = _hgcalWriterTM18.clone(
299  outputFileName = cms.string("l1HGCalTM18-outputs-fwd"),
300  outputRegions = cms.vuint32(*range(18)),
301  outputBoard = cms.int32(-1),#0,1),
302  outputLinksPuppi = cms.vuint32(*range(2)),
303  outputLinkEgamma = cms.int32(-1),
304 )
305 
306 
310 _hfWriterOutputOnly = cms.PSet(
311  partition = cms.string("HF"),
312  tmuxFactor = cms.uint32(6),
313  outputLinksPuppi = cms.vuint32(*range(3)),
314  nOutputFramesPerBX = cms.uint32(9),
315  fileFormat = cms.string("EMPv2"),
316  outputFileExtension = cms.string("txt.gz"),
317  maxLinesPerOutputFile = cms.uint32(1024),
318  eventsPerFile = cms.uint32(_eventsPerFile),
319 )
320 hfWriterConfigs = [
321  _hfWriterOutputOnly.clone(
322  outputRegions = cms.vuint32(*[9*ie+i for i in range(9)]),
323  outputFileName = cms.string("l1HF%s-outputs" % ("Pos" if ie else "Neg")),
324  ) for ie in range(2)
325 ]
326 
327 
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135