diff --git a/DQM/L1TMonitor/interface/L1TStage2uGMT.h b/DQM/L1TMonitor/interface/L1TStage2uGMT.h index 9e3c6bb6f7978..b9b1e1d3e91a9 100644 --- a/DQM/L1TMonitor/interface/L1TStage2uGMT.h +++ b/DQM/L1TMonitor/interface/L1TStage2uGMT.h @@ -44,7 +44,6 @@ class L1TStage2uGMT : public DQMEDAnalyzer { const float etaScale_; const float phiScale_; - MonitorElement* ugmtBMTFBX; MonitorElement* ugmtBMTFnMuons; MonitorElement* ugmtBMTFhwPt; MonitorElement* ugmtBMTFhwPtUnconstrained; @@ -61,7 +60,6 @@ class L1TStage2uGMT : public DQMEDAnalyzer { MonitorElement* ugmtBMTFMuMuDPhi; MonitorElement* ugmtBMTFMuMuDR; - MonitorElement* ugmtOMTFBX; MonitorElement* ugmtOMTFnMuons; MonitorElement* ugmtOMTFhwPt; MonitorElement* ugmtOMTFhwEta; @@ -79,7 +77,6 @@ class L1TStage2uGMT : public DQMEDAnalyzer { MonitorElement* ugmtOMTFMuMuDPhi; MonitorElement* ugmtOMTFMuMuDR; - MonitorElement* ugmtEMTFBX; MonitorElement* ugmtEMTFnMuons; MonitorElement* ugmtEMTFhwPt; MonitorElement* ugmtEMTFhwPtUnconstrained; @@ -100,8 +97,6 @@ class L1TStage2uGMT : public DQMEDAnalyzer { MonitorElement* ugmtEMTFMuMuDR; MonitorElement* ugmtEMTFShowerTypeOccupancyPerSector; - MonitorElement* ugmtEMTFShowerTypeOccupancyPerBx; - MonitorElement* ugmtEMTFShowerSectorOccupancyPerBx; MonitorElement* ugmtBOMTFposMuMuDEta; MonitorElement* ugmtBOMTFposMuMuDPhi; @@ -117,12 +112,6 @@ class L1TStage2uGMT : public DQMEDAnalyzer { MonitorElement* ugmtEOMTFnegMuMuDPhi; MonitorElement* ugmtEOMTFnegMuMuDR; - MonitorElement* ugmtBMTFBXvsProcessor; - MonitorElement* ugmtOMTFBXvsProcessor; - MonitorElement* ugmtEMTFBXvsProcessor; - MonitorElement* ugmtBXvsLink; - - MonitorElement* ugmtMuonBX; MonitorElement* ugmtnMuons; MonitorElement* ugmtMuonIndex; MonitorElement* ugmtMuonhwPt; @@ -160,19 +149,8 @@ class L1TStage2uGMT : public DQMEDAnalyzer { MonitorElement* ugmtMuonPhivsEta; MonitorElement* ugmtMuonPhiAtVtxvsEtaAtVtx; - MonitorElement* ugmtMuonBXvsLink; - MonitorElement* ugmtMuonBXvshwPt; - MonitorElement* ugmtMuonBXvshwEta; - MonitorElement* ugmtMuonBXvshwPhi; - MonitorElement* ugmtMuonBXvshwCharge; - MonitorElement* ugmtMuonBXvshwChargeValid; - MonitorElement* ugmtMuonBXvshwQual; - MonitorElement* ugmtMuonBXvshwIso; MonitorElement* ugmtMuonChargevsLink; - // Output shower plots - MonitorElement* ugmtMuonShowerTypeOccupancyPerBx; - // muon correlations MonitorElement* ugmtMuMuInvMass; MonitorElement* ugmtMuMuInvMassAtVtx; diff --git a/DQM/L1TMonitor/interface/L1TStage2uGMTBxDistributions.h b/DQM/L1TMonitor/interface/L1TStage2uGMTBxDistributions.h new file mode 100644 index 0000000000000..b07c6ff81796b --- /dev/null +++ b/DQM/L1TMonitor/interface/L1TStage2uGMTBxDistributions.h @@ -0,0 +1,72 @@ +#ifndef DQM_L1TMonitor_L1TStage2uGMTBxDistributions_h +#define DQM_L1TMonitor_L1TStage2uGMTBxDistributions_h + +#include "DataFormats/L1Trigger/interface/Muon.h" +#include "DataFormats/L1TMuon/interface/RegionalMuonCand.h" +#include "DataFormats/L1Trigger/interface/MuonShower.h" +#include "DataFormats/L1TMuon/interface/RegionalMuonShower.h" +#include "L1Trigger/L1TMuon/interface/MicroGMTConfiguration.h" + +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" +#include "DQMServices/Core/interface/DQMStore.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" + +class L1TStage2uGMTBxDistributions : public DQMEDAnalyzer { +public: + L1TStage2uGMTBxDistributions(const edm::ParameterSet& ps); + ~L1TStage2uGMTBxDistributions() override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +protected: + void bookHistograms(DQMStore::IBooker&, const edm::Run&, const edm::EventSetup&) override; + void analyze(const edm::Event&, const edm::EventSetup&) override; + +private: + edm::EDGetTokenT ugmtBMTFToken_; + edm::EDGetTokenT ugmtOMTFToken_; + edm::EDGetTokenT ugmtEMTFToken_; + edm::EDGetTokenT ugmtMuonToken_; + edm::EDGetTokenT ugmtEMTFShowerToken_; + edm::EDGetTokenT ugmtMuonShowerToken_; + std::string monitorDir_; + bool emul_; + bool verbose_; + bool hadronicShowers_; + + MonitorElement* ugmtBMTFBX; + + MonitorElement* ugmtOMTFBX; + + MonitorElement* ugmtEMTFBX; + + MonitorElement* ugmtEMTFShowerTypeOccupancyPerBx; + MonitorElement* ugmtEMTFShowerSectorOccupancyPerBx; + + MonitorElement* ugmtBMTFBXvsProcessor; + MonitorElement* ugmtOMTFBXvsProcessor; + MonitorElement* ugmtEMTFBXvsProcessor; + MonitorElement* ugmtBXvsLink; + + MonitorElement* ugmtMuonBX; + MonitorElement* ugmtMuonBXvsLink; + MonitorElement* ugmtMuonBXvshwPt; + MonitorElement* ugmtMuonBXvshwEta; + MonitorElement* ugmtMuonBXvshwPhi; + MonitorElement* ugmtMuonBXvshwCharge; + MonitorElement* ugmtMuonBXvshwChargeValid; + MonitorElement* ugmtMuonBXvshwQual; + MonitorElement* ugmtMuonBXvshwIso; + + // Output shower plots + MonitorElement* ugmtMuonShowerTypeOccupancyPerBx; + + static constexpr unsigned IDX_TIGHT_SHOWER{2}; + static constexpr unsigned IDX_NOMINAL_SHOWER{1}; +}; + +#endif diff --git a/DQM/L1TMonitor/plugins/SealModule.cc b/DQM/L1TMonitor/plugins/SealModule.cc index 7ce8d179e5f37..e1c9713896d3b 100644 --- a/DQM/L1TMonitor/plugins/SealModule.cc +++ b/DQM/L1TMonitor/plugins/SealModule.cc @@ -33,6 +33,9 @@ DEFINE_FWK_MODULE(L1TStage2CaloLayer2); #include "DQM/L1TMonitor/interface/L1TStage2uGMT.h" DEFINE_FWK_MODULE(L1TStage2uGMT); +#include "DQM/L1TMonitor/interface/L1TStage2uGMTBxDistributions.h" +DEFINE_FWK_MODULE(L1TStage2uGMTBxDistributions); + #include "DQM/L1TMonitor/interface/L1TObjectsTiming.h" DEFINE_FWK_MODULE(L1TObjectsTiming); diff --git a/DQM/L1TMonitor/python/L1TStage2uGMTBxDistributions_cfi.py b/DQM/L1TMonitor/python/L1TStage2uGMTBxDistributions_cfi.py new file mode 100644 index 0000000000000..6b68742e4dc37 --- /dev/null +++ b/DQM/L1TMonitor/python/L1TStage2uGMTBxDistributions_cfi.py @@ -0,0 +1,21 @@ +import FWCore.ParameterSet.Config as cms + +# the uGMT DQM module +from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer +l1TStage2uGMTBxDistributions = DQMEDAnalyzer( + "L1TStage2uGMTBxDistributions", + bmtfProducer = cms.InputTag("gmtStage2Digis", "BMTF"), + omtfProducer = cms.InputTag("gmtStage2Digis", "OMTF"), + emtfProducer = cms.InputTag("gmtStage2Digis", "EMTF"), + emtfShowerProducer = cms.InputTag("gmtStage2Digis", "EMTF"), + muonProducer = cms.InputTag("gmtStage2Digis", "Muon"), + muonShowerProducer = cms.InputTag("gmtStage2Digis", "MuonShower"), + monitorDir = cms.untracked.string("L1T/L1TStage2uGMT"), + emulator = cms.untracked.bool(False), + verbose = cms.untracked.bool(False), + hadronicShowers = cms.untracked.bool(False) +) + +## 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(l1TStage2uGMTBxDistributions, hadronicShowers = cms.untracked.bool(True)) diff --git a/DQM/L1TMonitor/python/L1TStage2uGMT_cff.py b/DQM/L1TMonitor/python/L1TStage2uGMT_cff.py index cdce478861ea5..3289a49021e9d 100644 --- a/DQM/L1TMonitor/python/L1TStage2uGMT_cff.py +++ b/DQM/L1TMonitor/python/L1TStage2uGMT_cff.py @@ -2,6 +2,7 @@ # the uGMT DQM module from DQM.L1TMonitor.L1TStage2uGMT_cfi import * +from DQM.L1TMonitor.L1TStage2uGMTBxDistributions_cfi import * # the uGMT intermediate muon DQM modules from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer @@ -215,6 +216,7 @@ # sequences l1tStage2uGMTOnlineDQMSeq = cms.Sequence( l1tStage2uGMT + + l1TStage2uGMTBxDistributions + l1tStage2uGMTIntermediateBMTF + l1tStage2uGMTIntermediateOMTFNeg + l1tStage2uGMTIntermediateOMTFPos + @@ -234,7 +236,7 @@ ) -## Era: Run3_2021; Hadronic showers from EMTF used in uGMT from Run-3. Comparing output copies routinely, but moving the uGMT main DQM behind the fat event filter so the BX comparisons aren't biased. +## Era: Run3_2021; Hadronic showers from EMTF used in uGMT from Run-3. Comparing output copies routinely, but moving the uGMT BX distribution plots behind the fat event filter so the BX comparisons aren't biased. from Configuration.Eras.Modifier_stage2L1Trigger_2021_cff import stage2L1Trigger_2021 _run3_l1tStage2uGMTOnlineDQMSeq = cms.Sequence(l1tStage2uGMTOnlineDQMSeq.copy() + @@ -250,10 +252,10 @@ l1tStage2uGMTMuonShowerVsuGMTMuonShowerCopy4 + l1tStage2uGMTMuonShowerVsuGMTMuonShowerCopy5 ) -_run3_l1tStage2uGMTOnlineDQMSeq.remove(l1tStage2uGMT) +_run3_l1tStage2uGMTOnlineDQMSeq.remove(l1TStage2uGMTBxDistributions) stage2L1Trigger_2021.toReplaceWith(l1tStage2uGMTOnlineDQMSeq, _run3_l1tStage2uGMTOnlineDQMSeq) # The following needs to go after the fat events filter, because inputs are read out with only the central BX for the standard events, so the BX distributions would otherwise be heavily biased toward the central BX. -_run3_l1tStage2uGMTValidationEventOnlineDQMSeq = cms.Sequence(l1tStage2uGMT) +_run3_l1tStage2uGMTValidationEventOnlineDQMSeq = cms.Sequence(l1TStage2uGMTBxDistributions) stage2L1Trigger_2021.toReplaceWith(l1tStage2uGMTValidationEventOnlineDQMSeq, _run3_l1tStage2uGMTValidationEventOnlineDQMSeq) diff --git a/DQM/L1TMonitor/src/L1TStage2uGMT.cc b/DQM/L1TMonitor/src/L1TStage2uGMT.cc index cda7d7855a031..d894cd1593ae1 100644 --- a/DQM/L1TMonitor/src/L1TStage2uGMT.cc +++ b/DQM/L1TMonitor/src/L1TStage2uGMT.cc @@ -46,9 +46,6 @@ void L1TStage2uGMT::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, // BMTF Input ibooker.setCurrentFolder(monitorDir_ + "/BMTFInput"); - ugmtBMTFBX = ibooker.book1D("ugmtBMTFBX", "uGMT BMTF Input BX", 7, -3.5, 3.5); - ugmtBMTFBX->setAxisTitle("BX", 1); - ugmtBMTFnMuons = ibooker.book1D("ugmtBMTFnMuons", "uGMT BMTF Input Muon Multiplicity", 37, -0.5, 36.5); ugmtBMTFnMuons->setAxisTitle("Muon Multiplicity (BX == 0)", 1); @@ -107,9 +104,6 @@ void L1TStage2uGMT::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, // OMTF Input ibooker.setCurrentFolder(monitorDir_ + "/OMTFInput"); - ugmtOMTFBX = ibooker.book1D("ugmtOMTFBX", "uGMT OMTF Input BX", 7, -3.5, 3.5); - ugmtOMTFBX->setAxisTitle("BX", 1); - ugmtOMTFnMuons = ibooker.book1D("ugmtOMTFnMuons", "uGMT OMTF Input Muon Multiplicity", 37, -0.5, 36.5); ugmtOMTFnMuons->setAxisTitle("Muon Multiplicity (BX == 0)", 1); @@ -174,9 +168,6 @@ void L1TStage2uGMT::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, // EMTF Input ibooker.setCurrentFolder(monitorDir_ + "/EMTFInput"); - ugmtEMTFBX = ibooker.book1D("ugmtEMTFBX", "uGMT EMTF Input BX", 7, -3.5, 3.5); - ugmtEMTFBX->setAxisTitle("BX", 1); - ugmtEMTFnMuons = ibooker.book1D("ugmtEMTFnMuons", "uGMT EMTF Input Muon Multiplicity", 37, -0.5, 36.5); ugmtEMTFnMuons->setAxisTitle("Muon Multiplicity (BX == 0)", 1); @@ -269,30 +260,6 @@ void L1TStage2uGMT::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, ugmtEMTFShowerTypeOccupancyPerSector->setAxisTitle("Shower type", 2); ugmtEMTFShowerTypeOccupancyPerSector->setBinLabel(IDX_TIGHT_SHOWER, "Tight", 2); ugmtEMTFShowerTypeOccupancyPerSector->setBinLabel(IDX_NOMINAL_SHOWER, "Nominal", 2); - - ugmtEMTFShowerTypeOccupancyPerBx = - ibooker.book2D("ugmtEMTFShowerTypeOccupancyPerBx", "Shower type occupancy per BX", 7, -3.5, 3.5, 2, 1, 3); - ugmtEMTFShowerTypeOccupancyPerBx->setAxisTitle("BX", 1); - ugmtEMTFShowerTypeOccupancyPerBx->setAxisTitle("Shower type", 2); - ugmtEMTFShowerTypeOccupancyPerBx->setBinLabel(IDX_TIGHT_SHOWER, "Tight", 2); - ugmtEMTFShowerTypeOccupancyPerBx->setBinLabel(IDX_NOMINAL_SHOWER, "Nominal", 2); - - ugmtEMTFShowerSectorOccupancyPerBx = ibooker.book2D( - "ugmtEMTFShowerSectorOccupancyPerBx", "Shower BX occupancy per sector", 7, -3.5, 3.5, 12, 1, 13); - ugmtEMTFShowerSectorOccupancyPerBx->setAxisTitle("BX", 1); - ugmtEMTFShowerSectorOccupancyPerBx->setAxisTitle("Processor", 2); - ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(12, "+6", 2); - ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(11, "+5", 2); - ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(10, "+4", 2); - ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(9, "+3", 2); - ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(8, "+2", 2); - ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(7, "+1", 2); - ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(6, "-6", 2); - ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(5, "-5", 2); - ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(4, "-4", 2); - ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(3, "-3", 2); - ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(2, "-2", 2); - ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(1, "-1", 2); } // inter-TF muon correlations @@ -350,49 +317,6 @@ void L1TStage2uGMT::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, // Subsystem Monitoring and Muon Output ibooker.setCurrentFolder(monitorDir_); - if (!emul_) { - ugmtBMTFBXvsProcessor = - ibooker.book2D("ugmtBXvsProcessorBMTF", "uGMT BMTF Input BX vs Processor", 12, -0.5, 11.5, 5, -2.5, 2.5); - ugmtBMTFBXvsProcessor->setAxisTitle("Wedge", 1); - for (int bin = 1; bin <= 12; ++bin) { - ugmtBMTFBXvsProcessor->setBinLabel(bin, std::to_string(bin), 1); - } - ugmtBMTFBXvsProcessor->setAxisTitle("BX", 2); - - ugmtOMTFBXvsProcessor = - ibooker.book2D("ugmtBXvsProcessorOMTF", "uGMT OMTF Input BX vs Processor", 12, -0.5, 11.5, 5, -2.5, 2.5); - ugmtOMTFBXvsProcessor->setAxisTitle("Sector (Detector Side)", 1); - for (int bin = 1; bin <= 6; ++bin) { - ugmtOMTFBXvsProcessor->setBinLabel(bin, std::to_string(7 - bin) + " (-)", 1); - ugmtOMTFBXvsProcessor->setBinLabel(bin + 6, std::to_string(bin) + " (+)", 1); - } - ugmtOMTFBXvsProcessor->setAxisTitle("BX", 2); - - ugmtEMTFBXvsProcessor = - ibooker.book2D("ugmtBXvsProcessorEMTF", "uGMT EMTF Input BX vs Processor", 12, -0.5, 11.5, 5, -2.5, 2.5); - ugmtEMTFBXvsProcessor->setAxisTitle("Sector (Detector Side)", 1); - for (int bin = 1; bin <= 6; ++bin) { - ugmtEMTFBXvsProcessor->setBinLabel(bin, std::to_string(7 - bin) + " (-)", 1); - ugmtEMTFBXvsProcessor->setBinLabel(bin + 6, std::to_string(bin) + " (+)", 1); - } - ugmtEMTFBXvsProcessor->setAxisTitle("BX", 2); - - ugmtBXvsLink = ibooker.book2D("ugmtBXvsLink", "uGMT BX vs Input Links", 36, 35.5, 71.5, 5, -2.5, 2.5); - ugmtBXvsLink->setAxisTitle("Link", 1); - for (int bin = 1; bin <= 6; ++bin) { - ugmtBXvsLink->setBinLabel(bin, Form("E+%d", bin), 1); - ugmtBXvsLink->setBinLabel(bin + 6, Form("O+%d", bin), 1); - ugmtBXvsLink->setBinLabel(bin + 12, Form("B%d", bin), 1); - ugmtBXvsLink->setBinLabel(bin + 18, Form("B%d", bin + 6), 1); - ugmtBXvsLink->setBinLabel(bin + 24, Form("O-%d", bin), 1); - ugmtBXvsLink->setBinLabel(bin + 30, Form("E-%d", bin), 1); - } - ugmtBXvsLink->setAxisTitle("BX", 2); - } - - ugmtMuonBX = ibooker.book1D("ugmtMuonBX", "uGMT Muon BX", 7, -3.5, 3.5); - ugmtMuonBX->setAxisTitle("BX", 1); - ugmtnMuons = ibooker.book1D("ugmtnMuons", "uGMT Muon Multiplicity", 9, -0.5, 8.5); ugmtnMuons->setAxisTitle("Muon Multiplicity (BX == 0)", 1); @@ -553,18 +477,6 @@ void L1TStage2uGMT::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, ugmtMuonPhiAtVtxvsEtaAtVtx->setAxisTitle("#eta at vertex", 1); ugmtMuonPhiAtVtxvsEtaAtVtx->setAxisTitle("#phi at vertex", 2); - ugmtMuonBXvsLink = ibooker.book2D("ugmtMuonBXvsLink", "uGMT Muon BX vs Input Links", 36, 35.5, 71.5, 5, -2.5, 2.5); - ugmtMuonBXvsLink->setAxisTitle("Muon Input Links", 1); - for (int bin = 1; bin <= 6; ++bin) { - ugmtMuonBXvsLink->setBinLabel(bin, Form("E+%d", bin), 1); - ugmtMuonBXvsLink->setBinLabel(bin + 6, Form("O+%d", bin), 1); - ugmtMuonBXvsLink->setBinLabel(bin + 12, Form("B%d", bin), 1); - ugmtMuonBXvsLink->setBinLabel(bin + 18, Form("B%d", bin + 6), 1); - ugmtMuonBXvsLink->setBinLabel(bin + 24, Form("O-%d", bin), 1); - ugmtMuonBXvsLink->setBinLabel(bin + 30, Form("E-%d", bin), 1); - } - ugmtMuonBXvsLink->setAxisTitle("BX", 2); - ugmtMuonChargevsLink = ibooker.book2D("ugmtMuonChargevsLink", "uGMT Muon Charge vs Input Links", 36, 35.5, 71.5, 3, -1.5, 1.5); ugmtMuonChargevsLink->setAxisTitle("Muon Input Links", 1); @@ -578,45 +490,6 @@ void L1TStage2uGMT::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, } ugmtMuonChargevsLink->setAxisTitle("Charge", 2); - if (hadronicShowers_) { - ugmtMuonShowerTypeOccupancyPerBx = - ibooker.book2D("ugmtMuonShowerTypeOccupancyPerBx", "Shower type occupancy per BX", 7, -3.5, 3.5, 2, 1, 3); - ugmtMuonShowerTypeOccupancyPerBx->setAxisTitle("BX", 1); - ugmtMuonShowerTypeOccupancyPerBx->setAxisTitle("Shower type", 2); - ugmtMuonShowerTypeOccupancyPerBx->setBinLabel(IDX_TIGHT_SHOWER, "Tight", 2); - ugmtMuonShowerTypeOccupancyPerBx->setBinLabel(IDX_NOMINAL_SHOWER, "Nominal", 2); - } - - ugmtMuonBXvshwPt = ibooker.book2D("ugmtMuonBXvshwPt", "uGMT Muon BX vs HW p_{T}", 128, -0.5, 511.5, 5, -2.5, 2.5); - ugmtMuonBXvshwPt->setAxisTitle("Hardware p_{T}", 1); - ugmtMuonBXvshwPt->setAxisTitle("BX", 2); - - ugmtMuonBXvshwEta = ibooker.book2D("ugmtMuonBXvshwEta", "uGMT Muon BX vs HW #eta", 93, -232.5, 232.5, 5, -2.5, 2.5); - ugmtMuonBXvshwEta->setAxisTitle("Hardware #eta", 1); - ugmtMuonBXvshwEta->setAxisTitle("BX", 2); - - ugmtMuonBXvshwPhi = ibooker.book2D("ugmtMuonBXvshwPhi", "uGMT Muon BX vs HW #phi", 116, -2.5, 577.5, 5, -2.5, 2.5); - ugmtMuonBXvshwPhi->setAxisTitle("Hardware #phi", 1); - ugmtMuonBXvshwPhi->setAxisTitle("BX", 2); - - ugmtMuonBXvshwCharge = - ibooker.book2D("ugmtMuonBXvshwCharge", "uGMT Muon BX vs HW Charge", 2, -0.5, 1.5, 5, -2.5, 2.5); - ugmtMuonBXvshwCharge->setAxisTitle("Hardware Charge", 1); - ugmtMuonBXvshwCharge->setAxisTitle("BX", 2); - - ugmtMuonBXvshwChargeValid = - ibooker.book2D("ugmtMuonBXvshwChargeValid", "uGMT Muon BX vs ChargeValid", 2, -0.5, 1.5, 5, -2.5, 2.5); - ugmtMuonBXvshwChargeValid->setAxisTitle("ChargeValid", 1); - ugmtMuonBXvshwChargeValid->setAxisTitle("BX", 2); - - ugmtMuonBXvshwQual = ibooker.book2D("ugmtMuonBXvshwQual", "uGMT Muon BX vs Quality", 16, -0.5, 15.5, 5, -2.5, 2.5); - ugmtMuonBXvshwQual->setAxisTitle("Quality", 1); - ugmtMuonBXvshwQual->setAxisTitle("BX", 2); - - ugmtMuonBXvshwIso = ibooker.book2D("ugmtMuonBXvshwIso", "uGMT Muon BX vs Isolation", 4, -0.5, 3.5, 5, -2.5, 2.5); - ugmtMuonBXvshwIso->setAxisTitle("Isolation", 1); - ugmtMuonBXvshwIso->setAxisTitle("BX", 2); - // muon correlations ibooker.setCurrentFolder(monitorDir_ + "/muon_correlations"); @@ -757,7 +630,6 @@ void L1TStage2uGMT::analyze(const edm::Event& e, const edm::EventSetup& c) { for (l1t::RegionalMuonCandBxCollection::const_iterator BMTF = BMTFBxCollection->begin(itBX); BMTF != BMTFBxCollection->end(itBX); ++BMTF) { - ugmtBMTFBX->Fill(itBX); ugmtBMTFhwPt->Fill(BMTF->hwPt()); if (displacedQuantities_) { ugmtBMTFhwPtUnconstrained->Fill(BMTF->hwPtUnconstrained()); @@ -774,9 +646,7 @@ void L1TStage2uGMT::analyze(const edm::Event& e, const edm::EventSetup& c) { l1t::MicroGMTConfiguration::calcGlobalPhi(BMTF->hwPhi(), BMTF->trackFinderType(), BMTF->processor()); ugmtBMTFglbPhi->Fill(global_hw_phi); - ugmtBMTFBXvsProcessor->Fill(BMTF->processor(), itBX); ugmtBMTFProcvshwPhi->Fill(BMTF->hwPhi(), BMTF->processor()); - ugmtBXvsLink->Fill(BMTF->link(), itBX); // Analyse muon correlations for (l1t::RegionalMuonCandBxCollection::const_iterator BMTF2 = BMTF + 1; BMTF2 != BMTFBxCollection->end(itBX); @@ -806,7 +676,6 @@ void L1TStage2uGMT::analyze(const edm::Event& e, const edm::EventSetup& c) { for (l1t::RegionalMuonCandBxCollection::const_iterator OMTF = OMTFBxCollection->begin(itBX); OMTF != OMTFBxCollection->end(itBX); ++OMTF) { - ugmtOMTFBX->Fill(itBX); ugmtOMTFhwPt->Fill(OMTF->hwPt()); ugmtOMTFhwEta->Fill(OMTF->hwEta()); ugmtOMTFhwSign->Fill(OMTF->hwSign()); @@ -820,19 +689,15 @@ void L1TStage2uGMT::analyze(const edm::Event& e, const edm::EventSetup& c) { l1t::tftype trackFinderType = OMTF->trackFinderType(); if (trackFinderType == l1t::omtf_neg) { - ugmtOMTFBXvsProcessor->Fill(5 - OMTF->processor(), itBX); ugmtOMTFhwPhiNeg->Fill(OMTF->hwPhi()); ugmtOMTFglbPhiNeg->Fill(global_hw_phi); ugmtOMTFProcvshwPhiNeg->Fill(OMTF->hwPhi(), OMTF->processor()); } else { - ugmtOMTFBXvsProcessor->Fill(OMTF->processor() + 6, itBX); ugmtOMTFhwPhiPos->Fill(OMTF->hwPhi()); ugmtOMTFglbPhiPos->Fill(global_hw_phi); ugmtOMTFProcvshwPhiPos->Fill(OMTF->hwPhi(), OMTF->processor()); } - ugmtBXvsLink->Fill(OMTF->link(), itBX); - // Analyse muon correlations for (l1t::RegionalMuonCandBxCollection::const_iterator OMTF2 = OMTF + 1; OMTF2 != OMTFBxCollection->end(itBX); ++OMTF2) { @@ -861,7 +726,6 @@ void L1TStage2uGMT::analyze(const edm::Event& e, const edm::EventSetup& c) { for (l1t::RegionalMuonCandBxCollection::const_iterator EMTF = EMTFBxCollection->begin(itBX); EMTF != EMTFBxCollection->end(itBX); ++EMTF) { - ugmtEMTFBX->Fill(itBX); ugmtEMTFhwPt->Fill(EMTF->hwPt()); if (displacedQuantities_) { ugmtEMTFhwPtUnconstrained->Fill(EMTF->hwPtUnconstrained()); @@ -879,19 +743,15 @@ void L1TStage2uGMT::analyze(const edm::Event& e, const edm::EventSetup& c) { l1t::tftype trackFinderType = EMTF->trackFinderType(); if (trackFinderType == l1t::emtf_neg) { - ugmtEMTFBXvsProcessor->Fill(5 - EMTF->processor(), itBX); ugmtEMTFhwPhiNeg->Fill(EMTF->hwPhi()); ugmtEMTFglbPhiNeg->Fill(global_hw_phi); ugmtEMTFProcvshwPhiNeg->Fill(EMTF->hwPhi(), EMTF->processor()); } else { - ugmtEMTFBXvsProcessor->Fill(EMTF->processor() + 6, itBX); ugmtEMTFhwPhiPos->Fill(EMTF->hwPhi()); ugmtEMTFglbPhiPos->Fill(global_hw_phi); ugmtEMTFProcvshwPhiPos->Fill(EMTF->hwPhi(), EMTF->processor()); } - ugmtBXvsLink->Fill(EMTF->link(), itBX); - // Analyse muon correlations for (l1t::RegionalMuonCandBxCollection::const_iterator EMTF2 = EMTF + 1; EMTF2 != EMTFBxCollection->end(itBX); ++EMTF2) { @@ -924,20 +784,14 @@ void L1TStage2uGMT::analyze(const edm::Event& e, const edm::EventSetup& c) { continue; } if (shower->isOneNominalInTime()) { - ugmtEMTFShowerSectorOccupancyPerBx->Fill( - itBX, shower->processor() + 1 + (shower->trackFinderType() == l1t::tftype::emtf_pos ? 6 : 0)); ugmtEMTFShowerTypeOccupancyPerSector->Fill( shower->processor() + 1 + (shower->trackFinderType() == l1t::tftype::emtf_pos ? 6 : 0), IDX_NOMINAL_SHOWER); - ugmtEMTFShowerTypeOccupancyPerBx->Fill(itBX, IDX_NOMINAL_SHOWER); } if (shower->isOneTightInTime()) { - ugmtEMTFShowerSectorOccupancyPerBx->Fill( - itBX, shower->processor() + 1 + (shower->trackFinderType() == l1t::tftype::emtf_pos ? 6 : 0)); ugmtEMTFShowerTypeOccupancyPerSector->Fill( shower->processor() + 1 + (shower->trackFinderType() == l1t::tftype::emtf_pos ? 6 : 0), IDX_TIGHT_SHOWER); - ugmtEMTFShowerTypeOccupancyPerBx->Fill(itBX, IDX_TIGHT_SHOWER); } } } @@ -1027,7 +881,6 @@ void L1TStage2uGMT::analyze(const edm::Event& e, const edm::EventSetup& c) { ++Muon) { int tfMuonIndex = Muon->tfMuonIndex(); - ugmtMuonBX->Fill(itBX); ugmtMuonIndex->Fill(tfMuonIndex); ugmtMuonhwPt->Fill(Muon->hwPt()); if (displacedQuantities_) { @@ -1074,14 +927,6 @@ void L1TStage2uGMT::analyze(const edm::Event& e, const edm::EventSetup& c) { ugmtMuonPhiAtVtxvsEtaAtVtx->Fill(Muon->etaAtVtx(), Muon->phiAtVtx()); - ugmtMuonBXvsLink->Fill(int(Muon->tfMuonIndex() / 3.) + 36, itBX); - ugmtMuonBXvshwPt->Fill(Muon->hwPt(), itBX); - ugmtMuonBXvshwEta->Fill(Muon->hwEta(), itBX); - ugmtMuonBXvshwPhi->Fill(Muon->hwPhi(), itBX); - ugmtMuonBXvshwCharge->Fill(Muon->hwCharge(), itBX); - ugmtMuonBXvshwChargeValid->Fill(Muon->hwChargeValid(), itBX); - ugmtMuonBXvshwQual->Fill(Muon->hwQual(), itBX); - ugmtMuonBXvshwIso->Fill(Muon->hwIso(), itBX); ugmtMuonChargevsLink->Fill(int(Muon->tfMuonIndex() / 3.) + 36, Muon->charge()); int link = (int)std::floor(tfMuonIndex / 3.); @@ -1158,28 +1003,6 @@ void L1TStage2uGMT::analyze(const edm::Event& e, const edm::EventSetup& c) { } } } - - // Fill shower plots - if (hadronicShowers_) { - edm::Handle showersBxCollection; - e.getByToken(ugmtMuonShowerToken_, showersBxCollection); - - for (int itBX = showersBxCollection->getFirstBX(); itBX <= showersBxCollection->getLastBX(); ++itBX) { - for (l1t::MuonShowerBxCollection::const_iterator shower = showersBxCollection->begin(itBX); - shower != showersBxCollection->end(itBX); - ++shower) { - if (not shower->isValid()) { - continue; - } - if (shower->isOneNominalInTime()) { - ugmtMuonShowerTypeOccupancyPerBx->Fill(itBX, IDX_NOMINAL_SHOWER); - } - if (shower->isOneTightInTime()) { - ugmtMuonShowerTypeOccupancyPerBx->Fill(itBX, IDX_TIGHT_SHOWER); - } - } - } - } } l1t::tftype L1TStage2uGMT::getTfOrigin(const int tfMuonIndex) { diff --git a/DQM/L1TMonitor/src/L1TStage2uGMTBxDistributions.cc b/DQM/L1TMonitor/src/L1TStage2uGMTBxDistributions.cc new file mode 100644 index 0000000000000..47a5abfdad013 --- /dev/null +++ b/DQM/L1TMonitor/src/L1TStage2uGMTBxDistributions.cc @@ -0,0 +1,316 @@ +#include "DQM/L1TMonitor/interface/L1TStage2uGMTBxDistributions.h" + +L1TStage2uGMTBxDistributions::L1TStage2uGMTBxDistributions(const edm::ParameterSet& ps) + : ugmtMuonToken_(consumes(ps.getParameter("muonProducer"))), + ugmtMuonShowerToken_(consumes(ps.getParameter("muonShowerProducer"))), + monitorDir_(ps.getUntrackedParameter("monitorDir")), + emul_(ps.getUntrackedParameter("emulator")), + verbose_(ps.getUntrackedParameter("verbose")), + hadronicShowers_(ps.getUntrackedParameter("hadronicShowers")) { + if (!emul_) { + ugmtBMTFToken_ = consumes(ps.getParameter("bmtfProducer")); + ugmtOMTFToken_ = consumes(ps.getParameter("omtfProducer")); + ugmtEMTFToken_ = consumes(ps.getParameter("emtfProducer")); + ugmtEMTFShowerToken_ = + consumes(ps.getParameter("emtfShowerProducer")); + } +} + +L1TStage2uGMTBxDistributions::~L1TStage2uGMTBxDistributions() {} + +void L1TStage2uGMTBxDistributions::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("muonProducer")->setComment("uGMT output muons."); + + desc.add("bmtfProducer")->setComment("RegionalMuonCands from BMTF."); + desc.add("omtfProducer")->setComment("RegionalMuonCands from OMTF."); + desc.add("emtfProducer")->setComment("RegionalMuonCands from EMTF."); + desc.add("muonShowerProducer")->setComment("uGMT output showers."); + desc.add("emtfShowerProducer")->setComment("RegionalMuonShowers from EMTF."); + desc.addUntracked("monitorDir", "") + ->setComment("Target directory in the DQM file. Will be created if not existing."); + desc.addUntracked("emulator", false) + ->setComment("Create histograms for muonProducer input only. xmtfProducer inputs are ignored."); + desc.addUntracked("verbose", false); + desc.addUntracked("hadronicShowers", false); + descriptions.add("l1tStage2uGMTBxDistributions", desc); +} + +void L1TStage2uGMTBxDistributions::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, const edm::EventSetup&) { + if (!emul_) { + // BMTF Input + ibooker.setCurrentFolder(monitorDir_ + "/BMTFInput"); + + ugmtBMTFBX = ibooker.book1D("ugmtBMTFBX", "uGMT BMTF Input BX", 7, -3.5, 3.5); + ugmtBMTFBX->setAxisTitle("BX", 1); + + // OMTF Input + ibooker.setCurrentFolder(monitorDir_ + "/OMTFInput"); + + ugmtOMTFBX = ibooker.book1D("ugmtOMTFBX", "uGMT OMTF Input BX", 7, -3.5, 3.5); + ugmtOMTFBX->setAxisTitle("BX", 1); + + // EMTF Input + ibooker.setCurrentFolder(monitorDir_ + "/EMTFInput"); + + ugmtEMTFBX = ibooker.book1D("ugmtEMTFBX", "uGMT EMTF Input BX", 7, -3.5, 3.5); + ugmtEMTFBX->setAxisTitle("BX", 1); + + // EMTF muon showers + if (hadronicShowers_) { + ibooker.setCurrentFolder(monitorDir_ + "/EMTFInput/Muon showers"); + + ugmtEMTFShowerTypeOccupancyPerBx = + ibooker.book2D("ugmtEMTFShowerTypeOccupancyPerBx", "Shower type occupancy per BX", 7, -3.5, 3.5, 2, 1, 3); + ugmtEMTFShowerTypeOccupancyPerBx->setAxisTitle("BX", 1); + ugmtEMTFShowerTypeOccupancyPerBx->setAxisTitle("Shower type", 2); + ugmtEMTFShowerTypeOccupancyPerBx->setBinLabel(IDX_TIGHT_SHOWER, "Tight", 2); + ugmtEMTFShowerTypeOccupancyPerBx->setBinLabel(IDX_NOMINAL_SHOWER, "Nominal", 2); + + ugmtEMTFShowerSectorOccupancyPerBx = ibooker.book2D( + "ugmtEMTFShowerSectorOccupancyPerBx", "Shower BX occupancy per sector", 7, -3.5, 3.5, 12, 1, 13); + ugmtEMTFShowerSectorOccupancyPerBx->setAxisTitle("BX", 1); + ugmtEMTFShowerSectorOccupancyPerBx->setAxisTitle("Processor", 2); + ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(12, "+6", 2); + ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(11, "+5", 2); + ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(10, "+4", 2); + ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(9, "+3", 2); + ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(8, "+2", 2); + ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(7, "+1", 2); + ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(6, "-6", 2); + ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(5, "-5", 2); + ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(4, "-4", 2); + ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(3, "-3", 2); + ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(2, "-2", 2); + ugmtEMTFShowerSectorOccupancyPerBx->setBinLabel(1, "-1", 2); + } + } + + // Subsystem Monitoring and Muon Output + ibooker.setCurrentFolder(monitorDir_); + + if (!emul_) { + ugmtBMTFBXvsProcessor = + ibooker.book2D("ugmtBXvsProcessorBMTF", "uGMT BMTF Input BX vs Processor", 12, -0.5, 11.5, 5, -2.5, 2.5); + ugmtBMTFBXvsProcessor->setAxisTitle("Wedge", 1); + for (int bin = 1; bin <= 12; ++bin) { + ugmtBMTFBXvsProcessor->setBinLabel(bin, std::to_string(bin), 1); + } + ugmtBMTFBXvsProcessor->setAxisTitle("BX", 2); + + ugmtOMTFBXvsProcessor = + ibooker.book2D("ugmtBXvsProcessorOMTF", "uGMT OMTF Input BX vs Processor", 12, -0.5, 11.5, 5, -2.5, 2.5); + ugmtOMTFBXvsProcessor->setAxisTitle("Sector (Detector Side)", 1); + for (int bin = 1; bin <= 6; ++bin) { + ugmtOMTFBXvsProcessor->setBinLabel(bin, std::to_string(7 - bin) + " (-)", 1); + ugmtOMTFBXvsProcessor->setBinLabel(bin + 6, std::to_string(bin) + " (+)", 1); + } + ugmtOMTFBXvsProcessor->setAxisTitle("BX", 2); + + ugmtEMTFBXvsProcessor = + ibooker.book2D("ugmtBXvsProcessorEMTF", "uGMT EMTF Input BX vs Processor", 12, -0.5, 11.5, 5, -2.5, 2.5); + ugmtEMTFBXvsProcessor->setAxisTitle("Sector (Detector Side)", 1); + for (int bin = 1; bin <= 6; ++bin) { + ugmtEMTFBXvsProcessor->setBinLabel(bin, std::to_string(7 - bin) + " (-)", 1); + ugmtEMTFBXvsProcessor->setBinLabel(bin + 6, std::to_string(bin) + " (+)", 1); + } + ugmtEMTFBXvsProcessor->setAxisTitle("BX", 2); + + ugmtBXvsLink = ibooker.book2D("ugmtBXvsLink", "uGMT BX vs Input Links", 36, 35.5, 71.5, 5, -2.5, 2.5); + ugmtBXvsLink->setAxisTitle("Link", 1); + for (int bin = 1; bin <= 6; ++bin) { + ugmtBXvsLink->setBinLabel(bin, Form("E+%d", bin), 1); + ugmtBXvsLink->setBinLabel(bin + 6, Form("O+%d", bin), 1); + ugmtBXvsLink->setBinLabel(bin + 12, Form("B%d", bin), 1); + ugmtBXvsLink->setBinLabel(bin + 18, Form("B%d", bin + 6), 1); + ugmtBXvsLink->setBinLabel(bin + 24, Form("O-%d", bin), 1); + ugmtBXvsLink->setBinLabel(bin + 30, Form("E-%d", bin), 1); + } + ugmtBXvsLink->setAxisTitle("BX", 2); + } + + ugmtMuonBX = ibooker.book1D("ugmtMuonBX", "uGMT Muon BX", 7, -3.5, 3.5); + ugmtMuonBX->setAxisTitle("BX", 1); + + ugmtMuonBXvsLink = ibooker.book2D("ugmtMuonBXvsLink", "uGMT Muon BX vs Input Links", 36, 35.5, 71.5, 5, -2.5, 2.5); + ugmtMuonBXvsLink->setAxisTitle("Muon Input Links", 1); + for (int bin = 1; bin <= 6; ++bin) { + ugmtMuonBXvsLink->setBinLabel(bin, Form("E+%d", bin), 1); + ugmtMuonBXvsLink->setBinLabel(bin + 6, Form("O+%d", bin), 1); + ugmtMuonBXvsLink->setBinLabel(bin + 12, Form("B%d", bin), 1); + ugmtMuonBXvsLink->setBinLabel(bin + 18, Form("B%d", bin + 6), 1); + ugmtMuonBXvsLink->setBinLabel(bin + 24, Form("O-%d", bin), 1); + ugmtMuonBXvsLink->setBinLabel(bin + 30, Form("E-%d", bin), 1); + } + ugmtMuonBXvsLink->setAxisTitle("BX", 2); + + if (hadronicShowers_) { + ugmtMuonShowerTypeOccupancyPerBx = + ibooker.book2D("ugmtMuonShowerTypeOccupancyPerBx", "Shower type occupancy per BX", 7, -3.5, 3.5, 2, 1, 3); + ugmtMuonShowerTypeOccupancyPerBx->setAxisTitle("BX", 1); + ugmtMuonShowerTypeOccupancyPerBx->setAxisTitle("Shower type", 2); + ugmtMuonShowerTypeOccupancyPerBx->setBinLabel(IDX_TIGHT_SHOWER, "Tight", 2); + ugmtMuonShowerTypeOccupancyPerBx->setBinLabel(IDX_NOMINAL_SHOWER, "Nominal", 2); + } + + ugmtMuonBXvshwPt = ibooker.book2D("ugmtMuonBXvshwPt", "uGMT Muon BX vs HW p_{T}", 128, -0.5, 511.5, 5, -2.5, 2.5); + ugmtMuonBXvshwPt->setAxisTitle("Hardware p_{T}", 1); + ugmtMuonBXvshwPt->setAxisTitle("BX", 2); + + ugmtMuonBXvshwEta = ibooker.book2D("ugmtMuonBXvshwEta", "uGMT Muon BX vs HW #eta", 93, -232.5, 232.5, 5, -2.5, 2.5); + ugmtMuonBXvshwEta->setAxisTitle("Hardware #eta", 1); + ugmtMuonBXvshwEta->setAxisTitle("BX", 2); + + ugmtMuonBXvshwPhi = ibooker.book2D("ugmtMuonBXvshwPhi", "uGMT Muon BX vs HW #phi", 116, -2.5, 577.5, 5, -2.5, 2.5); + ugmtMuonBXvshwPhi->setAxisTitle("Hardware #phi", 1); + ugmtMuonBXvshwPhi->setAxisTitle("BX", 2); + + ugmtMuonBXvshwCharge = + ibooker.book2D("ugmtMuonBXvshwCharge", "uGMT Muon BX vs HW Charge", 2, -0.5, 1.5, 5, -2.5, 2.5); + ugmtMuonBXvshwCharge->setAxisTitle("Hardware Charge", 1); + ugmtMuonBXvshwCharge->setAxisTitle("BX", 2); + + ugmtMuonBXvshwChargeValid = + ibooker.book2D("ugmtMuonBXvshwChargeValid", "uGMT Muon BX vs ChargeValid", 2, -0.5, 1.5, 5, -2.5, 2.5); + ugmtMuonBXvshwChargeValid->setAxisTitle("ChargeValid", 1); + ugmtMuonBXvshwChargeValid->setAxisTitle("BX", 2); + + ugmtMuonBXvshwQual = ibooker.book2D("ugmtMuonBXvshwQual", "uGMT Muon BX vs Quality", 16, -0.5, 15.5, 5, -2.5, 2.5); + ugmtMuonBXvshwQual->setAxisTitle("Quality", 1); + ugmtMuonBXvshwQual->setAxisTitle("BX", 2); + + ugmtMuonBXvshwIso = ibooker.book2D("ugmtMuonBXvshwIso", "uGMT Muon BX vs Isolation", 4, -0.5, 3.5, 5, -2.5, 2.5); + ugmtMuonBXvshwIso->setAxisTitle("Isolation", 1); + ugmtMuonBXvshwIso->setAxisTitle("BX", 2); +} + +void L1TStage2uGMTBxDistributions::analyze(const edm::Event& e, const edm::EventSetup& c) { + if (verbose_) + edm::LogInfo("L1TStage2uGMTBxDistributions") << "L1TStage2uGMTBxDistributions: analyze..." << std::endl; + + if (!emul_) { + edm::Handle BMTFBxCollection; + e.getByToken(ugmtBMTFToken_, BMTFBxCollection); + + for (int itBX = BMTFBxCollection->getFirstBX(); itBX <= BMTFBxCollection->getLastBX(); ++itBX) { + for (l1t::RegionalMuonCandBxCollection::const_iterator BMTF = BMTFBxCollection->begin(itBX); + BMTF != BMTFBxCollection->end(itBX); + ++BMTF) { + ugmtBMTFBX->Fill(itBX); + + ugmtBMTFBXvsProcessor->Fill(BMTF->processor(), itBX); + ugmtBXvsLink->Fill(BMTF->link(), itBX); + } + } + + edm::Handle OMTFBxCollection; + e.getByToken(ugmtOMTFToken_, OMTFBxCollection); + + for (int itBX = OMTFBxCollection->getFirstBX(); itBX <= OMTFBxCollection->getLastBX(); ++itBX) { + for (l1t::RegionalMuonCandBxCollection::const_iterator OMTF = OMTFBxCollection->begin(itBX); + OMTF != OMTFBxCollection->end(itBX); + ++OMTF) { + ugmtOMTFBX->Fill(itBX); + + l1t::tftype trackFinderType = OMTF->trackFinderType(); + + if (trackFinderType == l1t::omtf_neg) { + ugmtOMTFBXvsProcessor->Fill(5 - OMTF->processor(), itBX); + } else { + ugmtOMTFBXvsProcessor->Fill(OMTF->processor() + 6, itBX); + } + + ugmtBXvsLink->Fill(OMTF->link(), itBX); + } + } + + edm::Handle EMTFBxCollection; + e.getByToken(ugmtEMTFToken_, EMTFBxCollection); + + for (int itBX = EMTFBxCollection->getFirstBX(); itBX <= EMTFBxCollection->getLastBX(); ++itBX) { + for (l1t::RegionalMuonCandBxCollection::const_iterator EMTF = EMTFBxCollection->begin(itBX); + EMTF != EMTFBxCollection->end(itBX); + ++EMTF) { + ugmtEMTFBX->Fill(itBX); + + l1t::tftype trackFinderType = EMTF->trackFinderType(); + + if (trackFinderType == l1t::emtf_neg) { + ugmtEMTFBXvsProcessor->Fill(5 - EMTF->processor(), itBX); + } else { + ugmtEMTFBXvsProcessor->Fill(EMTF->processor() + 6, itBX); + } + + ugmtBXvsLink->Fill(EMTF->link(), itBX); + } + } + + // Fill shower plots + if (hadronicShowers_) { + edm::Handle EMTFShowersBxCollection; + e.getByToken(ugmtEMTFShowerToken_, EMTFShowersBxCollection); + + for (int itBX = EMTFShowersBxCollection->getFirstBX(); itBX <= EMTFShowersBxCollection->getLastBX(); ++itBX) { + for (l1t::RegionalMuonShowerBxCollection::const_iterator shower = EMTFShowersBxCollection->begin(itBX); + shower != EMTFShowersBxCollection->end(itBX); + ++shower) { + if (not shower->isValid()) { + continue; + } + if (shower->isOneNominalInTime()) { + ugmtEMTFShowerSectorOccupancyPerBx->Fill( + itBX, shower->processor() + 1 + (shower->trackFinderType() == l1t::tftype::emtf_pos ? 6 : 0)); + ugmtEMTFShowerTypeOccupancyPerBx->Fill(itBX, IDX_NOMINAL_SHOWER); + } + if (shower->isOneTightInTime()) { + ugmtEMTFShowerSectorOccupancyPerBx->Fill( + itBX, shower->processor() + 1 + (shower->trackFinderType() == l1t::tftype::emtf_pos ? 6 : 0)); + ugmtEMTFShowerTypeOccupancyPerBx->Fill(itBX, IDX_TIGHT_SHOWER); + } + } + } + } + } + + edm::Handle MuonBxCollection; + e.getByToken(ugmtMuonToken_, MuonBxCollection); + + for (int itBX = MuonBxCollection->getFirstBX(); itBX <= MuonBxCollection->getLastBX(); ++itBX) { + for (l1t::MuonBxCollection::const_iterator Muon = MuonBxCollection->begin(itBX); + Muon != MuonBxCollection->end(itBX); + ++Muon) { + ugmtMuonBX->Fill(itBX); + ugmtMuonBXvsLink->Fill(int(Muon->tfMuonIndex() / 3.) + 36, itBX); + ugmtMuonBXvshwPt->Fill(Muon->hwPt(), itBX); + ugmtMuonBXvshwEta->Fill(Muon->hwEta(), itBX); + ugmtMuonBXvshwPhi->Fill(Muon->hwPhi(), itBX); + ugmtMuonBXvshwCharge->Fill(Muon->hwCharge(), itBX); + ugmtMuonBXvshwChargeValid->Fill(Muon->hwChargeValid(), itBX); + ugmtMuonBXvshwQual->Fill(Muon->hwQual(), itBX); + ugmtMuonBXvshwIso->Fill(Muon->hwIso(), itBX); + } + } + + // Fill shower plots + if (hadronicShowers_) { + edm::Handle showersBxCollection; + e.getByToken(ugmtMuonShowerToken_, showersBxCollection); + + for (int itBX = showersBxCollection->getFirstBX(); itBX <= showersBxCollection->getLastBX(); ++itBX) { + for (l1t::MuonShowerBxCollection::const_iterator shower = showersBxCollection->begin(itBX); + shower != showersBxCollection->end(itBX); + ++shower) { + if (not shower->isValid()) { + continue; + } + if (shower->isOneNominalInTime()) { + ugmtMuonShowerTypeOccupancyPerBx->Fill(itBX, IDX_NOMINAL_SHOWER); + } + if (shower->isOneTightInTime()) { + ugmtMuonShowerTypeOccupancyPerBx->Fill(itBX, IDX_TIGHT_SHOWER); + } + } + } + } +} +