Skip to content

Commit cd77553

Browse files
authored
Merge pull request #48979 from kmorrison314/EMTF_DQMPlot_Fixes_9_19_25
[L1T] EMTF DQM Errors Plot and GEM Plot Minor Fixes
2 parents 037421d + 5f4d7b2 commit cd77553

File tree

3 files changed

+42
-20
lines changed

3 files changed

+42
-20
lines changed

DQM/L1TMonitor/interface/L1TStage2EMTF.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class L1TStage2EMTF : public DQMOneEDAnalyzer<> {
2929
edm::EDGetTokenT<l1t::RegionalMuonCandBxCollection> muonToken;
3030
std::string monitorDir;
3131
bool verbose;
32+
bool isRun3;
3233

3334
MonitorElement* emtfErrors;
3435
MonitorElement* mpcLinkErrors;

DQM/L1TMonitor/python/L1TStage2EMTF_cfi.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
emtfSource = cms.InputTag("emtfStage2Digis"),
77
monitorDir = cms.untracked.string("L1T/L1TStage2EMTF"),
88
verbose = cms.untracked.bool(False),
9+
isRun3 = cms.untracked.bool(False),
910
)
1011

12+
## Era: Run3_2021
13+
from Configuration.Eras.Modifier_stage2L1Trigger_2021_cff import stage2L1Trigger_2021
14+
stage2L1Trigger_2021.toModify(l1tStage2Emtf, isRun3 = True)

DQM/L1TMonitor/src/L1TStage2EMTF.cc

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,27 @@ L1TStage2EMTF::L1TStage2EMTF(const edm::ParameterSet& ps)
1111
trackToken(consumes<l1t::EMTFTrackCollection>(ps.getParameter<edm::InputTag>("emtfSource"))),
1212
muonToken(consumes<l1t::RegionalMuonCandBxCollection>(ps.getParameter<edm::InputTag>("emtfSource"))),
1313
monitorDir(ps.getUntrackedParameter<std::string>("monitorDir", "")),
14-
verbose(ps.getUntrackedParameter<bool>("verbose", false)) {}
14+
verbose(ps.getUntrackedParameter<bool>("verbose", false)),
15+
isRun3(ps.getUntrackedParameter<bool>("isRun3", false)) {}
1516

1617
void L1TStage2EMTF::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, const edm::EventSetup&) {
1718
// Monitor Dir
1819
ibooker.setCurrentFolder(monitorDir);
1920

20-
const std::array<std::string, 6> binNamesErrors{
21-
{"Corruptions", "Synch. Err.", "Synch. Mod.", "BX Mismatch", "Time Misalign", "FMM != Ready"}};
22-
23-
// DAQ Output Monitor Elements
24-
emtfErrors = ibooker.book1D("emtfErrors", "EMTF Errors", 6, 0, 6);
21+
emtfErrors = ibooker.book1D("emtfErrors", "EMTF Errors", 5, 0, 5);
2522
emtfErrors->setAxisTitle("Error Type (Corruptions Not Implemented)", 1);
2623
emtfErrors->setAxisTitle("Number of Errors", 2);
27-
for (unsigned int bin = 0; bin < binNamesErrors.size(); ++bin) {
28-
emtfErrors->setBinLabel(bin + 1, binNamesErrors[bin], 1);
24+
if (isRun3) {
25+
const std::array<std::string, 4> binNamesErrors{{"FMM != Ready", "BSY", "OSY", "WOF"}};
26+
for (unsigned int bin = 0; bin < binNamesErrors.size(); ++bin) {
27+
emtfErrors->setBinLabel(bin + 1, binNamesErrors[bin], 1);
28+
}
29+
} else {
30+
const std::array<std::string, 5> binNamesErrors{
31+
{"Synch. Err.", "Synch. Mod.", "BX Mismatch", "Time Misalign", "FMM != Ready"}};
32+
for (unsigned int bin = 0; bin < binNamesErrors.size(); ++bin) {
33+
emtfErrors->setBinLabel(bin + 1, binNamesErrors[bin], 1);
34+
}
2935
}
3036

3137
// CSC LCT Monitor Elements
@@ -807,20 +813,30 @@ void L1TStage2EMTF::analyze(const edm::Event& e, const edm::EventSetup& c) {
807813

808814
for (auto DaqOut = DaqOutCollection->begin(); DaqOut != DaqOutCollection->end(); ++DaqOut) {
809815
const l1t::emtf::MECollection* MECollection = DaqOut->PtrMECollection();
810-
for (auto ME = MECollection->begin(); ME != MECollection->end(); ++ME) {
811-
if (ME->SE())
816+
const l1t::emtf::EventHeader* EventHeader = DaqOut->PtrEventHeader();
817+
if (isRun3) {
818+
if (!EventHeader->Rdy())
819+
emtfErrors->Fill(0);
820+
if (EventHeader->BSY())
812821
emtfErrors->Fill(1);
813-
if (ME->SM())
822+
if (EventHeader->OSY())
814823
emtfErrors->Fill(2);
815-
if (ME->BXE())
824+
if (EventHeader->WOF())
816825
emtfErrors->Fill(3);
817-
if (ME->AF())
818-
emtfErrors->Fill(4);
819-
}
820-
821-
const l1t::emtf::EventHeader* EventHeader = DaqOut->PtrEventHeader();
822-
if (!EventHeader->Rdy())
823-
emtfErrors->Fill(5);
826+
} else {
827+
for (auto ME = MECollection->begin(); ME != MECollection->end(); ++ME) {
828+
if (ME->SE())
829+
emtfErrors->Fill(0);
830+
if (ME->SM())
831+
emtfErrors->Fill(1);
832+
if (ME->BXE())
833+
emtfErrors->Fill(2);
834+
if (ME->AF())
835+
emtfErrors->Fill(3);
836+
if (!EventHeader->Rdy())
837+
emtfErrors->Fill(4);
838+
}
839+
};
824840

825841
// Fill MPC input link errors
826842
int offset = (EventHeader->Sector() - 1) * 9;
@@ -999,8 +1015,9 @@ void L1TStage2EMTF::analyze(const edm::Event& e, const edm::EventSetup& c) {
9991015
hist_index = (endcap > 0) ? 1 : 0;
10001016
//Added def of layer
10011017
int layer = Hit->Layer();
1018+
int GEM_MAX_NROLL = 8;
10021019
int phi_part = Hit->Pad() / 64; // 0-2
1003-
int vfat = phi_part * 8 + Hit->Partition();
1020+
int vfat = phi_part * 8 - Hit->Partition() + GEM_MAX_NROLL;
10041021
if (Hit->Neighbor() == false) {
10051022
gemChamberPad[hist_index]->Fill(chamber, Hit->Pad());
10061023
gemChamberPartition[hist_index]->Fill(chamber, Hit->Partition());

0 commit comments

Comments
 (0)