From c85ffc50b6b83dde49699e65a0d06f6482c68333 Mon Sep 17 00:00:00 2001 From: Tanmay Mudholkar Date: Mon, 18 Apr 2016 18:21:44 +0200 Subject: [PATCH] Added chi-squared plots to Timing Task --- DQM/EcalMonitorTasks/python/TimingTask_cfi.py | 12 ++++++++++++ DQM/EcalMonitorTasks/src/TimingTask.cc | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/DQM/EcalMonitorTasks/python/TimingTask_cfi.py b/DQM/EcalMonitorTasks/python/TimingTask_cfi.py index 5c935be29dd44..11cd14e6758cb 100644 --- a/DQM/EcalMonitorTasks/python/TimingTask_cfi.py +++ b/DQM/EcalMonitorTasks/python/TimingTask_cfi.py @@ -140,6 +140,18 @@ ), btype = cms.untracked.string('User'), description = cms.untracked.string('Distribution of the mean rec hit timing. Only hits with GOOD or OUT_OF_TIME reconstruction flags and energy above threshold are used. The energy thresholds are ' + ('%f and %f' % (energyThresholdEB, energyThresholdEE)) + ' for EB and EE respectively.') + ), + Chi2 = cms.untracked.PSet( + path = cms.untracked.string("%(subdet)s/%(prefix)sTimingTask/%(prefix)sTMT %(subdetshortsig)s Chi2"), + kind = cms.untracked.string('TH1F'), + otype = cms.untracked.string('Ecal3P'), + btype = cms.untracked.string('User'), + xaxis = cms.untracked.PSet( + high = cms.untracked.double(100.), + low = cms.untracked.double(0.), + nbins = cms.untracked.int32(100) + ), + description = cms.untracked.string('Chi2 of the pulse reconstruction.') ) ) ) diff --git a/DQM/EcalMonitorTasks/src/TimingTask.cc b/DQM/EcalMonitorTasks/src/TimingTask.cc index ebdf1527be7ad..3713aa8138311 100644 --- a/DQM/EcalMonitorTasks/src/TimingTask.cc +++ b/DQM/EcalMonitorTasks/src/TimingTask.cc @@ -50,9 +50,11 @@ namespace ecaldqm MESet& meTimeAllMap(MEs_.at("TimeAllMap")); MESet& meTimeMap(MEs_.at("TimeMap")); MESet& meTime1D(MEs_.at("Time1D")); + MESet& meChi2(MEs_.at("Chi2")); uint32_t mask(~((0x1 << EcalRecHit::kGood) | (0x1 << EcalRecHit::kOutOfTime))); float threshold(_collection == kEBRecHit ? energyThresholdEB_ : energyThresholdEE_); + int signedSubdet; std::for_each(_hits.begin(), _hits.end(), [&](EcalRecHitCollection::value_type const& hit){ if(hit.checkFlagMask(mask)) return; @@ -63,6 +65,23 @@ namespace ecaldqm float energy(hit.energy()); float chi2Threshold = ( id.subdetId() == EcalBarrel ) ? chi2ThresholdEB_ : chi2ThresholdEE_; + if (id.subdetId() == EcalBarrel) { + signedSubdet=EcalBarrel; + } + else { + EEDetId eeId(hit.id()); + if(eeId.zside() < 0){ + signedSubdet = -EcalEndcap; + } + else{ + signedSubdet = EcalEndcap; + } + } + + if(energy > threshold){ + meChi2.fill(signedSubdet, hit.chi2()); + } + if( hit.chi2() > chi2Threshold ) return; meTimeAmp.fill(id, energy, time);