From b62bdfeb65c3cb43cd57b98d54ee588eea7d2fe2 Mon Sep 17 00:00:00 2001 From: Tanmay Mudholkar Date: Thu, 23 Mar 2017 23:49:42 +0100 Subject: [PATCH 1/3] Added new plot for mean partition timing vs BX to TimingTask. --- DQM/EcalMonitorTasks/interface/TimingTask.h | 8 +++++ DQM/EcalMonitorTasks/python/TimingTask_cfi.py | 36 +++++++++++++++++++ DQM/EcalMonitorTasks/src/TimingTask.cc | 16 +++++++++ 3 files changed, 60 insertions(+) diff --git a/DQM/EcalMonitorTasks/interface/TimingTask.h b/DQM/EcalMonitorTasks/interface/TimingTask.h index cde29c9ae63cb..f4ed5d509bbbf 100644 --- a/DQM/EcalMonitorTasks/interface/TimingTask.h +++ b/DQM/EcalMonitorTasks/interface/TimingTask.h @@ -19,10 +19,18 @@ namespace ecaldqm { void runOnRecHits(EcalRecHitCollection const&, Collections); void runOnUncalibRecHits(EcalUncalibratedRecHitCollection const&); + enum Constants { + nBXBins = 15 + }; + private: void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + void beginEvent(edm::Event const&, edm::EventSetup const&) override; void setParams(edm::ParameterSet const&) override; + int bxBinEdges_[nBXBins + 1]; + double bxBin_; + float chi2ThresholdEB_; float chi2ThresholdEE_; float energyThresholdEB_; diff --git a/DQM/EcalMonitorTasks/python/TimingTask_cfi.py b/DQM/EcalMonitorTasks/python/TimingTask_cfi.py index 02c8974264bc3..44971f5feac72 100644 --- a/DQM/EcalMonitorTasks/python/TimingTask_cfi.py +++ b/DQM/EcalMonitorTasks/python/TimingTask_cfi.py @@ -1,5 +1,24 @@ import FWCore.ParameterSet.Config as cms +bxBins = [ + "1", + "271", + "541", + "892", + "1162", + "1432", + "1783", + "2053", + "2323", + "2674", + "2944", + "3214", + "3446", + "3490", + "3491", + "3565" +] + EaxisEdges = [] for i in range(50) : EaxisEdges.append(pow(10., -0.5 + 2.5 / 50. * i)) @@ -102,6 +121,23 @@ path = cms.untracked.string('%(subdet)s/%(prefix)sTimingTask/%(prefix)sTMT timing vs amplitude %(sm)s'), description = cms.untracked.string('Correlation between hit timing and energy. Only hits with GOOD or OUT_OF_TIME reconstruction flags are used.') ), + TimingVsBX = cms.untracked.PSet( + path = cms.untracked.string('%(subdet)s/%(prefix)sTimingTask/%(prefix)sTMT Timing vs BX%(suffix)s'), + kind = cms.untracked.string('TProfile'), + otype = cms.untracked.string('Ecal3P'), + xaxis = cms.untracked.PSet( + high = cms.untracked.double(16.0), + nbins = cms.untracked.int32(16), + low = cms.untracked.double(0.0), + title = cms.untracked.string('bunch crossing'), + labels = cms.untracked.vstring(bxBins) + ), + yaxis = cms.untracked.PSet( + title = cms.untracked.string('Timing (ns)') + ), + btype = cms.untracked.string('User'), + description = cms.untracked.string('Average hit timing in the partition as a function of BX number.') + ), TimeAmpBXm = cms.untracked.PSet( kind = cms.untracked.string('TH2F'), yaxis = cms.untracked.PSet( diff --git a/DQM/EcalMonitorTasks/src/TimingTask.cc b/DQM/EcalMonitorTasks/src/TimingTask.cc index 71f8e6962224f..8cd2ee8bf8dd0 100644 --- a/DQM/EcalMonitorTasks/src/TimingTask.cc +++ b/DQM/EcalMonitorTasks/src/TimingTask.cc @@ -1,6 +1,9 @@ #include "../interface/TimingTask.h" #include "DQM/EcalCommon/interface/EcalDQMCommonUtils.h" +#include "FWCore/Framework/interface/EventSetup.h" + +#include "FWCore/Framework/interface/Event.h" #include "DataFormats/EcalRawData/interface/EcalDCCHeaderBlock.h" @@ -10,6 +13,8 @@ namespace ecaldqm { TimingTask::TimingTask() : DQWorkerTask(), + bxBinEdges_{1, 271, 541, 892, 1162, 1432, 1783, 2053, 2323, 2674, 2944, 3214, 3446, 3490, 3491, 3565}, + bxBin_(0.), chi2ThresholdEB_(0.), chi2ThresholdEE_(0.), energyThresholdEB_(0.), @@ -53,11 +58,20 @@ namespace ecaldqm meTimeMapByLS->reset(); } + void + TimingTask::beginEvent(edm::Event const& _evt, edm::EventSetup const& _es) + { + using namespace std; + int* pBin(std::upper_bound(bxBinEdges_, bxBinEdges_ + nBXBins + 1, _evt.bunchCrossing())); + bxBin_ = static_cast(pBin - bxBinEdges_) - 0.5; + } + void TimingTask::runOnRecHits(EcalRecHitCollection const& _hits, Collections _collection) { MESet& meTimeAmp(MEs_.at("TimeAmp")); MESet& meTimeAmpAll(MEs_.at("TimeAmpAll")); + MESet& meTimingVsBX(MEs_.at("TimingVsBX")); MESet& meTimeAll(MEs_.at("TimeAll")); MESet& meTimeAllMap(MEs_.at("TimeAllMap")); MESet& meTimeMap(MEs_.at("TimeMap")); // contains cumulative run stats => not suitable for Trend plots @@ -94,6 +108,8 @@ namespace ecaldqm meTimeAmp.fill(id, energy, time); meTimeAmpAll.fill(id, energy, time); + meTimingVsBX.fill(signedSubdet, bxBin_, time); + if(energy > threshold){ meTimeAll.fill(id, time); meTimeMap.fill(id, time); From f957a08859f03eaecea2824047aed4c3551c3274 Mon Sep 17 00:00:00 2001 From: Tanmay Mudholkar Date: Fri, 24 Mar 2017 00:14:07 +0100 Subject: [PATCH 2/3] Changed expected value of laser timing for green laser, changed the deviation from this expected value which triggers RED in the quality plot, and changed the binning range to more clearly see the full shape. --- DQM/EcalMonitorClient/python/LaserClient_cfi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DQM/EcalMonitorClient/python/LaserClient_cfi.py b/DQM/EcalMonitorClient/python/LaserClient_cfi.py index ef7db446c7173..01693525c51ab 100644 --- a/DQM/EcalMonitorClient/python/LaserClient_cfi.py +++ b/DQM/EcalMonitorClient/python/LaserClient_cfi.py @@ -13,8 +13,8 @@ expectedPNAmplitude = [800.0, 800.0, 800.0, 800.0] tolerancePNAmp = 0.1 tolerancePNRMSRatio = 1. -expectedTiming = [4.2, 4.2, 4.2, 4.2] -toleranceTiming = 0.5 +expectedTiming = [4.2, 3.7, 4.2, 4.2] +toleranceTiming = 1.0 toleranceTimRMS = 0.4 ecalLaserClient = cms.untracked.PSet( @@ -63,9 +63,9 @@ ), otype = cms.untracked.string('SM'), xaxis = cms.untracked.PSet( - high = cms.untracked.double(5.5), + high = cms.untracked.double(5.0), nbins = cms.untracked.int32(100), - low = cms.untracked.double(3.5), + low = cms.untracked.double(3.0), title = cms.untracked.string('time (clock)') ), btype = cms.untracked.string('User'), From e131c90eb03daabd264360d401c23d93a0220d6c Mon Sep 17 00:00:00 2001 From: Tanmay Mudholkar Date: Thu, 30 Mar 2017 16:21:07 +0200 Subject: [PATCH 3/3] Changed array to std::array to improve code readability. --- DQM/EcalMonitorTasks/interface/TimingTask.h | 2 +- DQM/EcalMonitorTasks/interface/TrigPrimTask.h | 2 +- DQM/EcalMonitorTasks/src/TimingTask.cc | 6 +++--- DQM/EcalMonitorTasks/src/TrigPrimTask.cc | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/DQM/EcalMonitorTasks/interface/TimingTask.h b/DQM/EcalMonitorTasks/interface/TimingTask.h index f4ed5d509bbbf..c4634a4d9cb57 100644 --- a/DQM/EcalMonitorTasks/interface/TimingTask.h +++ b/DQM/EcalMonitorTasks/interface/TimingTask.h @@ -28,7 +28,7 @@ namespace ecaldqm { void beginEvent(edm::Event const&, edm::EventSetup const&) override; void setParams(edm::ParameterSet const&) override; - int bxBinEdges_[nBXBins + 1]; + std::array bxBinEdges_; double bxBin_; float chi2ThresholdEB_; diff --git a/DQM/EcalMonitorTasks/interface/TrigPrimTask.h b/DQM/EcalMonitorTasks/interface/TrigPrimTask.h index f501329aa3bcd..cf609af093393 100644 --- a/DQM/EcalMonitorTasks/interface/TrigPrimTask.h +++ b/DQM/EcalMonitorTasks/interface/TrigPrimTask.h @@ -45,7 +45,7 @@ namespace ecaldqm { /* bool HLTCaloBit_; */ /* bool HLTMuonBit_; */ - int bxBinEdges_[nBXBins + 1]; + std::array bxBinEdges_; double bxBin_; std::map towerReadouts_; diff --git a/DQM/EcalMonitorTasks/src/TimingTask.cc b/DQM/EcalMonitorTasks/src/TimingTask.cc index 8cd2ee8bf8dd0..cc1b05a9a2473 100644 --- a/DQM/EcalMonitorTasks/src/TimingTask.cc +++ b/DQM/EcalMonitorTasks/src/TimingTask.cc @@ -13,7 +13,7 @@ namespace ecaldqm { TimingTask::TimingTask() : DQWorkerTask(), - bxBinEdges_{1, 271, 541, 892, 1162, 1432, 1783, 2053, 2323, 2674, 2944, 3214, 3446, 3490, 3491, 3565}, + bxBinEdges_{ {1, 271, 541, 892, 1162, 1432, 1783, 2053, 2323, 2674, 2944, 3214, 3446, 3490, 3491, 3565} }, bxBin_(0.), chi2ThresholdEB_(0.), chi2ThresholdEE_(0.), @@ -62,8 +62,8 @@ namespace ecaldqm TimingTask::beginEvent(edm::Event const& _evt, edm::EventSetup const& _es) { using namespace std; - int* pBin(std::upper_bound(bxBinEdges_, bxBinEdges_ + nBXBins + 1, _evt.bunchCrossing())); - bxBin_ = static_cast(pBin - bxBinEdges_) - 0.5; + int* pBin(std::upper_bound(bxBinEdges_.begin(), bxBinEdges_.end(), _evt.bunchCrossing())); + bxBin_ = static_cast(pBin - bxBinEdges_.begin()) - 0.5; } void diff --git a/DQM/EcalMonitorTasks/src/TrigPrimTask.cc b/DQM/EcalMonitorTasks/src/TrigPrimTask.cc index 45352a28dbe6f..1afaa7788f59c 100644 --- a/DQM/EcalMonitorTasks/src/TrigPrimTask.cc +++ b/DQM/EcalMonitorTasks/src/TrigPrimTask.cc @@ -22,7 +22,7 @@ namespace ecaldqm // HLTMuonPath_(""), // HLTCaloBit_(false), // HLTMuonBit_(false), - bxBinEdges_{1, 271, 541, 892, 1162, 1432, 1783, 2053, 2323, 2674, 2944, 3214, 3446, 3490, 3491, 3565}, + bxBinEdges_{ {1, 271, 541, 892, 1162, 1432, 1783, 2053, 2323, 2674, 2944, 3214, 3446, 3490, 3491, 3565} }, bxBin_(0.), towerReadouts_() { @@ -76,8 +76,8 @@ namespace ecaldqm // HLTCaloBit_ = false; // HLTMuonBit_ = false; - int* pBin(std::upper_bound(bxBinEdges_, bxBinEdges_ + nBXBins + 1, _evt.bunchCrossing())); - bxBin_ = static_cast(pBin - bxBinEdges_) - 0.5; + int* pBin(std::upper_bound(bxBinEdges_.begin(), bxBinEdges_.end(), _evt.bunchCrossing())); + bxBin_ = static_cast(pBin - bxBinEdges_.begin()) - 0.5; edm::ESHandle TTStatusRcd_; _es.get().get(TTStatusRcd_);