Skip to content

Commit 5f4d7b2

Browse files
committed
Fixes for EMTF Errors Plot and GEM vfat
1 parent 5126e97 commit 5f4d7b2

File tree

1 file changed

+29
-32
lines changed

1 file changed

+29
-32
lines changed

DQM/L1TMonitor/src/L1TStage2EMTF.cc

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,27 @@ L1TStage2EMTF::L1TStage2EMTF(const edm::ParameterSet& ps)
1313
monitorDir(ps.getUntrackedParameter<std::string>("monitorDir", "")),
1414
verbose(ps.getUntrackedParameter<bool>("verbose", false)),
1515
isRun3(ps.getUntrackedParameter<bool>("isRun3", false)) {}
16-
16+
1717
void L1TStage2EMTF::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, const edm::EventSetup&) {
1818
// Monitor Dir
1919
ibooker.setCurrentFolder(monitorDir);
2020

21-
emtfErrors = ibooker.book1D("emtfErrors", "EMTF Errors", 6, 0, 6);
21+
emtfErrors = ibooker.book1D("emtfErrors", "EMTF Errors", 5, 0, 5);
2222
emtfErrors->setAxisTitle("Error Type (Corruptions Not Implemented)", 1);
2323
emtfErrors->setAxisTitle("Number of Errors", 2);
24-
if (isRun3 == true) {
25-
const std::array<std::string, 5> binNamesErrors{
26-
{"Corruptions", "FMM != Ready", "BSY", "OSY", "WOF"}};
24+
if (isRun3) {
25+
const std::array<std::string, 4> binNamesErrors{{"FMM != Ready", "BSY", "OSY", "WOF"}};
2726
for (unsigned int bin = 0; bin < binNamesErrors.size(); ++bin) {
2827
emtfErrors->setBinLabel(bin + 1, binNamesErrors[bin], 1);
2928
}
30-
}
31-
if (isRun3 == false) {
32-
const std::array<std::string, 6> binNamesErrors{
33-
{"Corruptions", "Synch. Err.", "Synch. Mod.", "BX Mismatch", "Time Misalign", "FMM != Ready"}};
29+
} else {
30+
const std::array<std::string, 5> binNamesErrors{
31+
{"Synch. Err.", "Synch. Mod.", "BX Mismatch", "Time Misalign", "FMM != Ready"}};
3432
for (unsigned int bin = 0; bin < binNamesErrors.size(); ++bin) {
3533
emtfErrors->setBinLabel(bin + 1, binNamesErrors[bin], 1);
3634
}
3735
}
38-
39-
36+
4037
// CSC LCT Monitor Elements
4138
int nChambs, nWires, nStrips; // Number of chambers, wiregroups, and halfstrips in each station/ring pair
4239
std::string name, label;
@@ -813,33 +810,32 @@ void L1TStage2EMTF::analyze(const edm::Event& e, const edm::EventSetup& c) {
813810
// DAQ Output
814811
edm::Handle<l1t::EMTFDaqOutCollection> DaqOutCollection;
815812
e.getByToken(daqToken, DaqOutCollection);
816-
813+
817814
for (auto DaqOut = DaqOutCollection->begin(); DaqOut != DaqOutCollection->end(); ++DaqOut) {
818815
const l1t::emtf::MECollection* MECollection = DaqOut->PtrMECollection();
819816
const l1t::emtf::EventHeader* EventHeader = DaqOut->PtrEventHeader();
820-
if (isRun3==false){
821-
for (auto ME = MECollection->begin(); ME != MECollection->end(); ++ME) {
822-
if (ME->SE())
823-
emtfErrors->Fill(1);
824-
if (ME->SM())
825-
emtfErrors->Fill(2);
826-
if (ME->BXE())
827-
emtfErrors->Fill(3);
828-
if (ME->AF())
829-
emtfErrors->Fill(4);
817+
if (isRun3) {
830818
if (!EventHeader->Rdy())
831-
emtfErrors->Fill(5);
832-
}};
833-
834-
if (isRun3==true){
835-
if (!EventHeader->Rdy())
836-
emtfErrors->Fill(1);
819+
emtfErrors->Fill(0);
837820
if (EventHeader->BSY())
838-
emtfErrors->Fill(2);
821+
emtfErrors->Fill(1);
839822
if (EventHeader->OSY())
840-
emtfErrors->Fill(3);
823+
emtfErrors->Fill(2);
841824
if (EventHeader->WOF())
842-
emtfErrors->Fill(4);
825+
emtfErrors->Fill(3);
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+
}
843839
};
844840

845841
// Fill MPC input link errors
@@ -1019,8 +1015,9 @@ void L1TStage2EMTF::analyze(const edm::Event& e, const edm::EventSetup& c) {
10191015
hist_index = (endcap > 0) ? 1 : 0;
10201016
//Added def of layer
10211017
int layer = Hit->Layer();
1018+
int GEM_MAX_NROLL = 8;
10221019
int phi_part = Hit->Pad() / 64; // 0-2
1023-
int vfat = phi_part * 8 + Hit->Partition();
1020+
int vfat = phi_part * 8 - Hit->Partition() + GEM_MAX_NROLL;
10241021
if (Hit->Neighbor() == false) {
10251022
gemChamberPad[hist_index]->Fill(chamber, Hit->Pad());
10261023
gemChamberPartition[hist_index]->Fill(chamber, Hit->Partition());

0 commit comments

Comments
 (0)