From eec9a8463474fd61875990fb7ad2869d0d9daaa9 Mon Sep 17 00:00:00 2001 From: Gianluca Date: Fri, 8 Mar 2024 10:14:04 +0100 Subject: [PATCH 1/2] Update Electron and Photon GT interface --- L1Trigger/Phase2L1GT/plugins/L1GTProducer.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/L1Trigger/Phase2L1GT/plugins/L1GTProducer.cc b/L1Trigger/Phase2L1GT/plugins/L1GTProducer.cc index 4e1cf7d93ecc9..42af0349cd340 100644 --- a/L1Trigger/Phase2L1GT/plugins/L1GTProducer.cc +++ b/L1Trigger/Phase2L1GT/plugins/L1GTProducer.cc @@ -310,7 +310,7 @@ namespace l1t { std::unique_ptr outputCollection = std::make_unique(); const TkEmCollection &collection = event.get(cl2PhotonToken_); for (size_t i = 0; i < collection.size() && i < 12; i++) { - l1gt::Photon gtPhoton = l1gt::Photon::unpack_ap(const_cast(collection[i]).egBinaryWord<96>()); + l1gt::Photon gtPhoton = collection[i].hwObj(); P2GTCandidate gtObj(0, reco::ParticleState::PolarLorentzVector(scales_.to_pT(gtPhoton.v3.pt.V.to_int()), scales_.to_eta(gtPhoton.v3.eta.V.to_int()), @@ -319,8 +319,8 @@ namespace l1t { gtObj.hwPT_ = gtPhoton.v3.pt.V.to_int(); gtObj.hwPhi_ = gtPhoton.v3.phi.V.to_int(); gtObj.hwEta_ = gtPhoton.v3.eta.V.to_int(); - gtObj.hwIso_ = gtPhoton.isolation.V.to_int(); - gtObj.hwQual_ = gtPhoton.quality.V.to_int(); + gtObj.hwIso_ = gtPhoton.isolationPT.V.to_int(); + gtObj.hwQual_ = gtPhoton.qualityFlags.V.to_int(); gtObj.objectType_ = P2GTCandidate::CL2Photons; outputCollection->push_back(gtObj); @@ -332,7 +332,7 @@ namespace l1t { std::unique_ptr outputCollection = std::make_unique(); const TkElectronCollection &collection = event.get(cl2ElectronToken_); for (size_t i = 0; i < collection.size() && i < 12; i++) { - l1gt::Electron gtElectron = l1gt::Electron::unpack_ap(const_cast(collection[i]).egBinaryWord<96>()); + l1gt::Electron gtElectron = collection[i].hwObj(); int hwZ0 = gtElectron.z0.V.to_int() << 7; P2GTCandidate gtObj(scales_.to_chg(gtElectron.charge.V.to_int()), reco::ParticleState::PolarLorentzVector(scales_.to_pT(gtElectron.v3.pt.V.to_int()), @@ -344,8 +344,8 @@ namespace l1t { gtObj.hwPhi_ = gtElectron.v3.phi.V.to_int(); gtObj.hwEta_ = gtElectron.v3.eta.V.to_int(); gtObj.hwZ0_ = hwZ0; - gtObj.hwIso_ = gtElectron.isolation.V.to_int(); - gtObj.hwQual_ = gtElectron.quality.V.to_int(); + gtObj.hwIso_ = gtElectron.isolationPT.V.to_int(); + gtObj.hwQual_ = gtElectron.qualityFlags.V.to_int(); gtObj.hwCharge_ = gtElectron.charge.V.to_int(); gtObj.objectType_ = P2GTCandidate::CL2Electrons; From 80035f064547b883d6efcfbd2e422a8b8079e091 Mon Sep 17 00:00:00 2001 From: Gianluca Date: Fri, 8 Mar 2024 12:31:45 +0100 Subject: [PATCH 2/2] Update pattern creation scripts for new muon sequence and updated input files --- .../python/l1ctLayer2EG_cff.py | 14 +++++------ .../test/make_l1ct_binaryFiles_cfg.py | 23 +++++++++++++++---- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer2EG_cff.py b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer2EG_cff.py index ee68943bea14b..11a874344a1ee 100644 --- a/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer2EG_cff.py +++ b/L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer2EG_cff.py @@ -159,35 +159,35 @@ tkElectrons=cms.VPSet( cms.PSet( pfProducer=cms.InputTag("l1tLayer1HGCalElliptic", 'L1TkElePerBoard'), - channels=cms.vint32(3, 4) + regions=cms.vint32(3, 4) ), cms.PSet( pfProducer=cms.InputTag("l1tLayer1Barrel", 'L1TkElePerBoard'), - channels=cms.vint32(0, 1, 2) + regions=cms.vint32(0, 1, 2) ), ), tkEms=cms.VPSet( cms.PSet( pfProducer=cms.InputTag("l1tLayer1HGCalElliptic", 'L1TkEmPerBoard'), - channels=cms.vint32(3, 4) + regions=cms.vint32(3, 4) ), cms.PSet( pfProducer=cms.InputTag("l1tLayer1HGCalNoTK", 'L1TkEmPerBoard'), - channels=cms.vint32(-1) + regions=cms.vint32(-1) ), cms.PSet( pfProducer=cms.InputTag("l1tLayer1Barrel", 'L1TkEmPerBoard'), - channels=cms.vint32(0, 1, 2) + regions=cms.vint32(0, 1, 2) ), ), tkEgs=cms.VPSet( cms.PSet( pfProducer=cms.InputTag("l1tLayer1HGCalElliptic", 'L1Eg'), - channels=cms.vint32(-1) + regions=cms.vint32(-1) ), cms.PSet( pfProducer=cms.InputTag("l1tLayer1HGCalNoTK", 'L1Eg'), - channels=cms.vint32(-1) + regions=cms.vint32(-1) ), ), ) diff --git a/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py b/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py index 35af83ce2c0e0..2191018d20618 100644 --- a/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py +++ b/L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py @@ -57,8 +57,19 @@ 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') -from L1Trigger.Phase2L1GMT.gmt_cfi import l1tStandaloneMuons -process.l1tSAMuonsGmt = l1tStandaloneMuons.clone() +from L1Trigger.Configuration.SimL1Emulator_cff import l1tSAMuonsGmt +process.l1tSAMuonsGmt = l1tSAMuonsGmt.clone() +from L1Trigger.L1CaloTrigger.l1tPhase2L1CaloEGammaEmulator_cfi import l1tPhase2L1CaloEGammaEmulator +process.l1tPhase2L1CaloEGammaEmulator = l1tPhase2L1CaloEGammaEmulator.clone() +from L1Trigger.L1CaloTrigger.l1tPhase2CaloPFClusterEmulator_cfi import l1tPhase2CaloPFClusterEmulator +process.l1tPhase2CaloPFClusterEmulator = l1tPhase2CaloPFClusterEmulator.clone() + +process.L1TInputTask = cms.Task( + process.l1tSAMuonsGmt, + process.l1tPhase2L1CaloEGammaEmulator, + process.l1tPhase2CaloPFClusterEmulator +) + from L1Trigger.Phase2L1ParticleFlow.l1tJetFileWriter_cfi import l1tSeededConeJetFileWriter l1ctLayer2SCJetsProducts = cms.VPSet([cms.PSet(jets = cms.InputTag("l1tSC4PFL1PuppiCorrectedEmulator"), @@ -119,7 +130,9 @@ process.l1tLayer1HF.patternWriters = cms.untracked.VPSet(*hfWriterConfigs) process.runPF = cms.Path( - process.l1tSAMuonsGmt + + # process.l1tSAMuonsGmt + + # process.l1tPhase2L1CaloEGammaEmulator + + # process.l1tPhase2CaloPFClusterEmulator + process.l1tGTTInputProducer + process.l1tTrackSelectionProducer + process.l1tVertexFinderEmulator + @@ -138,9 +151,9 @@ # process.l1tLayer2SeedConeJetWriter + process.l1tLayer2EG ) +process.runPF.associate(process.L1TInputTask) process.runPF.associate(process.L1TLayer1TaskInputsTask) - ##################################################################################################################### ## Layer 2 e/gamma @@ -200,4 +213,4 @@ for det in "HGCalTM18", "HGCalNoTKTM18", "BarrelSerenityTM18": 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' ] +process.source.fileNames = [ '/store/cmst3/group/l1tr/cerminar/14_0_X/fpinputs_131X/v3/TTbar_PU200/inputs131X_1.root' ]