From 8ce7ce440c7ada82fa0663234bdf1c3ee1b926dc Mon Sep 17 00:00:00 2001 From: Giovanni Date: Fri, 16 Jun 2023 12:57:32 +0200 Subject: [PATCH 1/8] Configure regionizer emulator for fwd hgcal region instead of ideal one --- .../python/l1ctLayer1_cff.py | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py index 4b41d349e4524..06962889d01ed 100644 --- a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py +++ b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py @@ -326,17 +326,31 @@ hgcalInputConversionParameters = cms.PSet( slim = cms.bool(True) ), - regionizerAlgo = cms.string("Ideal"), - pfAlgo = cms.string("PFAlgoDummy"), - puAlgo = cms.string("LinearizedPuppi"), + regionizerAlgo = cms.string("Multififo"), regionizerAlgoParameters = cms.PSet( useAlsoVtxCoords = cms.bool(True), - ), + nEndcaps = cms.uint32(2), + nClocks = cms.uint32(54), + nTkLinks = cms.uint32(0), + nCaloLinks = cms.uint32(3), + nTrack = cms.uint32(0), + nCalo = cms.uint32(12), + nEmCalo = cms.uint32(12), + nMu = cms.uint32(4), + egInterceptMode = cms.PSet( + afterFifo = cms.bool(True), + emIDMask = cms.uint32(0x1E), + nHADCALO_IN = cms.uint32(12), + nEMCALO_OUT = cms.uint32(12), + ) + ), + pfAlgo = cms.string("PFAlgoDummy"), pfAlgoParameters = cms.PSet( nCalo = cms.uint32(12), nMu = cms.uint32(4), # unused debug = cms.untracked.bool(False) ), + puAlgo = cms.string("LinearizedPuppi"), puAlgoParameters = cms.PSet( nTrack = cms.uint32(0), # unused nIn = cms.uint32(12), From e9ca3e7b9f4ed419ccae2580e48112f8ebb83030 Mon Sep 17 00:00:00 2001 From: Giovanni Date: Mon, 3 Jul 2023 14:00:36 +0200 Subject: [PATCH 2/8] fillDescriptions for L1SeedConePFJetProducers & related config fixes --- .../plugins/L1SeedConePFJetProducer.cc | 17 +++++++++++++++++ .../python/l1pfJetMet_cff.py | 3 ++- .../l1tSeedConePFJetEmulatorProducer_cfi.py | 2 ++ .../python/l1tSeedConePFJetProducer_cfi.py | 15 --------------- .../test/make_l1ct_binaryFiles_cfg.py | 4 ++-- 5 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 L1Trigger/Phase2L1ParticleFlow/python/l1tSeedConePFJetEmulatorProducer_cfi.py delete mode 100644 L1Trigger/Phase2L1ParticleFlow/python/l1tSeedConePFJetProducer_cfi.py diff --git a/L1Trigger/Phase2L1ParticleFlow/plugins/L1SeedConePFJetProducer.cc b/L1Trigger/Phase2L1ParticleFlow/plugins/L1SeedConePFJetProducer.cc index 5cf255385f433..450269d466a7e 100644 --- a/L1Trigger/Phase2L1ParticleFlow/plugins/L1SeedConePFJetProducer.cc +++ b/L1Trigger/Phase2L1ParticleFlow/plugins/L1SeedConePFJetProducer.cc @@ -8,6 +8,8 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "DataFormats/L1TParticleFlow/interface/PFCandidate.h" #include "DataFormats/L1TParticleFlow/interface/PFJet.h" @@ -23,6 +25,8 @@ class L1SeedConePFJetProducer : public edm::global::EDProducer<> { explicit L1SeedConePFJetProducer(const edm::ParameterSet&); ~L1SeedConePFJetProducer() override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + private: /// ///////////////// /// /// MANDATORY METHODS /// @@ -213,5 +217,18 @@ std::vector L1SeedConePFJetProducer::convertHWToEDM( return edmJets; } +void L1SeedConePFJetProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("L1PFObjects", edm::InputTag("l1tLayer1", "Puppi")); + desc.add("nJets", 16); + desc.add("coneSize", 0.4); + desc.add("HW", false); + desc.add("debug", false); + desc.add("doCorrections", false); + desc.add("correctorFile", ""); + desc.add("correctorDir", ""); + descriptions.add("l1tSeedConePFJetProducer", desc); +} + #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(L1SeedConePFJetProducer); diff --git a/L1Trigger/Phase2L1ParticleFlow/python/l1pfJetMet_cff.py b/L1Trigger/Phase2L1ParticleFlow/python/l1pfJetMet_cff.py index 60d58d2ac23dd..a2a34b149513a 100644 --- a/L1Trigger/Phase2L1ParticleFlow/python/l1pfJetMet_cff.py +++ b/L1Trigger/Phase2L1ParticleFlow/python/l1pfJetMet_cff.py @@ -1,6 +1,7 @@ import FWCore.ParameterSet.Config as cms -from L1Trigger.Phase2L1ParticleFlow.l1tSeedConePFJetProducer_cfi import l1tSeedConePFJetProducer, l1tSeedConePFJetEmulatorProducer +from L1Trigger.Phase2L1ParticleFlow.l1tSeedConePFJetProducer_cfi import l1tSeedConePFJetProducer +from L1Trigger.Phase2L1ParticleFlow.l1tSeedConePFJetEmulatorProducer_cfi import l1tSeedConePFJetEmulatorProducer from L1Trigger.Phase2L1ParticleFlow.l1tDeregionizerProducer_cfi import l1tDeregionizerProducer as l1tLayer2Deregionizer, l1tDeregionizerProducerExtended as l1tLayer2DeregionizerExtended l1tSCPFL1PF = l1tSeedConePFJetProducer.clone(L1PFObjects = 'l1tLayer1:PF') l1tSCPFL1Puppi = l1tSeedConePFJetProducer.clone() diff --git a/L1Trigger/Phase2L1ParticleFlow/python/l1tSeedConePFJetEmulatorProducer_cfi.py b/L1Trigger/Phase2L1ParticleFlow/python/l1tSeedConePFJetEmulatorProducer_cfi.py new file mode 100644 index 0000000000000..2c859e0a97af7 --- /dev/null +++ b/L1Trigger/Phase2L1ParticleFlow/python/l1tSeedConePFJetEmulatorProducer_cfi.py @@ -0,0 +1,2 @@ +from L1Trigger.Phase2L1ParticleFlow.l1tSeedConePFJetProducer_cfi import l1tSeedConePFJetProducer as _l1tSeedConePFJetProducer +l1tSeedConePFJetEmulatorProducer = _l1tSeedConePFJetProducer.clone(HW = True) \ No newline at end of file diff --git a/L1Trigger/Phase2L1ParticleFlow/python/l1tSeedConePFJetProducer_cfi.py b/L1Trigger/Phase2L1ParticleFlow/python/l1tSeedConePFJetProducer_cfi.py deleted file mode 100644 index eb7fd2fd1e081..0000000000000 --- a/L1Trigger/Phase2L1ParticleFlow/python/l1tSeedConePFJetProducer_cfi.py +++ /dev/null @@ -1,15 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -l1tSeedConePFJetProducer = cms.EDProducer("L1SeedConePFJetProducer", - L1PFObjects = cms.InputTag("l1tLayer1","Puppi"), - nJets = cms.uint32(16), - coneSize = cms.double(0.4), - HW = cms.bool(False), - debug = cms.bool(False), - doCorrections = cms.bool(False), - correctorFile = cms.string(""), - correctorDir = cms.string("") - ) - -l1tSeedConePFJetEmulatorProducer = l1tSeedConePFJetProducer.clone(HW = True) - diff --git a/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py b/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py index 21d6d105095f9..203f6dfbeebb3 100644 --- a/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py +++ b/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py @@ -60,11 +60,11 @@ from L1Trigger.Phase2L1GMT.gmt_cfi import l1tStandaloneMuons process.l1tSAMuonsGmt = l1tStandaloneMuons.clone() -from L1Trigger.Phase2L1ParticleFlow.l1tSeedConePFJetProducer_cfi import l1tSeedConePFJetEmulatorProducer +from L1Trigger.Phase2L1ParticleFlow.l1tSeedConePFJetEmulatorProducer_cfi import l1tSeedConePFJetEmulatorProducer from L1Trigger.Phase2L1ParticleFlow.l1tDeregionizerProducer_cfi import l1tDeregionizerProducer from L1Trigger.Phase2L1ParticleFlow.l1tJetFileWriter_cfi import l1tSeededConeJetFileWriter process.l1tLayer2Deregionizer = l1tDeregionizerProducer.clone() -process.l1tLayer2SeedConeJetsCorrected = l1tSeedConePFJetEmulatorProducer.clone(L1PFObject = cms.InputTag('l1tLayer2Deregionizer', 'Puppi'), +process.l1tLayer2SeedConeJetsCorrected = l1tSeedConePFJetEmulatorProducer.clone(L1PFObjects = cms.InputTag('l1tLayer2Deregionizer', 'Puppi'), doCorrections = cms.bool(True), correctorFile = cms.string("L1Trigger/Phase2L1ParticleFlow/data/jecs/jecs_20220308.root"), correctorDir = cms.string('L1PuppiSC4EmuJets')) From 693cbfaebbe88e9241dda9cd45f40e6ec9ee1c5d Mon Sep 17 00:00:00 2001 From: Giovanni Date: Mon, 3 Jul 2023 16:37:32 +0200 Subject: [PATCH 3/8] Cleanup & improve pattern writer config --- .../plugins/L1CTJetFileWriter.cc | 2 +- .../python/l1ctLayer1_patternWriters_cff.py | 221 ++++++++++-------- .../python/l1tJetFileWriter_cfi.py | 3 +- .../Phase2L1ParticleFlow/test/.gitignore | 2 + .../test/make_l1ct_binaryFiles_cfg.py | 41 +--- 5 files changed, 143 insertions(+), 126 deletions(-) diff --git a/L1Trigger/Phase2L1ParticleFlow/plugins/L1CTJetFileWriter.cc b/L1Trigger/Phase2L1ParticleFlow/plugins/L1CTJetFileWriter.cc index 4696bfa2fe70f..82957e57178e1 100644 --- a/L1Trigger/Phase2L1ParticleFlow/plugins/L1CTJetFileWriter.cc +++ b/L1Trigger/Phase2L1ParticleFlow/plugins/L1CTJetFileWriter.cc @@ -114,7 +114,7 @@ void L1CTJetFileWriter::fillDescriptions(edm::ConfigurationDescriptions& descrip desc.add("nFramesPerBX", 9); desc.add("TMUX", 6); desc.add("maxLinesPerFile", 1024); - desc.add("format", "EMP"); + desc.add("format", "EMPv2"); descriptions.addDefault(desc); } diff --git a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_patternWriters_cff.py b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_patternWriters_cff.py index 9d9affc831d1c..823302c8f1103 100644 --- a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_patternWriters_cff.py +++ b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_patternWriters_cff.py @@ -1,58 +1,77 @@ import FWCore.ParameterSet.Config as cms -eventsPerFile_ = 12 -gttLatency_ = 156+120 -gttNumberOfPVs_ = 10 +_eventsPerFile = 12 +_gttLatency = 156+120 +_gttNumberOfPVs = 10 ##################################################################################################################### ## Barrel configurations: 54 regions, 6 puppi output links, only write out the layer 1 outputs for now -barrelWriterOutputOnly_ = cms.PSet( +_barrelWriterOutputOnly = cms.PSet( partition = cms.string("Barrel"), outputLinksPuppi = cms.vuint32(*range(6)), outputLinkEgamma = cms.int32(6), nEgammaObjectsOut = cms.uint32(16), + nInputFramesPerBX = cms.uint32(9), nOutputFramesPerBX = cms.uint32(9), fileFormat = cms.string("EMPv2"), + inputFileExtension = cms.string("txt.gz"), outputFileExtension = cms.string("txt.gz"), + maxLinesPerInputFile = cms.uint32(1024), maxLinesPerOutputFile = cms.uint32(1024), - eventsPerFile = cms.uint32(eventsPerFile_), + eventsPerFile = cms.uint32(_eventsPerFile), ) -## Barrel (54) split in 3 eta slices -barrelWriterOutputOnlyEtaConfigs = [ - barrelWriterOutputOnly_.clone( - outputRegions = cms.vuint32(*[18*ie+i for i in range(18)]), - outputFileName = cms.string("l1BarrelEta%d-outputs-ideal" % (ie+1)), - outputBoard = cms.int32(-1), ## can't output e/gamma in eta split regions - outputLinkEgamma = cms.int32(-1), ## since the boards are defined in phi regions - ) for ie in range(3) -] ## Barrel (54) split in 3 phi slices barrelWriterOutputOnlyPhiConfigs = [ - barrelWriterOutputOnly_.clone( + _barrelWriterOutputOnly.clone( outputRegions = cms.vuint32(*[3*ip+9*ie+i for ie in range(6) for i in range(3) ]), outputBoard = cms.int32(ip), - outputFileName = cms.string("l1BarrelPhi%d-outputs-ideal" % (ip+1)) - ) for ip in range(3) -] -## Barrel9 (27) split in phi eta slices -barrel9WriterOutputOnlyPhiConfigs = [ - barrelWriterOutputOnly_.clone( - outputRegions = cms.vuint32(*[3*ip+9*ie+i for ie in range(3) for i in range(3) ]), - outputBoard = cms.int32(ip), - outputFileName = cms.string("l1Barrel9Phi%d-outputs-ideal" % (ip+1)) + outputFileName = cms.string("l1BarrelPhi%d-outputs" % (ip+1)) ) for ip in range(3) ] -barrelWriterConfigs = barrelWriterOutputOnlyPhiConfigs # + barrelWriterOutputOnlyEtaConfigs -barrel9WriterConfigs = [] #barrel9WriterOutputOnlyPhiConfigs +barrelSerenityPhi1Config = barrelWriterOutputOnlyPhiConfigs[0].clone( + tfTimeSlices = cms.VPSet(*[cms.PSet(tfSectors = cms.VPSet(*[ cms.PSet(tfLink = cms.int32(-1)) for s in range(18) ])) for t in range(3)]), + gctSectors = cms.VPSet(*[cms.PSet( + gctLinksHad = cms.vint32(-1,-1), + gctLinksEcal = cms.vint32(-1), + ) for s in range(3)]), + gmtTimeSlices = cms.VPSet(*[cms.PSet(gmtLink = cms.int32(4*17+t)) for t in range(3)]), + gmtNumberOfMuons = cms.uint32(12), + gttLatency = cms.uint32(156+10), + gttNumberOfPVs = cms.uint32(_gttNumberOfPVs), + inputFileName = cms.string("l1BarrelPhi1Serenity-inputs-vu9p"), + outputFileName = cms.string("l1BarrelPhi1Serenity-outputs") +) +barrelSerenityVU9PPhi1Config = barrelSerenityPhi1Config.clone( + gttLink = cms.int32(4*28+3), + inputFileName = cms.string("l1BarrelPhi1Serenity-inputs-vu9p"), + outputFileName = cms.string("l1BarrelPhi1Serenity-outputs") +) +barrelSerenityVU13PPhi1Config = barrelSerenityPhi1Config.clone( + gttLink = cms.int32(4*31+3), + inputFileName = cms.string("l1BarrelPhi1Serenity-inputs-vu13p"), +) +for t in range(3): + for ie in range(2): + for i,s in enumerate([8, 0, 1, 2, 3]): + loglink = 3*(i+5*ie)+t + physlink = loglink+4*1 if loglink < 15 else (loglink-15)+4*25 + barrelSerenityVU9PPhi1Config.tfTimeSlices[t].tfSectors[s+9*ie].tfLink = physlink + physlink = loglink+4*0 if loglink < 15 else (loglink-15)+4*28 + barrelSerenityVU13PPhi1Config.tfTimeSlices[t].tfSectors[s+9*ie].tfLink = physlink +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] + +barrelWriterConfigs = barrelWriterOutputOnlyPhiConfigs ##################################################################################################################### ## HGcal configuration: write out both inputs and outputs -hgcalWriterConfig_ = cms.PSet( +_hgcalWriterConfig = cms.PSet( partition = cms.string("HGCal"), - outputRegions = cms.vuint32(*[i+9 for i in range(9)]), - outputBoard = cms.int32(1), nEgammaObjectsOut = cms.uint32(16), nInputFramesPerBX = cms.uint32(9), nOutputFramesPerBX = cms.uint32(9), @@ -61,124 +80,138 @@ outputFileExtension = cms.string("txt.gz"), maxLinesPerInputFile = cms.uint32(1024), maxLinesPerOutputFile = cms.uint32(1024), - eventsPerFile = cms.uint32(eventsPerFile_), + eventsPerFile = cms.uint32(_eventsPerFile), tfTimeSlices = cms.VPSet(*[cms.PSet(tfSectors = cms.VPSet()) for i in range(3)]), hgcTimeSlices = cms.VPSet(*[cms.PSet(hgcSectors = cms.VPSet()) for i in range(3)]), gmtTimeSlices = cms.VPSet(cms.PSet(),cms.PSet(),cms.PSet()), gmtNumberOfMuons = cms.uint32(12), gttLink = cms.int32(-1), - gttLatency = cms.uint32(gttLatency_), - gttNumberOfPVs = cms.uint32(gttNumberOfPVs_) + gttLatency = cms.uint32(_gttLatency), + gttNumberOfPVs = cms.uint32(_gttNumberOfPVs), + outputLinksPuppi = cms.vuint32(*range(3)), + outputLinkEgamma = cms.int32(3), ) ## Ideal configuration: 27 input links from tf, 36 from hgc, 3 from gmt, 1 from gtt, in this order; output 3 puppi + 1 e/gamma -hgcalPosIdealWriterConfig = hgcalWriterConfig_.clone() -for t in range(3): - hgcalPosIdealWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(-1)) for i in range(9) ] # neg - hgcalPosIdealWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t)) for i in range(9) ] # pos - hgcalPosIdealWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(-1,-1,-1,-1)) for i in range(3) ] # neg - hgcalPosIdealWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(*[27+12*i+4*t+j for j in range(4)])) for i in range(3) ] # pos - hgcalPosIdealWriterConfig.gmtTimeSlices[t].gmtLink = cms.int32(27+36+t) -hgcalPosIdealWriterConfig.gttLink = 27+36+3 -hgcalPosIdealWriterConfig.outputLinksPuppi = cms.vuint32(0,1,2) -hgcalPosIdealWriterConfig.outputLinkEgamma = cms.int32(5) -hgcalPosIdealWriterConfig.inputFileName = cms.string("l1HGCalPos-inputs-ideal") -hgcalPosIdealWriterConfig.outputFileName = cms.string("l1HGCalPos-outputs-ideal") -hgcalNegIdealWriterConfig = hgcalPosIdealWriterConfig.clone( - inputFileName = "", - outputFileName = "l1HGCalNeg-outputs-ideal", +_hgcalPosWriterConfig = _hgcalWriterConfig.clone( + outputRegions = cms.vuint32(*[i+9 for i in range(9)]), + outputBoard = cms.int32(1), +) +_hgcalNegWriterConfig = _hgcalPosWriterConfig.clone( outputRegions = [i for i in range(9)], outputBoard = 0, ) -## Current configuration for VU9P at B904 for layer1 - layer2 tests with puppi and e/gamma outputs on links 56-59 -hgcalPosVU9PB904egWriterConfig = hgcalWriterConfig_.clone() +hgcalPosOutputWriterConfig = _hgcalPosWriterConfig.clone( + outputFileName = cms.string("l1HGCalPos-outputs") +) +hgcalNegOutputWriterConfig = _hgcalNegWriterConfig.clone( + outputFileName = cms.string("l1HGCalNeg-outputs") +) +## Current configurations for VU9P +hgcalPosVU9PWriterConfig = _hgcalPosWriterConfig.clone() +hgcalNegVU9PWriterConfig = _hgcalNegWriterConfig.clone() for t in range(3): - hgcalPosVU9PB904egWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(-1)) for i in range(9) ] # neg - hgcalPosVU9PB904egWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*2)) for i in range(4) ] # pos, left quads - hgcalPosVU9PB904egWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*25)) for i in range(5) ] # pos, right quads - hgcalPosVU9PB904egWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(-1,-1,-1,-1)) for i in range(3) ] # neg - hgcalPosVU9PB904egWriterConfig.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 - hgcalPosVU9PB904egWriterConfig.gmtTimeSlices[t].gmtLink = cms.int32(4+t) -hgcalPosVU9PB904egWriterConfig.gttLink = 4+3 -hgcalPosVU9PB904egWriterConfig.outputLinksPuppi = cms.vuint32(56,57,58) -hgcalPosVU9PB904egWriterConfig.outputLinkEgamma = cms.int32(59) -hgcalPosVU9PB904egWriterConfig.inputFileName = cms.string("l1HGCalPos-inputs-vu9p_B904eg") -hgcalPosVU9PB904egWriterConfig.outputFileName = cms.string("l1HGCalPos-outputs-vu9p_B904eg") -## Current configuration for VU13P -hgcalPosVU13PWriterConfig = hgcalWriterConfig_.clone() + 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 + 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 +hgcalPosVU9PWriterConfig.inputFileName = cms.string("l1HGCalPos-inputs-vu9p") +hgcalNegVU9PWriterConfig.inputFileName = cms.string("l1HGCalNeg-inputs-vu9p") +## Current configurations for VU13P +hgcalPosVU13PWriterConfig = _hgcalPosWriterConfig.clone() +hgcalNegVU13PWriterConfig = _hgcalNegWriterConfig.clone() for t in range(3): - hgcalPosVU13PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(-1)) for i in range(9) ] # neg - hgcalPosVU13PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*0)) for i in range(5) ] # pos, left quads + hgcalPosVU13PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(-1)) for i in range(9) ] # neg + hgcalPosVU13PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*0)) for i in range(5) ] # pos, left quads hgcalPosVU13PWriterConfig.tfTimeSlices[t].tfSectors += [ cms.PSet(tfLink = cms.int32(3*i+t+4*28)) for i in range(4) ] # pos, right quads + 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 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 - hgcalPosVU13PWriterConfig.gmtTimeSlices[t].gmtLink = cms.int32(4*27+t) -hgcalPosVU13PWriterConfig.gttLink = 4*27+3 -hgcalPosVU13PWriterConfig.outputLinksPuppi = cms.vuint32(0,1,2) -hgcalPosVU13PWriterConfig.outputLinkEgamma = cms.int32(3) -hgcalPosVU13PWriterConfig.inputFileName = cms.string("l1HGCalPos-inputs-vu13p") -hgcalPosVU13PWriterConfig.outputFileName = cms.string("l1HGCalPos-outputs-vu13p") -hgcalNegVU13PWriterConfig = hgcalWriterConfig_.clone() -for t in range(3): - 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 - for isec,q0 in (0,12),(1,17),(2,20): hgcalNegVU13PWriterConfig.hgcTimeSlices[t].hgcSectors += [ cms.PSet(hgcLinks = cms.vint32(*[4*q0+4*t+j for j in range(4)])) ] # 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 -hgcalNegVU13PWriterConfig.outputLinksPuppi = cms.vuint32(0,1,2) -hgcalNegVU13PWriterConfig.outputLinkEgamma = cms.int32(3) +hgcalPosVU13PWriterConfig.inputFileName = cms.string("l1HGCalPos-inputs-vu13p") hgcalNegVU13PWriterConfig.inputFileName = cms.string("l1HGCalNeg-inputs-vu13p") -hgcalNegVU13PWriterConfig.outputFileName = cms.string("l1HGCalNeg-outputs-vu13p") - -## Enable both +## Enable outputs and both boards hgcalWriterConfigs = [ - hgcalPosIdealWriterConfig, - hgcalNegIdealWriterConfig, - hgcalPosVU9PB904egWriterConfig, + hgcalPosOutputWriterConfig, + hgcalNegOutputWriterConfig, + hgcalPosVU9PWriterConfig, + hgcalNegVU9PWriterConfig, hgcalPosVU13PWriterConfig, hgcalNegVU13PWriterConfig ] ##################################################################################################################### ## Forward HGCal configuration: only outputs for now, 18 regions, 12 candidates x region, 4 output fibers -hgcalNoTKWriterOutputOnlyConfig = cms.PSet( +_hgcalNoTKWriterConfig = cms.PSet( partition = cms.string("HGCalNoTk"), outputRegions = cms.vuint32(*range(18)), + nInputFramesPerBX = cms.uint32(9), nOutputFramesPerBX = cms.uint32(9), fileFormat = cms.string("EMPv2"), inputFileExtension = cms.string("txt.gz"), outputFileExtension = cms.string("txt.gz"), + maxLinesPerInputFile = cms.uint32(1024), maxLinesPerOutputFile = cms.uint32(1024), - eventsPerFile = cms.uint32(eventsPerFile_), - outputLinksPuppi = cms.vuint32(0,1,2,4), - outputFileName = cms.string("l1HGCalNoTk-outputs-ideal") + eventsPerFile = cms.uint32(_eventsPerFile), +) +hgcalNoTKOutputWriterConfig = _hgcalNoTKWriterConfig.clone( + outputLinksPuppi = cms.vuint32(*range(4)), + outputFileName = cms.string("l1HGCalNoTK-outputs") ) +hgcalNoTKVU13PWriterConfig = _hgcalNoTKWriterConfig.clone( + hgcTimeSlices = cms.VPSet(*[cms.PSet(hgcSectors = cms.VPSet()) for i in range(3)]), + gmtTimeSlices = cms.VPSet(*[cms.PSet(gmtLink = cms.int32(-1)) for i in range(3)]), + gmtNumberOfMuons = cms.uint32(12), + gttLink = cms.int32(-1), + gttLatency = cms.uint32(_gttLatency), + gttNumberOfPVs = cms.uint32(_gttNumberOfPVs), +) +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 +hgcalNoTKVU13PWriterConfig.inputFileName = cms.string("l1HGCalNoTK-inputs-vu13p") # vu9p uses the same cabling for now hgcalNoTKWriterConfigs = [ - hgcalNoTKWriterOutputOnlyConfig + hgcalNoTKOutputWriterConfig, + hgcalNoTKVU13PWriterConfig ] ##################################################################################################################### -## HF configuration: not enabled for the moment +## HF configuration (to be better defined later) ##################################################################################################################### ## HF configuration not realistic, 3 links per endcap, write out the layer 1 outputs for now -hfWriterOutputOnly_ = cms.PSet( +_hfWriterOutputOnly = cms.PSet( partition = cms.string("HF"), outputLinksPuppi = cms.vuint32(*range(3)), nOutputFramesPerBX = cms.uint32(9), fileFormat = cms.string("EMPv2"), outputFileExtension = cms.string("txt.gz"), maxLinesPerOutputFile = cms.uint32(1024), - eventsPerFile = cms.uint32(eventsPerFile_), + eventsPerFile = cms.uint32(_eventsPerFile), ) hfWriterConfigs = [ - hfWriterOutputOnly_.clone( + _hfWriterOutputOnly.clone( outputRegions = cms.vuint32(*[9*ie+i for i in range(9)]), - outputFileName = cms.string("l1HF%s-outputs-ideal" % ("Pos" if ie else "Neg")), + outputFileName = cms.string("l1HF%s-outputs" % ("Pos" if ie else "Neg")), ) for ie in range(2) ] diff --git a/L1Trigger/Phase2L1ParticleFlow/python/l1tJetFileWriter_cfi.py b/L1Trigger/Phase2L1ParticleFlow/python/l1tJetFileWriter_cfi.py index 6dd9b1f64370e..a53db5cb667fe 100644 --- a/L1Trigger/Phase2L1ParticleFlow/python/l1tJetFileWriter_cfi.py +++ b/L1Trigger/Phase2L1ParticleFlow/python/l1tJetFileWriter_cfi.py @@ -7,5 +7,6 @@ TMUX = cms.uint32(6), maxLinesPerFile = cms.uint32(1024), outputFilename = cms.string("L1CTSCJetsPatterns"), - format = cms.string("EMP") + format = cms.string("EMPv2"), + outputFileExtension = cms.string("txt.gz") ) diff --git a/L1Trigger/Phase2L1ParticleFlow/test/.gitignore b/L1Trigger/Phase2L1ParticleFlow/test/.gitignore index 26f0a8dafc043..61181e36e734f 100644 --- a/L1Trigger/Phase2L1ParticleFlow/test/.gitignore +++ b/L1Trigger/Phase2L1ParticleFlow/test/.gitignore @@ -1,2 +1,4 @@ *.txt +*.txt.gz +*.txt.xz *.dump diff --git a/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py b/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py index 203f6dfbeebb3..b8dd4ffdf4467 100644 --- a/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py +++ b/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py @@ -23,7 +23,7 @@ import FWCore.ParameterSet.Config as cms from Configuration.StandardSequences.Eras import eras -process = cms.Process("RESP", eras.Phase2C9) +process = cms.Process("RESP", eras.Phase2C17I13M9) process.load('Configuration.StandardSequences.Services_cff') process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") @@ -41,14 +41,14 @@ "drop l1tTkPrimaryVertexs_*_*_*") ) -process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff') -process.load('Configuration.Geometry.GeometryExtended2026D49_cff') +process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D88_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff') # needed to read HCal TPs process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, '123X_mcRun4_realistic_v3', '') +process.GlobalTag = GlobalTag(process.GlobalTag, '125X_mcRun4_realistic_v2', '') process.load('L1Trigger.Phase2L1ParticleFlow.l1ctLayer1_cff') process.load('L1Trigger.Phase2L1ParticleFlow.l1ctLayer2EG_cff') @@ -70,18 +70,6 @@ correctorDir = cms.string('L1PuppiSC4EmuJets')) process.l1tLayer2SeedConeJetWriter = l1tSeededConeJetFileWriter.clone(jets = "l1tLayer2SeedConeJetsCorrected") -process.l1tLayer1Barrel9 = process.l1tLayer1Barrel.clone() -process.l1tLayer1Barrel9.puAlgo.nFinalSort = 32 -process.l1tLayer1Barrel9.regions[0].etaBoundaries = [ -1.5, -0.5, 0.5, 1.5 ] -process.l1tLayer1Barrel9.boards=cms.VPSet( - cms.PSet( - regions=cms.vuint32(*[0+9*ie+i for ie in range(3) for i in range(3)])), - cms.PSet( - regions=cms.vuint32(*[3+9*ie+i for ie in range(3) for i in range(3)])), - cms.PSet( - regions=cms.vuint32(*[6+9*ie+i for ie in range(3) for i in range(3)])), - ) - process.l1tLayer1BarrelTDR = process.l1tLayer1Barrel.clone() process.l1tLayer1BarrelTDR.regionizerAlgo = cms.string("TDR") process.l1tLayer1BarrelTDR.regionizerAlgoParameters = cms.PSet( @@ -116,9 +104,10 @@ process.l1tLayer1BarrelSerenity.puAlgoParameters.finalSortAlgo = "FoldedHybrid" from L1Trigger.Phase2L1ParticleFlow.l1ctLayer1_patternWriters_cff import * +from L1Trigger.Phase2L1ParticleFlow.l1ctLayer1_patternWriters_cff import _eventsPerFile if not args.patternFilesOFF: process.l1tLayer1Barrel.patternWriters = cms.untracked.VPSet(*barrelWriterConfigs) - # process.l1tLayer1Barrel9.patternWriters = cms.untracked.VPSet(*barrel9WriterConfigs) # not enabled for now + process.l1tLayer1BarrelSerenity.patternWriters = cms.untracked.VPSet(barrelSerenityVU9PPhi1Config,barrelSerenityVU13PPhi1Config) process.l1tLayer1HGCal.patternWriters = cms.untracked.VPSet(*hgcalWriterConfigs) process.l1tLayer1HGCalNoTK.patternWriters = cms.untracked.VPSet(*hgcalNoTKWriterConfigs) process.l1tLayer1HF.patternWriters = cms.untracked.VPSet(*hfWriterConfigs) @@ -130,7 +119,6 @@ process.l1tLayer1Barrel + process.l1tLayer1BarrelTDR + process.l1tLayer1BarrelSerenity + - process.l1tLayer1Barrel9 + process.l1tLayer1HGCal + process.l1tLayer1HGCalElliptic + process.l1tLayer1HGCalNoTK + @@ -150,26 +138,19 @@ if not args.patternFilesOFF: process.l1tLayer2EG.writeInPattern = True process.l1tLayer2EG.writeOutPattern = True - process.l1tLayer2EG.inPatternFile.maxLinesPerFile = eventsPerFile_*54 - process.l1tLayer2EG.outPatternFile.maxLinesPerFile = eventsPerFile_*54 + process.l1tLayer2EG.inPatternFile.maxLinesPerFile = _eventsPerFile*54 + process.l1tLayer2EG.outPatternFile.maxLinesPerFile = _eventsPerFile*54 ##################################################################################################################### ## Layer 2 seeded-cone jets if not args.patternFilesOFF: process.runPF.insert(process.runPF.index(process.l1tLayer2SeedConeJetsCorrected)+1, process.l1tLayer2SeedConeJetWriter) - process.l1tLayer2SeedConeJetWriter.maxLinesPerFile = eventsPerFile_*54 + process.l1tLayer2SeedConeJetWriter.maxLinesPerFile = _eventsPerFile*54 if not args.dumpFilesOFF: - for det in "Barrel", "BarrelTDR", "BarrelSerenity", "Barrel9", "HGCal", "HGCalElliptic", "HGCalNoTK", "HF": + for det in "Barrel", "BarrelTDR", "BarrelSerenity", "HGCal", "HGCalElliptic", "HGCalNoTK", "HF": l1pf = getattr(process, 'l1tLayer1'+det) l1pf.dumpFileName = cms.untracked.string("TTbar_PU200_"+det+".dump") -process.source.fileNames = [ '/store/cmst3/group/l1tr/gpetrucc/11_1_0/NewInputs110X/110121.done/TTbar_PU200/inputs110X_%d.root' % i for i in (1,3,7,8,9) ] -process.l1tPFClustersFromL1EGClusters.src = cms.InputTag("L1EGammaClusterEmuProducer",) -process.l1tPFClustersFromCombinedCaloHCal.phase2barrelCaloTowers = [cms.InputTag("L1EGammaClusterEmuProducer",)] -process.l1tPFClustersFromHGC3DClusters.src = cms.InputTag("hgcalBackEndLayer2Producer","HGCalBackendLayer2Processor3DClustering") -process.l1tPFClustersFromCombinedCaloHF.hcalCandidates = [ cms.InputTag("hgcalBackEndLayer2Producer","HGCalBackendLayer2Processor3DClustering")] -process.l1tPFTracksFromL1Tracks.L1TrackTag = cms.InputTag("TTTracksFromTrackletEmulation","Level1TTTracks") -process.l1tGTTInputProducer.l1TracksInputTag = cms.InputTag("TTTracksFromTrackletEmulation","Level1TTTracks") - +process.source.fileNames = [ '/store/cmst3/group/l1tr/gpetrucc/12_5_X/NewInputs125X/150223/TTbar_PU200/inputs125X_1.root' ] From b0c620dfafd631f5d7d1bff68f6aa4b416680de0 Mon Sep 17 00:00:00 2001 From: Giovanni Date: Wed, 5 Jul 2023 22:08:24 +0200 Subject: [PATCH 4/8] make_l1ct_binaryFiles_cfg.py: option to use serenity settings for barrel --- .../test/make_l1ct_binaryFiles_cfg.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py b/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py index b8dd4ffdf4467..03b07a893e24c 100644 --- a/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py +++ b/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py @@ -1,13 +1,14 @@ import argparse import sys -# example: cmsRun L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_patternFiles_cfg.py -- --dumpFilesOFF -# example: cmsRun L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_patternFiles_cfg.py -- --dumpFilesOFF +# example: cmsRun L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_patternFiles_cfg.py -- --patternFilesOFF +# example: cmsRun L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_patternFiles_cfg.py -- --dumpFilesOFF --serenity parser = argparse.ArgumentParser(prog=sys.argv[0], description='Optional parameters') parser.add_argument("--dumpFilesOFF", help="switch on dump file production", action="store_true", default=False) parser.add_argument("--patternFilesOFF", help="switch on Layer-1 pattern file production", action="store_true", default=False) +parser.add_argument("--serenity", help="use Serenity settigns as default everwhere, i.e. also for barrel", action="store_true", default=False) argv = sys.argv[:] if '--' in argv: @@ -103,6 +104,11 @@ process.l1tLayer1BarrelSerenity.puAlgoParameters.nOut = 27 process.l1tLayer1BarrelSerenity.puAlgoParameters.finalSortAlgo = "FoldedHybrid" +if args.serenity: + process.l1tLayer1.pfProducers[0] = "l1tLayer1BarrelSerenity" + process.l1tLayer2EG.tkElectrons[1].pfProducer = "l1tLayer1BarrelSerenity:L1TkElePerBoard" + process.l1tLayer2EG.tkEms[2].pfProducer = "l1tLayer1BarrelSerenity:L1TkEmPerBoard" + from L1Trigger.Phase2L1ParticleFlow.l1ctLayer1_patternWriters_cff import * from L1Trigger.Phase2L1ParticleFlow.l1ctLayer1_patternWriters_cff import _eventsPerFile if not args.patternFilesOFF: From 44d98eb0c45ae7bf4a26e84720edbdba84c00056 Mon Sep 17 00:00:00 2001 From: Giovanni Date: Mon, 21 Aug 2023 17:37:57 +0200 Subject: [PATCH 5/8] CMSSW support for TM18 Endcap Correlator --- .../L1TCorrelatorLayer1PatternFileWriter.h | 16 ++--- ...buffered_folded_multififo_regionizer_ref.h | 2 + .../regionizer/multififo_regionizer_ref.h | 1 + .../plugins/L1TCorrelatorLayer1Producer.cc | 4 ++ .../python/l1ctLayer1_patternWriters_cff.py | 54 ++++++++++++++++ .../L1TCorrelatorLayer1PatternFileWriter.cc | 61 +++++++++++++------ ...ffered_folded_multififo_regionizer_ref.cpp | 22 +++++++ 7 files changed, 133 insertions(+), 27 deletions(-) diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/L1TCorrelatorLayer1PatternFileWriter.h b/L1Trigger/Phase2L1ParticleFlow/interface/L1TCorrelatorLayer1PatternFileWriter.h index 15004caa2f803..dc786b910eecd 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/L1TCorrelatorLayer1PatternFileWriter.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/L1TCorrelatorLayer1PatternFileWriter.h @@ -19,17 +19,18 @@ class L1TCorrelatorLayer1PatternFileWriter { enum class Partition { Barrel, HGCal, HGCalNoTk, HF }; Partition partition_; - const unsigned int tmuxFactor_ = 6; // not really configurable in current architecture + const unsigned int tmuxFactor_; bool writeInputs_, writeOutputs_; std::map> channelIdsInput_, channelIdsOutput_; std::map channelSpecsInput_, channelSpecsOutput_; - const unsigned int tfTimeslices_ = 3, tfLinksFactor_ = 1; // not really configurable in current architecture - const unsigned int hgcTimeslices_ = 3, hgcLinksFactor_ = 4; // not really configurable in current architecture - const unsigned int gctTimeslices_ = 1, gctSectors_ = 3; // not really configurable in current architecture - const unsigned int gctLinksEcal_ = 1, gctLinksHad_ = 2; // could be made configurable later - const unsigned int gmtTimeslices_ = 3, gmtLinksFactor_ = 1; // not really configurable in current architecture - const unsigned int gttTimeslices_ = 1, gttLinksFactor_ = 1; // not really configurable in current architecture + 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 gmtNumberOfMuons_; uint32_t gttNumberOfPVs_; uint32_t gttLatency_; @@ -70,6 +71,7 @@ class L1TCorrelatorLayer1PatternFileWriter { void writeGMT(const l1ct::Event& event, l1t::demo::EventData& out); void writeGTT(const l1ct::Event& event, l1t::demo::EventData& out); void writePuppi(const l1ct::Event& event, l1t::demo::EventData& out); + void writeEgamma(const l1ct::OutputBoard& egboard, std::vector>& out); void writeEgamma(const l1ct::Event& event, l1t::demo::EventData& out); }; diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/buffered_folded_multififo_regionizer_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/buffered_folded_multififo_regionizer_ref.h index 5b54130f93b0c..596838f963715 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/buffered_folded_multififo_regionizer_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/buffered_folded_multififo_regionizer_ref.h @@ -52,6 +52,8 @@ namespace l1ct { unsigned int outii, unsigned int pauseii, bool useAlsoVtxCoords); + // note: this one will work only in CMSSW + BufferedFoldedMultififoRegionizerEmulator(const edm::ParameterSet& iConfig); ~BufferedFoldedMultififoRegionizerEmulator() override; diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/multififo_regionizer_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/multififo_regionizer_ref.h index c906a502c5caa..c62dd73eb49e1 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/multififo_regionizer_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/multififo_regionizer_ref.h @@ -2,6 +2,7 @@ #define multififo_regionizer_ref_h #include "L1Trigger/Phase2L1ParticleFlow/interface/regionizer/regionizer_base_ref.h" +#include "L1Trigger/Phase2L1ParticleFlow/interface/egamma/pfeginput_ref.h" #include "L1Trigger/Phase2L1ParticleFlow/interface/regionizer/multififo_regionizer_elements_ref.h" #include diff --git a/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc b/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc index d6bd40e646190..6d3779404c679 100644 --- a/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc +++ b/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc @@ -24,6 +24,7 @@ #include "L1Trigger/Phase2L1ParticleFlow/interface/l1-converters/hgcalinput_ref.h" #include "L1Trigger/Phase2L1ParticleFlow/interface/regionizer/regionizer_base_ref.h" #include "L1Trigger/Phase2L1ParticleFlow/interface/regionizer/multififo_regionizer_ref.h" +#include "L1Trigger/Phase2L1ParticleFlow/interface/regionizer/buffered_folded_multififo_regionizer_ref.h" #include "L1Trigger/Phase2L1ParticleFlow/interface/regionizer/tdr_regionizer_ref.h" #include "L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo2hgc_ref.h" #include "L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo3_ref.h" @@ -249,6 +250,9 @@ L1TCorrelatorLayer1Producer::L1TCorrelatorLayer1Producer(const edm::ParameterSet } else if (regalgo == "Multififo") { regionizer_ = std::make_unique( iConfig.getParameter("regionizerAlgoParameters")); + } else if (regalgo == "BufferedFoldedMultififo") { + regionizer_ = std::make_unique( + iConfig.getParameter("regionizerAlgoParameters")); } else if (regalgo == "MultififoBarrel") { const auto &pset = iConfig.getParameter("regionizerAlgoParameters"); regionizer_ = diff --git a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_patternWriters_cff.py b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_patternWriters_cff.py index 823302c8f1103..9bd1434d9cd3d 100644 --- a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_patternWriters_cff.py +++ b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_patternWriters_cff.py @@ -8,6 +8,7 @@ ## Barrel configurations: 54 regions, 6 puppi output links, only write out the layer 1 outputs for now _barrelWriterOutputOnly = cms.PSet( partition = cms.string("Barrel"), + tmuxFactor = cms.uint32(6), outputLinksPuppi = cms.vuint32(*range(6)), outputLinkEgamma = cms.int32(6), nEgammaObjectsOut = cms.uint32(16), @@ -72,6 +73,7 @@ ## HGcal configuration: write out both inputs and outputs _hgcalWriterConfig = cms.PSet( partition = cms.string("HGCal"), + tmuxFactor = cms.uint32(6), nEgammaObjectsOut = cms.uint32(16), nInputFramesPerBX = cms.uint32(9), nOutputFramesPerBX = cms.uint32(9), @@ -162,6 +164,7 @@ ## Forward HGCal configuration: only outputs for now, 18 regions, 12 candidates x region, 4 output fibers _hgcalNoTKWriterConfig = cms.PSet( partition = cms.string("HGCalNoTk"), + tmuxFactor = cms.uint32(6), outputRegions = cms.vuint32(*range(18)), nInputFramesPerBX = cms.uint32(9), nOutputFramesPerBX = cms.uint32(9), @@ -195,12 +198,63 @@ hgcalNoTKVU13PWriterConfig ] +##################################################################################################################### +## HGCal TM18 configuration +_hgcalWriterTM18 = _hgcalWriterConfig.clone( + tmuxFactor = cms.uint32(18), + tfTimeSlices = None, + tfSectors = cms.VPSet(*[cms.PSet(tfLink = cms.int32(-1)) for i in range(18)]), + hgcTimeSlices = None, + hgcSectors = cms.VPSet(*[cms.PSet() for i in range(6)]), + gmtTimeSlices = None, + gmtLink = cms.int32(4*27+0), + gttLink = 4*27+3, + eventsPerFile = 6, +) +hgcalWriterOutputTM18WriterConfig = _hgcalWriterTM18.clone( + outputFileName = cms.string("l1HGCalTM18-outputs"), + outputRegions = cms.vuint32(*range(18)), + outputLinksPuppi = cms.vuint32(*range(2)), + outputLinkEgamma = cms.int32(2), +) +hgcalWriterVU9PTM18WriterConfig = _hgcalWriterTM18.clone( + 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 +) +hgcalWriterVU13PTM18WriterConfig = hgcalWriterVU9PTM18WriterConfig.clone( + inputFileName = cms.string("l1HGCalTM18-inputs-vu13p"), +) +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))) + 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 = cms.vint32(*range(4*(12+ilink),4*(12+ilink)+4)) + hgcalWriterVU13PTM18WriterConfig.hgcSectors[isec].hgcLinks = cms.vint32(*range(4*(13+ilink),4*(13+ilink)+4)) + +hgcalTM18WriterConfigs = [ + hgcalWriterOutputTM18WriterConfig, + hgcalWriterVU9PTM18WriterConfig, + hgcalWriterVU13PTM18WriterConfig +] +hgcalNoTKOutputTM18WriterConfig = _hgcalWriterTM18.clone( + outputFileName = cms.string("l1HGCalTM18-outputs-fwd"), + outputRegions = cms.vuint32(*range(18)), + outputBoard = cms.int32(-1),#0,1), + outputLinksPuppi = cms.vuint32(*range(2)), + outputLinkEgamma = cms.int32(-1), +) + ##################################################################################################################### ## HF configuration (to be better defined later) ##################################################################################################################### ## HF configuration not realistic, 3 links per endcap, write out the layer 1 outputs for now _hfWriterOutputOnly = cms.PSet( partition = cms.string("HF"), + tmuxFactor = cms.uint32(6), outputLinksPuppi = cms.vuint32(*range(3)), nOutputFramesPerBX = cms.uint32(9), fileFormat = cms.string("EMPv2"), diff --git a/L1Trigger/Phase2L1ParticleFlow/src/L1TCorrelatorLayer1PatternFileWriter.cc b/L1Trigger/Phase2L1ParticleFlow/src/L1TCorrelatorLayer1PatternFileWriter.cc index 6c6043241f5d9..a8176b96846d5 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/L1TCorrelatorLayer1PatternFileWriter.cc +++ b/L1Trigger/Phase2L1ParticleFlow/src/L1TCorrelatorLayer1PatternFileWriter.cc @@ -5,10 +5,16 @@ L1TCorrelatorLayer1PatternFileWriter::L1TCorrelatorLayer1PatternFileWriter(const edm::ParameterSet& iConfig, const l1ct::Event& eventTemplate) : partition_(parsePartition(iConfig.getParameter("partition"))), + tmuxFactor_(iConfig.getParameter("tmuxFactor")), writeInputs_(iConfig.existsAs("inputFileName") && !iConfig.getParameter("inputFileName").empty()), writeOutputs_(iConfig.existsAs("outputFileName") && !iConfig.getParameter("outputFileName").empty()), + tfTimeslices_(std::max(1u, tfTmuxFactor_ / tmuxFactor_)), + hgcTimeslices_(std::max(1u, hgcTmuxFactor_ / tmuxFactor_)), + gctTimeslices_(std::max(1u, gctTmuxFactor_ / tmuxFactor_)), + gmtTimeslices_(std::max(1u, gmtTmuxFactor_ / tmuxFactor_)), + gttTimeslices_(std::max(1u, gttTmuxFactor_ / tmuxFactor_)), outputBoard_(-1), outputLinkEgamma_(-1), fileFormat_(iConfig.getParameter("fileFormat")), @@ -19,7 +25,7 @@ L1TCorrelatorLayer1PatternFileWriter::L1TCorrelatorLayer1PatternFileWriter(const if (partition_ == Partition::Barrel || partition_ == Partition::HGCal) { configTimeSlices(iConfig, "tf", eventTemplate.raw.track.size(), tfTimeslices_, tfLinksFactor_); - channelSpecsInput_["tf"] = {tmuxFactor_ * tfTimeslices_, tfTimeslices_}; + channelSpecsInput_["tf"] = {tfTmuxFactor_, tfTimeslices_}; } if (partition_ == Partition::Barrel) { auto sectorConfig = iConfig.getParameter>("gctSectors"); @@ -56,7 +62,7 @@ L1TCorrelatorLayer1PatternFileWriter::L1TCorrelatorLayer1PatternFileWriter(const configTimeSlices(iConfig, "gtt", 1, gttTimeslices_, gttLinksFactor_); gttLatency_ = iConfig.getParameter("gttLatency"); gttNumberOfPVs_ = iConfig.getParameter("gttNumberOfPVs"); - channelSpecsInput_["gtt"] = l1t::demo::ChannelSpec{tmuxFactor_, gttTimeslices_, gttLatency_}; + channelSpecsInput_["gtt"] = l1t::demo::ChannelSpec{tmuxFactor_ * gttTimeslices_, 1, gttLatency_}; } inputFileWriter_ = std::make_unique(l1t::demo::parseFileFormat(fileFormat_), @@ -80,17 +86,19 @@ L1TCorrelatorLayer1PatternFileWriter::L1TCorrelatorLayer1PatternFileWriter(const channelSpecsOutput_["puppi"] = {tmuxFactor_, 0}; nPuppiFramesPerRegion_ = (nOutputFramesPerBX_ * tmuxFactor_) / outputRegions_.size(); if (partition_ == Partition::Barrel || partition_ == Partition::HGCal) { - outputBoard_ = iConfig.getParameter("outputBoard"); outputLinkEgamma_ = iConfig.getParameter("outputLinkEgamma"); nEgammaObjectsOut_ = iConfig.getParameter("nEgammaObjectsOut"); if (outputLinkEgamma_ != -1) { channelIdsOutput_[l1t::demo::LinkId{"egamma", 0}].push_back(outputLinkEgamma_); - channelSpecsOutput_["egamma"] = {tmuxFactor_, nOutputFramesPerBX_ * tmuxFactor_ - 3 * nEgammaObjectsOut_}; + if (partition_ == Partition::HGCal && tmuxFactor_ == 18) { + // the format is different, as we put together both endcaps + channelSpecsOutput_["egamma"] = {tmuxFactor_, nOutputFramesPerBX_ * tmuxFactor_ / 2 - 3 * nEgammaObjectsOut_}; + } else { + outputBoard_ = iConfig.getParameter("outputBoard"); + channelSpecsOutput_["egamma"] = {tmuxFactor_, nOutputFramesPerBX_ * tmuxFactor_ - 3 * nEgammaObjectsOut_}; + } } } - if ((outputBoard_ == -1) != (outputLinkEgamma_ == -1)) { - throw cms::Exception("Configuration", "Inconsistent configuration of outputLinkEgamma, outputBoard"); - } outputFileWriter_ = std::make_unique(l1t::demo::parseFileFormat(fileFormat_), iConfig.getParameter("outputFileName"), @@ -247,12 +255,12 @@ void L1TCorrelatorLayer1PatternFileWriter::writeHGC(const l1ct::Event& event, l1 // put header word and (dummy) towers ret[il].resize(31); ap_uint<64>& head64 = ret[il][0]; - head64(63, 48) = 0xABC0; // Magic - head64(47, 38) = 0; // Opaque - head64(39, 32) = (eventIndex_ % 3) * 6; // TM slice - head64(31, 24) = iS; // Sector - head64(23, 16) = il; // link - head64(15, 0) = eventIndex_ % 3564; // BX + head64(63, 48) = 0xABC0; // Magic + head64(47, 38) = 0; // Opaque + head64(39, 32) = (eventIndex_ % hgcTimeslices_) * tmuxFactor_; // TM slice + head64(31, 24) = iS; // Sector + head64(23, 16) = il; // link + head64(15, 0) = eventIndex_ % 3564; // BX for (unsigned int j = 0; j < 30; ++j) { ret[il][j + 1] = 4 * j + il; } @@ -331,21 +339,34 @@ void L1TCorrelatorLayer1PatternFileWriter::writePuppi(const l1ct::Event& event, } } -void L1TCorrelatorLayer1PatternFileWriter::writeEgamma(const l1ct::Event& event, l1t::demo::EventData& out) { - std::vector> ret; - const auto& pho = event.board_out[outputBoard_].egphoton; - const auto& ele = event.board_out[outputBoard_].egelectron; - ret.reserve(3 * nEgammaObjectsOut_); +void L1TCorrelatorLayer1PatternFileWriter::writeEgamma(const l1ct::OutputBoard& egboard, + std::vector>& ret) { + unsigned int s0 = ret.size(); + const auto& pho = egboard.egphoton; + const auto& ele = egboard.egelectron; + ret.reserve(s0 + 3 * nEgammaObjectsOut_); for (const auto& p : pho) { ret.emplace_back(p.pack()); } - ret.resize(nEgammaObjectsOut_, ap_uint<64>(0)); + ret.resize(s0 + nEgammaObjectsOut_, ap_uint<64>(0)); for (const auto& p : ele) { ap_uint<128> dword = p.pack(); ret.push_back(dword(63, 0)); ret.push_back(dword(127, 64)); } - ret.resize(3 * nEgammaObjectsOut_, ap_uint<64>(0)); + ret.resize(s0 + 3 * nEgammaObjectsOut_, ap_uint<64>(0)); +} + +void L1TCorrelatorLayer1PatternFileWriter::writeEgamma(const l1ct::Event& event, l1t::demo::EventData& out) { + std::vector> ret; + if (partition_ == Partition::HGCal && tmuxFactor_ == 18) { + // the format is different, as we put together both endcaps + writeEgamma(event.board_out[0], ret); + ret.resize(nOutputFramesPerBX_ * tmuxFactor_ / 2, ap_uint<64>(0)); + writeEgamma(event.board_out[1], ret); + } else { + writeEgamma(event.board_out[outputBoard_], ret); + } out.add(l1t::demo::LinkId{"egamma", 0}, ret); } diff --git a/L1Trigger/Phase2L1ParticleFlow/src/regionizer/buffered_folded_multififo_regionizer_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/regionizer/buffered_folded_multififo_regionizer_ref.cpp index a9dbeba35ee2d..e03e29850148d 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/regionizer/buffered_folded_multififo_regionizer_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/regionizer/buffered_folded_multififo_regionizer_ref.cpp @@ -3,6 +3,28 @@ #include #include +#ifdef CMSSW_GIT_HASH +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +l1ct::BufferedFoldedMultififoRegionizerEmulator::BufferedFoldedMultififoRegionizerEmulator( + const edm::ParameterSet& iConfig) + : BufferedFoldedMultififoRegionizerEmulator(iConfig.getParameter("nClocks"), + iConfig.getParameter("nTrack"), + iConfig.getParameter("nCalo"), + iConfig.getParameter("nEmCalo"), + iConfig.getParameter("nMu"), + /*streaming=*/true, + /*outii=*/6, + /*pauseii=*/3, + iConfig.getParameter("useAlsoVtxCoords")) { + debug_ = iConfig.getUntrackedParameter("debug", false); + if (iConfig.existsAs("egInterceptMode")) { + const auto& emSelCfg = iConfig.getParameter("egInterceptMode"); + setEgInterceptMode(emSelCfg.getParameter("afterFifo"), emSelCfg); + } +} +#endif + l1ct::BufferedFoldedMultififoRegionizerEmulator::BufferedFoldedMultififoRegionizerEmulator(unsigned int nclocks, unsigned int ntk, unsigned int ncalo, From dfbebc16e3b9d2a10d0ee4439acc802645cb5668 Mon Sep 17 00:00:00 2001 From: Giovanni Date: Tue, 22 Aug 2023 11:02:16 +0200 Subject: [PATCH 6/8] Update pattern and dump file producer for GTT changes and add support for TM18 --- .../test/make_l1ct_binaryFiles_cfg.py | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py b/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py index 03b07a893e24c..249725522860e 100644 --- a/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py +++ b/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py @@ -9,6 +9,7 @@ parser.add_argument("--dumpFilesOFF", help="switch on dump file production", action="store_true", default=False) parser.add_argument("--patternFilesOFF", help="switch on Layer-1 pattern file production", action="store_true", default=False) parser.add_argument("--serenity", help="use Serenity settigns as default everwhere, i.e. also for barrel", action="store_true", default=False) +parser.add_argument("--tm18", help="Add TM18 emulators for the endcaps", action="store_true", default=False) argv = sys.argv[:] if '--' in argv: @@ -54,10 +55,9 @@ process.load('L1Trigger.Phase2L1ParticleFlow.l1ctLayer1_cff') process.load('L1Trigger.Phase2L1ParticleFlow.l1ctLayer2EG_cff') process.load('L1Trigger.L1TTrackMatch.l1tGTTInputProducer_cfi') +process.load('L1Trigger.L1TTrackMatch.l1tTrackSelectionProducer_cfi') +process.l1tTrackSelectionProducer.processSimulatedTracks = False # these would need stubs, and are not used anyway process.load('L1Trigger.VertexFinder.l1tVertexProducer_cfi') -process.l1tVertexFinderEmulator = process.l1tVertexProducer.clone() -process.l1tVertexFinderEmulator.VertexReconstruction.Algorithm = "fastHistoEmulation" -process.l1tVertexFinderEmulator.l1TracksInputTag = cms.InputTag("l1tGTTInputProducer", "Level1TTTracksConverted") from L1Trigger.Phase2L1GMT.gmt_cfi import l1tStandaloneMuons process.l1tSAMuonsGmt = l1tStandaloneMuons.clone() @@ -121,6 +121,7 @@ process.runPF = cms.Path( process.l1tSAMuonsGmt + process.l1tGTTInputProducer + + process.l1tTrackSelectionProducer + process.l1tVertexFinderEmulator + process.l1tLayer1Barrel + process.l1tLayer1BarrelTDR + @@ -159,4 +160,23 @@ l1pf.dumpFileName = cms.untracked.string("TTbar_PU200_"+det+".dump") +if args.tm18: + process.l1tLayer1HGCalTM18 = process.l1tLayer1HGCal.clone() + process.l1tLayer1HGCalTM18.regionizerAlgo = "BufferedFoldedMultififo" + process.l1tLayer1HGCalTM18.regionizerAlgoParameters.nClocks = 162 + process.l1tLayer1HGCalTM18.regionizerAlgoParameters.nTkLinks = 1 + process.l1tLayer1HGCalTM18.regionizerAlgoParameters.nCaloLinks = 1 + process.l1tLayer1HGCalNoTKTM18 = process.l1tLayer1HGCalNoTK.clone() + process.l1tLayer1HGCalNoTKTM18.regionizerAlgo = "BufferedFoldedMultififo" + process.l1tLayer1HGCalNoTKTM18.regionizerAlgoParameters.nClocks = 162 + process.l1tLayer1HGCalNoTKTM18.regionizerAlgoParameters.nCaloLinks = 1 + process.runPF.insert(process.runPF.index(process.l1tLayer1HGCal)+1, process.l1tLayer1HGCalTM18) + process.runPF.insert(process.runPF.index(process.l1tLayer1HGCalNoTK)+1, process.l1tLayer1HGCalNoTKTM18) + if not args.patternFilesOFF: + process.l1tLayer1HGCalTM18.patternWriters = cms.untracked.VPSet(*hgcalTM18WriterConfigs) + process.l1tLayer1HGCalNoTKTM18.patternWriters = cms.untracked.VPSet(hgcalNoTKOutputTM18WriterConfig) + if not args.dumpFilesOFF: + for det in "HGCalTM18", "HGCalNoTKTM18": + getattr(process, 'l1tLayer1'+det).dumpFileName = cms.untracked.string("TTbar_PU200_"+det+".dump") + process.source.fileNames = [ '/store/cmst3/group/l1tr/gpetrucc/12_5_X/NewInputs125X/150223/TTbar_PU200/inputs125X_1.root' ] From 3c38256b87e234f873b88e6b20b004cfa3842a7a Mon Sep 17 00:00:00 2001 From: Giovanni Date: Wed, 23 Aug 2023 16:41:39 +0200 Subject: [PATCH 7/8] FillDescriptions part 1 (not yet removing the defaults from the cff files) --- .../L1TCorrelatorLayer1PatternFileWriter.h | 14 +++ .../interface/egamma/pfeginput_ref.h | 5 +- .../interface/egamma/pftkegalgo_ref.h | 7 +- .../egamma/pftkegsorter_barrel_ref.h | 4 + .../interface/egamma/pftkegsorter_ref.h | 7 ++ .../interface/l1-converters/hgcalinput_ref.h | 6 +- .../l1-converters/muonGmtToL1ct_ref.h | 7 +- .../interface/l1-converters/tkinput_ref.h | 5 +- .../interface/pf/pfalgo2hgc_ref.h | 5 +- .../interface/pf/pfalgo3_ref.h | 5 +- .../interface/pf/pfalgo_common_ref.h | 4 +- .../interface/pf/pfalgo_dummy_ref.h | 5 +- .../interface/puppi/linpuppi_ref.h | 5 +- ...buffered_folded_multififo_regionizer_ref.h | 2 + .../regionizer/multififo_regionizer_ref.h | 6 +- .../regionizer/regionizer_base_ref.h | 5 +- .../interface/regionizer/tdr_regionizer_ref.h | 5 +- .../plugins/L1TCorrelatorLayer1Producer.cc | 111 ++++++++++++++++-- .../plugins/L1TEGMultiMerger.cc | 14 +++ .../plugins/L1TPFCandMultiMerger.cc | 27 +++++ .../python/l1ctLayer1_cff.py | 3 - .../python/l1ctLayer1_patternWriters_cff.py | 35 +++--- .../L1TCorrelatorLayer1PatternFileWriter.cc | 84 ++++++++++++- .../src/egamma/pfeginput_ref.cpp | 11 +- .../src/egamma/pftkegalgo_ref.cpp | 67 +++++++++++ .../src/l1-converters/hgcalinputt_ref.cpp | 7 ++ .../src/l1-converters/muonGmtToL1ct_ref.cpp | 8 ++ .../src/l1-converters/tkinput_ref.cpp | 48 ++++++++ .../src/pf/pfalgo2hgc_ref.cpp | 16 +++ .../src/pf/pfalgo3_ref.cpp | 22 ++++ .../src/pf/pfalgo_common_ref.cpp | 9 ++ .../src/pf/pfalgo_dummy_ref.cpp | 9 ++ .../src/puppi/linpuppi_ref.cpp | 36 +++++- ...ffered_folded_multififo_regionizer_ref.cpp | 18 ++- .../regionizer/multififo_regionizer_ref.cpp | 38 +++++- .../src/regionizer/regionizer_base_ref.cpp | 11 +- .../src/regionizer/tdr_regionizer_ref.cpp | 16 ++- .../test/make_l1ct_binaryFiles_cfg.py | 9 +- 38 files changed, 636 insertions(+), 60 deletions(-) diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/L1TCorrelatorLayer1PatternFileWriter.h b/L1Trigger/Phase2L1ParticleFlow/interface/L1TCorrelatorLayer1PatternFileWriter.h index dc786b910eecd..0a10bc16d4866 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/L1TCorrelatorLayer1PatternFileWriter.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/L1TCorrelatorLayer1PatternFileWriter.h @@ -2,6 +2,7 @@ #define L1Trigger_Phase2L1ParticleFlow_L1TCorrelatorLayer1PatternFileWriter_h #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "L1Trigger/DemonstratorTools/interface/BoardDataWriter.h" #include "L1Trigger/DemonstratorTools/interface/utilities.h" @@ -12,6 +13,8 @@ class L1TCorrelatorLayer1PatternFileWriter { L1TCorrelatorLayer1PatternFileWriter(const edm::ParameterSet& iConfig, const l1ct::Event& eventTemplate); ~L1TCorrelatorLayer1PatternFileWriter(); + static edm::ParameterSetDescription getParameterSetDescription(); + void write(const l1ct::Event& event); void flush(); @@ -51,19 +54,30 @@ class L1TCorrelatorLayer1PatternFileWriter { static Partition parsePartition(const std::string& partition); + static std::unique_ptr describeTF(); + static std::unique_ptr describeGCT(); + static std::unique_ptr describeHGC(); + static std::unique_ptr describeGMT(); + static std::unique_ptr describeGTT(); + static std::unique_ptr describePuppi(); + static std::unique_ptr describeEG(); + void configTimeSlices(const edm::ParameterSet& iConfig, const std::string& prefix, unsigned int nSectors, unsigned int nTimeSlices, unsigned int linksFactor); + static std::unique_ptr describeTimeSlices(const std::string& prefix); void configSectors(const edm::ParameterSet& iConfig, const std::string& prefix, unsigned int nSectors, unsigned int linksFactor); + static std::unique_ptr describeSectors(const std::string& prefix); void configLinks(const edm::ParameterSet& iConfig, const std::string& prefix, unsigned int linksFactor, unsigned int offset); + static std::unique_ptr describeLinks(const std::string& prefix); void writeTF(const l1ct::Event& event, l1t::demo::EventData& out); void writeBarrelGCT(const l1ct::Event& event, l1t::demo::EventData& out); diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pfeginput_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pfeginput_ref.h index 599eae5484522..88a071c1223f4 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pfeginput_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pfeginput_ref.h @@ -7,7 +7,8 @@ namespace edm { class ParameterSet; -} + class ParameterSetDescription; +} // namespace edm namespace l1ct { @@ -16,6 +17,8 @@ namespace l1ct { EGInputSelectorEmuConfig(unsigned int emIdMask, unsigned int nHADCALO_IN, unsigned int nEMCALO_OUT, int debug) : idMask(emIdMask), nHADCALO_IN(nHADCALO_IN), nEMCALO_OUT(nEMCALO_OUT), debug(debug) {} + static edm::ParameterSetDescription getParameterSetDescription(); + emid_t idMask; unsigned int nHADCALO_IN; unsigned int nEMCALO_OUT; diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pftkegalgo_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pftkegalgo_ref.h index 560325e46cb0c..58ddfccec14b4 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pftkegalgo_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pftkegalgo_ref.h @@ -9,7 +9,8 @@ namespace edm { class ParameterSet; -} + class ParameterSetDescription; +} // namespace edm namespace l1ct { @@ -47,6 +48,7 @@ namespace l1ct { ap_int dZ; int dRMin2; int dRMax2; + static edm::ParameterSetDescription getParameterSetDescription(); }; IsoParameters tkIsoParams_tkEle; @@ -65,6 +67,7 @@ namespace l1ct { const double bdtScore_loose_wp; // XGBOOST score const double bdtScore_tight_wp; // XGBOOST score const std::string conifer_model; + static edm::ParameterSetDescription getParameterSetDescription(); }; CompIDParameters compIDparams; @@ -131,6 +134,8 @@ namespace l1ct { hwIsoTypeTkEm(hwIsoTypeTkEm), compIDparams(compIDparams), debug(debug) {} + + static edm::ParameterSetDescription getParameterSetDescription(); }; class PFTkEGAlgoEmulator { diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pftkegsorter_barrel_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pftkegsorter_barrel_ref.h index 2895848dd11fe..624b3851fa36d 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pftkegsorter_barrel_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pftkegsorter_barrel_ref.h @@ -18,6 +18,10 @@ namespace l1ct { PFTkEGSorterBarrelEmulator(const edm::ParameterSet& iConfig) : PFTkEGSorterEmulator(iConfig.getParameter("nObjToSort"), iConfig.getParameter("nObjSorted")) {} + + static edm::ParameterSetDescription getParameterSetDescription() { + return PFTkEGSorterEmulator::getParameterSetDescription(); + } #endif ~PFTkEGSorterBarrelEmulator() override {} diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pftkegsorter_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pftkegsorter_ref.h index fffb556552b0d..9e1c7b364514c 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pftkegsorter_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/egamma/pftkegsorter_ref.h @@ -9,6 +9,7 @@ #ifdef CMSSW_GIT_HASH #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #endif namespace l1ct { @@ -22,6 +23,12 @@ namespace l1ct { : PFTkEGSorterEmulator(iConfig.getParameter("nObjToSort"), iConfig.getParameter("nObjSorted")) {} + static edm::ParameterSetDescription getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("nObjToSort"); + description.add("nObjSorted"); + return description; + } #endif virtual ~PFTkEGSorterEmulator() {} diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/l1-converters/hgcalinput_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/l1-converters/hgcalinput_ref.h index 5fd80ba3954d7..c7c82f0b4c8ae 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/l1-converters/hgcalinput_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/l1-converters/hgcalinput_ref.h @@ -5,7 +5,8 @@ namespace edm { class ParameterSet; -} + class ParameterSetDescription; +} // namespace edm namespace l1ct { class HgcalClusterDecoderEmulator { @@ -16,6 +17,9 @@ namespace l1ct { HgcalClusterDecoderEmulator(const edm::ParameterSet &pset); ~HgcalClusterDecoderEmulator(); + + static edm::ParameterSetDescription getParameterSetDescription(); + l1ct::HadCaloObjEmu decode(const ap_uint<256> &in) const; }; } // namespace l1ct diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/l1-converters/muonGmtToL1ct_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/l1-converters/muonGmtToL1ct_ref.h index 4d1705d1b1778..aad7976a7b720 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/l1-converters/muonGmtToL1ct_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/l1-converters/muonGmtToL1ct_ref.h @@ -5,14 +5,19 @@ namespace edm { class ParameterSet; -} + class ParameterSetDescription; +} // namespace edm namespace l1ct { class GMTMuonDecoderEmulator { public: GMTMuonDecoderEmulator(float z0Scale, float dxyScale); GMTMuonDecoderEmulator(const edm::ParameterSet &iConfig); + ~GMTMuonDecoderEmulator(); + + static edm::ParameterSetDescription getParameterSetDescription(); + l1ct::MuObjEmu decode(const ap_uint<64> &in) const; protected: diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/l1-converters/tkinput_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/l1-converters/tkinput_ref.h index 2545a6dabc243..98d592f17e7f0 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/l1-converters/tkinput_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/l1-converters/tkinput_ref.h @@ -7,7 +7,8 @@ namespace edm { class ParameterSet; -} + class ParameterSetDescription; +} // namespace edm namespace l1ct { class TrackInputEmulator { @@ -27,6 +28,8 @@ namespace l1ct { bool bitwise = true, bool slim = true); + static edm::ParameterSetDescription getParameterSetDescription(); + std::pair decodeTrack(ap_uint<96> tkword, const l1ct::PFRegionEmu §or) const { return decodeTrack(tkword, sector, bitwise_, slim_); } diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo2hgc_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo2hgc_ref.h index ee9dbc93206a7..fbd53dabd8455 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo2hgc_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo2hgc_ref.h @@ -5,7 +5,8 @@ namespace edm { class ParameterSet; -} + class ParameterSetDescription; +} // namespace edm namespace l1ct { @@ -27,6 +28,8 @@ namespace l1ct { ~PFAlgo2HGCEmulator() override {} + static edm::ParameterSetDescription getParameterSetDescription(); + void run(const PFInputRegion& in, OutputRegion& out) const override; /// moves all objects from out.pfphoton to the beginning of out.pfneutral: nothing to do for this algo diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo3_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo3_ref.h index 85a1a01db572d..aa184887a1d0b 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo3_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo3_ref.h @@ -5,7 +5,8 @@ namespace edm { class ParameterSet; -} + class ParameterSetDescription; +} // namespace edm namespace l1ct { @@ -37,6 +38,8 @@ namespace l1ct { ~PFAlgo3Emulator() override {} + static edm::ParameterSetDescription getParameterSetDescription(); + void run(const PFInputRegion& in, OutputRegion& out) const override; void toFirmware(const PFInputRegion& in, diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo_common_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo_common_ref.h index eacb4ee7ff178..dcb63d3ca289f 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo_common_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo_common_ref.h @@ -9,7 +9,8 @@ namespace edm { class ParameterSet; -} + class ParameterSetDescription; +} // namespace edm namespace l1ct { @@ -38,6 +39,7 @@ namespace l1ct { void loadPtErrBins( unsigned int nbins, const float absetas[], const float scales[], const float offs[], bool verbose = false); void loadPtErrBins(const edm::ParameterSet& iConfig); + static void addCaloResolutionParameterSetDescription(edm::ParameterSetDescription& to); void setDebug(bool debug = true) { debug_ = debug; } diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo_dummy_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo_dummy_ref.h index 8eec4d19ac22b..938c44182804d 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo_dummy_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/pf/pfalgo_dummy_ref.h @@ -5,7 +5,8 @@ namespace edm { class ParameterSet; -} + class ParameterSetDescription; +} // namespace edm namespace l1ct { @@ -18,6 +19,8 @@ namespace l1ct { ~PFAlgoDummyEmulator() override {} + static edm::ParameterSetDescription getParameterSetDescription(); + void run(const PFInputRegion& in, OutputRegion& out) const override; /// moves all objects from out.pfphoton to the beginning of out.pfneutral: nothing to do for this algo diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/puppi/linpuppi_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/puppi/linpuppi_ref.h index dea624afd1a5a..4591f5ef3dc4f 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/puppi/linpuppi_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/puppi/linpuppi_ref.h @@ -7,7 +7,8 @@ namespace edm { class ParameterSet; -} + class ParameterSetDescription; +} // namespace edm namespace l1ct { @@ -138,6 +139,8 @@ namespace l1ct { LinPuppiEmulator(const edm::ParameterSet &iConfig); + static edm::ParameterSetDescription getParameterSetDescription(); + // charged void linpuppi_chs_ref(const PFRegionEmu ®ion, const PVObjEmu &pv, diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/buffered_folded_multififo_regionizer_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/buffered_folded_multififo_regionizer_ref.h index 596838f963715..cf30b63f10978 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/buffered_folded_multififo_regionizer_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/buffered_folded_multififo_regionizer_ref.h @@ -57,6 +57,8 @@ namespace l1ct { ~BufferedFoldedMultififoRegionizerEmulator() override; + static edm::ParameterSetDescription getParameterSetDescription(); + void initSectorsAndRegions(const RegionizerDecodedInputs& in, const std::vector& out) override; void run(const RegionizerDecodedInputs& in, std::vector& out) override; diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/multififo_regionizer_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/multififo_regionizer_ref.h index c62dd73eb49e1..554302a38ab54 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/multififo_regionizer_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/multififo_regionizer_ref.h @@ -8,7 +8,8 @@ namespace edm { class ParameterSet; -} + class ParameterSetDescription; +} // namespace edm namespace l1ct { class EGInputSelectorEmulator; @@ -50,6 +51,9 @@ namespace l1ct { ~MultififoRegionizerEmulator() override; + static edm::ParameterSetDescription getParameterSetDescription(); + static edm::ParameterSetDescription getParameterSetDescriptionBarrel(); + static BarrelSetup parseBarrelSetup(const std::string& setup); void setEgInterceptMode(bool afterFifo, const l1ct::EGInputSelectorEmuConfig& interceptorConfig); diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/regionizer_base_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/regionizer_base_ref.h index 5ae375d54f819..1f1550538e4d1 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/regionizer_base_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/regionizer_base_ref.h @@ -5,7 +5,8 @@ namespace edm { class ParameterSet; -} + class ParameterSetDescription; +} // namespace edm namespace l1ct { @@ -16,6 +17,8 @@ namespace l1ct { virtual ~RegionizerEmulator(); + static edm::ParameterSetDescription getParameterSetDescription(); + void setDebug(bool debug = true) { debug_ = debug; } virtual void initSectorsAndRegions(const RegionizerDecodedInputs& in, const std::vector& out) {} diff --git a/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/tdr_regionizer_ref.h b/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/tdr_regionizer_ref.h index f486902602ac9..3ee4950c81e01 100644 --- a/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/tdr_regionizer_ref.h +++ b/L1Trigger/Phase2L1ParticleFlow/interface/regionizer/tdr_regionizer_ref.h @@ -6,7 +6,8 @@ namespace edm { class ParameterSet; -} + class ParameterSetDescription; +} // namespace edm namespace l1ct { class TDRRegionizerEmulator : public RegionizerEmulator { @@ -24,6 +25,8 @@ namespace l1ct { ~TDRRegionizerEmulator() override; + static edm::ParameterSetDescription getParameterSetDescription(); + void initSectorsAndRegions(const RegionizerDecodedInputs& in, const std::vector& out) override; void run(const RegionizerDecodedInputs& in, std::vector& out) override; diff --git a/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc b/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc index 6d3779404c679..4aa1c4289d6fa 100644 --- a/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc +++ b/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc @@ -10,6 +10,9 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/FileInPath.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/allowedValues.h" #include "DataFormats/Common/interface/View.h" #include "DataFormats/Common/interface/RefToPtr.h" @@ -48,6 +51,8 @@ class L1TCorrelatorLayer1Producer : public edm::stream::EDProducer<> { explicit L1TCorrelatorLayer1Producer(const edm::ParameterSet &); ~L1TCorrelatorLayer1Producer() override; + static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); + private: edm::ParameterSet config_; @@ -80,7 +85,7 @@ class L1TCorrelatorLayer1Producer : public edm::stream::EDProducer<> { const std::string regionDumpName_; bool writeRawHgcalCluster_; std::fstream fRegionDump_; - const std::vector patternWriterConfigs_; + const edm::VParameterSet patternWriterConfigs_; std::vector> patternWriters_; // region of interest debugging @@ -175,6 +180,13 @@ class L1TCorrelatorLayer1Producer : public edm::stream::EDProducer<> { typedef l1ct::OutputRegion::ObjType OutputType; std::unique_ptr> vecOutput(OutputType i, bool usePuppi) const; std::pair totAndMax(const std::vector &perRegion) const; + + // utilities + template + static edm::ParameterDescription getParDesc(const std::string &name) { + return edm::ParameterDescription( + name + "Parameters", T::getParameterSetDescription(), true); + } }; // @@ -194,13 +206,12 @@ L1TCorrelatorLayer1Producer::L1TCorrelatorLayer1Producer(const edm::ParameterSet l1pualgo_(nullptr), l1tkegalgo_(nullptr), l1tkegsorter_(nullptr), - regionDumpName_(iConfig.getUntrackedParameter("dumpFileName", "")), - writeRawHgcalCluster_(iConfig.getUntrackedParameter("writeRawHgcalCluster", false)), - patternWriterConfigs_(iConfig.getUntrackedParameter>( - "patternWriters", std::vector())), - debugEta_(iConfig.getUntrackedParameter("debugEta", 0)), - debugPhi_(iConfig.getUntrackedParameter("debugPhi", 0)), - debugR_(iConfig.getUntrackedParameter("debugR", -1)) { + regionDumpName_(iConfig.getUntrackedParameter("dumpFileName")), + writeRawHgcalCluster_(iConfig.getUntrackedParameter("writeRawHgcalCluster")), + patternWriterConfigs_(iConfig.getUntrackedParameter("patternWriters")), + debugEta_(iConfig.getUntrackedParameter("debugEta")), + debugPhi_(iConfig.getUntrackedParameter("debugPhi")), + debugR_(iConfig.getUntrackedParameter("debugR")) { produces("PF"); produces("Puppi"); produces("PuppiRegional"); @@ -330,6 +341,82 @@ L1TCorrelatorLayer1Producer::L1TCorrelatorLayer1Producer(const edm::ParameterSet L1TCorrelatorLayer1Producer::~L1TCorrelatorLayer1Producer() {} +void L1TCorrelatorLayer1Producer::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { + edm::ParameterSetDescription desc; + // Inputs and cuts + desc.add("tracks", edm::InputTag("l1tPFTracksFromL1Tracks")); + desc.add("muons", edm::InputTag("l1tSAMuonsGmt", "promptSAMuons")); + desc.add>("emClusters", std::vector()); + desc.add>("hadClusters", std::vector()); + desc.add("vtxCollection", edm::InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation")); + desc.add("vtxCollectionEmulation", true); + desc.add("emPtCut", 0.0); + desc.add("hadPtCut", 0.0); + desc.add("trkPtCut", 0.0); + desc.add("nVtx"); + // Input conversion + edm::EmptyGroupDescription emptyGroup; + desc.ifValue(edm::ParameterDescription("trackInputConversionAlgo", "Ideal", true), + "Ideal" >> emptyGroup or "Emulator" >> getParDesc("trackInputConversion")); + desc.ifValue(edm::ParameterDescription("muonInputConversionAlgo", "Ideal", true), + "Ideal" >> emptyGroup or "Emulator" >> getParDesc("muonInputConversion")); + desc.ifValue( + edm::ParameterDescription("hgcalInputConversionAlgo", "Ideal", true), + "Ideal" >> emptyGroup or "Emulator" >> getParDesc("hgcalInputConversion")); + // Regionizer + auto idealRegPD = getParDesc("regionizerAlgo"); + auto tdrRegPD = getParDesc("regionizerAlgo"); + auto multififoRegPD = getParDesc("regionizerAlgo"); + auto bfMultififoRegPD = getParDesc("regionizerAlgo"); + auto multififoBarrelRegPD = edm::ParameterDescription( + "regionizerAlgoParameters", l1ct::MultififoRegionizerEmulator::getParameterSetDescriptionBarrel(), true); + desc.ifValue(edm::ParameterDescription("regionizerAlgo", "Ideal", true), + "Ideal" >> idealRegPD or "TDR" >> tdrRegPD or "Multififo" >> multififoRegPD or + "BufferedFoldedMultififo" >> bfMultififoRegPD or "MultififoBarrel" >> multififoBarrelRegPD); + // PF + desc.ifValue(edm::ParameterDescription("pfAlgo", "PFAlgo3", true), + "PFAlgo3" >> getParDesc("pfAlgo") or + "PFAlgo2HGC" >> getParDesc("pfAlgo") or + "PFAlgoDummy" >> getParDesc("pfAlgo")); + // Puppi + desc.ifValue(edm::ParameterDescription("puAlgo", "LinearizedPuppi", true), + "LinearizedPuppi" >> getParDesc("puAlgo")); + // EGamma + desc.add("tkEgAlgoParameters", l1ct::PFTkEGAlgoEmuConfig::getParameterSetDescription()); + // EGamma sort + desc.ifValue(edm::ParameterDescription("tkEgSorterAlgo", "Barrel", true), + "Barrel" >> getParDesc("tkEgSorter") or + "Endcap" >> getParDesc("tkEgSorter")); + // geometry: calo sectors + edm::ParameterSetDescription caloSectorPSD; + caloSectorPSD.add>("etaBoundaries"); + caloSectorPSD.add("phiSlices", 3); + caloSectorPSD.add("phiZero", 0.); + desc.addVPSet("caloSectors", caloSectorPSD); + // geometry: regions + edm::ParameterSetDescription regionPSD; + regionPSD.add>("etaBoundaries"); + regionPSD.add("phiSlices", 9); + regionPSD.add("etaExtra", 0.25); + regionPSD.add("phiExtra", 0.25); + desc.addVPSet("regions", regionPSD); + // geometry: boards + edm::ParameterSetDescription boardPSD; + boardPSD.add>("regions"); + desc.addVPSet("boards", boardPSD); + // dump files + desc.addUntracked("dumpFileName", ""); + desc.addUntracked("writeRawHgcalCluster", false); + // pattern files + desc.addVPSetUntracked( + "patternWriters", L1TCorrelatorLayer1PatternFileWriter::getParameterSetDescription(), edm::VParameterSet()); + // debug + desc.addUntracked("debugEta", 0.); + desc.addUntracked("debugPhi", 0.); + desc.addUntracked("debugR", -1.); + descriptions.add("l1tCorrelatorLayer1", desc); +} + void L1TCorrelatorLayer1Producer::beginStream(edm::StreamID id) { if (!regionDumpName_.empty()) { if (id == 0) { @@ -453,7 +540,7 @@ void L1TCorrelatorLayer1Producer::produce(edm::Event &iEvent, const edm::EventSe hwpv.hwZ0 = l1ct::Scales::makeZ0(pvwd.z0()); event_.pvs.push_back(hwpv); event_.pvs_emu.push_back(pvwd.vertexWord()); - //Do a quick histogram vertexing to get multiple vertices (Hack for the taus) + //get additional vertices if requested if (nVtx_ > 1) { std::stable_sort(ptsums.begin(), ptsums.end(), [](const auto &a, const auto &b) { return a.first > b.first; }); for (int i0 = 0; i0 < std::min(int(ptsums.size()), int(nVtx_)); i0++) { @@ -567,7 +654,7 @@ void L1TCorrelatorLayer1Producer::initSectorsAndRegions(const edm::ParameterSet event_.decoded.hadcalo.clear(); event_.raw.hgcalcluster.clear(); - for (const edm::ParameterSet &preg : iConfig.getParameter>("caloSectors")) { + for (const edm::ParameterSet &preg : iConfig.getParameter("caloSectors")) { std::vector etaBoundaries = preg.getParameter>("etaBoundaries"); if (!std::is_sorted(etaBoundaries.begin(), etaBoundaries.end())) throw cms::Exception("Configuration", "caloSectors.etaBoundaries not sorted\n"); @@ -593,7 +680,7 @@ void L1TCorrelatorLayer1Producer::initSectorsAndRegions(const edm::ParameterSet event_.raw.muon.region = l1ct::PFRegionEmu(0., 0.); // centered at (0,0) event_.pfinputs.clear(); - for (const edm::ParameterSet &preg : iConfig.getParameter>("regions")) { + for (const edm::ParameterSet &preg : iConfig.getParameter("regions")) { std::vector etaBoundaries = preg.getParameter>("etaBoundaries"); if (!std::is_sorted(etaBoundaries.begin(), etaBoundaries.end())) throw cms::Exception("Configuration", "regions.etaBoundaries not sorted\n"); @@ -611,7 +698,7 @@ void L1TCorrelatorLayer1Producer::initSectorsAndRegions(const edm::ParameterSet } event_.board_out.clear(); - const std::vector &board_params = iConfig.getParameter>("boards"); + const edm::VParameterSet &board_params = iConfig.getParameter("boards"); event_.board_out.resize(board_params.size()); for (unsigned int bidx = 0; bidx < board_params.size(); bidx++) { event_.board_out[bidx].region_index = board_params[bidx].getParameter>("regions"); diff --git a/L1Trigger/Phase2L1ParticleFlow/plugins/L1TEGMultiMerger.cc b/L1Trigger/Phase2L1ParticleFlow/plugins/L1TEGMultiMerger.cc index 44a83bf22db7a..fd91a0f7bdda6 100644 --- a/L1Trigger/Phase2L1ParticleFlow/plugins/L1TEGMultiMerger.cc +++ b/L1Trigger/Phase2L1ParticleFlow/plugins/L1TEGMultiMerger.cc @@ -7,6 +7,8 @@ #include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/Utilities/interface/transform.h" #include "FWCore/Utilities/interface/InputTag.h" #include @@ -16,6 +18,7 @@ class L1TEGMultiMerger : public edm::global::EDProducer<> { public: explicit L1TEGMultiMerger(const edm::ParameterSet&); ~L1TEGMultiMerger() override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; @@ -120,5 +123,16 @@ void L1TEGMultiMerger::produce(edm::StreamID, edm::Event& iEvent, const edm::Eve emMerger.produce(iEvent, refmapper); } +void L1TEGMultiMerger::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription psetDesc; + psetDesc.add("instance"); + psetDesc.add>("pfProducers"); + edm::ParameterSetDescription desc; + desc.addVPSet("tkElectrons", psetDesc); + desc.addVPSet("tkEms", psetDesc); + desc.addVPSet("tkEgs", psetDesc); + descriptions.addWithDefaultLabel(desc); +} + #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(L1TEGMultiMerger); diff --git a/L1Trigger/Phase2L1ParticleFlow/plugins/L1TPFCandMultiMerger.cc b/L1Trigger/Phase2L1ParticleFlow/plugins/L1TPFCandMultiMerger.cc index 61e629b23097e..6644cb851c40a 100644 --- a/L1Trigger/Phase2L1ParticleFlow/plugins/L1TPFCandMultiMerger.cc +++ b/L1Trigger/Phase2L1ParticleFlow/plugins/L1TPFCandMultiMerger.cc @@ -3,6 +3,8 @@ #include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/Utilities/interface/transform.h" #include "FWCore/Utilities/interface/InputTag.h" #include "DataFormats/Common/interface/CloneTrait.h" @@ -12,6 +14,7 @@ class L1TPFCandMultiMerger : public edm::global::EDProducer<> { public: explicit L1TPFCandMultiMerger(const edm::ParameterSet&); ~L1TPFCandMultiMerger() override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; @@ -91,5 +94,29 @@ void L1TPFCandMultiMerger::produce(edm::StreamID, edm::Event& iEvent, const edm: } } +void L1TPFCandMultiMerger::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + // l1tLayer1 + edm::ParameterSetDescription desc; + desc.add>("pfProducers", + { + edm::InputTag("l1tLayer1Barrel"), + edm::InputTag("l1tLayer1HGCal"), + edm::InputTag("l1tLayer1HGCalNoTK"), + edm::InputTag("l1tLayer1HF"), + }); + desc.add>("labelsToMerge", + { + "PF", + "Puppi", + "Calo", + "TK", + }); + desc.add>("regionalLabelsToMerge", + { + "Puppi", + }); + descriptions.addWithDefaultLabel(desc); +} + #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(L1TPFCandMultiMerger); diff --git a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py index 06962889d01ed..7d06f3d1d4fb1 100644 --- a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py +++ b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py @@ -414,8 +414,6 @@ l1tLayer1HF = cms.EDProducer("L1TCorrelatorLayer1Producer", tracks = cms.InputTag(''), muons = cms.InputTag('l1tSAMuonsGmt','promptSAMuons'), - useStandaloneMuons = cms.bool(False), - useTrackerMuons = cms.bool(False), emClusters = cms.VInputTag(), hadClusters = cms.VInputTag(cms.InputTag('l1tPFClustersFromCombinedCaloHF:calibrated')), vtxCollection = cms.InputTag("l1tVertexFinderEmulator","L1VerticesEmulation"), @@ -425,7 +423,6 @@ hadPtCut = cms.double(15.0), trkPtCut = cms.double(2.0), muonInputConversionAlgo = cms.string("Ideal"), - muonInputConversionParameters = muonInputConversionParameters.clone(), hgcalInputConversionAlgo = cms.string("Ideal"), regionizerAlgo = cms.string("Ideal"), pfAlgo = cms.string("PFAlgoDummy"), diff --git a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_patternWriters_cff.py b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_patternWriters_cff.py index 9bd1434d9cd3d..b71e76d8b0c51 100644 --- a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_patternWriters_cff.py +++ b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_patternWriters_cff.py @@ -20,6 +20,13 @@ maxLinesPerInputFile = cms.uint32(1024), maxLinesPerOutputFile = cms.uint32(1024), eventsPerFile = cms.uint32(_eventsPerFile), + tfTimeSlices = cms.VPSet(), + gctSectors = cms.VPSet(), + gmtTimeSlices = cms.VPSet(), + gmtNumberOfMuons = cms.uint32(12), + gttLink = cms.int32(-1), + gttLatency = cms.uint32(156+10), + gttNumberOfPVs = cms.uint32(_gttNumberOfPVs), ) ## Barrel (54) split in 3 phi slices barrelWriterOutputOnlyPhiConfigs = [ @@ -37,11 +44,6 @@ gctLinksEcal = cms.vint32(-1), ) for s in range(3)]), gmtTimeSlices = cms.VPSet(*[cms.PSet(gmtLink = cms.int32(4*17+t)) for t in range(3)]), - gmtNumberOfMuons = cms.uint32(12), - gttLatency = cms.uint32(156+10), - gttNumberOfPVs = cms.uint32(_gttNumberOfPVs), - inputFileName = cms.string("l1BarrelPhi1Serenity-inputs-vu9p"), - outputFileName = cms.string("l1BarrelPhi1Serenity-outputs") ) barrelSerenityVU9PPhi1Config = barrelSerenityPhi1Config.clone( gttLink = cms.int32(4*28+3), @@ -85,7 +87,7 @@ eventsPerFile = cms.uint32(_eventsPerFile), tfTimeSlices = cms.VPSet(*[cms.PSet(tfSectors = cms.VPSet()) for i in range(3)]), hgcTimeSlices = cms.VPSet(*[cms.PSet(hgcSectors = cms.VPSet()) for i in range(3)]), - gmtTimeSlices = cms.VPSet(cms.PSet(),cms.PSet(),cms.PSet()), + gmtTimeSlices = cms.VPSet(*[cms.PSet(gmtLink = cms.int32(-1)) for i in range(3)]), gmtNumberOfMuons = cms.uint32(12), gttLink = cms.int32(-1), gttLatency = cms.uint32(_gttLatency), @@ -174,19 +176,18 @@ maxLinesPerInputFile = cms.uint32(1024), maxLinesPerOutputFile = cms.uint32(1024), eventsPerFile = cms.uint32(_eventsPerFile), + hgcTimeSlices = cms.VPSet(*[cms.PSet(hgcSectors = cms.VPSet()) for i in range(3)]), + gmtTimeSlices = cms.VPSet(*[cms.PSet(gmtLink = cms.int32(-1)) for i in range(3)]), + gmtNumberOfMuons = cms.uint32(12), + #gttLink = cms.int32(-1), + #gttLatency = cms.uint32(_gttLatency), + #gttNumberOfPVs = cms.uint32(_gttNumberOfPVs), ) hgcalNoTKOutputWriterConfig = _hgcalNoTKWriterConfig.clone( outputLinksPuppi = cms.vuint32(*range(4)), outputFileName = cms.string("l1HGCalNoTK-outputs") ) -hgcalNoTKVU13PWriterConfig = _hgcalNoTKWriterConfig.clone( - hgcTimeSlices = cms.VPSet(*[cms.PSet(hgcSectors = cms.VPSet()) for i in range(3)]), - gmtTimeSlices = cms.VPSet(*[cms.PSet(gmtLink = cms.int32(-1)) for i in range(3)]), - gmtNumberOfMuons = cms.uint32(12), - gttLink = cms.int32(-1), - gttLatency = cms.uint32(_gttLatency), - gttNumberOfPVs = cms.uint32(_gttNumberOfPVs), -) +hgcalNoTKVU13PWriterConfig = _hgcalNoTKWriterConfig.clone() for t in range(3): for isec in range(6): q0 = 3*isec + 6 @@ -205,7 +206,7 @@ tfTimeSlices = None, tfSectors = cms.VPSet(*[cms.PSet(tfLink = cms.int32(-1)) for i in range(18)]), hgcTimeSlices = None, - hgcSectors = cms.VPSet(*[cms.PSet() for i in range(6)]), + hgcSectors = cms.VPSet(*[cms.PSet(hgcLinks = cms.vint32()) for i in range(6)]), gmtTimeSlices = None, gmtLink = cms.int32(4*27+0), gttLink = 4*27+3, @@ -232,8 +233,8 @@ 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 = cms.vint32(*range(4*(12+ilink),4*(12+ilink)+4)) - hgcalWriterVU13PTM18WriterConfig.hgcSectors[isec].hgcLinks = cms.vint32(*range(4*(13+ilink),4*(13+ilink)+4)) + hgcalWriterVU9PTM18WriterConfig.hgcSectors[isec].hgcLinks += range(4*(12+ilink),4*(12+ilink)+4) + hgcalWriterVU13PTM18WriterConfig.hgcSectors[isec].hgcLinks += range(4*(13+ilink),4*(13+ilink)+4) hgcalTM18WriterConfigs = [ hgcalWriterOutputTM18WriterConfig, diff --git a/L1Trigger/Phase2L1ParticleFlow/src/L1TCorrelatorLayer1PatternFileWriter.cc b/L1Trigger/Phase2L1ParticleFlow/src/L1TCorrelatorLayer1PatternFileWriter.cc index a8176b96846d5..e39f86c267216 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/L1TCorrelatorLayer1PatternFileWriter.cc +++ b/L1Trigger/Phase2L1ParticleFlow/src/L1TCorrelatorLayer1PatternFileWriter.cc @@ -1,15 +1,14 @@ #include "L1Trigger/Phase2L1ParticleFlow/interface/L1TCorrelatorLayer1PatternFileWriter.h" #include "FWCore/Utilities/interface/Exception.h" +#include "FWCore/ParameterSet/interface/allowedValues.h" #include L1TCorrelatorLayer1PatternFileWriter::L1TCorrelatorLayer1PatternFileWriter(const edm::ParameterSet& iConfig, const l1ct::Event& eventTemplate) : partition_(parsePartition(iConfig.getParameter("partition"))), tmuxFactor_(iConfig.getParameter("tmuxFactor")), - writeInputs_(iConfig.existsAs("inputFileName") && - !iConfig.getParameter("inputFileName").empty()), - writeOutputs_(iConfig.existsAs("outputFileName") && - !iConfig.getParameter("outputFileName").empty()), + writeInputs_(!iConfig.getParameter("inputFileName").empty()), + writeOutputs_(!iConfig.getParameter("outputFileName").empty()), tfTimeslices_(std::max(1u, tfTmuxFactor_ / tmuxFactor_)), hgcTimeslices_(std::max(1u, hgcTmuxFactor_ / tmuxFactor_)), gctTimeslices_(std::max(1u, gctTmuxFactor_ / tmuxFactor_)), @@ -113,6 +112,60 @@ L1TCorrelatorLayer1PatternFileWriter::L1TCorrelatorLayer1PatternFileWriter(const L1TCorrelatorLayer1PatternFileWriter::~L1TCorrelatorLayer1PatternFileWriter() {} +edm::ParameterSetDescription L1TCorrelatorLayer1PatternFileWriter::getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("inputFileName", ""); + description.add("inputFileExtension", "txt.gz"); + description.add("maxLinesPerInputFile", 1024u); + description.add("nInputFramesPerBX", 9u); + description.add("outputFileName", ""); + description.add("outputFileExtension", "txt.gz"); + description.add("maxLinesPerOutputFile", 1024u); + description.add("nOutputFramesPerBX", 9u); + description.add("tmuxFactor", 6u); + description.add("eventsPerFile", 12u); + description.add("fileFormat"); + + description.ifValue(edm::ParameterDescription("partition", "Barrel", true), + "Barrel" >> (describeTF() and describeGCT() and describeGTT() and describeGMT() and + describePuppi() and describeEG()) or + "HGCal" >> (describeTF() and describeHGC() and describeGTT() and describeGMT() and + describePuppi() and describeEG()) or + "HGCalNoTk" >> (describeHGC() and describeGMT() and describePuppi()) or + "HF" >> (describePuppi())); + return description; +} + +std::unique_ptr L1TCorrelatorLayer1PatternFileWriter::describeTF() { + return describeTimeSlices("tf"); +} +std::unique_ptr L1TCorrelatorLayer1PatternFileWriter::describeGCT() { + edm::ParameterSetDescription gctSectorPSD; + gctSectorPSD.add>("gctLinksEcal"); + gctSectorPSD.add>("gctLinksHad"); + return std::make_unique>>("gctSectors", gctSectorPSD, true); +} +std::unique_ptr L1TCorrelatorLayer1PatternFileWriter::describeHGC() { + return describeTimeSlices("hgc"); +} +std::unique_ptr L1TCorrelatorLayer1PatternFileWriter::describeGMT() { + return describeTimeSlices("gmt") and edm::ParameterDescription("gmtNumberOfMuons", 12, true); +} +std::unique_ptr L1TCorrelatorLayer1PatternFileWriter::describeGTT() { + return describeTimeSlices("gtt") and + edm::ParameterDescription("gttLatency", 162, true) and // minimal latency is 18 BX + edm::ParameterDescription("gttNumberOfPVs", 10, true); +} +std::unique_ptr L1TCorrelatorLayer1PatternFileWriter::describePuppi() { + return edm::ParameterDescription>("outputRegions", std::vector(), true) and + edm::ParameterDescription>("outputLinksPuppi", std::vector(), true); +} +std::unique_ptr L1TCorrelatorLayer1PatternFileWriter::describeEG() { + return edm::ParameterDescription("outputLinkEgamma", -1, true) and + edm::ParameterDescription("nEgammaObjectsOut", 16, true) and + edm::ParameterDescription("outputBoard", -1, true); +} + void L1TCorrelatorLayer1PatternFileWriter::write(const l1ct::Event& event) { if (writeInputs_) { l1t::demo::EventData inputs; @@ -182,6 +235,14 @@ void L1TCorrelatorLayer1PatternFileWriter::configTimeSlices(const edm::Parameter } } +std::unique_ptr L1TCorrelatorLayer1PatternFileWriter::describeTimeSlices( + const std::string& prefix) { + edm::ParameterSetDescription timeslicesPSD; + timeslicesPSD.addNode(describeSectors(prefix)); + return edm::ParameterDescription>(prefix + "TimeSlices", timeslicesPSD, true) xor + describeSectors(prefix); +} + void L1TCorrelatorLayer1PatternFileWriter::configSectors(const edm::ParameterSet& iConfig, const std::string& prefix, unsigned int nSectors, @@ -198,6 +259,15 @@ void L1TCorrelatorLayer1PatternFileWriter::configSectors(const edm::ParameterSet configLinks(iConfig, prefix, linksFactor, 0); } } + +std::unique_ptr L1TCorrelatorLayer1PatternFileWriter::describeSectors( + const std::string& prefix) { + edm::ParameterSetDescription sectorsPSD; + sectorsPSD.addNode(describeLinks(prefix)); + return edm::ParameterDescription>(prefix + "Sectors", sectorsPSD, true) xor + describeLinks(prefix); +} + void L1TCorrelatorLayer1PatternFileWriter::configLinks(const edm::ParameterSet& iConfig, const std::string& prefix, unsigned int linksFactor, @@ -220,6 +290,12 @@ void L1TCorrelatorLayer1PatternFileWriter::configLinks(const edm::ParameterSet& } } +std::unique_ptr L1TCorrelatorLayer1PatternFileWriter::describeLinks( + const std::string& prefix) { + return edm::ParameterDescription(prefix + "Link", true) xor + edm::ParameterDescription>(prefix + "Links", true); +} + void L1TCorrelatorLayer1PatternFileWriter::writeTF(const l1ct::Event& event, l1t::demo::EventData& out) { for (unsigned int iS = 0, nS = event.raw.track.size(); iS < nS; ++iS) { l1t::demo::LinkId key{"tf", iS}; diff --git a/L1Trigger/Phase2L1ParticleFlow/src/egamma/pfeginput_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/egamma/pfeginput_ref.cpp index 560e0eb96df7f..b8289c959f743 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/egamma/pfeginput_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/egamma/pfeginput_ref.cpp @@ -4,13 +4,22 @@ using namespace l1ct; #ifdef CMSSW_GIT_HASH #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" l1ct::EGInputSelectorEmuConfig::EGInputSelectorEmuConfig(const edm::ParameterSet &pset) : idMask(pset.getParameter("emIDMask")), nHADCALO_IN(pset.getParameter("nHADCALO_IN")), nEMCALO_OUT(pset.getParameter("nEMCALO_OUT")), - debug(pset.getUntrackedParameter("debug", 0)) {} + debug(pset.getUntrackedParameter("debug")) {} +edm::ParameterSetDescription l1ct::EGInputSelectorEmuConfig::getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("emIDMask", 30); + description.add("nHADCALO_IN"); + description.add("nEMCALO_OUT"); + description.addUntracked("debug", 0); + return description; +} #endif void EGInputSelectorEmulator::toFirmware(const PFInputRegion &in, HadCaloObj hadcalo[/*nCALO*/]) const { diff --git a/L1Trigger/Phase2L1ParticleFlow/src/egamma/pftkegalgo_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/egamma/pftkegalgo_ref.cpp index da9baff109831..097ec687420d7 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/egamma/pftkegalgo_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/egamma/pftkegalgo_ref.cpp @@ -13,6 +13,7 @@ using namespace l1ct; #ifdef CMSSW_GIT_HASH #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" l1ct::PFTkEGAlgoEmuConfig::PFTkEGAlgoEmuConfig(const edm::ParameterSet &pset) : nTRACK(pset.getParameter("nTRACK")), @@ -45,17 +46,83 @@ l1ct::PFTkEGAlgoEmuConfig::PFTkEGAlgoEmuConfig(const edm::ParameterSet &pset) compIDparams(pset.getParameter("compositeParametersTkEle")), debug(pset.getUntrackedParameter("debug", 0)) {} +edm::ParameterSetDescription l1ct::PFTkEGAlgoEmuConfig::getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("nTRACK"); + description.add("nTRACK_EGIN"); + description.add("nEMCALO_EGIN"); + description.add("nEM_EGOUT"); + description.add("doBremRecovery", false); + description.add("writeBeforeBremRecovery", false); + description.add("filterHwQuality", false); + description.add("caloHwQual", 4); + description.add("doEndcapHwQual", false); + description.add("dEtaMaxBrem", 0.02); + description.add("dPhiMaxBrem", 0.1); + description.add>("absEtaBoundaries", + { + 0.0, + 0.9, + 1.5, + }); + description.add>("dEtaValues", + { + 0.025, + 0.015, + 0.01, + }); + description.add>("dPhiValues", + { + 0.07, + 0.07, + 0.07, + }); + description.add("caloEtMin", 0.0); + description.add("trkQualityPtMin", 10.0); + description.add("writeEGSta", false); + description.add("tkIsoParametersTkEm", IsoParameters::getParameterSetDescription()); + description.add("tkIsoParametersTkEle", IsoParameters::getParameterSetDescription()); + description.add("pfIsoParametersTkEm", IsoParameters::getParameterSetDescription()); + description.add("pfIsoParametersTkEle", IsoParameters::getParameterSetDescription()); + description.add("doTkIso", true); + description.add("doPfIso", true); + description.add("hwIsoTypeTkEle", 0); + description.add("hwIsoTypeTkEm", 2); + description.add("doCompositeTkEle", false); + description.add("nCompCandPerCluster", 3); + description.add("compositeParametersTkEle", + CompIDParameters::getParameterSetDescription()); + return description; +} + l1ct::PFTkEGAlgoEmuConfig::IsoParameters::IsoParameters(const edm::ParameterSet &pset) : IsoParameters(pset.getParameter("tkQualityPtMin"), pset.getParameter("dZ"), pset.getParameter("dRMin"), pset.getParameter("dRMax")) {} +edm::ParameterSetDescription l1ct::PFTkEGAlgoEmuConfig::IsoParameters::getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("tkQualityPtMin"); + description.add("dZ", 0.6); + description.add("dRMin"); + description.add("dRMax"); + description.add("tkQualityChi2Max"); + return description; +} + l1ct::PFTkEGAlgoEmuConfig::CompIDParameters::CompIDParameters(const edm::ParameterSet &pset) : CompIDParameters(pset.getParameter("loose_wp"), pset.getParameter("tight_wp"), pset.getParameter("model")) {} +edm::ParameterSetDescription l1ct::PFTkEGAlgoEmuConfig::CompIDParameters::getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("loose_wp", -0.732422); + description.add("tight_wp", 0.214844); + description.add("model", "L1Trigger/Phase2L1ParticleFlow/data/compositeID.json"); + return description; +} #endif PFTkEGAlgoEmulator::PFTkEGAlgoEmulator(const PFTkEGAlgoEmuConfig &config) diff --git a/L1Trigger/Phase2L1ParticleFlow/src/l1-converters/hgcalinputt_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/l1-converters/hgcalinputt_ref.cpp index e4713944edf02..7cd2aeb8ef9c0 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/l1-converters/hgcalinputt_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/l1-converters/hgcalinputt_ref.cpp @@ -2,9 +2,16 @@ #ifdef CMSSW_GIT_HASH #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" + l1ct::HgcalClusterDecoderEmulator::HgcalClusterDecoderEmulator(const edm::ParameterSet &pset) : slim_(pset.getParameter("slim")) {} +edm::ParameterSetDescription l1ct::HgcalClusterDecoderEmulator::getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("slim", false); + return description; +} #endif l1ct::HgcalClusterDecoderEmulator::~HgcalClusterDecoderEmulator() {} diff --git a/L1Trigger/Phase2L1ParticleFlow/src/l1-converters/muonGmtToL1ct_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/l1-converters/muonGmtToL1ct_ref.cpp index 0c3ddda6a1c43..67342116f8f90 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/l1-converters/muonGmtToL1ct_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/l1-converters/muonGmtToL1ct_ref.cpp @@ -2,10 +2,18 @@ #ifdef CMSSW_GIT_HASH #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" l1ct::GMTMuonDecoderEmulator::GMTMuonDecoderEmulator(const edm::ParameterSet &iConfig) : z0Scale_(iConfig.getParameter("z0Scale")), dxyScale_(iConfig.getParameter("dxyScale")) {} +edm::ParameterSetDescription l1ct::GMTMuonDecoderEmulator::getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("z0Scale", 1.875); + description.add("dxyScale", 3.85); + return description; +} + #endif l1ct::GMTMuonDecoderEmulator::GMTMuonDecoderEmulator(float z0Scale, float dxyScale) diff --git a/L1Trigger/Phase2L1ParticleFlow/src/l1-converters/tkinput_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/l1-converters/tkinput_ref.cpp index ca61b38eb3eb6..21d5e71eab989 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/l1-converters/tkinput_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/l1-converters/tkinput_ref.cpp @@ -10,6 +10,8 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/allowedValues.h" namespace { l1ct::TrackInputEmulator::Region parseRegion(const std::string &str) { @@ -80,6 +82,52 @@ l1ct::TrackInputEmulator::TrackInputEmulator(const edm::ParameterSet &iConfig) } } +edm::ParameterSetDescription l1ct::TrackInputEmulator::getParameterSetDescription() { + edm::ParameterSetDescription description; + // region-independent parameters and/or defaults + description.add("ptLUTBits", 11u); + description.add("etaPreOffs", 0); + description.add("etaSigned", true); + description.add("phiBits", 10u); + description.add("z0Bits", 12u); + description.ifValue(edm::ParameterDescription("trackWordEncoding", "biased", true), + edm::allowedValues("biased", "unbised", "stepping")); + description.add("bitwiseAccurate", true); + description.add("slimDataFormat", false); + description.addUntracked("debug", false); + // region-dependent parameters and/or defaults + auto barrelParamerers = edm::ParameterDescription("etaLUTBits", 10, true) and + edm::ParameterDescription("etaShift", 15 - 10, true) and + edm::ParameterDescription("etaPostOffs", 0, true) and + edm::ParameterDescription("dEtaBarrelBits", 8, true) and + edm::ParameterDescription("dEtaBarrelZ0PreShift", 2, true) and + edm::ParameterDescription("dEtaBarrelZ0PostShift", 2, true) and + edm::ParameterDescription("dEtaBarrelFloatOffs", 0.0, true) and + edm::ParameterDescription("dPhiBarrelBits", 4, true) and + edm::ParameterDescription("dPhiBarrelRInvPreShift", 4, true) and + edm::ParameterDescription("dPhiBarrelRInvPostShift", 4, true) and + edm::ParameterDescription("dPhiBarrelFloatOffs", 0.0, true); + auto endcapParameters = edm::ParameterDescription("etaLUTBits", 11, true) and + edm::ParameterDescription("etaShift", 15 - 11, true) and + edm::ParameterDescription("etaPostOffs", 150, true) and + edm::ParameterDescription("dEtaHGCalBits", 10, true) and + edm::ParameterDescription("dEtaHGCalZ0PreShift", 2, true) and + edm::ParameterDescription("dEtaHGCalRInvPreShift", 6, true) and + edm::ParameterDescription("dEtaHGCalLUTBits", 10, true) and + edm::ParameterDescription("dEtaHGCalLUTShift", 2, true) and + edm::ParameterDescription("dEtaHGCalFloatOffs", 0.0, true) and + edm::ParameterDescription("dPhiHGCalBits", 4, true) and + edm::ParameterDescription("dPhiHGCalZ0PreShift", 4, true) and + edm::ParameterDescription("dPhiHGCalZ0PostShift", 6, true) and + edm::ParameterDescription("dPhiHGCalRInvShift", 4, true) and + edm::ParameterDescription("dPhiHGCalTanlInvShift", 22, true) and + edm::ParameterDescription("dPhiHGCalTanlLUTBits", 10, true) and + edm::ParameterDescription("dPhiHGCalFloatOffs", 0.0, true); + description.ifValue(edm::ParameterDescription("region", "barrel", true), + "barrel" >> std::move(barrelParamerers) or "endcap" >> std::move(endcapParameters)); + return description; +} + #endif l1ct::TrackInputEmulator::TrackInputEmulator(Region region, Encoding encoding, bool bitwise, bool slim) diff --git a/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo2hgc_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo2hgc_ref.cpp index ff7fe8b05be2d..bec78588a66ba 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo2hgc_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo2hgc_ref.cpp @@ -8,6 +8,7 @@ #ifdef CMSSW_GIT_HASH #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" l1ct::PFAlgo2HGCEmulator::PFAlgo2HGCEmulator(const edm::ParameterSet& iConfig) : PFAlgoEmulatorBase(iConfig.getParameter("nTrack"), @@ -22,6 +23,21 @@ l1ct::PFAlgo2HGCEmulator::PFAlgo2HGCEmulator(const edm::ParameterSet& iConfig) loadPtErrBins(iConfig); } +edm::ParameterSetDescription l1ct::PFAlgo2HGCEmulator::getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("nTrack", 30); + description.add("nCalo", 20); + description.add("nMu", 4); + description.add("nSelCalo", 20); + description.add("trackMuDR", 0.2); + description.add("trackCaloDR", 0.1); + description.add("maxInvisiblePt", 10.0); + description.add("tightTrackMaxInvisiblePt", 20); + addCaloResolutionParameterSetDescription(description); + description.addUntracked("debug", false); + return description; +} + #endif void l1ct::PFAlgo2HGCEmulator::toFirmware(const PFInputRegion& in, diff --git a/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo3_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo3_ref.cpp index fe0e3e0bd5ae6..9df780c81849c 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo3_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo3_ref.cpp @@ -9,6 +9,7 @@ #ifdef CMSSW_GIT_HASH #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" l1ct::PFAlgo3Emulator::PFAlgo3Emulator(const edm::ParameterSet& iConfig) : PFAlgoEmulatorBase(iConfig.getParameter("nTrack"), @@ -27,6 +28,27 @@ l1ct::PFAlgo3Emulator::PFAlgo3Emulator(const edm::ParameterSet& iConfig) debug_ = iConfig.getUntrackedParameter("debug", false); loadPtErrBins(iConfig); } + +edm::ParameterSetDescription l1ct::PFAlgo3Emulator::getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("nTrack", 25); + description.add("nCalo", 18); + description.add("nMu", 2); + description.add("nSelCalo", 18); + description.add("nEmCalo", 12); + description.add("nPhoton", 12); + description.add("nAllNeutral", 25); + description.add("trackMuDR", 0.2); + description.add("trackEmDR", 0.04); + description.add("emCaloDR", 0.1); + description.add("trackCaloDR", 0.15); + description.add("maxInvisiblePt", 10.0); + description.add("tightTrackMaxInvisiblePt", 20); + addCaloResolutionParameterSetDescription(description); + description.addUntracked("debug", false); + return description; +} + #endif void l1ct::PFAlgo3Emulator::toFirmware(const PFInputRegion& in, diff --git a/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo_common_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo_common_ref.cpp index 1e7fa983f559a..bff4ff27775d7 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo_common_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo_common_ref.cpp @@ -6,6 +6,7 @@ #ifdef CMSSW_GIT_HASH #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #endif l1ct::PFAlgoEmulatorBase::~PFAlgoEmulatorBase() {} @@ -43,6 +44,14 @@ void l1ct::PFAlgoEmulatorBase::loadPtErrBins(const edm::ParameterSet &iConfig) { loadPtErrBins(absetas.size(), &absetas[0], &scales[0], &offs[0]); } +void l1ct::PFAlgoEmulatorBase::addCaloResolutionParameterSetDescription(edm::ParameterSetDescription &to) { + edm::ParameterSetDescription description; + description.add>("etaBins"); + description.add>("offset"); + description.add>("scale"); + to.add("caloResolution", description); +} + #endif l1ct::pt_t l1ct::PFAlgoEmulatorBase::ptErr_ref(const l1ct::PFRegionEmu ®ion, const l1ct::TkObjEmu &track) const { diff --git a/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo_dummy_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo_dummy_ref.cpp index 0f39904bce93b..baad992b18549 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo_dummy_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/pf/pfalgo_dummy_ref.cpp @@ -8,12 +8,21 @@ #ifdef CMSSW_GIT_HASH #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" l1ct::PFAlgoDummyEmulator::PFAlgoDummyEmulator(const edm::ParameterSet& iConfig) : PFAlgoEmulatorBase( 0, iConfig.getParameter("nCalo"), iConfig.getParameter("nMu"), 0, 0, 0, 0, 0) { debug_ = iConfig.getUntrackedParameter("debug", false); } + +edm::ParameterSetDescription l1ct::PFAlgoDummyEmulator::getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("nCalo"); + description.add("nMu"); + description.addUntracked("debug", false); + return description; +} #endif void l1ct::PFAlgoDummyEmulator::run(const PFInputRegion& in, OutputRegion& out) const { diff --git a/L1Trigger/Phase2L1ParticleFlow/src/puppi/linpuppi_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/puppi/linpuppi_ref.cpp index 8ef2679747d0d..e2643999529e1 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/puppi/linpuppi_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/puppi/linpuppi_ref.cpp @@ -9,6 +9,8 @@ #ifdef CMSSW_GIT_HASH #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/allowedValues.h" #include "FWCore/Utilities/interface/transform.h" #include "FWCore/Utilities/interface/Exception.h" #endif @@ -115,9 +117,7 @@ l1ct::LinPuppiEmulator::LinPuppiEmulator(const edm::ParameterSet &iConfig) ptCut_(edm::vector_transform(iConfig.getParameter>("ptCut"), l1ct::Scales::makePtFromFloat)), nFinalSort_(iConfig.getParameter("nFinalSort")), debug_(iConfig.getUntrackedParameter("debug", false)), - fakePuppi_(iConfig.existsAs("fakePuppi") ? iConfig.getParameter("fakePuppi") - : false) // it's only for debug, but still better be tracked -{ + fakePuppi_(iConfig.getParameter("fakePuppi")) { if (absEtaBins_.size() + 1 != ptSlopeNe_.size()) throw cms::Exception("Configuration", "size mismatch for ptSlopes parameter"); if (absEtaBins_.size() + 1 != ptSlopePh_.size()) @@ -152,6 +152,36 @@ l1ct::LinPuppiEmulator::LinPuppiEmulator(const edm::ParameterSet &iConfig) else throw cms::Exception("Configuration", "unsupported finalSortAlgo '" + sortAlgo + "'"); } + +edm::ParameterSetDescription l1ct::LinPuppiEmulator::getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("nTrack"); + description.add("nIn"); + description.add("nOut"); + description.add("nVtx", 1); + description.add("dZ"); + description.add("dr"); + description.add("drMin"); + description.add("ptMax"); + description.add>("absEtaCuts"); + description.add>("ptCut"); + description.add>("ptSlopes"); + description.add>("ptSlopesPhoton"); + description.add>("ptZeros"); + description.add>("ptZerosPhoton"); + description.add>("alphaSlopes"); + description.add>("alphaZeros"); + description.add>("alphaCrop"); + description.add>("priors"); + description.add>("priorsPhoton"); + description.add("nFinalSort"); + description.ifValue( + edm::ParameterDescription("finalSortAlgo", "Insertion", true), + edm::allowedValues("Insertion", "BitonicRUFL", "BitonicHLS", "Hybrid", "FoldedHybrid")); + description.add("fakePuppi", false); + description.addUntracked("debug", false); + return description; +} #endif void l1ct::LinPuppiEmulator::puppisort_and_crop_ref(unsigned int nOutMax, diff --git a/L1Trigger/Phase2L1ParticleFlow/src/regionizer/buffered_folded_multififo_regionizer_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/regionizer/buffered_folded_multififo_regionizer_ref.cpp index e03e29850148d..9717416c15b0d 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/regionizer/buffered_folded_multififo_regionizer_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/regionizer/buffered_folded_multififo_regionizer_ref.cpp @@ -5,6 +5,7 @@ #ifdef CMSSW_GIT_HASH #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" l1ct::BufferedFoldedMultififoRegionizerEmulator::BufferedFoldedMultififoRegionizerEmulator( const edm::ParameterSet& iConfig) @@ -17,12 +18,27 @@ l1ct::BufferedFoldedMultififoRegionizerEmulator::BufferedFoldedMultififoRegioniz /*outii=*/6, /*pauseii=*/3, iConfig.getParameter("useAlsoVtxCoords")) { - debug_ = iConfig.getUntrackedParameter("debug", false); + debug_ = iConfig.getUntrackedParameter("debug"); if (iConfig.existsAs("egInterceptMode")) { const auto& emSelCfg = iConfig.getParameter("egInterceptMode"); setEgInterceptMode(emSelCfg.getParameter("afterFifo"), emSelCfg); } } + +edm::ParameterSetDescription l1ct::BufferedFoldedMultififoRegionizerEmulator::getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("nClocks", 162); + description.add("nTrack", 30); + description.add("nCalo", 20); + description.add("nEmCalo", 10); + description.add("nMu", 4); + edm::ParameterSetDescription egIntercept = l1ct::EGInputSelectorEmuConfig::getParameterSetDescription(); + egIntercept.add("afterFifo", true); + description.addOptional("egInterceptMode", egIntercept); + description.add("useAlsoVtxCoords", true); + description.addUntracked("debug", false); + return description; +} #endif l1ct::BufferedFoldedMultififoRegionizerEmulator::BufferedFoldedMultififoRegionizerEmulator(unsigned int nclocks, diff --git a/L1Trigger/Phase2L1ParticleFlow/src/regionizer/multififo_regionizer_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/regionizer/multififo_regionizer_ref.cpp index cfe6ec7664565..7b2de76db7e47 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/regionizer/multififo_regionizer_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/regionizer/multififo_regionizer_ref.cpp @@ -8,6 +8,8 @@ #ifdef CMSSW_GIT_HASH #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/allowedValues.h" l1ct::MultififoRegionizerEmulator::MultififoRegionizerEmulator(const edm::ParameterSet& iConfig) : MultififoRegionizerEmulator(iConfig.getParameter("nEndcaps"), @@ -43,7 +45,41 @@ l1ct::MultififoRegionizerEmulator::MultififoRegionizerEmulator(const std::string /*outii=*/1, /*pauseii=*/0, iConfig.getParameter("useAlsoVtxCoords")) { - debug_ = iConfig.getUntrackedParameter("debug", false); + debug_ = iConfig.getUntrackedParameter("debug"); +} + +edm::ParameterSetDescription l1ct::MultififoRegionizerEmulator::getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("nEndcaps", 2); + description.add("nClocks", 54); + description.add("nTkLinks", 2); + description.add("nCaloLinks", 3); + description.add("nTrack", 30); + description.add("nCalo", 20); + description.add("nEmCalo", 10); + description.add("nMu", 4); + edm::ParameterSetDescription egIntercept = l1ct::EGInputSelectorEmuConfig::getParameterSetDescription(); + egIntercept.add("afterFifo", true); + description.addOptional("egInterceptMode", egIntercept); + description.add("useAlsoVtxCoords", true); + description.addUntracked("debug", false); + return description; +} + +edm::ParameterSetDescription l1ct::MultififoRegionizerEmulator::getParameterSetDescriptionBarrel() { + edm::ParameterSetDescription description; + description.ifValue(edm::ParameterDescription("barrelSetup", "Full54", true), + edm::allowedValues("Full54", "Full27")); + description.add("nClocks", 54); + description.add("nHCalLinks", 2); + description.add("nECalLinks", 1); + description.add("nTrack", 22); + description.add("nCalo", 15); + description.add("nEmCalo", 12); + description.add("nMu", 2); + description.add("useAlsoVtxCoords", true); + description.addUntracked("debug", false); + return description; } #endif diff --git a/L1Trigger/Phase2L1ParticleFlow/src/regionizer/regionizer_base_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/regionizer/regionizer_base_ref.cpp index f79f9f6934903..42d9a15bb87af 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/regionizer/regionizer_base_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/regionizer/regionizer_base_ref.cpp @@ -6,9 +6,18 @@ #ifdef CMSSW_GIT_HASH #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" + l1ct::RegionizerEmulator::RegionizerEmulator(const edm::ParameterSet& iConfig) : useAlsoVtxCoords_(iConfig.getParameter("useAlsoVtxCoords")), - debug_(iConfig.getUntrackedParameter("debug", false)) {} + debug_(iConfig.getUntrackedParameter("debug")) {} + +edm::ParameterSetDescription l1ct::RegionizerEmulator::getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("useAlsoVtxCoords", true); + description.addUntracked("debug", false); + return description; +} #endif l1ct::RegionizerEmulator::~RegionizerEmulator() {} diff --git a/L1Trigger/Phase2L1ParticleFlow/src/regionizer/tdr_regionizer_ref.cpp b/L1Trigger/Phase2L1ParticleFlow/src/regionizer/tdr_regionizer_ref.cpp index 8a654985ab2e0..79616c2753888 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/regionizer/tdr_regionizer_ref.cpp +++ b/L1Trigger/Phase2L1ParticleFlow/src/regionizer/tdr_regionizer_ref.cpp @@ -5,6 +5,7 @@ #ifdef CMSSW_GIT_HASH #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" l1ct::TDRRegionizerEmulator::TDRRegionizerEmulator(const edm::ParameterSet& iConfig) : TDRRegionizerEmulator(iConfig.getParameter("nTrack"), @@ -14,7 +15,20 @@ l1ct::TDRRegionizerEmulator::TDRRegionizerEmulator(const edm::ParameterSet& iCon iConfig.getParameter("nClocks"), iConfig.getParameter>("bigRegionEdges"), iConfig.getParameter("doSort")) { - debug_ = iConfig.getUntrackedParameter("debug", false); + debug_ = iConfig.getUntrackedParameter("debug"); +} + +edm::ParameterSetDescription l1ct::TDRRegionizerEmulator::getParameterSetDescription() { + edm::ParameterSetDescription description; + description.add("nClocks", 162); + description.add("nTrack", 22); + description.add("nCalo", 15); + description.add("nEmCalo", 12); + description.add("nMu", 2); + description.add("doSort", false); + description.add>("bigRegionEdges", {-560, -80, 400, -560}); + description.addUntracked("debug", false); + return description; } #endif diff --git a/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py b/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py index 249725522860e..a778a86ffb84a 100644 --- a/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py +++ b/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py @@ -164,12 +164,15 @@ process.l1tLayer1HGCalTM18 = process.l1tLayer1HGCal.clone() process.l1tLayer1HGCalTM18.regionizerAlgo = "BufferedFoldedMultififo" process.l1tLayer1HGCalTM18.regionizerAlgoParameters.nClocks = 162 - process.l1tLayer1HGCalTM18.regionizerAlgoParameters.nTkLinks = 1 - process.l1tLayer1HGCalTM18.regionizerAlgoParameters.nCaloLinks = 1 + del process.l1tLayer1HGCalTM18.regionizerAlgoParameters.nEndcaps + del process.l1tLayer1HGCalTM18.regionizerAlgoParameters.nTkLinks + del process.l1tLayer1HGCalTM18.regionizerAlgoParameters.nCaloLinks process.l1tLayer1HGCalNoTKTM18 = process.l1tLayer1HGCalNoTK.clone() process.l1tLayer1HGCalNoTKTM18.regionizerAlgo = "BufferedFoldedMultififo" process.l1tLayer1HGCalNoTKTM18.regionizerAlgoParameters.nClocks = 162 - process.l1tLayer1HGCalNoTKTM18.regionizerAlgoParameters.nCaloLinks = 1 + del process.l1tLayer1HGCalNoTKTM18.regionizerAlgoParameters.nEndcaps + del process.l1tLayer1HGCalNoTKTM18.regionizerAlgoParameters.nTkLinks + del process.l1tLayer1HGCalNoTKTM18.regionizerAlgoParameters.nCaloLinks process.runPF.insert(process.runPF.index(process.l1tLayer1HGCal)+1, process.l1tLayer1HGCalTM18) process.runPF.insert(process.runPF.index(process.l1tLayer1HGCalNoTK)+1, process.l1tLayer1HGCalNoTKTM18) if not args.patternFilesOFF: From 3476f770a260719f5fbcb91b7b013a7399b0e613 Mon Sep 17 00:00:00 2001 From: Giovanni Date: Fri, 25 Aug 2023 13:38:57 +0200 Subject: [PATCH 8/8] Cleanup some configuration settings, using the defaults from fillDescriptions --- .../plugins/L1TCorrelatorLayer1Producer.cc | 2 +- .../python/l1ctLayer1_cff.py | 214 ++++++------------ 2 files changed, 73 insertions(+), 143 deletions(-) diff --git a/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc b/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc index 4aa1c4289d6fa..a6a77c217fe14 100644 --- a/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc +++ b/L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc @@ -344,7 +344,7 @@ L1TCorrelatorLayer1Producer::~L1TCorrelatorLayer1Producer() {} void L1TCorrelatorLayer1Producer::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { edm::ParameterSetDescription desc; // Inputs and cuts - desc.add("tracks", edm::InputTag("l1tPFTracksFromL1Tracks")); + desc.add("tracks", edm::InputTag("")); desc.add("muons", edm::InputTag("l1tSAMuonsGmt", "promptSAMuons")); desc.add>("emClusters", std::vector()); desc.add>("hadClusters", std::vector()); diff --git a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py index 7d06f3d1d4fb1..2e7082629a1cb 100644 --- a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py +++ b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py @@ -9,54 +9,35 @@ from L1Trigger.Phase2L1ParticleFlow.l1TkEgAlgoEmulator_cfi import tkEgAlgoParameters,tkEgSorterParameters -muonInputConversionParameters = cms.PSet( - z0Scale = cms.double(1.875), - dxyScale = cms.double(3.85) -) - l1tLayer1Barrel = cms.EDProducer("L1TCorrelatorLayer1Producer", tracks = cms.InputTag('l1tPFTracksFromL1Tracks'), muons = cms.InputTag('l1tSAMuonsGmt','promptSAMuons'), emClusters = cms.VInputTag(cms.InputTag('l1tPFClustersFromL1EGClusters:selected')), hadClusters = cms.VInputTag(cms.InputTag('l1tPFClustersFromCombinedCaloHCal:calibrated')), vtxCollection = cms.InputTag("l1tVertexFinderEmulator","L1VerticesEmulation"), - vtxCollectionEmulation = cms.bool(True), - emPtCut = cms.double(0.5), + nVtx = cms.int32(1), + emPtCut = cms.double(0.5), hadPtCut = cms.double(1.0), - trkPtCut = cms.double(2.0), + trkPtCut = cms.double(2.0), trackInputConversionAlgo = cms.string("Emulator"), trackInputConversionParameters = cms.PSet( region = cms.string("barrel"), - trackWordEncoding = cms.string("biased"), - bitwiseAccurate = cms.bool(True), slimDataFormat = cms.bool(True), ptLUTBits = cms.uint32(11), etaLUTBits = cms.uint32(10), - etaPreOffs = cms.int32(0), etaShift = cms.uint32(15-10), - etaPostOffs = cms.int32(0), - etaSigned = cms.bool(True), phiBits = cms.uint32(10), z0Bits = cms.uint32(12), dEtaBarrelBits = cms.uint32(8), dEtaBarrelZ0PreShift = cms.uint32(2), dEtaBarrelZ0PostShift = cms.uint32(2), - dEtaBarrelFloatOffs = cms.double(0.0), dPhiBarrelBits = cms.uint32(4), dPhiBarrelRInvPreShift = cms.uint32(4), dPhiBarrelRInvPostShift = cms.uint32(4), - dPhiBarrelFloatOffs = cms.double(0.0) ), muonInputConversionAlgo = cms.string("Emulator"), - muonInputConversionParameters = muonInputConversionParameters.clone(), - hgcalInputConversionAlgo = cms.string("Ideal"), regionizerAlgo = cms.string("Ideal"), pfAlgo = cms.string("PFAlgo3"), - puAlgo = cms.string("LinearizedPuppi"), - nVtx = cms.int32(1), - regionizerAlgoParameters = cms.PSet( - useAlsoVtxCoords = cms.bool(True), - ), pfAlgoParameters = cms.PSet( nTrack = cms.uint32(25), nCalo = cms.uint32(18), @@ -76,8 +57,8 @@ offset = cms.vdouble( 2.909, 2.864, 0.294), scale = cms.vdouble( 0.119, 0.127, 0.442), ), - debug = cms.untracked.bool(False) ), + puAlgo = cms.string("LinearizedPuppi"), puAlgoParameters = cms.PSet( nTrack = cms.uint32(22), nIn = cms.uint32(25), @@ -100,43 +81,36 @@ alphaCrop = cms.vdouble( 4 ), # max. absolute value for alpha term priors = cms.vdouble( 5.0 ), priorsPhoton = cms.vdouble( 1.0 ), - debug = cms.untracked.bool(False) ), - tkEgAlgoParameters=tkEgAlgoParameters.clone( + tkEgAlgoParameters = tkEgAlgoParameters.clone( nTRACK = 25, nTRACK_EGIN = 13, nEMCALO_EGIN = 10, nEM_EGOUT = 10, ), tkEgSorterAlgo = cms.string("Barrel"), - tkEgSorterParameters=tkEgSorterParameters.clone( + tkEgSorterParameters = tkEgSorterParameters.clone( nObjToSort = 10 ), caloSectors = cms.VPSet( cms.PSet( etaBoundaries = cms.vdouble(-1.5, 1.5), phiSlices = cms.uint32(3), - phiZero = cms.double(0), ) ), regions = cms.VPSet( cms.PSet( etaBoundaries = cms.vdouble(-1.5, -1.0, -0.5, 0.0, 0.5, 1.0, 1.5), phiSlices = cms.uint32(9), - etaExtra = cms.double(0.25), - phiExtra = cms.double(0.25), ), ), - boards=cms.VPSet( + boards = cms.VPSet( cms.PSet( - regions=cms.vuint32(*[0+9*ie+i for ie in range(6) for i in range(3)])), # phi splitting - # regions=cms.vuint32(range(0, 18))), # eta splitting + regions = cms.vuint32(*[0+9*ie+i for ie in range(6) for i in range(3)])), # phi splitting cms.PSet( - regions=cms.vuint32(*[3+9*ie+i for ie in range(6) for i in range(3)])), # phi splitting - # regions=cms.vuint32(range(18, 36))), # eta splitting + regions = cms.vuint32(*[3+9*ie+i for ie in range(6) for i in range(3)])), # phi splitting cms.PSet( - regions=cms.vuint32(*[6+9*ie+i for ie in range(6) for i in range(3)])), # phi splitting - # regions=cms.vuint32(range(36, 54))), # eta splitting + regions = cms.vuint32(*[6+9*ie+i for ie in range(6) for i in range(3)])), # phi splitting ) ) @@ -146,7 +120,7 @@ cms.PSet( etaBoundaries = cms.vdouble(-3.0, -1.5), phiSlices = cms.uint32(3), - phiZero = cms.double(math.pi/2) # The edge of the 0th HGCal sectors is at 30 deg, the center at 30+120/2=90 = pi/2 + phiZero = cms.double(math.pi/2) # The edge of the 0th HGCal sectors is at 30 deg, the center at 30+120/2 = 90 = pi/2 ), cms.PSet( etaBoundaries = cms.vdouble(+1.5, +3.0), @@ -162,23 +136,18 @@ emClusters = cms.VInputTag(cms.InputTag('l1tPFClustersFromHGC3DClusters:egamma')), # used only for E/gamma hadClusters = cms.VInputTag(cms.InputTag('l1tPFClustersFromHGC3DClusters')), vtxCollection = cms.InputTag("l1tVertexFinderEmulator","L1VerticesEmulation"), - vtxCollectionEmulation = cms.bool(True), - nVtx = cms.int32(1), - emPtCut = cms.double(0.5), + nVtx = cms.int32(1), + emPtCut = cms.double(0.5), hadPtCut = cms.double(1.0), - trkPtCut = cms.double(2.0), + trkPtCut = cms.double(2.0), trackInputConversionAlgo = cms.string("Emulator"), trackInputConversionParameters = cms.PSet( region = cms.string("endcap"), - trackWordEncoding = cms.string("biased"), - bitwiseAccurate = cms.bool(True), slimDataFormat = cms.bool(False), ptLUTBits = cms.uint32(11), etaLUTBits = cms.uint32(11), - etaPreOffs = cms.int32(0), etaShift = cms.uint32(15-11), etaPostOffs = cms.int32(150), - etaSigned = cms.bool(True), phiBits = cms.uint32(10), z0Bits = cms.uint32(12), dEtaHGCalBits = cms.uint32(10), @@ -186,21 +155,15 @@ dEtaHGCalRInvPreShift = cms.uint32(6), dEtaHGCalLUTBits = cms.uint32(10), dEtaHGCalLUTShift = cms.uint32(2), - dEtaHGCalFloatOffs = cms.double(0.0), dPhiHGCalBits = cms.uint32(4), dPhiHGCalZ0PreShift = cms.uint32(4), dPhiHGCalZ0PostShift = cms.uint32(6), dPhiHGCalRInvShift = cms.uint32(4), dPhiHGCalTanlInvShift = cms.uint32(22), dPhiHGCalTanlLUTBits = cms.uint32(10), - dPhiHGCalFloatOffs = cms.double(0.0) ), muonInputConversionAlgo = cms.string("Emulator"), - muonInputConversionParameters = muonInputConversionParameters.clone(), hgcalInputConversionAlgo = cms.string("Emulator"), - hgcalInputConversionParameters = cms.PSet( - slim = cms.bool(False) - ), regionizerAlgo = cms.string("Multififo"), regionizerAlgoParameters = cms.PSet( useAlsoVtxCoords = cms.bool(True), @@ -234,7 +197,6 @@ offset = cms.vdouble( 1.793, 1.827, 2.363, 2.538, 2.812, 2.642), scale = cms.vdouble( 0.138, 0.137, 0.124, 0.115, 0.106, 0.121), ), - debug = cms.untracked.bool(False) ), puAlgo = cms.string("LinearizedPuppi"), puAlgoParameters = cms.PSet( @@ -259,21 +221,20 @@ alphaCrop = cms.vdouble( 3 , 3 ), # max. absolute value for alpha term priors = cms.vdouble( 5.0, 5.0 ), priorsPhoton = cms.vdouble( 1.5, 1.5 ), #When e/g ID not applied, use: cms.vdouble( 3.5, 3.5, 7.0 ), - debug = cms.untracked.bool(False) ), - tkEgAlgoParameters=tkEgAlgoParameters.clone( + tkEgAlgoParameters = tkEgAlgoParameters.clone( nTRACK = 30, nTRACK_EGIN = 10, nEMCALO_EGIN = 10, nEM_EGOUT = 5, - doBremRecovery=True, - doEndcapHwQual=True, - writeBeforeBremRecovery=False, - writeEGSta=True, - doCompositeTkEle=True, - trkQualityPtMin=0.), # This should be 10 GeV when doCompositeTkEle=False + doBremRecovery = True, + doEndcapHwQual = True, + writeBeforeBremRecovery = False, + writeEGSta = True, + doCompositeTkEle = True, + trkQualityPtMin = 0.), # This should be 10 GeV when doCompositeTkEle = False tkEgSorterAlgo = cms.string("Endcap"), - tkEgSorterParameters=tkEgSorterParameters.clone( + tkEgSorterParameters = tkEgSorterParameters.clone( nObjToSort = 5 ), caloSectors = _hgcalSectors, @@ -281,22 +242,18 @@ cms.PSet( etaBoundaries = cms.vdouble(-2.5, -1.5), phiSlices = cms.uint32(9), - etaExtra = cms.double(0.25), - phiExtra = cms.double(0.25), ), cms.PSet( etaBoundaries = cms.vdouble(+1.5, +2.5), phiSlices = cms.uint32(9), - etaExtra = cms.double(0.25), - phiExtra = cms.double(0.25), ) ), - boards=cms.VPSet( + boards = cms.VPSet( cms.PSet( - regions=cms.vuint32(range(0, 9))), + regions = cms.vuint32(range(0, 9))), cms.PSet( - regions=cms.vuint32(range(9, 18))), + regions = cms.vuint32(range(9, 18))), ), writeRawHgcalCluster = cms.untracked.bool(True) ) @@ -310,18 +267,15 @@ l1tLayer1HGCalExtended = l1tLayer1HGCal.clone(tracks = cms.InputTag('l1tPFTracksFromL1TracksExtended')) l1tLayer1HGCalNoTK = cms.EDProducer("L1TCorrelatorLayer1Producer", - tracks = cms.InputTag(''), muons = cms.InputTag('l1tSAMuonsGmt','promptSAMuons'), emClusters = cms.VInputTag(cms.InputTag('l1tPFClustersFromHGC3DClusters:egamma')), # used only for E/gamma hadClusters = cms.VInputTag(cms.InputTag('l1tPFClustersFromHGC3DClusters')), vtxCollection = cms.InputTag("l1tVertexFinderEmulator","L1VerticesEmulation"), - vtxCollectionEmulation = cms.bool(True), - nVtx = cms.int32(1), - emPtCut = cms.double(0.5), + nVtx = cms.int32(1), + emPtCut = cms.double(0.5), hadPtCut = cms.double(1.0), - trkPtCut = cms.double(2.0), + trkPtCut = cms.double(2.0), muonInputConversionAlgo = cms.string("Emulator"), - muonInputConversionParameters = muonInputConversionParameters.clone(), hgcalInputConversionAlgo = cms.string("Emulator"), hgcalInputConversionParameters = cms.PSet( slim = cms.bool(True) @@ -348,7 +302,6 @@ pfAlgoParameters = cms.PSet( nCalo = cms.uint32(12), nMu = cms.uint32(4), # unused - debug = cms.untracked.bool(False) ), puAlgo = cms.string("LinearizedPuppi"), puAlgoParameters = cms.PSet( @@ -373,68 +326,53 @@ alphaCrop = cms.vdouble( 4 ), # max. absolute value for alpha term priors = cms.vdouble( 7.0 ), priorsPhoton = cms.vdouble( 5.0 ), #When e/g ID not applied, use: cms.vdouble( 3.5, 3.5, 7.0 ), - debug = cms.untracked.bool(False) ), - tkEgAlgoParameters=tkEgAlgoParameters.clone( + tkEgAlgoParameters = tkEgAlgoParameters.clone( nTRACK = 30, nTRACK_EGIN = 10, nEMCALO_EGIN = 10, nEM_EGOUT = 5, - doBremRecovery=True, - doEndcapHwQual=True, - writeBeforeBremRecovery=False, - writeEGSta=True), + doBremRecovery = True, + doEndcapHwQual = True, + writeBeforeBremRecovery = False, + writeEGSta = True), tkEgSorterAlgo = cms.string("Endcap"), - tkEgSorterParameters=tkEgSorterParameters.clone( - nObjToSort=5 + tkEgSorterParameters = tkEgSorterParameters.clone( + nObjToSort = 5 ), caloSectors = _hgcalSectors, regions = cms.VPSet( cms.PSet( etaBoundaries = cms.vdouble(-3.0, -2.5), phiSlices = cms.uint32(9), - etaExtra = cms.double(0.25), - phiExtra = cms.double(0.25), ), cms.PSet( etaBoundaries = cms.vdouble(+2.5, +3.0), phiSlices = cms.uint32(9), - etaExtra = cms.double(0.25), - phiExtra = cms.double(0.25), ) ), - boards=cms.VPSet( - cms.PSet( - regions=cms.vuint32(range(0,18))), + boards = cms.VPSet( + cms.PSet(regions = cms.vuint32(range(0,18))), ), writeRawHgcalCluster = cms.untracked.bool(True) ) l1tLayer1HF = cms.EDProducer("L1TCorrelatorLayer1Producer", - tracks = cms.InputTag(''), muons = cms.InputTag('l1tSAMuonsGmt','promptSAMuons'), - emClusters = cms.VInputTag(), hadClusters = cms.VInputTag(cms.InputTag('l1tPFClustersFromCombinedCaloHF:calibrated')), vtxCollection = cms.InputTag("l1tVertexFinderEmulator","L1VerticesEmulation"), - vtxCollectionEmulation = cms.bool(True), - nVtx = cms.int32(1), - emPtCut = cms.double(0.5), + nVtx = cms.int32(1), + emPtCut = cms.double(0.5), hadPtCut = cms.double(15.0), - trkPtCut = cms.double(2.0), - muonInputConversionAlgo = cms.string("Ideal"), - hgcalInputConversionAlgo = cms.string("Ideal"), - regionizerAlgo = cms.string("Ideal"), + trkPtCut = cms.double(2.0), pfAlgo = cms.string("PFAlgoDummy"), - puAlgo = cms.string("LinearizedPuppi"), - regionizerAlgoParameters = cms.PSet( - useAlsoVtxCoords = cms.bool(True), - ), pfAlgoParameters = cms.PSet( nCalo = cms.uint32(18), nMu = cms.uint32(4), # unused debug = cms.untracked.bool(False) ), + puAlgo = cms.string("LinearizedPuppi"), puAlgoParameters = cms.PSet( nTrack = cms.uint32(0), # unused nIn = cms.uint32(18), @@ -459,42 +397,36 @@ priorsPhoton = cms.vdouble( 6.0 ), debug = cms.untracked.bool(False) ), - tkEgAlgoParameters=tkEgAlgoParameters.clone( + tkEgAlgoParameters = tkEgAlgoParameters.clone( nTRACK = 5, # to be defined nTRACK_EGIN = 5, # to be defined nEMCALO_EGIN = 5, # to be defined nEM_EGOUT = 5, # to be defined - doBremRecovery=True, - writeEGSta=True), + doBremRecovery = True, + writeEGSta = True), tkEgSorterAlgo = cms.string("Endcap"), - tkEgSorterParameters=tkEgSorterParameters.clone(), + tkEgSorterParameters = tkEgSorterParameters.clone(), caloSectors = cms.VPSet( cms.PSet( etaBoundaries = cms.vdouble(-5.5, -3.0), phiSlices = cms.uint32(9), - phiZero = cms.double(0), ), cms.PSet( etaBoundaries = cms.vdouble(+3.0, +5.5), phiSlices = cms.uint32(9), - phiZero = cms.double(0), ) ), regions = cms.VPSet( cms.PSet( etaBoundaries = cms.vdouble(-5.5, -3.0), phiSlices = cms.uint32(9), - etaExtra = cms.double(0.25), - phiExtra = cms.double(0.25), ), cms.PSet( etaBoundaries = cms.vdouble(+3.0, +5.5), phiSlices = cms.uint32(9), - etaExtra = cms.double(0.25), - phiExtra = cms.double(0.25), ) ), - boards=cms.VPSet(), + boards = cms.VPSet(), ) @@ -505,8 +437,6 @@ cms.InputTag("l1tLayer1HGCalNoTK"), cms.InputTag("l1tLayer1HF") ), - labelsToMerge = cms.vstring("PF", "Puppi", "Calo", "TK"), - regionalLabelsToMerge = cms.vstring("Puppi"), ) @@ -521,39 +451,39 @@ l1tLayer1EG = cms.EDProducer( "L1TEGMultiMerger", - tkElectrons=cms.VPSet( + tkElectrons = cms.VPSet( cms.PSet( - instance=cms.string("L1TkEleEE"), - pfProducers=cms.VInputTag( + instance = cms.string("L1TkEleEE"), + pfProducers = cms.VInputTag( cms.InputTag("l1tLayer1HGCal", 'L1TkEle') ) ), cms.PSet( - instance=cms.string("L1TkEleEB"), - pfProducers=cms.VInputTag( + instance = cms.string("L1TkEleEB"), + pfProducers = cms.VInputTag( cms.InputTag("l1tLayer1Barrel", 'L1TkEle') ) ) ), - tkEms=cms.VPSet( + tkEms = cms.VPSet( cms.PSet( - instance=cms.string("L1TkEmEE"), - pfProducers=cms.VInputTag( + instance = cms.string("L1TkEmEE"), + pfProducers = cms.VInputTag( cms.InputTag("l1tLayer1HGCal", 'L1TkEm'), cms.InputTag("l1tLayer1HGCalNoTK", 'L1TkEm') ) ), cms.PSet( - instance=cms.string("L1TkEmEB"), - pfProducers=cms.VInputTag( + instance = cms.string("L1TkEmEB"), + pfProducers = cms.VInputTag( cms.InputTag("l1tLayer1Barrel", 'L1TkEm') ) ) ), - tkEgs=cms.VPSet( + tkEgs = cms.VPSet( cms.PSet( - instance=cms.string("L1EgEE"), - pfProducers=cms.VInputTag( + instance = cms.string("L1EgEE"), + pfProducers = cms.VInputTag( cms.InputTag("l1tLayer1HGCal", 'L1Eg'), cms.InputTag("l1tLayer1HGCalNoTK", 'L1Eg') ) @@ -563,39 +493,39 @@ l1tLayer1EGElliptic = cms.EDProducer( "L1TEGMultiMerger", - tkElectrons=cms.VPSet( + tkElectrons = cms.VPSet( cms.PSet( - instance=cms.string("L1TkEleEE"), - pfProducers=cms.VInputTag( + instance = cms.string("L1TkEleEE"), + pfProducers = cms.VInputTag( cms.InputTag("l1tLayer1HGCalElliptic", 'L1TkEle') ) ), cms.PSet( - instance=cms.string("L1TkEleEB"), - pfProducers=cms.VInputTag( + instance = cms.string("L1TkEleEB"), + pfProducers = cms.VInputTag( cms.InputTag("l1tLayer1Barrel", 'L1TkEle') ) ) ), - tkEms=cms.VPSet( + tkEms = cms.VPSet( cms.PSet( - instance=cms.string("L1TkEmEE"), - pfProducers=cms.VInputTag( + instance = cms.string("L1TkEmEE"), + pfProducers = cms.VInputTag( cms.InputTag("l1tLayer1HGCalElliptic", 'L1TkEm'), cms.InputTag("l1tLayer1HGCalNoTK", 'L1TkEm') ) ), cms.PSet( - instance=cms.string("L1TkEmEB"), - pfProducers=cms.VInputTag( + instance = cms.string("L1TkEmEB"), + pfProducers = cms.VInputTag( cms.InputTag("l1tLayer1Barrel", 'L1TkEm') ) ) ), - tkEgs=cms.VPSet( + tkEgs = cms.VPSet( cms.PSet( - instance=cms.string("L1EgEE"), - pfProducers=cms.VInputTag( + instance = cms.string("L1EgEE"), + pfProducers = cms.VInputTag( cms.InputTag("l1tLayer1HGCalElliptic", 'L1Eg'), cms.InputTag("l1tLayer1HGCalNoTK", 'L1Eg') )