From 683fcc711bbfdff1aba775ee553522f045cbf878 Mon Sep 17 00:00:00 2001 From: Junghwan John Goh Date: Thu, 1 Aug 2024 14:26:50 +0200 Subject: [PATCH 1/5] set default draw option to colz for 2d plots, increase x-range of ring1 residual plot --- Validation/MuonRPCDigis/src/RPCDigiValid.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Validation/MuonRPCDigis/src/RPCDigiValid.cc b/Validation/MuonRPCDigis/src/RPCDigiValid.cc index 6ae4f5921d34f..2d8e7eda95565 100644 --- a/Validation/MuonRPCDigis/src/RPCDigiValid.cc +++ b/Validation/MuonRPCDigis/src/RPCDigiValid.cc @@ -201,6 +201,7 @@ void RPCDigiValid::bookHistograms(DQMStore::IBooker &booker, edm::Run const &run // RZ plot hRZ_ = booker.book2D("RZ", "R-Z view;Z (cm);R (cm)", nbinsZ, -maxZ, maxZ, nbinsR, minR, maxR); + hRZ_->setOption("colz"); // XY plots hXY_Barrel_ = booker.book2D("XY_Barrel", "X-Y view of Barrel", nbinsXY, -maxXY, maxXY, nbinsXY, -maxXY, maxXY); @@ -211,6 +212,8 @@ void RPCDigiValid::bookHistograms(DQMStore::IBooker &booker, edm::Run const &run const std::string meTitleN = fmt::format("X-Y view of Endcap{:+1d};X (cm);Y (cm)", -disk); hXY_Endcap_[disk] = booker.book2D(meNameP, meTitleP, nbinsXY, -maxXY, maxXY, nbinsXY, -maxXY, maxXY); hXY_Endcap_[-disk] = booker.book2D(meNameN, meTitleN, nbinsXY, -maxXY, maxXY, nbinsXY, -maxXY, maxXY); + hXY_Endcap_[disk]->setOption("colz"); + hXY_Endcap_[-disk]->setOption("colz"); } // Z-phi plots @@ -218,6 +221,7 @@ void RPCDigiValid::bookHistograms(DQMStore::IBooker &booker, edm::Run const &run const std::string meName = fmt::format("ZPhi_Layer{:1d}", layer); const std::string meTitle = fmt::format("Z-#phi view of Layer{:1d};Z (cm);#phi (degree)", layer); hZPhi_[layer] = booker.book2D(meName, meTitle, nbinsBarrelZ, -maxBarrelZ, maxBarrelZ, nbinsPhi, -180, 180); + hZPhi_[layer]->setOption("colz"); } // Strip profile @@ -267,9 +271,7 @@ void RPCDigiValid::bookHistograms(DQMStore::IBooker &booker, edm::Run const &run hResEndcapDisks_[-disk] = booker.book1D(meNameN, meTitleN, 100, -8, 8); } - for (int ring = 1; ring <= 3; ++ring) { - const std::string meName = fmt::format("Residual_Endcap_Ring{:1d}", ring); - const std::string meTitle = fmt::format("Residual of Endcap Ring{:1d};dx (cm)", ring); - hResEndcapRings_[ring] = booker.book1D(meName, meTitle, 100, -8, 8); - } + hResEndcapRings_[1] = booker.book1D("Residual_Endcap_Ring1", "Residual of Endcap Ring1;dx (cm)", 100, -12, 12); + hResEndcapRings_[2] = booker.book1D("Residual_Endcap_Ring2", "Residual of Endcap Ring2;dx (cm)", 100, -8, 8); + hResEndcapRings_[3] = booker.book1D("Residual_Endcap_Ring3", "Residual of Endcap Ring3;dx (cm)", 100, -8, 8); } From cc8612b2a8db7bd2703f2414246eb696ef3e130d Mon Sep 17 00:00:00 2001 From: Junghwan John Goh Date: Thu, 1 Aug 2024 16:07:50 +0200 Subject: [PATCH 2/5] make digi time distribution only for phase2 upgrades using the era modifiers --- .../MuonRPCDigis/interface/RPCDigiValid.h | 1 + .../python/validationMuonRPCDigis_cfi.py | 6 ++++ Validation/MuonRPCDigis/src/RPCDigiValid.cc | 32 +++++++++++-------- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/Validation/MuonRPCDigis/interface/RPCDigiValid.h b/Validation/MuonRPCDigis/interface/RPCDigiValid.h index b7896a53b6c4c..2d3b32a0ef169 100644 --- a/Validation/MuonRPCDigis/interface/RPCDigiValid.h +++ b/Validation/MuonRPCDigis/interface/RPCDigiValid.h @@ -45,6 +45,7 @@ class RPCDigiValid : public DQMEDAnalyzer { MonitorElement *hBxDisc_4Min_; // Timing information + bool isDigiTimeAvailable_; MonitorElement *hDigiTimeAll_, *hDigiTime_, *hDigiTimeIRPC_, *hDigiTimeNoIRPC_; // Multiplicity plots diff --git a/Validation/MuonRPCDigis/python/validationMuonRPCDigis_cfi.py b/Validation/MuonRPCDigis/python/validationMuonRPCDigis_cfi.py index e04d953a5e736..d1c89422eb6f6 100644 --- a/Validation/MuonRPCDigis/python/validationMuonRPCDigis_cfi.py +++ b/Validation/MuonRPCDigis/python/validationMuonRPCDigis_cfi.py @@ -8,9 +8,15 @@ # Tag for simulated hits event data retrieval simHitTag = cms.untracked.InputTag("g4SimHits", "MuonRPCHits"), + # Flag to turn on/off timing plots + digiTime = cms.untracked.bool(False), + # Name of the root file which will contain the histos outputFile = cms.untracked.string('') ) from Configuration.Eras.Modifier_fastSim_cff import fastSim fastSim.toModify(validationMuonRPCDigis, simHitTag = "MuonSimHits:MuonRPCHits") + +from Configuration.Eras.Modifier_phase2_common_cff import phase2_common +phase2_common.toModify(validationMuonRPCDigis, digiTime = True) diff --git a/Validation/MuonRPCDigis/src/RPCDigiValid.cc b/Validation/MuonRPCDigis/src/RPCDigiValid.cc index 2d8e7eda95565..70a08c455f795 100644 --- a/Validation/MuonRPCDigis/src/RPCDigiValid.cc +++ b/Validation/MuonRPCDigis/src/RPCDigiValid.cc @@ -26,6 +26,8 @@ RPCDigiValid::RPCDigiValid(const ParameterSet &ps) { rpcDigiToken_ = consumes( ps.getUntrackedParameter("rpcDigiTag", edm::InputTag("simMuonRPCDigis"))); + isDigiTimeAvailable_ = ps.getUntrackedParameter("digiTime", false); + rpcGeomToken_ = esConsumes(); } @@ -122,14 +124,16 @@ void RPCDigiValid::analyze(const Event &event, const EventSetup &eventSetup) { } // Fill timing information - const double digiTime = digiIt->hasTime() ? digiIt->time() : digiIt->bx() * 25; - hDigiTimeAll_->Fill(digiTime); - if (digiIt->hasTime()) { - hDigiTime_->Fill(digiTime); - if (roll->isIRPC()) - hDigiTimeIRPC_->Fill(digiTime); - else - hDigiTimeNoIRPC_->Fill(digiTime); + if ( isDigiTimeAvailable_ ) { + const double digiTime = digiIt->hasTime() ? digiIt->time() : digiIt->bx() * 25; + hDigiTimeAll_->Fill(digiTime); + if (digiIt->hasTime()) { + hDigiTime_->Fill(digiTime); + if (roll->isIRPC()) + hDigiTimeIRPC_->Fill(digiTime); + else + hDigiTimeNoIRPC_->Fill(digiTime); + } } // Keep digi position @@ -237,11 +241,13 @@ void RPCDigiValid::bookHistograms(DQMStore::IBooker &booker, edm::Run const &run hBxDisc_4Min_ = booker.book1D("BxDisc_4Min", "BxDisc_4Min", 20, -10., 10.); // Timing informations - hDigiTimeAll_ = - booker.book1D("DigiTimeAll", "Digi time including present electronics;Digi time (ns)", 100, -12.5, 12.5); - hDigiTime_ = booker.book1D("DigiTime", "Digi time only with timing information;Digi time (ns)", 100, -12.5, 12.5); - hDigiTimeIRPC_ = booker.book1D("DigiTimeIRPC", "IRPC Digi time;Digi time (ns)", 100, -12.5, 12.5); - hDigiTimeNoIRPC_ = booker.book1D("DigiTimeNoIRPC", "non-IRPC Digi time;Digi time (ns)", 100, -12.5, 12.5); + if ( isDigiTimeAvailable_ ) { + hDigiTimeAll_ = + booker.book1D("DigiTimeAll", "Digi time including present electronics;Digi time (ns)", 100, -12.5, 12.5); + hDigiTime_ = booker.book1D("DigiTime", "Digi time only with timing information;Digi time (ns)", 100, -12.5, 12.5); + hDigiTimeIRPC_ = booker.book1D("DigiTimeIRPC", "IRPC Digi time;Digi time (ns)", 100, -12.5, 12.5); + hDigiTimeNoIRPC_ = booker.book1D("DigiTimeNoIRPC", "non-IRPC Digi time;Digi time (ns)", 100, -12.5, 12.5); + } // SimHit and Digi multiplicity per roll hNSimHitPerRoll_ = booker.book1D("NSimHitPerRoll", "SimHit multiplicity per Roll;Multiplicity", 10, 0, 10); From 44f1c72d6226fb07607c43390ac8ecc34b342250 Mon Sep 17 00:00:00 2001 From: Junghwan John Goh Date: Thu, 1 Aug 2024 16:09:37 +0200 Subject: [PATCH 3/5] remove deprecated parameter only in cfi file --- Validation/MuonRPCDigis/python/validationMuonRPCDigis_cfi.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Validation/MuonRPCDigis/python/validationMuonRPCDigis_cfi.py b/Validation/MuonRPCDigis/python/validationMuonRPCDigis_cfi.py index d1c89422eb6f6..bb5be6e10d096 100644 --- a/Validation/MuonRPCDigis/python/validationMuonRPCDigis_cfi.py +++ b/Validation/MuonRPCDigis/python/validationMuonRPCDigis_cfi.py @@ -9,10 +9,7 @@ simHitTag = cms.untracked.InputTag("g4SimHits", "MuonRPCHits"), # Flag to turn on/off timing plots - digiTime = cms.untracked.bool(False), - - # Name of the root file which will contain the histos - outputFile = cms.untracked.string('') + digiTime = cms.untracked.bool(False) ) from Configuration.Eras.Modifier_fastSim_cff import fastSim From 3ae7be13eb8042c966d2d22ba06470b083bff779 Mon Sep 17 00:00:00 2001 From: Junghwan John Goh Date: Thu, 1 Aug 2024 16:11:43 +0200 Subject: [PATCH 4/5] apply code format --- Validation/MuonRPCDigis/src/RPCDigiValid.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Validation/MuonRPCDigis/src/RPCDigiValid.cc b/Validation/MuonRPCDigis/src/RPCDigiValid.cc index 70a08c455f795..bc5b59d6a530c 100644 --- a/Validation/MuonRPCDigis/src/RPCDigiValid.cc +++ b/Validation/MuonRPCDigis/src/RPCDigiValid.cc @@ -124,7 +124,7 @@ void RPCDigiValid::analyze(const Event &event, const EventSetup &eventSetup) { } // Fill timing information - if ( isDigiTimeAvailable_ ) { + if (isDigiTimeAvailable_) { const double digiTime = digiIt->hasTime() ? digiIt->time() : digiIt->bx() * 25; hDigiTimeAll_->Fill(digiTime); if (digiIt->hasTime()) { @@ -241,7 +241,7 @@ void RPCDigiValid::bookHistograms(DQMStore::IBooker &booker, edm::Run const &run hBxDisc_4Min_ = booker.book1D("BxDisc_4Min", "BxDisc_4Min", 20, -10., 10.); // Timing informations - if ( isDigiTimeAvailable_ ) { + if (isDigiTimeAvailable_) { hDigiTimeAll_ = booker.book1D("DigiTimeAll", "Digi time including present electronics;Digi time (ns)", 100, -12.5, 12.5); hDigiTime_ = booker.book1D("DigiTime", "Digi time only with timing information;Digi time (ns)", 100, -12.5, 12.5); From 75b30b09aad5d876c2cf5d4b71d3954331fb27a6 Mon Sep 17 00:00:00 2001 From: Junghwan John Goh Date: Wed, 14 Aug 2024 16:53:00 +0200 Subject: [PATCH 5/5] missing colz option to 2d histogram --- Validation/MuonRPCDigis/src/RPCDigiValid.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/Validation/MuonRPCDigis/src/RPCDigiValid.cc b/Validation/MuonRPCDigis/src/RPCDigiValid.cc index bc5b59d6a530c..e6e69d65d4e38 100644 --- a/Validation/MuonRPCDigis/src/RPCDigiValid.cc +++ b/Validation/MuonRPCDigis/src/RPCDigiValid.cc @@ -209,6 +209,7 @@ void RPCDigiValid::bookHistograms(DQMStore::IBooker &booker, edm::Run const &run // XY plots hXY_Barrel_ = booker.book2D("XY_Barrel", "X-Y view of Barrel", nbinsXY, -maxXY, maxXY, nbinsXY, -maxXY, maxXY); + hXY_Barrel_->setOption("colz"); for (int disk = 1; disk <= 4; ++disk) { const std::string meNameP = fmt::format("XY_Endcap_p{:1d}", disk); const std::string meNameN = fmt::format("XY_Endcap_m{:1d}", disk);