diff --git a/DQM/L1TMonitor/interface/L1TStage2RegionalMuonCandComp.h b/DQM/L1TMonitor/interface/L1TStage2RegionalMuonCandComp.h index f679c4d30a852..28bbf0e5b3bfa 100644 --- a/DQM/L1TMonitor/interface/L1TStage2RegionalMuonCandComp.h +++ b/DQM/L1TMonitor/interface/L1TStage2RegionalMuonCandComp.h @@ -63,6 +63,10 @@ class L1TStage2RegionalMuonCandComp : public DQMEDAnalyzer { RPT2 }; enum tfs { BMTFBIN = 1, OMTFNEGBIN, OMTFPOSBIN, EMTFNEGBIN, EMTFPOSBIN }; + int numSummaryBins_{ + TRACKADDRBAD}; // In Run-2 we didn't have the last two bins. This is incremented in source file if we configure for Run-3. + int numErrBins_{ + RTRACKADDR}; // In Run-2 we didn't have the last two bins. This is incremented in source file if we configure for Run-3. bool incBin[RPT2 + 1]; edm::EDGetTokenT muonToken1; @@ -74,7 +78,7 @@ class L1TStage2RegionalMuonCandComp : public DQMEDAnalyzer { bool ignoreBadTrkAddr; std::vector ignoreBin; bool verbose; - bool isBmtf; + bool hasDisplacementInfo; MonitorElement* summary; MonitorElement* errorSummaryNum; diff --git a/DQM/L1TMonitor/interface/L1TStage2uGMT.h b/DQM/L1TMonitor/interface/L1TStage2uGMT.h index 0c19f63af5183..3b42ddd51bcd7 100644 --- a/DQM/L1TMonitor/interface/L1TStage2uGMT.h +++ b/DQM/L1TMonitor/interface/L1TStage2uGMT.h @@ -77,6 +77,8 @@ class L1TStage2uGMT : public DQMEDAnalyzer { MonitorElement* ugmtEMTFBX; MonitorElement* ugmtEMTFnMuons; MonitorElement* ugmtEMTFhwPt; + MonitorElement* ugmtEMTFhwPtUnconstrained; + MonitorElement* ugmtEMTFhwDXY; MonitorElement* ugmtEMTFhwEta; MonitorElement* ugmtEMTFhwPhiPos; MonitorElement* ugmtEMTFhwPhiNeg; diff --git a/DQM/L1TMonitor/python/L1TStage2BMTF_cff.py b/DQM/L1TMonitor/python/L1TStage2BMTF_cff.py index 9c8381c866f3a..2f3008ec2be8c 100644 --- a/DQM/L1TMonitor/python/L1TStage2BMTF_cff.py +++ b/DQM/L1TMonitor/python/L1TStage2BMTF_cff.py @@ -39,7 +39,7 @@ l1tStage2BmtfSecond.bmtfSource = cms.InputTag("bmtfDigis","BMTF2") l1tStage2BmtfSecond.monitorDir = cms.untracked.string("L1T/L1TStage2BMTF/L1TStage2BMTF-Secondary") l1tStage2BmtfSecond.verbose = cms.untracked.bool(False) -l1tStage2BmtfSecond.isBmtf = cms.untracked.bool(True) +l1tStage2BmtfSecond.hasDisplacementInfo = cms.untracked.bool(True) # sequences l1tStage2BmtfOnlineDQMSeq = cms.Sequence( diff --git a/DQM/L1TMonitor/python/L1TStage2uGMT_cff.py b/DQM/L1TMonitor/python/L1TStage2uGMT_cff.py index c00390ff7beac..27f41eb379110 100644 --- a/DQM/L1TMonitor/python/L1TStage2uGMT_cff.py +++ b/DQM/L1TMonitor/python/L1TStage2uGMT_cff.py @@ -54,6 +54,10 @@ displacedQuantities = cms.untracked.bool(False) ) +## Era: Run3_2021; Displaced muons from EMTF used in uGMT from Run-3 +stage2L1Trigger_2021.toModify(l1tStage2uGMTIntermediateEMTFNeg, displacedQuantities = cms.untracked.bool(True)) +stage2L1Trigger_2021.toModify(l1tStage2uGMTIntermediateEMTFPos, displacedQuantities = cms.untracked.bool(True)) + # zero suppression DQM l1tStage2uGMTZeroSupp = DQMEDAnalyzer( "L1TMP7ZeroSupp", @@ -129,7 +133,7 @@ ## Era: Run3_2021; Displaced muons from BMTF used in uGMT from Run-3 from Configuration.Eras.Modifier_stage2L1Trigger_2021_cff import stage2L1Trigger_2021 -stage2L1Trigger_2021.toModify(l1tStage2BmtfOutVsuGMTIn, isBmtf = cms.untracked.bool(True)) +stage2L1Trigger_2021.toModify(l1tStage2BmtfOutVsuGMTIn, hasDisplacementInfo = cms.untracked.bool(True)) # compares the unpacked OMTF output regional muon collection with the unpacked uGMT input regional muon collection from OMTF # only muons that do not match are filled in the histograms @@ -159,6 +163,9 @@ verbose = cms.untracked.bool(False), ) +## Era: Run3_2021; Displaced muons from EMTF used in uGMT from Run-3 +stage2L1Trigger_2021.toModify(l1tStage2EmtfOutVsuGMTIn, hasDisplacementInfo = cms.untracked.bool(True)) + # The five modules below compare the primary unpacked uGMT muon collection to goes to uGT board 0 # to the unpacked uGMT muon collections that are sent to uGT boards 1 to 5. # Only muons that do not match are filled in the histograms diff --git a/DQM/L1TMonitor/python/L1TdeStage2BMTFSecond_cff.py b/DQM/L1TMonitor/python/L1TdeStage2BMTFSecond_cff.py index e89a775927457..7bb5830598de9 100644 --- a/DQM/L1TMonitor/python/L1TdeStage2BMTFSecond_cff.py +++ b/DQM/L1TMonitor/python/L1TdeStage2BMTFSecond_cff.py @@ -14,7 +14,7 @@ l1tdeStage2BmtfSecond.summaryTitle = cms.untracked.string("Summary of comparison between BMTF2 muons and BMTF2 emulator muons") l1tdeStage2BmtfSecond.ignoreBin = cms.untracked.vint32(ignoreBinsDeStage2Bmtf) l1tdeStage2BmtfSecond.verbose = cms.untracked.bool(False) -l1tdeStage2BmtfSecond.isBmtf = cms.untracked.bool(True) +l1tdeStage2BmtfSecond.hasDisplacementInfo = cms.untracked.bool(True) diff --git a/DQM/L1TMonitor/python/L1TdeStage2BMTF_cfi.py b/DQM/L1TMonitor/python/L1TdeStage2BMTF_cfi.py index f5d967b2d18cf..195ba1806a810 100644 --- a/DQM/L1TMonitor/python/L1TdeStage2BMTF_cfi.py +++ b/DQM/L1TMonitor/python/L1TdeStage2BMTF_cfi.py @@ -17,6 +17,6 @@ summaryTitle = cms.untracked.string("Summary of comparison between BMTF muons and BMTF emulator muons"), ignoreBin = cms.untracked.vint32(ignoreBinsDeStage2Bmtf), verbose = cms.untracked.bool(False), - isBmtf = cms.untracked.bool(True) + hasDisplacementInfo = cms.untracked.bool(True) ) diff --git a/DQM/L1TMonitor/python/L1TdeStage2uGMT_cff.py b/DQM/L1TMonitor/python/L1TdeStage2uGMT_cff.py index 15114f493df1f..847bdf683b421 100644 --- a/DQM/L1TMonitor/python/L1TdeStage2uGMT_cff.py +++ b/DQM/L1TMonitor/python/L1TdeStage2uGMT_cff.py @@ -66,6 +66,10 @@ verbose = cms.untracked.bool(False), ) +## Era: Run3_2021; Displaced muons from EMTF used in uGMT from Run-3 +stage2L1Trigger_2021.toModify(l1tStage2uGMTIntermediateEMTFNegEmul, displacedQuantities = cms.untracked.bool(True)) +stage2L1Trigger_2021.toModify(l1tStage2uGMTIntermediateEMTFPosEmul, displacedQuantities = cms.untracked.bool(True)) + # compares the unpacked uGMT muon collection to the emulated uGMT muon collection # only muons that do not match are filled in the histograms l1tdeStage2uGMT = DQMEDAnalyzer( diff --git a/DQM/L1TMonitor/src/L1TStage2MuonComp.cc b/DQM/L1TMonitor/src/L1TStage2MuonComp.cc index 37c62dcd634f0..51c1c53058490 100644 --- a/DQM/L1TMonitor/src/L1TStage2MuonComp.cc +++ b/DQM/L1TMonitor/src/L1TStage2MuonComp.cc @@ -12,8 +12,11 @@ L1TStage2MuonComp::L1TStage2MuonComp(const edm::ParameterSet& ps) enable2DComp( ps.getUntrackedParameter("enable2DComp")), // When true eta-phi comparison plots are also produced displacedQuantities_(ps.getUntrackedParameter("displacedQuantities")) { + if (displacedQuantities_) { + numErrBins_ += 2; + } // First include all bins - for (unsigned int i = 1; i <= RIDX; i++) { + for (int i = 1; i <= numErrBins_; i++) { incBin[i] = true; } // Then check the list of bins to ignore @@ -74,9 +77,6 @@ void L1TStage2MuonComp::bookHistograms(DQMStore::IBooker& ibooker, const edm::Ru summary->setBinLabel(DXYBAD, "dXY mismatch", 1); } - if (displacedQuantities_) { - numErrBins_ += 2; - } errorSummaryNum = ibooker.book1D( "errorSummaryNum", summaryTitle.c_str(), numErrBins_, 1, numErrBins_ + 1); // range to match bin numbering errorSummaryNum->setBinLabel(RBXRANGE, "BX range mismatch", 1); diff --git a/DQM/L1TMonitor/src/L1TStage2RegionalMuonCandComp.cc b/DQM/L1TMonitor/src/L1TStage2RegionalMuonCandComp.cc index 95f05d94d2734..8bd1f2fdbfaf2 100644 --- a/DQM/L1TMonitor/src/L1TStage2RegionalMuonCandComp.cc +++ b/DQM/L1TMonitor/src/L1TStage2RegionalMuonCandComp.cc @@ -12,9 +12,13 @@ L1TStage2RegionalMuonCandComp::L1TStage2RegionalMuonCandComp(const edm::Paramete ignoreBadTrkAddr(ps.getUntrackedParameter("ignoreBadTrackAddress")), ignoreBin(ps.getUntrackedParameter>("ignoreBin")), verbose(ps.getUntrackedParameter("verbose")), - isBmtf(ps.getUntrackedParameter("isBmtf")) { + hasDisplacementInfo(ps.getUntrackedParameter("hasDisplacementInfo")) { + if (hasDisplacementInfo) { + numErrBins_ += 2; + numSummaryBins_ += 2; + } // First include all bins - for (unsigned int i = 1; i <= RPT2; i++) { + for (int i = 1; i <= numErrBins_; i++) { incBin[i] = true; } // Then check the list of bins to ignore @@ -41,7 +45,7 @@ void L1TStage2RegionalMuonCandComp::fillDescriptions(edm::ConfigurationDescripti desc.addUntracked("ignoreBadTrackAddress", false)->setComment("Ignore muon track address mismatches."); desc.addUntracked>("ignoreBin", std::vector())->setComment("List of bins to ignore"); desc.addUntracked("verbose", false); - desc.addUntracked("isBmtf", false); + desc.addUntracked("hasDisplacementInfo", false); descriptions.add("l1tStage2RegionalMuonCandComp", desc); } @@ -53,16 +57,14 @@ void L1TStage2RegionalMuonCandComp::bookHistograms(DQMStore::IBooker& ibooker, trkAddrIgnoreText = " (Bad track addresses ignored)"; } - int nbins = 17; - if (isBmtf) { - nbins += 2; - } - // Subsystem Monitoring and Muon Output ibooker.setCurrentFolder(monitorDir); - summary = ibooker.book1D( - "summary", (summaryTitle + trkAddrIgnoreText).c_str(), nbins, 1, nbins + 1); // range to match bin numbering + summary = ibooker.book1D("summary", + (summaryTitle + trkAddrIgnoreText).c_str(), + numSummaryBins_, + 1, + numSummaryBins_ + 1); // range to match bin numbering summary->setBinLabel(BXRANGEGOOD, "BX range match", 1); summary->setBinLabel(BXRANGEBAD, "BX range mismatch", 1); summary->setBinLabel(NMUONGOOD, "muon collection size match", 1); @@ -80,21 +82,16 @@ void L1TStage2RegionalMuonCandComp::bookHistograms(DQMStore::IBooker& ibooker, summary->setBinLabel(PROCBAD, "processor mismatch", 1); summary->setBinLabel(TFBAD, "track finder type mismatch", 1); summary->setBinLabel(TRACKADDRBAD, "track address mismatch", 1); - if (isBmtf) { + if (hasDisplacementInfo) { summary->setBinLabel(DXYBAD, "DXY mismatch", 1); summary->setBinLabel(PT2BAD, "P_{T} unconstrained mismatch", 1); } - int nbinsNum = 14; - if (isBmtf) { - nbinsNum += 2; - } - errorSummaryNum = ibooker.book1D("errorSummaryNum", (summaryTitle + trkAddrIgnoreText).c_str(), - nbinsNum, + numErrBins_, 1, - nbinsNum + 1); // range to match bin numbering + numErrBins_ + 1); // range to match bin numbering errorSummaryNum->setBinLabel(RBXRANGE, "BX range mismatch", 1); errorSummaryNum->setBinLabel(RNMUON, "muon collection size mismatch", 1); errorSummaryNum->setBinLabel(RMUON, "mismatching muons", 1); @@ -109,7 +106,7 @@ void L1TStage2RegionalMuonCandComp::bookHistograms(DQMStore::IBooker& ibooker, errorSummaryNum->setBinLabel(RPROC, "processor mismatch", 1); errorSummaryNum->setBinLabel(RTF, "track finder type mismatch", 1); errorSummaryNum->setBinLabel(RTRACKADDR, "track address mismatch", 1); - if (isBmtf) { + if (hasDisplacementInfo) { errorSummaryNum->setBinLabel(RDXY, "DXY mismatch", 1); errorSummaryNum->setBinLabel(RPT2, "P_{T} unconstrained mismatch", 1); } @@ -125,8 +122,8 @@ void L1TStage2RegionalMuonCandComp::bookHistograms(DQMStore::IBooker& ibooker, // This needs to come after the calls to setBinLabel. errorSummaryNum->getTH1F()->GetXaxis()->SetCanExtend(false); - errorSummaryDen = - ibooker.book1D("errorSummaryDen", "denominators", nbinsNum, 1, nbinsNum + 1); // range to match bin numbering + errorSummaryDen = ibooker.book1D( + "errorSummaryDen", "denominators", numErrBins_, 1, numErrBins_ + 1); // range to match bin numbering errorSummaryDen->setBinLabel(RBXRANGE, "# events", 1); errorSummaryDen->setBinLabel(RNMUON, "# muon collections", 1); for (int i = RMUON; i <= errorSummaryDen->getNbinsX(); ++i) { @@ -195,7 +192,7 @@ void L1TStage2RegionalMuonCandComp::bookHistograms(DQMStore::IBooker& ibooker, 15.5); muColl1TrkAddr->setAxisTitle("key", 1); muColl1TrkAddr->setAxisTitle("value", 2); - if (isBmtf) { + if (hasDisplacementInfo) { muColl1hwDXY = ibooker.book1D("muhwDXYColl1", (muonColl1Title + " HW DXY" + trkAddrIgnoreText).c_str(), 4, 0, 4); muColl1hwDXY->setAxisTitle("Hardware DXY", 1); muColl1hwPtUnconstrained = ibooker.book1D("muhwPtUnconstrainedColl1", @@ -266,7 +263,7 @@ void L1TStage2RegionalMuonCandComp::bookHistograms(DQMStore::IBooker& ibooker, 15.5); muColl2TrkAddr->setAxisTitle("key", 1); muColl2TrkAddr->setAxisTitle("value", 2); - if (isBmtf) { + if (hasDisplacementInfo) { muColl2hwDXY = ibooker.book1D("muhwDXYColl2", (muonColl2Title + " HW DXY" + trkAddrIgnoreText).c_str(), 4, 0, 4); muColl2hwDXY->setAxisTitle("Hardware DXY", 1); muColl2hwPtUnconstrained = ibooker.book1D("muhwPtUnconstrainedColl2", @@ -337,7 +334,7 @@ void L1TStage2RegionalMuonCandComp::analyze(const edm::Event& e, const edm::Even muColl1trackFinderType->Fill(muonIt1->trackFinderType()); muColl1hwHF->Fill(muonIt1->hwHF()); muColl1TrkAddrSize->Fill(muon1TrackAddr.size()); - if (isBmtf) { + if (hasDisplacementInfo) { muColl1hwDXY->Fill(muonIt1->hwDXY()); muColl1hwPtUnconstrained->Fill(muonIt1->hwPtUnconstrained()); } @@ -361,7 +358,7 @@ void L1TStage2RegionalMuonCandComp::analyze(const edm::Event& e, const edm::Even muColl2trackFinderType->Fill(muonIt2->trackFinderType()); muColl2hwHF->Fill(muonIt2->hwHF()); muColl2TrkAddrSize->Fill(muon2TrackAddr.size()); - if (isBmtf) { + if (hasDisplacementInfo) { muColl2hwDXY->Fill(muonIt2->hwDXY()); muColl2hwPtUnconstrained->Fill(muonIt2->hwPtUnconstrained()); } @@ -377,16 +374,7 @@ void L1TStage2RegionalMuonCandComp::analyze(const edm::Event& e, const edm::Even muonIt1 = muonBxColl1->begin(iBx); muonIt2 = muonBxColl2->begin(iBx); - //std::cout << "Analysing muons from BX " << iBx << std::endl; while (muonIt1 != muonBxColl1->end(iBx) && muonIt2 != muonBxColl2->end(iBx)) { - //std::cout << "Coll 1 muon: hwPt=" << muonIt1->hwPt() << ", hwEta=" << muonIt1->hwEta() << ", hwPhi=" << muonIt1->hwPhi() - // << ", hwSign=" << muonIt1->hwSign() << ", hwSignValid=" << muonIt1->hwSignValid() - // << ", hwQual=" << muonIt1->hwQual() << ", link=" << muonIt1->link() << ", processor=" << muonIt1->processor() - // << ", trackFinderType=" << muonIt1->trackFinderType() << std::endl; - //std::cout << "Coll 2 muon: hwPt=" << muonIt2->hwPt() << ", hwEta=" << muonIt2->hwEta() << ", hwPhi=" << muonIt2->hwPhi() - // << ", hwSign=" << muonIt2->hwSign() << ", hwSignValid=" << muonIt2->hwSignValid() - // << ", hwQual=" << muonIt2->hwQual() << ", link=" << muonIt2->link() << ", processor=" << muonIt2->processor() - // << ", trackFinderType=" << muonIt2->trackFinderType() << std::endl; summary->Fill(MUONALL); for (int i = RMUON; i <= errorSummaryDen->getNbinsX(); ++i) { errorSummaryDen->Fill(i); @@ -503,7 +491,7 @@ void L1TStage2RegionalMuonCandComp::analyze(const edm::Event& e, const edm::Even errorSummaryNum->Fill(RTRACKADDR); } - if (isBmtf) { + if (hasDisplacementInfo) { if (muonIt1->hwDXY() != muonIt2->hwDXY()) { muonMismatch = true; summary->Fill(DXYBAD); @@ -538,7 +526,7 @@ void L1TStage2RegionalMuonCandComp::analyze(const edm::Event& e, const edm::Even muColl1trackFinderType->Fill(muonIt1->trackFinderType()); muColl1hwHF->Fill(muonIt1->hwHF()); muColl1TrkAddrSize->Fill(muon1TrackAddr.size()); - if (isBmtf) { + if (hasDisplacementInfo) { muColl1hwDXY->Fill(muonIt1->hwDXY()); muColl1hwPtUnconstrained->Fill(muonIt1->hwPtUnconstrained()); } @@ -558,7 +546,7 @@ void L1TStage2RegionalMuonCandComp::analyze(const edm::Event& e, const edm::Even muColl2trackFinderType->Fill(muonIt2->trackFinderType()); muColl2hwHF->Fill(muonIt2->hwHF()); muColl2TrkAddrSize->Fill(muon2TrackAddr.size()); - if (isBmtf) { + if (hasDisplacementInfo) { muColl2hwDXY->Fill(muonIt2->hwDXY()); muColl2hwPtUnconstrained->Fill(muonIt2->hwPtUnconstrained()); } diff --git a/DQM/L1TMonitor/src/L1TStage2uGMT.cc b/DQM/L1TMonitor/src/L1TStage2uGMT.cc index 780cd9598e7d8..1996d092b82d0 100644 --- a/DQM/L1TMonitor/src/L1TStage2uGMT.cc +++ b/DQM/L1TMonitor/src/L1TStage2uGMT.cc @@ -176,6 +176,15 @@ void L1TStage2uGMT::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, ugmtEMTFhwPt = ibooker.book1D("ugmtEMTFhwPt", "uGMT EMTF HW p_{T}", 512, -0.5, 511.5); ugmtEMTFhwPt->setAxisTitle("Hardware p_{T}", 1); + if (displacedQuantities_) { + ugmtEMTFhwPtUnconstrained = + ibooker.book1D("ugmtEMTFhwPtUnconstrained", "uGMT EMTF Input HW p_{T} unconstrained", 256, -0.5, 255.5); + ugmtEMTFhwPtUnconstrained->setAxisTitle("Hardware p_{T} unconstrained", 1); + + ugmtEMTFhwDXY = ibooker.book1D("ugmtEMTFhwDXY", "uGMT EMTF Input HW impact parameter", 4, -0.5, 3.5); + ugmtEMTFhwDXY->setAxisTitle("Hardware dXY", 1); + } + ugmtEMTFhwEta = ibooker.book1D("ugmtEMTFhwEta", "uGMT EMTF HW #eta", 461, -230.5, 230.5); ugmtEMTFhwEta->setAxisTitle("Hardware #eta", 1); @@ -790,6 +799,10 @@ void L1TStage2uGMT::analyze(const edm::Event& e, const edm::EventSetup& c) { ++EMTF) { ugmtEMTFBX->Fill(itBX); ugmtEMTFhwPt->Fill(EMTF->hwPt()); + if (displacedQuantities_) { + ugmtEMTFhwPtUnconstrained->Fill(EMTF->hwPtUnconstrained()); + ugmtEMTFhwDXY->Fill(EMTF->hwDXY()); + } ugmtEMTFhwEta->Fill(EMTF->hwEta()); ugmtEMTFhwSign->Fill(EMTF->hwSign()); ugmtEMTFhwSignValid->Fill(EMTF->hwSignValid()); diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc index 86430eee00ec3..83f29e7f27b62 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc @@ -44,7 +44,7 @@ namespace l1t { auto gmt_in_packer = static_pointer_cast( PackerFactory::get()->make("stage2::RegionalMuonGMTPacker")); if (fw >= 0x6000000) { - gmt_in_packer->setKalmanAlgoTrue(); + gmt_in_packer->setIsRun3(); } auto gmt_out_packer = static_pointer_cast(PackerFactory::get()->make("stage2::GMTMuonPacker")); @@ -87,7 +87,7 @@ namespace l1t { auto gmt_in_unp = static_pointer_cast( UnpackerFactory::get()->make("stage2::RegionalMuonGMTUnpacker")); if (fw >= 0x6000000) { - gmt_in_unp->setKalmanAlgoTrue(); + gmt_in_unp->setIsRun3(); } for (int iLink = 72; iLink < 144; iLink += 2) { diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.cc index 4ba50c5c03ee7..64ed17ecf676b 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.cc @@ -54,7 +54,7 @@ namespace l1t { uint32_t msw = 0; uint32_t lsw = 0; - RegionalMuonRawDigiTranslator::generatePackedDataWords(*mu, lsw, msw, isKalman_); + RegionalMuonRawDigiTranslator::generatePackedDataWords(*mu, lsw, msw, isRun3_); payloadMap[linkTimes2].push_back(lsw); payloadMap[linkTimes2].push_back(msw); diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.h b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.h index 879a1dd1f5bab..67fa5f14d8aa7 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.h +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.h @@ -13,13 +13,13 @@ namespace l1t { class RegionalMuonGMTPacker : public Packer { public: Blocks pack(const edm::Event&, const PackerTokens*) override; - void setKalmanAlgoTrue() { isKalman_ = true; }; + void setIsRun3() { isRun3_ = true; }; private: typedef std::map> PayloadMap; void packTF(const edm::Event&, const edm::EDGetTokenT&, Blocks&); - bool isKalman_{false}; + bool isRun3_{false}; }; } // namespace stage2 } // namespace l1t diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc index 2a8d556dc0eba..d58909a9395fe 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc @@ -102,7 +102,7 @@ namespace l1t { RegionalMuonCand mu; RegionalMuonRawDigiTranslator::fillRegionalMuonCand( - mu, raw_data_00_31, raw_data_32_63, processor, trackFinder, isKalman_); + mu, raw_data_00_31, raw_data_32_63, processor, trackFinder, isRun3_); LogDebug("L1T") << "Mu" << nWord / 2 << ": eta " << mu.hwEta() << " phi " << mu.hwPhi() << " pT " << mu.hwPt() << " qual " << mu.hwQual() << " sign " << mu.hwSign() << " sign valid " diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.h b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.h index 97e7683109526..43362150b2a53 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.h +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.h @@ -10,13 +10,13 @@ namespace l1t { class RegionalMuonGMTUnpacker : public Unpacker { public: bool unpack(const Block& block, UnpackerCollections* coll) override; - void setKalmanAlgoTrue() { isKalman_ = true; } + void setIsRun3() { isRun3_ = true; } private: static constexpr unsigned nWords_ = 6; // every link transmits 6 words (3 muons) per bx static constexpr unsigned bxzs_enable_shift_ = 1; - bool isKalman_{false}; + bool isRun3_{false}; }; } // namespace stage2 } // namespace l1t diff --git a/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h b/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h index 89e38d00345d9..1bb1377411be3 100644 --- a/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h +++ b/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h @@ -7,13 +7,13 @@ namespace l1t { class RegionalMuonRawDigiTranslator { public: static void fillRegionalMuonCand( - RegionalMuonCand& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int proc, tftype tf, bool isKalman); - static void fillRegionalMuonCand(RegionalMuonCand& mu, uint64_t dataword, int proc, tftype tf, bool isKalman); + RegionalMuonCand& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int proc, tftype tf, bool isRun3); + static void fillRegionalMuonCand(RegionalMuonCand& mu, uint64_t dataword, int proc, tftype tf, bool isRun3); static void generatePackedDataWords(const RegionalMuonCand& mu, uint32_t& raw_data_00_31, uint32_t& raw_data_32_63, - bool isKalman); - static uint64_t generate64bitDataWord(const RegionalMuonCand& mu, bool isKalman); + bool isRun3); + static uint64_t generate64bitDataWord(const RegionalMuonCand& mu, bool isRun3); static int generateRawTrkAddress(const RegionalMuonCand&, bool isKalman); static constexpr unsigned ptMask_ = 0x1FF; @@ -31,9 +31,11 @@ namespace l1t { static constexpr unsigned signShift_ = 0; static constexpr unsigned signValidShift_ = 1; static constexpr unsigned dxyMask_ = 0x3; - static constexpr unsigned dxyShift_ = 2; + static constexpr unsigned bmtfDxyShift_ = 2; + static constexpr unsigned emtfDxyShift_ = 29; static constexpr unsigned ptUnconstrainedMask_ = 0xFF; - static constexpr unsigned ptUnconstrainedShift_ = 23; + static constexpr unsigned bmtfPtUnconstrainedShift_ = 23; + static constexpr unsigned emtfPtUnconstrainedShift_ = 20; static constexpr unsigned trackAddressMask_ = 0x1FFFFFFF; static constexpr unsigned trackAddressShift_ = 2; // relative shifts within track address diff --git a/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc b/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc index dae2fd06445f4..482ee4fa754d9 100644 --- a/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc +++ b/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc @@ -1,8 +1,12 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h" -void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand( - RegionalMuonCand& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int proc, tftype tf, bool isKalman) { +void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand(RegionalMuonCand& mu, + const uint32_t raw_data_00_31, + const uint32_t raw_data_32_63, + const int proc, + const tftype tf, + const bool isRun3) { // translations as defined in DN-15-017 mu.setHwPt((raw_data_00_31 >> ptShift_) & ptMask_); mu.setHwQual((raw_data_00_31 >> qualShift_) & qualMask_); @@ -40,7 +44,7 @@ void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand( mu.setTrackSubAddress(RegionalMuonCand::kWheelSide, detSide); mu.setTrackSubAddress(RegionalMuonCand::kWheelNum, wheelNum); - if (!isKalman) { // The Run-2 standard configuration + if (!isRun3) { // The Run-2 standard configuration mu.setTrackSubAddress(RegionalMuonCand::kStat1, statAddr1); mu.setTrackSubAddress(RegionalMuonCand::kStat2, statAddr2); mu.setTrackSubAddress(RegionalMuonCand::kStat3, statAddr3); @@ -54,8 +58,8 @@ void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand( mu.setTrackSubAddress(RegionalMuonCand::kStat3, statAddr2); mu.setTrackSubAddress(RegionalMuonCand::kStat4, statAddr1); // Additionally we now have displacement information from the BMTF - mu.setHwPtUnconstrained((raw_data_32_63 >> ptUnconstrainedShift_) & ptUnconstrainedMask_); - mu.setHwDXY((raw_data_32_63 >> dxyShift_) & dxyMask_); + mu.setHwPtUnconstrained((raw_data_32_63 >> bmtfPtUnconstrainedShift_) & ptUnconstrainedMask_); + mu.setHwDXY((raw_data_32_63 >> bmtfDxyShift_) & dxyMask_); } mu.setTrackSubAddress(RegionalMuonCand::kSegSelStat1, 0); mu.setTrackSubAddress(RegionalMuonCand::kSegSelStat2, 0); @@ -74,6 +78,10 @@ void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand( mu.setTrackSubAddress(RegionalMuonCand::kTrkNum, (rawTrackAddress >> emtfTrAddrTrkNumShift_) & emtfTrAddrTrkNumMask_); mu.setTrackSubAddress(RegionalMuonCand::kBX, (rawTrackAddress >> emtfTrAddrBxShift_) & emtfTrAddrBxMask_); + if (isRun3) { // In Run-3 we receive displaced muon information from EMTF + mu.setHwPtUnconstrained((raw_data_32_63 >> emtfPtUnconstrainedShift_) & ptUnconstrainedMask_); + mu.setHwDXY((raw_data_32_63 >> emtfDxyShift_) & dxyMask_); + } } else if (tf == omtf_neg || tf == omtf_pos) { mu.setTrackSubAddress(RegionalMuonCand::kLayers, (rawTrackAddress >> omtfTrAddrLayersShift_) & omtfTrAddrLayersMask_); @@ -91,15 +99,15 @@ void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand( } void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand( - RegionalMuonCand& mu, uint64_t dataword, int proc, tftype tf, bool isKalman) { + RegionalMuonCand& mu, const uint64_t dataword, const int proc, const tftype tf, const bool isRun3) { fillRegionalMuonCand( - mu, (uint32_t)(dataword & 0xFFFFFFFF), (uint32_t)((dataword >> 32) & 0xFFFFFFFF), proc, tf, isKalman); + mu, (uint32_t)(dataword & 0xFFFFFFFF), (uint32_t)((dataword >> 32) & 0xFFFFFFFF), proc, tf, isRun3); } void l1t::RegionalMuonRawDigiTranslator::generatePackedDataWords(const RegionalMuonCand& mu, uint32_t& raw_data_00_31, uint32_t& raw_data_32_63, - const bool isKalman) { + const bool isRun3) { int abs_eta = mu.hwEta(); if (abs_eta < 0) { abs_eta += (1 << (etaSignShift_ - absEtaShift_)); @@ -114,21 +122,24 @@ void l1t::RegionalMuonRawDigiTranslator::generatePackedDataWords(const RegionalM (mu.hwPhi() < 0) << phiSignShift_; // generate the raw track address from the subaddresses - int rawTrkAddr = generateRawTrkAddress(mu, isKalman); + int rawTrkAddr = generateRawTrkAddress(mu, isRun3); raw_data_32_63 = mu.hwSign() << signShift_ | mu.hwSignValid() << signValidShift_ | (rawTrkAddr & trackAddressMask_) << trackAddressShift_; - if (isKalman) { - raw_data_32_63 |= (mu.hwPtUnconstrained() & ptUnconstrainedMask_) << ptUnconstrainedShift_ | (mu.hwDXY() & dxyMask_) - << dxyShift_; + if (isRun3 && mu.trackFinderType() == bmtf) { + raw_data_32_63 |= (mu.hwPtUnconstrained() & ptUnconstrainedMask_) << bmtfPtUnconstrainedShift_ | + (mu.hwDXY() & dxyMask_) << bmtfDxyShift_; + } else if (isRun3 && (mu.trackFinderType() == emtf_pos || mu.trackFinderType() == emtf_neg)) { + raw_data_32_63 |= (mu.hwPtUnconstrained() & ptUnconstrainedMask_) << emtfPtUnconstrainedShift_ | + (mu.hwDXY() & dxyMask_) << emtfDxyShift_; } } -uint64_t l1t::RegionalMuonRawDigiTranslator::generate64bitDataWord(const RegionalMuonCand& mu, const bool isKalman) { +uint64_t l1t::RegionalMuonRawDigiTranslator::generate64bitDataWord(const RegionalMuonCand& mu, const bool isRun3) { uint32_t lsw; uint32_t msw; - generatePackedDataWords(mu, lsw, msw, isKalman); + generatePackedDataWords(mu, lsw, msw, isRun3); return (((uint64_t)msw) << 32) + lsw; }