Skip to content

Commit

Permalink
Merge pull request #44963 from gpetruc/correlator_gtt_serenity_multib…
Browse files Browse the repository at this point in the history
…oard_cmsswmaster

[L1T Phase-2] Correlator Layer 1 pattern file producer updates for multi-board tests
  • Loading branch information
cmsbuild authored Jun 3, 2024
2 parents 1a3e7c1 + 28b0041 commit a9682e8
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ class L1TCorrelatorLayer1PatternFileWriter {
const unsigned int tfTmuxFactor_ = 18, tfLinksFactor_ = 1; // numbers not really configurable in current architecture
const unsigned int hgcTmuxFactor_ = 18, hgcLinksFactor_ = 4; // not really configurable in current architecture
const unsigned int gctTmuxFactor_ = 1, gctSectors_ = 3; // not really configurable in current architecture
const unsigned int gctLinksEcal_ = 1, gctLinksHad_ = 2; // could be made configurable later
const unsigned int gmtTmuxFactor_ = 18, gmtLinksFactor_ = 1; // not really configurable in current architecture
const unsigned int gttTmuxFactor_ = 6, gttLinksFactor_ = 1; // not really configurable in current architecture
const unsigned int tfTimeslices_, hgcTimeslices_, gctTimeslices_, gmtTimeslices_, gttTimeslices_;
uint32_t gctLinksEcal_, gctLinksHad_;
bool gctSingleLink_;
uint32_t gmtNumberOfMuons_;
uint32_t gttNumberOfPVs_;
uint32_t gttLatency_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ namespace l1ct {

void reset();

static void encode(const l1ct::EmCaloObjEmu& from, l1ct::HadCaloObjEmu& to);
static void encode(const l1ct::HadCaloObjEmu& from, l1ct::HadCaloObjEmu& to);
static void decode(l1ct::HadCaloObjEmu& had, l1ct::EmCaloObjEmu& em);

protected:
const unsigned int NTK_SECTORS, NCALO_SECTORS;
const unsigned int NTK_LINKS, HCAL_LINKS, ECAL_LINKS, NMU_LINKS;
Expand Down Expand Up @@ -115,10 +119,6 @@ namespace l1ct {
const std::vector<DetectorSector<l1ct::HadCaloObjEmu>>& had_in,
std::vector<l1ct::HadCaloObjEmu>& links,
std::vector<bool>& valid);

void encode(const l1ct::EmCaloObjEmu& from, l1ct::HadCaloObjEmu& to);
void encode(const l1ct::HadCaloObjEmu& from, l1ct::HadCaloObjEmu& to);
void decode(l1ct::HadCaloObjEmu& had, l1ct::EmCaloObjEmu& em);
};
} // namespace l1ct

Expand Down
112 changes: 83 additions & 29 deletions L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_patternWriters_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
maxLinesPerOutputFile = cms.uint32(1024),
eventsPerFile = cms.uint32(_eventsPerFile),
tfTimeSlices = cms.VPSet(),
gctNLinksEcal = cms.uint32(1),
gctNLinksHad = cms.uint32(2),
gctSectors = cms.VPSet(),
gmtTimeSlices = cms.VPSet(),
gmtNumberOfMuons = cms.uint32(12),
Expand Down Expand Up @@ -51,7 +53,8 @@
outputFileName = cms.string("l1BarrelPhi1Serenity-outputs")
)
barrelSerenityVU13PPhi1Config = barrelSerenityPhi1Config.clone(
gttLink = cms.int32(4*31+3),
gttLink = cms.int32(4*25+3),
gmtTimeSlices = cms.VPSet(*[cms.PSet(gmtLink = cms.int32(4*18+t)) for t in range(3)]),
inputFileName = cms.string("l1BarrelPhi1Serenity-inputs-vu13p"),
)
for t in range(3):
Expand All @@ -65,8 +68,9 @@
for i,s in enumerate([0,1]):
barrelSerenityVU9PPhi1Config.gctSectors[s].gctLinksHad = [3*i+4*18, 3*i+4*18+1]
barrelSerenityVU9PPhi1Config.gctSectors[s].gctLinksEcal = [3*i+4*18+2]
barrelSerenityVU13PPhi1Config.gctSectors[s].gctLinksHad = [3*i+4*18, 3*i+4*18+1]
barrelSerenityVU13PPhi1Config.gctSectors[s].gctLinksEcal = [3*i+4*18+2]
gctLinks = list(range(4*17,4*17+4)) + list(range(4*19,4*19+2))
barrelSerenityVU13PPhi1Config.gctSectors[s].gctLinksHad = [gctLinks[3*i], gctLinks[3*i+1]]
barrelSerenityVU13PPhi1Config.gctSectors[s].gctLinksEcal = [gctLinks[3*i+2]]

barrelWriterConfigs = barrelWriterOutputOnlyPhiConfigs

Expand Down Expand Up @@ -115,19 +119,22 @@
hgcalNegVU9PWriterConfig = _hgcalNegWriterConfig.clone()
for t in range(3):
hgcalPosVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(-1)) for i in range(9) ] # neg
hgcalPosVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*2)) for i in range(4) ] # pos, left quads
hgcalPosVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*25)) for i in range(5) ] # pos, right quads
hgcalNegVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*2)) for i in range(4) ] # neg, left quads
hgcalNegVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*25)) for i in range(5) ] # neg, right quads
hgcalPosVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*1)) for i in range(4) ] # pos, left quads
hgcalPosVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*26)) for i in range(5) ] # pos, right quads
hgcalNegVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*1)) for i in range(4) ] # neg, left quads
hgcalNegVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*26)) for i in range(5) ] # neg, right quads
hgcalNegVU9PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(-1)) for i in range(9) ] # pos
hgcalPosVU9PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(-1,-1,-1,-1)) for i in range(3) ] # neg
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
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
hgcalNegVU9PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(-1,-1,-1,-1)) for i in range(3) ] # pos
hgcalPosVU9PWriterConfig.gmtTimeSlices[t].gmtLink = cms.int32(4+t)
hgcalNegVU9PWriterConfig.gmtTimeSlices[t].gmtLink = cms.int32(4+t)
hgcalPosVU9PWriterConfig.gttLink = 4+3
hgcalNegVU9PWriterConfig.gttLink = 4+3
hgcQuads = [list(range(4*i,4*i+4)) for i in [10,11,12,13]]
hgcQuads += [[4*14+1,4*14+2,4*14+3,4*15+3]] # mixed quad
hgcQuads += [list(range(4*i,4*i+4)) for i in [16,17,18,19]]
hgcalPosVU9PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(-1,-1,-1,-1)) for i in range(3) ] # neg
hgcalPosVU9PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(*hgcQuads[3*i+t])) for i in range(3) ] # pos
hgcalNegVU9PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(*hgcQuads[3*i+t])) for i in range(3) ] # neg
hgcalNegVU9PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(-1,-1,-1,-1)) for i in range(3) ] # pos
hgcalPosVU9PWriterConfig.gmtTimeSlices[t].gmtLink = cms.int32(4*15+((t+2)%3))
hgcalNegVU9PWriterConfig.gmtTimeSlices[t].gmtLink = cms.int32(4*15+((t+2)%3))
hgcalPosVU9PWriterConfig.gttLink = 4*14+0
hgcalNegVU9PWriterConfig.gttLink = 4*14+0
hgcalPosVU9PWriterConfig.inputFileName = cms.string("l1HGCalPos-inputs-vu9p")
hgcalNegVU9PWriterConfig.inputFileName = cms.string("l1HGCalNeg-inputs-vu9p")
## Current configurations for VU13P
Expand All @@ -140,15 +147,15 @@
hgcalNegVU13PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*0)) for i in range(5) ] # neg, left quads
hgcalNegVU13PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*28)) for i in range(4) ] # neg, right quads
hgcalNegVU13PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(-1)) for i in range(9) ] # pos
hgcQuads = [list(range(4*i,4*i+4)) for i in [12,13,14, 16,17, 19,20,21,22]]
hgcalPosVU13PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(-1,-1,-1,-1)) for i in range(3) ] # neg
for isec,q0 in (0,12),(1,17),(2,20):
hgcalPosVU13PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(*[4*q0+4*t+j for j in range(4)])) ] # pos
hgcalNegVU13PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(*[4*q0+4*t+j for j in range(4)])) ] # neg
hgcalPosVU13PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(*hgcQuads[3*i+t])) for i in range(3) ] # pos
hgcalNegVU13PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(*hgcQuads[3*i+t])) for i in range(3) ] # neg
hgcalNegVU13PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(-1,-1,-1,-1)) for i in range(3) ] # pos
hgcalPosVU13PWriterConfig.gmtTimeSlices[t].gmtLink = cms.int32(4*27+t)
hgcalNegVU13PWriterConfig.gmtTimeSlices[t].gmtLink = cms.int32(4*27+t)
hgcalPosVU13PWriterConfig.gttLink = 4*27+3
hgcalNegVU13PWriterConfig.gttLink = 4*27+3
hgcalPosVU13PWriterConfig.gmtTimeSlices[t].gmtLink = cms.int32(4*18+t)
hgcalNegVU13PWriterConfig.gmtTimeSlices[t].gmtLink = cms.int32(4*18+t)
hgcalPosVU13PWriterConfig.gttLink = 4*25+3
hgcalNegVU13PWriterConfig.gttLink = 4*25+3
hgcalPosVU13PWriterConfig.inputFileName = cms.string("l1HGCalPos-inputs-vu13p")
hgcalNegVU13PWriterConfig.inputFileName = cms.string("l1HGCalNeg-inputs-vu13p")

Expand Down Expand Up @@ -190,8 +197,8 @@
hgcalNoTKVU13PWriterConfig = _hgcalNoTKWriterConfig.clone()
for t in range(3):
for isec in range(6):
q0 = 3*isec + 6
hgcalNoTKVU13PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(*[4*q0+4*t+j for j in range(4)])) ] # pos
q0 = 3*isec + (6 if isec < 3 else 8)
hgcalNoTKVU13PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(*[4*q0+4*t+j for j in range(4)])) ]
hgcalNoTKVU13PWriterConfig.inputFileName = cms.string("l1HGCalNoTK-inputs-vu13p") # vu9p uses the same cabling for now

hgcalNoTKWriterConfigs = [
Expand All @@ -200,7 +207,42 @@
]

#####################################################################################################################
## HGCal TM18 configuration
## TM18 configuration
_barrelSerenityTM18 = _barrelWriterOutputOnly.clone(
tmuxFactor = cms.uint32(18),
tfTimeSlices = None,
tfSectors = cms.VPSet(*[cms.PSet(tfLink = cms.int32(-1)) for i in range(18)]),
gmtTimeSlices = None,
gmtLink = cms.int32(4*18+0),
gttLink = 4*28+3,
eventsPerFile = 4,
)
barrelSerenityOutputTM18WriterConfig = _barrelSerenityTM18.clone(
outputRegions = cms.vuint32(*range(54)),
outputBoard = cms.int32(0),
outputFileName = cms.string("l1BarrelSerenityTM18-outputs")
)
barrelSerenityVU13PTM18WriterConfig = _barrelSerenityTM18.clone(
inputFileName = cms.string("l1BarrelSerenityTM18-inputs-vu13p"),
gttLatency = cms.uint32(167), # shorter, to fit 6 events in 1024 lines
maxLinesPerInputFile = cms.uint32(1024+167), # anything beyond 986 will be nulls
gctNLinksEcal = 1,
gctNLinksHad = 1,
gctSectors = cms.VPSet(*[cms.PSet(
gctLinksHad = cms.vint32(4*18+1+s),
gctLinksEcal = cms.vint32(4*18+1+s),
) for s in range(3)]),
)
for ie in range(2):
for iphi in range(9):
isec = 9*ie+iphi
barrelSerenityVU13PTM18WriterConfig.tfSectors[isec].tfLink = (isec if isec < 12 else (4*30+(isec-12)))

barrelSerenityTM18WriterConfigs = [
barrelSerenityOutputTM18WriterConfig,
barrelSerenityVU13PTM18WriterConfig
]

_hgcalWriterTM18 = _hgcalWriterConfig.clone(
tmuxFactor = cms.uint32(18),
tfTimeSlices = None,
Expand All @@ -210,7 +252,7 @@
gmtTimeSlices = None,
gmtLink = cms.int32(4*27+0),
gttLink = 4*27+3,
eventsPerFile = 6,
eventsPerFile = 4,
)
hgcalWriterOutputTM18WriterConfig = _hgcalWriterTM18.clone(
outputFileName = cms.string("l1HGCalTM18-outputs"),
Expand All @@ -222,19 +264,31 @@
inputFileName = cms.string("l1HGCalTM18-inputs-vu9p"),
gttLatency = cms.uint32(167), # shorter, to fit 6 events in 1024 lines
maxLinesPerInputFile = cms.uint32(1024+167), # anything beyond 986 will be nulls
gmtLink = 4*15+2,
gttLink = 0,
)
hgcalWriterVU13PTM18WriterConfig = hgcalWriterVU9PTM18WriterConfig.clone(
inputFileName = cms.string("l1HGCalTM18-inputs-vu13p"),
gmtLink = 4*18+0,
gttLink = 4*28+3,
)
for ie in range(2):
for iphi in range(9):
isec, ilink = 9*ie+iphi, 2*iphi+ie
hgcalWriterVU9PTM18WriterConfig.tfSectors[isec].tfLink = (ilink if ilink < 12 else (4*28+(ilink-12)))
hgcalWriterVU9PTM18WriterConfig.tfSectors[isec].tfLink = (ilink+2 if ilink < 10 else (4*28+(ilink-10)))
hgcalWriterVU13PTM18WriterConfig.tfSectors[isec].tfLink = (ilink if ilink < 12 else (4*30+(ilink-12)))
for iphi in range(3):
isec, ilink = 3*ie+iphi, 2*iphi+ie
hgcalWriterVU9PTM18WriterConfig.hgcSectors[isec].hgcLinks += range(4*(12+ilink),4*(12+ilink)+4)
hgcalWriterVU13PTM18WriterConfig.hgcSectors[isec].hgcLinks += range(4*(13+ilink),4*(13+ilink)+4)
if ilink < 2:
hgcalWriterVU9PTM18WriterConfig.hgcSectors[isec].hgcLinks += range(4*(12+ilink),4*(12+ilink)+4)
else:
hgcalWriterVU9PTM18WriterConfig.hgcSectors[isec].hgcLinks += range(4*(14+ilink),4*(14+ilink)+4)
if ilink < 3:
hgcalWriterVU13PTM18WriterConfig.hgcSectors[isec].hgcLinks += range(4*(12+ilink),4*(12+ilink)+4)
elif ilink < 5:
hgcalWriterVU13PTM18WriterConfig.hgcSectors[isec].hgcLinks += range(4*(13+ilink),4*(13+ilink)+4)
else:
hgcalWriterVU13PTM18WriterConfig.hgcSectors[isec].hgcLinks += range(4*(14+ilink),4*(14+ilink)+4)

hgcalTM18WriterConfigs = [
hgcalWriterOutputTM18WriterConfig,
Expand Down
Loading

0 comments on commit a9682e8

Please sign in to comment.