Skip to content

Commit

Permalink
Merge pull request cms-sw#1219 from cerminar/eg_updates_140X_v0
Browse files Browse the repository at this point in the history
Fix GT producer for new e/g hw interfaces and update emulator patterns for new recipe
  • Loading branch information
aloeliger committed Mar 11, 2024
2 parents c599f99 + 80035f0 commit c6b5166
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 18 deletions.
12 changes: 6 additions & 6 deletions L1Trigger/Phase2L1GT/plugins/L1GTProducer.cc
Expand Up @@ -310,7 +310,7 @@ namespace l1t {
std::unique_ptr<P2GTCandidateCollection> outputCollection = std::make_unique<P2GTCandidateCollection>();
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<TkEm &>(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()),
Expand All @@ -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);
Expand All @@ -332,7 +332,7 @@ namespace l1t {
std::unique_ptr<P2GTCandidateCollection> outputCollection = std::make_unique<P2GTCandidateCollection>();
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<TkElectron &>(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()),
Expand All @@ -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;

Expand Down
14 changes: 7 additions & 7 deletions L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer2EG_cff.py
Expand Up @@ -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)
),
),
)
Expand Down
23 changes: 18 additions & 5 deletions L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py
Expand Up @@ -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"),
Expand Down Expand Up @@ -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 +
Expand All @@ -138,9 +151,9 @@
# process.l1tLayer2SeedConeJetWriter +
process.l1tLayer2EG
)
process.runPF.associate(process.L1TInputTask)
process.runPF.associate(process.L1TLayer1TaskInputsTask)


#####################################################################################################################
## Layer 2 e/gamma

Expand Down Expand Up @@ -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' ]

0 comments on commit c6b5166

Please sign in to comment.