Skip to content

Commit 00d49b4

Browse files
committed
Edited EMTFErrors plot to fix plotting issue with Run3 events
1 parent aa39901 commit 00d49b4

File tree

3 files changed

+38
-15
lines changed

3 files changed

+38
-15
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: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,32 @@ 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)) {}
15-
14+
verbose(ps.getUntrackedParameter<bool>("verbose", false)),
15+
isRun3(ps.getUntrackedParameter<bool>("isRun3", false)) {}
16+
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 == true) {
25+
const std::array<std::string, 10> binNamesErrors{
26+
{"Corruptions", "FMM != Ready", "BSY", "OSY", "WOF"}};
27+
for (unsigned int bin = 0; bin < binNamesErrors.size(); ++bin) {
28+
emtfErrors->setBinLabel(bin + 1, binNamesErrors[bin], 1);
29+
}
2930
}
30-
31+
if (isRun3 == false) {
32+
const std::array<std::string, 10> binNamesErrors{
33+
{"Corruptions", "Synch. Err.", "Synch. Mod.", "BX Mismatch", "Time Misalign"}};
34+
for (unsigned int bin = 0; bin < binNamesErrors.size(); ++bin) {
35+
emtfErrors->setBinLabel(bin + 1, binNamesErrors[bin], 1);
36+
}
37+
}
38+
39+
3140
// CSC LCT Monitor Elements
3241
int nChambs, nWires, nStrips; // Number of chambers, wiregroups, and halfstrips in each station/ring pair
3342
std::string name, label;
@@ -805,8 +814,11 @@ void L1TStage2EMTF::analyze(const edm::Event& e, const edm::EventSetup& c) {
805814
edm::Handle<l1t::EMTFDaqOutCollection> DaqOutCollection;
806815
e.getByToken(daqToken, DaqOutCollection);
807816

817+
808818
for (auto DaqOut = DaqOutCollection->begin(); DaqOut != DaqOutCollection->end(); ++DaqOut) {
809819
const l1t::emtf::MECollection* MECollection = DaqOut->PtrMECollection();
820+
const l1t::emtf::EventHeader* EventHeader = DaqOut->PtrEventHeader();
821+
if (isRun3==false){
810822
for (auto ME = MECollection->begin(); ME != MECollection->end(); ++ME) {
811823
if (ME->SE())
812824
emtfErrors->Fill(1);
@@ -816,12 +828,18 @@ void L1TStage2EMTF::analyze(const edm::Event& e, const edm::EventSetup& c) {
816828
emtfErrors->Fill(3);
817829
if (ME->AF())
818830
emtfErrors->Fill(4);
819-
}
820-
821-
const l1t::emtf::EventHeader* EventHeader = DaqOut->PtrEventHeader();
831+
}};
832+
833+
if (isRun3==true){
822834
if (!EventHeader->Rdy())
823-
emtfErrors->Fill(5);
824-
835+
emtfErrors->Fill(1);
836+
if (EventHeader->BSY())
837+
emtfErrors->Fill(2);
838+
if (EventHeader->OSY())
839+
emtfErrors->Fill(3);
840+
if (EventHeader->WOF())
841+
emtfErrors->Fill(4);
842+
};
825843
// Fill MPC input link errors
826844
int offset = (EventHeader->Sector() - 1) * 9;
827845
int endcap = EventHeader->Endcap();

0 commit comments

Comments
 (0)