From ad99fa6cbb76b29b9678f280df3aee98c881eece Mon Sep 17 00:00:00 2001 From: Stefano Argiro Date: Mon, 4 Sep 2017 13:41:55 +0200 Subject: [PATCH 1/9] fix for Nans, added histos, added check, added exclusion of non-stablebeam (off in config) --- .../interface/ECALpedestalPCLHarvester.h | 9 ++- .../interface/ECALpedestalPCLworker.h | 7 +- .../python/ecalPedestalPCLHarvester_cfi.py | 3 + .../python/ecalPedestalPCLworker_cfi.py | 2 + .../src/ECALpedestalPCLHarvester.cc | 70 ++++++++++++------- .../src/ECALpedestalPCLworker.cc | 24 +++++-- 6 files changed, 79 insertions(+), 36 deletions(-) diff --git a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h index 138de7e2248d9..989a4b44e71c3 100644 --- a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h +++ b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h @@ -27,6 +27,8 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "DataFormats/EcalDetId/interface/EBDetId.h" +#include "DataFormats/EcalDetId/interface/EEDetId.h" #include "CondFormats/EcalObjects/interface/EcalPedestals.h" #include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" @@ -52,11 +54,16 @@ class ECALpedestalPCLHarvester : public DQMEDHarvester { bool checkVariation(const EcalPedestalsMap& oldPedestals, const EcalPedestalsMap& newPedestals); std::vector chStatusToExclude_; int minEntries_; - + + + int entriesEB_[EBDetId::kSizeForDenseIndexing]; + int entriesEE_[EEDetId::kSizeForDenseIndexing]; bool checkAnomalies_ ; // whether or not to avoid creating sqlite file in case of many changed pedestals double nSigma_; // threshold in sigmas to define a pedestal as changed double thresholdAnomalies_; // threshold (fraction of changed pedestals) to avoid creation of sqlite file std::string dqmDir_; // DQM directory where histograms are stored std::string labelG6G1_; // DB label from which pedestals for G6 and G1 are to be copied + float threshDiffEB_; // if the new pedestals differs more than this from old, keep old + float threshDiffEE_; // same as above for EE. Stray channel protection }; diff --git a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h index cee684ed6c426..10651be9708cd 100644 --- a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h +++ b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h @@ -26,7 +26,7 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" - +#include // // class declaration // @@ -45,10 +45,10 @@ class ECALpedestalPCLworker : public DQMEDAnalyzer { virtual void analyze(const edm::Event&, const edm::EventSetup&) ; virtual void endJob() ; - edm::InputTag digiTagEB_; - edm::InputTag digiTagEE_; + edm::EDGetTokenT digiTokenEB_; edm::EDGetTokenT digiTokenEE_; + edm::EDGetTokenT bstToken_; std::vector meEB_; std::vector meEE_; @@ -65,6 +65,7 @@ class ECALpedestalPCLworker : public DQMEDAnalyzer { int nBins_ ; // number of bins per histogram std::string dqmDir_; // DQM directory where histograms are stored + bool requireStableBeam_; // compare ADC values static bool adc_compare(uint16_t a, uint16_t b) { return ( a&0xFFF ) < (b&0xFFF);} diff --git a/Calibration/EcalCalibAlgos/python/ecalPedestalPCLHarvester_cfi.py b/Calibration/EcalCalibAlgos/python/ecalPedestalPCLHarvester_cfi.py index 8e19d45edf1f0..5aa4c1769509d 100644 --- a/Calibration/EcalCalibAlgos/python/ecalPedestalPCLHarvester_cfi.py +++ b/Calibration/EcalCalibAlgos/python/ecalPedestalPCLHarvester_cfi.py @@ -9,4 +9,7 @@ thresholdAnomalies = cms.double(0.1),# threshold (fraction of changed pedestals) to avoid creation of sqlite file dqmDir = cms.string('AlCaReco/EcalPedestalsPCL'), labelG6G1 = cms.string('HLT'), #use the HLT tag as source for G6 and G1 pedestals + threshDiffEB= cms.double(5.0), # if pedestal has changed more then this wrt old value, keep old value. Unit = ADC count + threshDiffEE= cms.double(8.0), + ) diff --git a/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py b/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py index c88db6dda2343..6bee9cc26fef3 100644 --- a/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py +++ b/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py @@ -3,6 +3,8 @@ ecalpedestalPCL =cms.EDAnalyzer('ECALpedestalPCLworker', BarrelDigis=cms.InputTag('ecalDigis','ebDigis'), EndcapDigis=cms.InputTag('ecalDigis','eeDigis'), + bstRecord =cms.InputTag('tcdsDigis','bstRecord'), + requireStableBeam = cms.bool(False), pedestalSamples=cms.uint32(2), # number of presamples to be used for pedestal determination checkSignal = cms.bool(False), # whether or not to exclude digis containing a signal sThresholdEB = cms.uint32(10), # threshold to define a digi as containing signal diff --git a/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc b/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc index 1d215a0a80ac2..4f6a77ab8031a 100644 --- a/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc +++ b/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc @@ -4,8 +4,6 @@ // user include files #include "Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h" -#include "DataFormats/EcalDetId/interface/EBDetId.h" -#include "DataFormats/EcalDetId/interface/EEDetId.h" #include "CondCore/DBOutputService/interface/PoolDBOutputService.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" @@ -27,6 +25,8 @@ ECALpedestalPCLHarvester::ECALpedestalPCLHarvester(const edm::ParameterSet& ps): thresholdAnomalies_ = ps.getParameter("thresholdAnomalies"); dqmDir_ = ps.getParameter("dqmDir"); labelG6G1_ = ps.getParameter("labelG6G1"); + threshDiffEB_ = ps.getParameter("threshDiffEB"); + threshDiffEE_ = ps.getParameter("threshDiffEE"); } void ECALpedestalPCLHarvester::dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore::IGetter& igetter_) { @@ -41,6 +41,7 @@ void ECALpedestalPCLHarvester::dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore:: MonitorElement* ch= igetter_.get(hname); double mean = ch->getMean(); double rms = ch->getRMS(); + entriesEB_[i] = ch->getEntries(); DetId id = EBDetId::detIdFromDenseIndex(i); EcalPedestal ped; @@ -50,8 +51,10 @@ void ECALpedestalPCLHarvester::dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore:: ped.mean_x12=mean; ped.rms_x12=rms; - // if bad channel or low stat skip - if(ch->getEntries()< minEntries_ || !checkStatusCode(id)){ + float diff = abs(mean-oldped.mean_x12); + + // if bad channel or low stat skip or the difference is too large wrt to previous record + if(ch->getEntries()< minEntries_ || !checkStatusCode(id) || diff>threshDiffEB_){ ped.mean_x12=oldped.mean_x12; ped.rms_x12=oldped.rms_x12; @@ -75,7 +78,8 @@ void ECALpedestalPCLHarvester::dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore:: MonitorElement* ch= igetter_.get(hname); double mean = ch->getMean(); double rms = ch->getRMS(); - + entriesEE_[i] = ch->getEntries(); + DetId id = EEDetId::detIdFromDenseIndex(i); EcalPedestal ped; EcalPedestal oldped = *currentPedestals_->find(id.rawId()); @@ -84,8 +88,10 @@ void ECALpedestalPCLHarvester::dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore:: ped.mean_x12=mean; ped.rms_x12=rms; - // if bad channel or low stat skip - if(ch->getEntries()< minEntries_ || !checkStatusCode(id)){ + float diff = abs(mean-oldped.mean_x12); + + // if bad channel or low stat skip or the difference is too large wrt to previous record + if(ch->getEntries()< minEntries_ || !checkStatusCode(id)|| diff>threshDiffEE_){ ped.mean_x12=oldped.mean_x12; ped.rms_x12=oldped.rms_x12; } @@ -220,23 +226,31 @@ void ECALpedestalPCLHarvester::dqmPlots(const EcalPedestals& newpeds, DQMStore: ibooker.cd(); ibooker.setCurrentFolder(dqmDir_+"/Summary"); - MonitorElement * pmeb = ibooker.book2D("meaneb","Pedestal Means",360, 1., 361., 171, -85., 86.); - MonitorElement * preb = ibooker.book2D("rmseb","Pedestal RMS",360, 1., 361., 171, -85., 86.); + MonitorElement * pmeb = ibooker.book2D("meaneb","Pedestal Means EB",360, 1., 361., 171, -85., 86.); + MonitorElement * preb = ibooker.book2D("rmseb","Pedestal RMS EB ",360, 1., 361., 171, -85., 86.); - MonitorElement * pmeep = ibooker.book2D("meaneep","Pedestal Means",100,1,101,100,1,101); - MonitorElement * preep = ibooker.book2D("rmseep","Pedestal RMS",100,1,101,100,1,101); + MonitorElement * pmeep = ibooker.book2D("meaneep","Pedestal Means EEP",100,1,101,100,1,101); + MonitorElement * preep = ibooker.book2D("rmseep","Pedestal RMS EEP",100,1,101,100,1,101); - MonitorElement * pmeem = ibooker.book2D("meaneem","Pedestal Means",100,1,101,100,1,101); - MonitorElement * preem = ibooker.book2D("rmseem","Pedestal RMS",100,1,101,100,1,101); + MonitorElement * pmeem = ibooker.book2D("meaneem","Pedestal Means EEM",100,1,101,100,1,101); + MonitorElement * preem = ibooker.book2D("rmseem","Pedestal RMS EEM",100,1,101,100,1,101); - MonitorElement * pmebd = ibooker.book2D("meanebdiff","Pedestal Means Diff",360, 1., 361., 171, -85., 86.); - MonitorElement * prebd = ibooker.book2D("rmsebdiff","Pedestal RMS Diff",360, 1., 361., 171, -85., 86.); + MonitorElement * pmebd = ibooker.book2D("meanebdiff","Abs Rel Pedestal Means Diff EB",360,1., 361., 171, -85., 86.); + MonitorElement * prebd = ibooker.book2D("rmsebdiff","Abs Rel Pedestal RMS Diff E ",360, 1., 361., 171, -85., 86.); - MonitorElement * pmeepd = ibooker.book2D("meaneepdiff","Pedestal Means Diff",100,1,101,100,1,101); - MonitorElement * preepd = ibooker.book2D("rmseepdiff","Pedestal RMS Diff",100,1,101,100,1,101); + MonitorElement * pmeepd = ibooker.book2D("meaneepdiff","Abs Rel Pedestal Means Diff EEP",100,1,101,100,1,101); + MonitorElement * preepd = ibooker.book2D("rmseepdiff","Abs Rel Pedestal RMS Diff EEP",100,1,101,100,1,101); - MonitorElement * pmeemd = ibooker.book2D("meaneemdiff","Pedestal Means Diff",100,1,101,100,1,101); - MonitorElement * preemd = ibooker.book2D("rmseemdiff","Pedestal RMS Diff",100,1,101,100,1,101); + MonitorElement * pmeemd = ibooker.book2D("meaneemdiff","Abs Rel Pedestal Means Diff EEM",100,1,101,100,1,101); + MonitorElement * preemd = ibooker.book2D("rmseemdiff","Abs RelPedestal RMS Diff EEM",100,1,101,100,1,101); + + MonitorElement * poeb = ibooker.book2D("occeb","Occupancy EB",360, 1., 361., 171, -85., 86.); + MonitorElement * poeep = ibooker.book2D("occeep","Occupancy EEP",100,1,101,100,1,101); + MonitorElement * poeem = ibooker.book2D("occeem","Occupancy EEM",100,1,101,100,1,101); + + + MonitorElement * hdiffeb = ibooker.book1D("diffeb","Pedestal Differences EB",100,-2.5,2.5); + MonitorElement * hdiffee = ibooker.book1D("diffee","Pedestal Differences EE",100,-2.5,2.5); for (int hash =0; hashFill(di.iphi(),di.ieta(),mean); preb->Fill(di.iphi(),di.ieta(),rms); - pmebd->Fill(di.iphi(),di.ieta(),std::abs(mean-cmean)/cmean); - prebd->Fill(di.iphi(),di.ieta(),std::abs(rms-crms)/crms); - + if (cmean) pmebd->Fill(di.iphi(),di.ieta(),std::abs(mean-cmean)/cmean); + if (crms) prebd->Fill(di.iphi(),di.ieta(),std::abs(rms-crms)/crms); + poeb->Fill(di.iphi(),di.ieta(),entriesEB_[hash]); + hdiffeb->Fill(mean-cmean); } @@ -270,14 +285,17 @@ void ECALpedestalPCLHarvester::dqmPlots(const EcalPedestals& newpeds, DQMStore: if (di.zside() >0){ pmeep->Fill(di.ix(),di.iy(),mean); preep->Fill(di.ix(),di.iy(),rms); - pmeepd->Fill(di.ix(),di.iy(),std::abs(mean-cmean)/cmean); - preepd->Fill(di.ix(),di.iy(),std::abs(rms-crms)/crms); + poeep->Fill(di.ix(),di.iy(),entriesEE_[hash]); + if (cmean) pmeepd->Fill(di.ix(),di.iy(),std::abs(mean-cmean)/cmean); + if (crms) preepd->Fill(di.ix(),di.iy(),std::abs(rms-crms)/crms); } else{ pmeem->Fill(di.ix(),di.iy(),mean); preem->Fill(di.ix(),di.iy(),rms); - pmeemd->Fill(di.ix(),di.iy(),std::abs(mean-cmean)/cmean); - preemd->Fill(di.ix(),di.iy(),std::abs(rms-crms)/crms); + if (cmean) pmeemd->Fill(di.ix(),di.iy(),std::abs(mean-cmean)/cmean); + poeem->Fill(di.ix(),di.iy(),entriesEE_[hash]); + if (crms)preemd->Fill(di.ix(),di.iy(),std::abs(rms-crms)/crms); } + hdiffee->Fill(mean-cmean); } diff --git a/Calibration/EcalCalibAlgos/src/ECALpedestalPCLworker.cc b/Calibration/EcalCalibAlgos/src/ECALpedestalPCLworker.cc index 923fe93d3f047..399b475809050 100644 --- a/Calibration/EcalCalibAlgos/src/ECALpedestalPCLworker.cc +++ b/Calibration/EcalCalibAlgos/src/ECALpedestalPCLworker.cc @@ -14,11 +14,11 @@ ECALpedestalPCLworker::ECALpedestalPCLworker(const edm::ParameterSet& iConfig) { - digiTagEB_= iConfig.getParameter("BarrelDigis"); - digiTagEE_= iConfig.getParameter("EndcapDigis"); + edm::InputTag digiTagEB= iConfig.getParameter("BarrelDigis"); + edm::InputTag digiTagEE= iConfig.getParameter("EndcapDigis"); - digiTokenEB_ = consumes(digiTagEB_); - digiTokenEE_ = consumes(digiTagEE_); + digiTokenEB_ = consumes(digiTagEB); + digiTokenEE_ = consumes(digiTagEE); pedestalSamples_ = iConfig.getParameter("pedestalSamples"); checkSignal_ = iConfig.getParameter("checkSignal"); @@ -29,6 +29,10 @@ ECALpedestalPCLworker::ECALpedestalPCLworker(const edm::ParameterSet& iConfig) fixedBookingCenterBin_ = iConfig.getParameter("fixedBookingCenterBin"); nBins_ = iConfig.getParameter("nBins"); dqmDir_ = iConfig.getParameter("dqmDir"); + + edm::InputTag bstRecord= iConfig.getParameter("bstRecord"); + bstToken_ = consumes(bstRecord); + requireStableBeam_ = iConfig.getParameter("requireStableBeam"); } @@ -40,12 +44,20 @@ ECALpedestalPCLworker::analyze(const edm::Event& iEvent, const edm::EventSetup& using namespace edm; Handle pDigiEB; - iEvent.getByLabel(digiTagEB_,pDigiEB); + iEvent.getByToken(digiTokenEB_,pDigiEB); Handle pDigiEE; - iEvent.getByLabel(digiTagEE_,pDigiEE); + iEvent.getByToken(digiTokenEE_,pDigiEE); + // Only Events with stable beam + + if (requireStableBeam_){ + edm::Handle bstData; + iEvent.getByToken(bstToken_,bstData); + int beamMode = static_cast( bstData->beamMode() ); + if (beamMode != 11 ) return; + } for (EBDigiCollection::const_iterator pDigi=pDigiEB->begin(); pDigi!=pDigiEB->end(); ++pDigi){ From 072eb539be6c88d3588dd5c3227d256ca7c15319 Mon Sep 17 00:00:00 2001 From: Stefano Argiro Date: Mon, 4 Sep 2017 14:15:37 +0200 Subject: [PATCH 2/9] fix as per code check --- .../EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h | 4 ++-- Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h | 4 ++-- Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h index 989a4b44e71c3..f63bcddc6aa5c 100644 --- a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h +++ b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h @@ -35,13 +35,13 @@ class ECALpedestalPCLHarvester : public DQMEDHarvester { public: explicit ECALpedestalPCLHarvester(const edm::ParameterSet& ps); - virtual void endRun(edm::Run const& run, edm::EventSetup const & isetup); + void endRun(edm::Run const& run, edm::EventSetup const & isetup); static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: - virtual void dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore::IGetter& igetter_) ; + void dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore::IGetter& igetter_) ; void dqmPlots(const EcalPedestals& newpeds, DQMStore::IBooker& ibooker); diff --git a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h index 10651be9708cd..9731b76db3941 100644 --- a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h +++ b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h @@ -41,8 +41,8 @@ class ECALpedestalPCLworker : public DQMEDAnalyzer { private: virtual void beginJob() ; - virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &); - virtual void analyze(const edm::Event&, const edm::EventSetup&) ; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &); + void analyze(const edm::Event&, const edm::EventSetup&) ; virtual void endJob() ; diff --git a/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc b/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc index 4f6a77ab8031a..214714e7c5e1e 100644 --- a/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc +++ b/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc @@ -16,7 +16,7 @@ #include ECALpedestalPCLHarvester::ECALpedestalPCLHarvester(const edm::ParameterSet& ps): - currentPedestals_(0),channelStatus_(0){ + currentPedestals_(nullptr),channelStatus_(nullptr){ chStatusToExclude_= StringToEnumValue(ps.getParameter >("ChannelStatusToExclude")); minEntries_=ps.getParameter("MinEntries"); From 92600209c7d28ab9880feefb10fea0ab3ea53298 Mon Sep 17 00:00:00 2001 From: Stefano Argiro Date: Mon, 4 Sep 2017 14:58:48 +0200 Subject: [PATCH 3/9] added ovverride keyword as per code-checks --- .../EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h | 4 ++-- Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h index f63bcddc6aa5c..c8ecfe9f64a32 100644 --- a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h +++ b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h @@ -35,13 +35,13 @@ class ECALpedestalPCLHarvester : public DQMEDHarvester { public: explicit ECALpedestalPCLHarvester(const edm::ParameterSet& ps); - void endRun(edm::Run const& run, edm::EventSetup const & isetup); + void endRun(edm::Run const& run, edm::EventSetup const & isetup) override; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: - void dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore::IGetter& igetter_) ; + void dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore::IGetter& igetter_) override ; void dqmPlots(const EcalPedestals& newpeds, DQMStore::IBooker& ibooker); diff --git a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h index 9731b76db3941..83cd79823ff7f 100644 --- a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h +++ b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h @@ -41,8 +41,8 @@ class ECALpedestalPCLworker : public DQMEDAnalyzer { private: virtual void beginJob() ; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &); - void analyze(const edm::Event&, const edm::EventSetup&) ; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; + void analyze(const edm::Event&, const edm::EventSetup&) override ; virtual void endJob() ; From 8e4fbee9062f899a9febf50e6d6bcb192eb9d952 Mon Sep 17 00:00:00 2001 From: Stefano Argiro Date: Tue, 5 Sep 2017 16:38:38 +0200 Subject: [PATCH 4/9] Enable Beam on condition and unpack TCDS digis --- .../python/ALCARECOPromptCalibProdEcalPedestals_cff.py | 6 +++++- .../EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py | 2 +- .../EcalCalibAlgos/test/ecalPedestalPCL_step1_cfg.py | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Calibration/EcalCalibAlgos/python/ALCARECOPromptCalibProdEcalPedestals_cff.py b/Calibration/EcalCalibAlgos/python/ALCARECOPromptCalibProdEcalPedestals_cff.py index 178a5552f4532..0210bff0a4d4f 100644 --- a/Calibration/EcalCalibAlgos/python/ALCARECOPromptCalibProdEcalPedestals_cff.py +++ b/Calibration/EcalCalibAlgos/python/ALCARECOPromptCalibProdEcalPedestals_cff.py @@ -16,6 +16,7 @@ ALCARECOEcalPedestals = ecalpedestalPCL.clone() ALCARECOEcalPedestals.BarrelDigis = cms.InputTag('ALCARECOEcalPedestalsDigis', 'ebDigis') ALCARECOEcalPedestals.EndcapDigis = cms.InputTag('ALCARECOEcalPedestalsDigis', 'eeDigis') +ALCARECOEcalPedestals.bstRecord = cms.InputTag('ALCALRECOEcalTCDSDigis', 'bstRecord') MEtoEDMConvertEcalPedestals = cms.EDProducer("MEtoEDMConverter", @@ -29,8 +30,11 @@ deleteAfterCopy=cms.untracked.bool(True) ) +ALCALRECOEcalTCDSDigis = cms.EDProducer('TcdsRawToDigi') + # The actual sequence -seqALCARECOPromptCalibProdEcalPedestals = cms.Sequence(ALCARECOEcalTestPulsesRaw * +seqALCARECOPromptCalibProdEcalPedestals = cms.Sequence(ALCALRECOEcalTCDSDigis * + ALCARECOEcalTestPulsesRaw * ALCARECOEcalPedestalsDigis * ALCARECOEcalPedestals * MEtoEDMConvertEcalPedestals) diff --git a/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py b/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py index 6bee9cc26fef3..5aa7462490122 100644 --- a/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py +++ b/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py @@ -4,7 +4,7 @@ BarrelDigis=cms.InputTag('ecalDigis','ebDigis'), EndcapDigis=cms.InputTag('ecalDigis','eeDigis'), bstRecord =cms.InputTag('tcdsDigis','bstRecord'), - requireStableBeam = cms.bool(False), + requireStableBeam = cms.bool(True), pedestalSamples=cms.uint32(2), # number of presamples to be used for pedestal determination checkSignal = cms.bool(False), # whether or not to exclude digis containing a signal sThresholdEB = cms.uint32(10), # threshold to define a digi as containing signal diff --git a/Calibration/EcalCalibAlgos/test/ecalPedestalPCL_step1_cfg.py b/Calibration/EcalCalibAlgos/test/ecalPedestalPCL_step1_cfg.py index e742432288e8d..495b2d7590a0c 100644 --- a/Calibration/EcalCalibAlgos/test/ecalPedestalPCL_step1_cfg.py +++ b/Calibration/EcalCalibAlgos/test/ecalPedestalPCL_step1_cfg.py @@ -64,7 +64,8 @@ process.load('Calibration.EcalCalibAlgos.ecalPedestalPCLworker_cfi') -process.raw2digi_step = cms.Path(process.ecalDigis*process.ecalpedestalPCL) +process.tcdsDigis = cms.EDProducer('TcdsRawToDigi') +process.raw2digi_step = cms.Path(process.tcdsDigis*process.ecalDigis*process.ecalpedestalPCL) process.DQMoutput = cms.OutputModule("DQMRootOutputModule", fileName = cms.untracked.string("OUT_step1.root")) From e5c726fd414aedd641d50353bbc176aba3e1646f Mon Sep 17 00:00:00 2001 From: Stefano Argiro Date: Wed, 6 Sep 2017 12:30:57 +0200 Subject: [PATCH 5/9] switch off stable beam check --- Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py b/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py index 5aa7462490122..6bee9cc26fef3 100644 --- a/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py +++ b/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py @@ -4,7 +4,7 @@ BarrelDigis=cms.InputTag('ecalDigis','ebDigis'), EndcapDigis=cms.InputTag('ecalDigis','eeDigis'), bstRecord =cms.InputTag('tcdsDigis','bstRecord'), - requireStableBeam = cms.bool(True), + requireStableBeam = cms.bool(False), pedestalSamples=cms.uint32(2), # number of presamples to be used for pedestal determination checkSignal = cms.bool(False), # whether or not to exclude digis containing a signal sThresholdEB = cms.uint32(10), # threshold to define a digi as containing signal From dba4375fffb607d51102187317adc38a6adb7c4c Mon Sep 17 00:00:00 2001 From: Stefano Argiro Date: Wed, 6 Sep 2017 17:05:25 +0200 Subject: [PATCH 6/9] fixed bug in tcds unpacking --- .../python/ALCARECOPromptCalibProdEcalPedestals_cff.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Calibration/EcalCalibAlgos/python/ALCARECOPromptCalibProdEcalPedestals_cff.py b/Calibration/EcalCalibAlgos/python/ALCARECOPromptCalibProdEcalPedestals_cff.py index 0210bff0a4d4f..dfdea447a685f 100644 --- a/Calibration/EcalCalibAlgos/python/ALCARECOPromptCalibProdEcalPedestals_cff.py +++ b/Calibration/EcalCalibAlgos/python/ALCARECOPromptCalibProdEcalPedestals_cff.py @@ -31,6 +31,7 @@ ) ALCALRECOEcalTCDSDigis = cms.EDProducer('TcdsRawToDigi') +ALCALRECOEcalTCDSDigis.InputLabel = cms.InputTag('hltEcalCalibrationRaw') # The actual sequence seqALCARECOPromptCalibProdEcalPedestals = cms.Sequence(ALCALRECOEcalTCDSDigis * From df82966dffc299b9d11c7385877880c6723ee66b Mon Sep 17 00:00:00 2001 From: Stefano Argiro Date: Wed, 6 Sep 2017 17:08:43 +0200 Subject: [PATCH 7/9] switch on beam check --- Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py b/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py index 6bee9cc26fef3..5aa7462490122 100644 --- a/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py +++ b/Calibration/EcalCalibAlgos/python/ecalPedestalPCLworker_cfi.py @@ -4,7 +4,7 @@ BarrelDigis=cms.InputTag('ecalDigis','ebDigis'), EndcapDigis=cms.InputTag('ecalDigis','eeDigis'), bstRecord =cms.InputTag('tcdsDigis','bstRecord'), - requireStableBeam = cms.bool(False), + requireStableBeam = cms.bool(True), pedestalSamples=cms.uint32(2), # number of presamples to be used for pedestal determination checkSignal = cms.bool(False), # whether or not to exclude digis containing a signal sThresholdEB = cms.uint32(10), # threshold to define a digi as containing signal From a755347cfaf949baf4d49553b760bcf1d0d17c19 Mon Sep 17 00:00:00 2001 From: Stefano Argiro Date: Thu, 7 Sep 2017 12:15:59 +0200 Subject: [PATCH 8/9] update tests and relval --- .../test/ecalPedestalPCL_step1_cfg.py | 21 +++++++------------ .../python/relval_production.py | 2 +- .../python/relval_steps.py | 5 +++-- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/Calibration/EcalCalibAlgos/test/ecalPedestalPCL_step1_cfg.py b/Calibration/EcalCalibAlgos/test/ecalPedestalPCL_step1_cfg.py index 495b2d7590a0c..135383e2941ef 100644 --- a/Calibration/EcalCalibAlgos/test/ecalPedestalPCL_step1_cfg.py +++ b/Calibration/EcalCalibAlgos/test/ecalPedestalPCL_step1_cfg.py @@ -26,14 +26,11 @@ # Input source process.source = cms.Source("PoolSource", - - #fileNames = cms.untracked.vstring('/store/data/Run2016D/TestEnablesEcalHcal/RAW/v2/000/276/315/00000/92AB6184-FD41-E611-A550-02163E01464C.root'), - #fileNames = cms.untracked.vstring('/store/data/Run2016D/TestEnablesEcalHcal/RAW/v2/000/276/318/00000/8487C425-1242-E611-81E6-02163E0146AF.root'), - fileNames = cms.untracked.vstring( - #'file://store_data_Run2016D_TestEnablesEcalHcal_RAW_v2_000_276_315_00000_92AB6184-FD41-E611-A550-02163E01464C.root', - #'file://store_data_Run2016D_TestEnablesEcalHcal_RAW_v2_000_276_318_00000_8487C425-1242-E611-81E6-02163E0146AF.root', - 'file:///afs/cern.ch/work/a/argiro/ecalpedPCL/data/store_data_Run2016D_TestEnablesEcalHcal_RAW_v2_000_276_318_00000_5A25B228-1242-E611-BA75-02163E0120B0.root', - ), + fileNames = cms.untracked.vstring( + '/store/data/Run2017B/TestEnablesEcalHcal/RAW/v1/000/299/149/00000/24768806-E869-E711-A7F2-02163E019BBE.root', + '/store/data/Run2017B/TestEnablesEcalHcal/RAW/v1/000/299/149/00000/26D7BF02-E869-E711-842E-02163E01A1CE.root', + '/store/data/Run2017B/TestEnablesEcalHcal/RAW/v1/000/299/149/00000/2AED4B13-EB69-E711-A167-02163E01A5B3.root', + ), secondaryFileNames = cms.untracked.vstring(), #duplicateCheckMode = cms.untracked.string('noDuplicateCheck') ) @@ -58,13 +55,11 @@ # Path and EndPath definitions -#process.ecalpedstalPCL = cms.EDAnalyzer('ECALpedestalPCLworker', -# BarrelDigis=cms.InputTag('ecalDigis','ebDigis'), -# EndcapDigis=cms.InputTag('ecalDigis','eeDigis')) process.load('Calibration.EcalCalibAlgos.ecalPedestalPCLworker_cfi') -process.tcdsDigis = cms.EDProducer('TcdsRawToDigi') + +process.tcdsDigis = cms.EDProducer('TcdsRawToDigi', InputLabel=cms.InputTag('hltEcalCalibrationRaw')) process.raw2digi_step = cms.Path(process.tcdsDigis*process.ecalDigis*process.ecalpedestalPCL) process.DQMoutput = cms.OutputModule("DQMRootOutputModule", @@ -76,5 +71,5 @@ process.schedule = cms.Schedule(process.raw2digi_step,process.DQMoutput_step) - process.ecalDigis.InputLabel = cms.InputTag('hltEcalCalibrationRaw') + diff --git a/Configuration/PyReleaseValidation/python/relval_production.py b/Configuration/PyReleaseValidation/python/relval_production.py index 71fcee0b46642..3ca1948b898a7 100644 --- a/Configuration/PyReleaseValidation/python/relval_production.py +++ b/Configuration/PyReleaseValidation/python/relval_production.py @@ -16,7 +16,7 @@ workflows[1003]=['', ['RunMinBias2012A','RECODDQM','HARVESTDDQM']] workflows[1004] = [ '',['RunHI2011','TIER0EXPHI','ALCAEXPHI','ALCAHARVD1HI','ALCAHARVD2HI','ALCAHARVD3HI','ALCAHARVD5HI']] -workflows[1010] = ['',['TestEnableEcalHCAL2016H','TIER0EXPTE', 'ALCAEXPTE', 'ALCAHARVDTE']] +workflows[1010] = ['',['TestEnableEcalHCAL2017B','TIER0EXPTE', 'ALCAEXPTE', 'ALCAHARVDTE']] workflows[1020] = ['',['AlCaLumiPixels2016H','TIER0PROMPTLP']] workflows[1030] = ['',['RunHLTPhy2017B','TIER0EXPHPBS','ALCASPLITHPBS','ALCAHARVDHPBS']] diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index db47b0420e162..ea09c01bd8532 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -60,14 +60,15 @@ steps['RunCosmics2011A']={'INPUT':InputInfo(dataSet='/Cosmics/Run2011A-v1/RAW',label='cos2011A',run=[160960],events=100000,location='STD')} Run2011A=[165121] -Run2016HTE=[281014, 281040, 281110, 281007] +Run2017BTE=[299149] Run2016HALP=[283383] steps['RunMinBias2011A']={'INPUT':InputInfo(dataSet='/MinimumBias/Run2011A-v1/RAW',label='mb2011A',run=Run2011A,events=100000,location='STD')} steps['RunMu2011A']={'INPUT':InputInfo(dataSet='/SingleMu/Run2011A-v1/RAW',label='mu2011A',run=Run2011A,events=100000)} steps['RunElectron2011A']={'INPUT':InputInfo(dataSet='/SingleElectron/Run2011A-v1/RAW',label='electron2011A',run=Run2011A,events=100000)} steps['RunPhoton2011A']={'INPUT':InputInfo(dataSet='/Photon/Run2011A-v1/RAW',label='photon2011A',run=Run2011A,events=100000)} steps['RunJet2011A']={'INPUT':InputInfo(dataSet='/Jet/Run2011A-v1/RAW',label='jet2011A',run=Run2011A,events=100000)} -steps['TestEnableEcalHCAL2016H']={'INPUT':InputInfo(dataSet='/TestEnablesEcalHcal/Run2016H-v1/RAW',label='te2016H',run=Run2016HTE,events=100000,location='STD')} +steps['TestEnableEcalHCAL2017B']={'INPUT':InputInfo(dataSet='/TestEnablesEcalHcal/Run2017B-v1/RAW',label='te2017B',run=Run2017BTE,events=100000,location='STD')} + steps['AlCaLumiPixels2016H']={'INPUT':InputInfo(dataSet='/AlCaLumiPixels1/Run2016H-v1/RAW',label='alcalp2016H',run=Run2016HALP,events=100000,location='STD')} From 5e88e68a74a2c9506c6f0b13e14cf862c292463e Mon Sep 17 00:00:00 2001 From: Stefano Argiro Date: Fri, 8 Sep 2017 22:05:37 +0200 Subject: [PATCH 9/9] fixed std::abs --- Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc b/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc index 214714e7c5e1e..eaf27c8053345 100644 --- a/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc +++ b/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc @@ -51,7 +51,7 @@ void ECALpedestalPCLHarvester::dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore:: ped.mean_x12=mean; ped.rms_x12=rms; - float diff = abs(mean-oldped.mean_x12); + float diff = std::abs(mean-oldped.mean_x12); // if bad channel or low stat skip or the difference is too large wrt to previous record if(ch->getEntries()< minEntries_ || !checkStatusCode(id) || diff>threshDiffEB_){ @@ -88,7 +88,7 @@ void ECALpedestalPCLHarvester::dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore:: ped.mean_x12=mean; ped.rms_x12=rms; - float diff = abs(mean-oldped.mean_x12); + float diff = std::abs(mean-oldped.mean_x12); // if bad channel or low stat skip or the difference is too large wrt to previous record if(ch->getEntries()< minEntries_ || !checkStatusCode(id)|| diff>threshDiffEE_){