Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion L1Trigger/Configuration/python/SimL1Emulator_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@

# Overlap and EndCap Muon Track Finder
# ########################################################################
from L1Trigger.L1TMuonOverlapPhase2.simOmtfPhase2Digis_cfi import *
from L1Trigger.L1TMuonOverlapPhase2.fakeOmtfParamsPhase2_cff import *
from L1Trigger.L1TMuonOverlapPhase2.simOmtfPhase2Digis_extrapol_cfi import *
#_phase2_siml1emulator.add(omtfParamsSource)
_phase2_siml1emulator.add(omtfParamsPhase2)
_phase2_siml1emulator.add(simOmtfPhase2Digis)

from L1Trigger.L1TMuonEndCapPhase2.simCscTriggerPrimitiveDigisForEMTF_cfi import *
Expand Down
17 changes: 17 additions & 0 deletions L1Trigger/L1TMuonOverlapPhase2/python/fakeOmtfParamsPhase2_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import FWCore.ParameterSet.Config as cms

omtfParamsSource = cms.ESSource(
"EmptyESSource",
recordName = cms.string('L1TMuonOverlapParamsRcd'),
iovIsRunNotTime = cms.bool(True),
firstValid = cms.vuint32(1)
)

###OMTF ESProducer. Fills CondFormats from XML files.
omtfParamsPhase2 = cms.ESProducer(
"L1TMuonOverlapPhase1ParamsESProducer",
patternsXMLFiles = cms.VPSet(
cms.PSet(patternsXMLFile = cms.FileInPath("L1Trigger/L1TMuon/data/omtf_config/Patterns_ExtraplMB1nadMB2DTQualAndEtaFixedP_ValueP1Scale_t20_v1_SingleMu_iPt_and_OneOverPt_classProb17_recalib2_minDP0.xml")),
),
configXMLFile = cms.FileInPath("L1Trigger/L1TMuon/data/omtf_config/hwToLogicLayer_0x0209.xml"),
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
srcCSC = cms.InputTag('simCscTriggerPrimitiveDigis','MPCSORTED'),
srcRPC = cms.InputTag('simMuonRPCDigis'),
srcDTPhPhase2 = cms.InputTag('dtTriggerPhase2PrimitiveDigis'),

srcDTThPhase2 = cms.InputTag('dtTriggerPhase2PrimitiveDigis'),

dumpResultToXML = cms.bool(False),
dumpDetailedResultToXML = cms.bool(False),
XMLDumpFileName = cms.string("TestEvents.xml"),
Expand Down Expand Up @@ -45,6 +46,9 @@
useStubQualInExtr = cms.bool(True),
useEndcapStubsRInExtr = cms.bool(True),
useFloatingPointExtrapolation = cms.bool(False),

## XML / PATTERNS file:
patternsXMLFile = cms.FileInPath("L1Trigger/L1TMuon/data/omtf_config/Patterns_ExtraplMB1nadMB2DTQualAndEtaFixedP_ValueP1Scale_t20_v1_SingleMu_iPt_and_OneOverPt_classProb17_recalib2_minDP0.xml"),
extrapolFactorsFilename = cms.FileInPath("L1Trigger/L1TMuon/data/omtf_config/ExtrapolationFactors_ExtraplMB1nadMB2DTQual_ValueP1Scale_t20.xml"),

sorterType = cms.string("byLLH"),
Expand Down
33 changes: 20 additions & 13 deletions L1Trigger/Phase2L1GMT/plugins/Phase2L1TGMTFwdMuonTranslator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,19 @@ void Phase2L1TGMTFwdMuonTranslator::produce(edm::Event& iEvent, const edm::Event
// Since OMTF is using Phase-1 LSB, will convert to SAMuon locally
// We should move to passing words in future
l1t::SAMuon samuon;
if (mu.hwPt() > 0)
if (mu.hwPt() > 0) {
samuon = Convertl1tMuon(mu, 0);
else if (mu.hwPtUnconstrained() > 0) //Assume exculsive, need double check
samuon = Convertl1tMuon(mu, 0, true);

//now associate the stubs
associateStubs(samuon, stubs);

// Add To Collections
if (mu.hwPt() > 0)
//now associate the stubs
associateStubs(samuon, stubs);
prompt.push_back(samuon);
else if (mu.hwPtUnconstrained() > 0)
}
if (mu.hwPtUnconstrained() > 0)
{
samuon = Convertl1tMuon(mu, 0, true);
//now associate the stubs
associateStubs(samuon, stubs);
displaced.push_back(samuon);
}
}

// Convert EMTF++ Tracks to SAMuons
Expand Down Expand Up @@ -159,10 +159,17 @@ SAMuon Phase2L1TGMTFwdMuonTranslator::Convertl1tMuon(const l1t::RegionalMuonCand
if (!isDisplaced && mu.hwPt() > 0)
pt = round(mu.hwPt() * 0.5 / LSBpt); // Phase-1 LSB 0.5GeV
if (isDisplaced && mu.hwPtUnconstrained() > 0)
pt = round(mu.hwPtUnconstrained() * 0.5 / LSBpt); // Phase-1 LSB 0.5GeV
pt = round(mu.hwPtUnconstrained() * 1.0 / LSBpt); // Phase-1 LSB 1.0GeV!!

// BEWARE: THIS CONVERSION IS ONLY VALID FOR OMTF
constexpr double p1phiLSB = 2 * M_PI / 576;
ap_int<BITSGTPHI> phi = round(mu.hwPhi() * p1phiLSB / LSBphi); // Phase-1 LSB (2*pi/576)
// From the uGMTConfiguration of OMTF. OMTF send in local phi!!
// all others correspond to 120 degree sectors = 192 in int-scale
int globPhi = mu.processor() * 192 + mu.hwPhi();
// first processor starts at CMS phi = 15 degrees (24 in int)... Handle wrap-around with %. Add 576 to make sure the number is positive
globPhi = (globPhi + 600) % 576;
ap_int<BITSGTPHI> phi = round(globPhi * p1phiLSB / LSBphi); // Phase-1 LSB (2*pi/576)

ap_int<BITSGTETA> eta = round(mu.hwEta() * 0.010875 / LSBeta); // Phase-1 LSB 0.010875

// FIXME: Below are not well defined in phase1 GMT
Expand Down Expand Up @@ -235,7 +242,7 @@ void Phase2L1TGMTFwdMuonTranslator::associateStubs(l1t::SAMuon& mu, const l1t::M
SAMuon Phase2L1TGMTFwdMuonTranslator::ConvertEMTFTrack(const l1t::phase2::EMTFTrack& track, const int bx_) {
// Convert EMTF Phi and Theta to Global Phi and Eta
float track_phi =
emtf::phase2::tp::calcPhiGlobRadFromLoc(track.sector(), emtf::phase2::tp::calcPhiLocDegFromInt(track.modelPhi()));
emtf::phase2::tp::calcPhiGlobRadFromLoc(track.sector(), emtf::phase2::tp::calcPhiLocRadFromInt(track.modelPhi()));
float track_theta = emtf::phase2::tp::calcThetaRadFromInt(track.modelEta());
float track_eta = -1 * std::log(std::tan(track_theta / 2));

Expand Down