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