Skip to content

Commit

Permalink
Enable displaced muon DQM plots for EMTF inputs to uGMT
Browse files Browse the repository at this point in the history
  • Loading branch information
dinyar committed Mar 11, 2021
1 parent e132f66 commit 1381748
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 18 deletions.
2 changes: 1 addition & 1 deletion DQM/L1TMonitor/interface/L1TStage2RegionalMuonCandComp.h
Expand Up @@ -74,7 +74,7 @@ class L1TStage2RegionalMuonCandComp : public DQMEDAnalyzer {
bool ignoreBadTrkAddr;
std::vector<int> ignoreBin;
bool verbose;
bool isBmtf;
bool hasDisplacementInfo;

MonitorElement* summary;
MonitorElement* errorSummaryNum;
Expand Down
2 changes: 2 additions & 0 deletions DQM/L1TMonitor/interface/L1TStage2uGMT.h
Expand Up @@ -77,6 +77,8 @@ class L1TStage2uGMT : public DQMEDAnalyzer {
MonitorElement* ugmtEMTFBX;
MonitorElement* ugmtEMTFnMuons;
MonitorElement* ugmtEMTFhwPt;
MonitorElement* ugmtEMTFhwPtUnconstrained;
MonitorElement* ugmtEMTFhwDXY;
MonitorElement* ugmtEMTFhwEta;
MonitorElement* ugmtEMTFhwPhiPos;
MonitorElement* ugmtEMTFhwPhiNeg;
Expand Down
2 changes: 1 addition & 1 deletion DQM/L1TMonitor/python/L1TStage2BMTF_cff.py
Expand Up @@ -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(
Expand Down
9 changes: 8 additions & 1 deletion DQM/L1TMonitor/python/L1TStage2uGMT_cff.py
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion DQM/L1TMonitor/python/L1TdeStage2BMTFSecond_cff.py
Expand Up @@ -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)



Expand Down
2 changes: 1 addition & 1 deletion DQM/L1TMonitor/python/L1TdeStage2BMTF_cfi.py
Expand Up @@ -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)
)

4 changes: 4 additions & 0 deletions DQM/L1TMonitor/python/L1TdeStage2uGMT_cff.py
Expand Up @@ -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(
Expand Down
26 changes: 13 additions & 13 deletions DQM/L1TMonitor/src/L1TStage2RegionalMuonCandComp.cc
Expand Up @@ -12,7 +12,7 @@ L1TStage2RegionalMuonCandComp::L1TStage2RegionalMuonCandComp(const edm::Paramete
ignoreBadTrkAddr(ps.getUntrackedParameter<bool>("ignoreBadTrackAddress")),
ignoreBin(ps.getUntrackedParameter<std::vector<int>>("ignoreBin")),
verbose(ps.getUntrackedParameter<bool>("verbose")),
isBmtf(ps.getUntrackedParameter<bool>("isBmtf")) {
hasDisplacementInfo(ps.getUntrackedParameter<bool>("hasDisplacementInfo")) {
// First include all bins
for (unsigned int i = 1; i <= RPT2; i++) {
incBin[i] = true;
Expand Down Expand Up @@ -41,7 +41,7 @@ void L1TStage2RegionalMuonCandComp::fillDescriptions(edm::ConfigurationDescripti
desc.addUntracked<bool>("ignoreBadTrackAddress", false)->setComment("Ignore muon track address mismatches.");
desc.addUntracked<std::vector<int>>("ignoreBin", std::vector<int>())->setComment("List of bins to ignore");
desc.addUntracked<bool>("verbose", false);
desc.addUntracked<bool>("isBmtf", false);
desc.addUntracked<bool>("hasDisplacementInfo", false);
descriptions.add("l1tStage2RegionalMuonCandComp", desc);
}

Expand All @@ -54,7 +54,7 @@ void L1TStage2RegionalMuonCandComp::bookHistograms(DQMStore::IBooker& ibooker,
}

int nbins = 17;
if (isBmtf) {
if (hasDisplacementInfo) {
nbins += 2;
}

Expand All @@ -80,13 +80,13 @@ 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) {
if (hasDisplacementInfo) {
nbinsNum += 2;
}

Expand All @@ -109,7 +109,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);
}
Expand Down Expand Up @@ -195,7 +195,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",
Expand Down Expand Up @@ -266,7 +266,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",
Expand Down Expand Up @@ -337,7 +337,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());
}
Expand All @@ -361,7 +361,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());
}
Expand Down Expand Up @@ -503,7 +503,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);
Expand Down Expand Up @@ -538,7 +538,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());
}
Expand All @@ -558,7 +558,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());
}
Expand Down
13 changes: 13 additions & 0 deletions DQM/L1TMonitor/src/L1TStage2uGMT.cc
Expand Up @@ -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);

Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 1381748

Please sign in to comment.