diff --git a/Configuration/StandardSequences/python/AlCaRecoStreams_cff.py b/Configuration/StandardSequences/python/AlCaRecoStreams_cff.py index ff65846206acf..d1348f9e6ae95 100644 --- a/Configuration/StandardSequences/python/AlCaRecoStreams_cff.py +++ b/Configuration/StandardSequences/python/AlCaRecoStreams_cff.py @@ -215,7 +215,7 @@ pathALCARECOHcalCalIsoTrk = cms.Path(seqALCARECOHcalCalIsoTrk*ALCARECOHcalCalIsoTrackDQM) pathALCARECOHcalCalIsoTrkFilter = cms.Path(seqALCARECOHcalCalIsoTrkFilter) pathALCARECOHcalCalNoise = cms.Path(seqALCARECOHcalCalNoise) -pathALCARECOHcalCalIterativePhiSym = cms.Path(seqALCARECOHcalCalIterativePhiSym*ALCARECOHcalCalPhisymDQM) +pathALCARECOHcalCalIterativePhiSym = cms.Path(seqALCARECOHcalCalIterativePhiSym*ALCARECOHcalCalIterativePhisymDQM) pathALCARECOHcalCalIsolatedBunchFilter = cms.Path(seqALCARECOHcalCalIsolatedBunchFilter) pathALCARECOHcalCalIsolatedBunchSelector = cms.Path(seqALCARECOHcalCalIsolatedBunchSelector*ALCARECOHcalCalIsolatedBunchDQM) pathALCARECOHcalCalHBHEMuonFilter = cms.Path(seqALCARECOHcalCalHBHEMuonFilter) diff --git a/DQMOffline/CalibCalo/interface/DQMHcalIterativePhiSymAlCaReco.h b/DQMOffline/CalibCalo/interface/DQMHcalIterativePhiSymAlCaReco.h new file mode 100644 index 0000000000000..673c8905d3e58 --- /dev/null +++ b/DQMOffline/CalibCalo/interface/DQMHcalIterativePhiSymAlCaReco.h @@ -0,0 +1,62 @@ +#ifndef DQMHcalIterativePhiSymAlCaReco_H +#define DQMHcalIterativePhiSymAlCaReco_H + +/** \class DQMHcalIterativePhiSymAlCaReco + * * + * DQM Source for iterative phi symmetry stream + * + * \author Sunanda Banerjee + * + */ + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DQMServices/Core/interface/DQMOneEDAnalyzer.h" +#include "DQMServices/Core/interface/DQMStore.h" +#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" +#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" + +#include + +class DQMHcalIterativePhiSymAlCaReco : public DQMOneEDAnalyzer<> { +public: + DQMHcalIterativePhiSymAlCaReco(const edm::ParameterSet &); + ~DQMHcalIterativePhiSymAlCaReco() override; + + static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); + +protected: + // void beginRun(const edm::Run& r, const edm::EventSetup& c); + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; + void analyze(const edm::Event &e, const edm::EventSetup &c) override; + + void dqmEndRun(const edm::Run &r, const edm::EventSetup &c) override {} + +private: + static constexpr int maxDepth_ = 7; + // + // Monitor elements + // + MonitorElement *hiDistr2D_[maxDepth_]; + + MonitorElement *hiDistrHBHEsize1D_; + MonitorElement *hiDistrHFsize1D_; + MonitorElement *hiDistrHOsize1D_; + + std::string folderName_; + int hiDistr_y_nbin_; + int hiDistr_x_nbin_; + double hiDistr_y_min_; + double hiDistr_y_max_; + double hiDistr_x_min_; + double hiDistr_x_max_; + /// object to monitor + + edm::EDGetTokenT tok_hbhe_; + edm::EDGetTokenT tok_ho_; + edm::EDGetTokenT tok_hf_; +}; + +#endif diff --git a/DQMOffline/CalibCalo/plugins/SealModule.cc b/DQMOffline/CalibCalo/plugins/SealModule.cc index b471a894d2a7c..8b457424fd2e7 100644 --- a/DQMOffline/CalibCalo/plugins/SealModule.cc +++ b/DQMOffline/CalibCalo/plugins/SealModule.cc @@ -8,8 +8,10 @@ #include "DQMOffline/CalibCalo/src/DQMHcalIsolatedBunchAlCaReco.h" #include "DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.h" #include "DQMOffline/CalibCalo/src/DQMSourcePi0.h" +#include "DQMOffline/CalibCalo/interface/DQMHcalIterativePhiSymAlCaReco.h" DEFINE_FWK_MODULE(DQMHcalPhiSymAlCaReco); +DEFINE_FWK_MODULE(DQMHcalIterativePhiSymAlCaReco); DEFINE_FWK_MODULE(DQMSourcePi0); DEFINE_FWK_MODULE(DQMSourceEleCalib); DEFINE_FWK_MODULE(DQMHcalIsoTrackAlCaReco); diff --git a/DQMOffline/CalibCalo/python/MonitorAlCaHcalIterativePhisym_cfi.py b/DQMOffline/CalibCalo/python/MonitorAlCaHcalIterativePhisym_cfi.py new file mode 100644 index 0000000000000..95093e0b9f8fe --- /dev/null +++ b/DQMOffline/CalibCalo/python/MonitorAlCaHcalIterativePhisym_cfi.py @@ -0,0 +1,17 @@ +import FWCore.ParameterSet.Config as cms + +from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer + +HcalIterativePhiSymMon = DQMEDAnalyzer('DQMHcalIterativePhiSymAlCaReco', + folderName = cms.string('ALCAStreamHcalIterativePhiSym'), + hbheInput = cms.InputTag('hbhereco'), + hfInput = cms.InputTag('hfreco'), + hoInput = cms.InputTag('horeco'), + hiDistr_y_nbin = cms.untracked.int32(72), + hiDistr_y_min = cms.untracked.double(0.5), + hiDistr_y_max = cms.untracked.double(72.5), + hiDistr_x_nbin = cms.untracked.int32(83), + hiDistr_x_min = cms.untracked.double(-41.5), + hiDistr_x_max = cms.untracked.double(41.5), + mightGet = cms.optional.untracked.vstring +) diff --git a/DQMOffline/CalibCalo/src/DQMHcalIterativePhiSymAlCaReco.cc b/DQMOffline/CalibCalo/src/DQMHcalIterativePhiSymAlCaReco.cc new file mode 100644 index 0000000000000..8cf92573de7fd --- /dev/null +++ b/DQMOffline/CalibCalo/src/DQMHcalIterativePhiSymAlCaReco.cc @@ -0,0 +1,150 @@ +/* + * \file DQMHcalIterativePhiSymAlCaReco.cc + * + * \author Sunanda Banerjee + * + * + * + * Description: Monitoring of Iterative Phi Symmetry Calibration Stream + */ + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +// DQM include files + +#include "DQMServices/Core/interface/DQMStore.h" + +// work on collections + +#include "DataFormats/HcalDetId/interface/HcalDetId.h" +#include "DataFormats/HcalDetId/interface/HcalSubdetector.h" +#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" +#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" +#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" + +#include "DQMOffline/CalibCalo/interface/DQMHcalIterativePhiSymAlCaReco.h" + +// ****************************************** +// constructors +// ***************************************** + +DQMHcalIterativePhiSymAlCaReco::DQMHcalIterativePhiSymAlCaReco(const edm::ParameterSet &ps) { + // + // Input from configurator file + // + folderName_ = ps.getParameter("folderName"); + + // histogram parameters + tok_ho_ = consumes(ps.getParameter("hoInput")); + tok_hf_ = consumes(ps.getParameter("hfInput")); + tok_hbhe_ = consumes(ps.getParameter("hbheInput")); + + // Distribution of rechits in iPhi, iEta + hiDistr_y_nbin_ = ps.getUntrackedParameter("hiDistr_y_nbin", 72); + hiDistr_y_min_ = ps.getUntrackedParameter("hiDistr_y_min", 0.5); + hiDistr_y_max_ = ps.getUntrackedParameter("hiDistr_y_max", 72.5); + hiDistr_x_nbin_ = ps.getUntrackedParameter("hiDistr_x_nbin", 83); + hiDistr_x_min_ = ps.getUntrackedParameter("hiDistr_x_min", -41.5); + hiDistr_x_max_ = ps.getUntrackedParameter("hiDistr_x_max", 41.5); +} + +DQMHcalIterativePhiSymAlCaReco::~DQMHcalIterativePhiSymAlCaReco() {} + +void DQMHcalIterativePhiSymAlCaReco::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { + edm::ParameterSetDescription desc; + desc.add("folderName", "ALCAStreamHcalIterativePhiSym"); + desc.add("hbheInput", edm::InputTag("hbhereco")); + desc.add("hfInput", edm::InputTag("hfreco")); + desc.add("hoInput", edm::InputTag("horeco")); + desc.addUntracked("hiDistr_y_nbin", 72); + desc.addUntracked("hiDistr_y_min", 0.5); + desc.addUntracked("hiDistr_y_max", 72.5); + desc.addUntracked("hiDistr_x_nbin", 83); + desc.addUntracked("hiDistr_x_min", -41.5); + desc.addUntracked("hiDistr_x_max", 41.5); + descriptions.add("dqmHcalIterativePhiSymAlCaReco", desc); +} + +//-------------------------------------------------------- +void DQMHcalIterativePhiSymAlCaReco::bookHistograms(DQMStore::IBooker &ibooker, + edm::Run const &irun, + edm::EventSetup const &isetup) { + // create and cd into new folder + ibooker.setCurrentFolder(folderName_); + + // book some histograms 1D + hiDistrHBHEsize1D_ = ibooker.book1D("DistrHBHEsize", "Size of HBHE Collection", 100, 0.0, 10000.0); + hiDistrHFsize1D_ = ibooker.book1D("DistrHFsize", "Size of HF Collection", 100, 0.0, 10000.0); + hiDistrHOsize1D_ = ibooker.book1D("DistrHOsize", "Size of HO Collection", 100, 0.0, 3000.0); + + // Eta-phi occupancy + for (int k = 0; k < maxDepth_; ++k) { + char name[20], title[20]; + sprintf(name, "MBdepth%d", (k + 1)); + sprintf(title, "Depth %d", (k + 1)); + hiDistr2D_[k] = ibooker.book2D( + name, title, hiDistr_x_nbin_, hiDistr_x_min_, hiDistr_x_max_, hiDistr_y_nbin_, hiDistr_y_min_, hiDistr_y_max_); + hiDistr2D_[k]->setAxisTitle("i#phi ", 2); + hiDistr2D_[k]->setAxisTitle("i#eta ", 1); + } +} + +//-------------------------------------------------------- + +//------------------------------------------------------------- + +void DQMHcalIterativePhiSymAlCaReco::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { + // First HBHE RecHits + edm::Handle hbheMB; + iEvent.getByToken(tok_hbhe_, hbheMB); + if (!hbheMB.isValid()) { + edm::LogWarning("DQMHcal") << "DQMHcalIterativePhiSymAlCaReco: Error! can't get HBHE RecHit Collection!"; + } else { + const HBHERecHitCollection Hithbhe = *(hbheMB.product()); + hiDistrHBHEsize1D_->Fill(Hithbhe.size()); + for (HBHERecHitCollection::const_iterator hbheItr = Hithbhe.begin(); hbheItr != Hithbhe.end(); hbheItr++) { + HcalDetId hid = HcalDetId(hbheItr->detid()); + int id = hid.depth() - 1; + if ((id >= 0) && (id < maxDepth_)) + hiDistr2D_[id]->Fill(hid.ieta(), hid.iphi(), hbheItr->energy()); + } + } + + // Then HF RecHits + edm::Handle hfMB; + iEvent.getByToken(tok_hf_, hfMB); + if (!hfMB.isValid()) { + edm::LogWarning("DQMHcal") << "DQMHcalIterativePhiSymAlCaReco: Error! can't get HF RecHit Collection!"; + } else { + const HFRecHitCollection Hithf = *(hfMB.product()); + hiDistrHFsize1D_->Fill(Hithf.size()); + for (HFRecHitCollection::const_iterator hfItr = Hithf.begin(); hfItr != Hithf.end(); hfItr++) { + HcalDetId hid = HcalDetId(hfItr->detid()); + int id = hid.depth() - 1; + if ((id >= 0) && (id < maxDepth_)) + hiDistr2D_[id]->Fill(hid.ieta(), hid.iphi(), hfItr->energy()); + } + } + + // And finally HO RecHits + edm::Handle hoMB; + iEvent.getByToken(tok_ho_, hoMB); + if (!hoMB.isValid()) { + edm::LogWarning("DQMHcal") << "DQMHcalIterativePhiSymAlCaReco: Error! can't get HO RecHit Collection!"; + } else { + const HORecHitCollection Hitho = *(hoMB.product()); + hiDistrHOsize1D_->Fill(Hitho.size()); + for (HORecHitCollection::const_iterator hoItr = Hitho.begin(); hoItr != Hitho.end(); hoItr++) { + HcalDetId hid = HcalDetId(hoItr->detid()); + int id = hid.depth() - 1; + if ((id >= 0) && (id < maxDepth_)) + hiDistr2D_[id]->Fill(hid.ieta(), hid.iphi(), hoItr->energy()); + } + } + +} // analyze diff --git a/DQMOffline/Configuration/python/ALCARECOHcalCalDQMHI_cff.py b/DQMOffline/Configuration/python/ALCARECOHcalCalDQMHI_cff.py index 4f04d745fe3b8..7edf371123da2 100644 --- a/DQMOffline/Configuration/python/ALCARECOHcalCalDQMHI_cff.py +++ b/DQMOffline/Configuration/python/ALCARECOHcalCalDQMHI_cff.py @@ -1,6 +1,7 @@ import FWCore.ParameterSet.Config as cms import DQMOffline.CalibCalo.MonitorAlCaHcalPhisym_cfi +import DQMOffline.CalibCalo.MonitorAlCaHcalIterativePhisym_cfi import DQMOffline.CalibCalo.MonitorHcalDiJetsAlCaReco_cfi import DQMOffline.CalibCalo.MonitorHcalIsoTrackAlCaReco_cfi import DQMOffline.CalibCalo.MonitorHcalIsolatedBunchAlCaReco_cfi @@ -15,6 +16,8 @@ ALCARECOHcalCalPhisymDQM.hbheInputMB = "hbhereco" ALCARECOHcalCalPhisymDQM.hbheInputMB = "horeco" +ALCARECOHcalCalIterativePhisymDQM = DQMOffline.CalibCalo.MonitorAlCaHcalIterativePhisym_cfi.HcalIterativePhiSymMon.clone() + ALCARECOHcalCalDiJetsDQM = DQMOffline.CalibCalo.MonitorHcalDiJetsAlCaReco_cfi.MonitorHcalDiJetsAlCaReco.clone() ALCARECOHcalCalIsoTrackDQM = DQMOffline.CalibCalo.MonitorHcalIsoTrackAlCaReco_cfi.MonitorHcalIsoTrackAlCaReco.clone() diff --git a/DQMOffline/Configuration/python/ALCARECOHcalCalDQM_cff.py b/DQMOffline/Configuration/python/ALCARECOHcalCalDQM_cff.py index 5457b8f9bbd53..4035084f7500b 100644 --- a/DQMOffline/Configuration/python/ALCARECOHcalCalDQM_cff.py +++ b/DQMOffline/Configuration/python/ALCARECOHcalCalDQM_cff.py @@ -1,6 +1,7 @@ import FWCore.ParameterSet.Config as cms import DQMOffline.CalibCalo.MonitorAlCaHcalPhisym_cfi +import DQMOffline.CalibCalo.MonitorAlCaHcalIterativePhisym_cfi import DQMOffline.CalibCalo.MonitorHcalDiJetsAlCaReco_cfi import DQMOffline.CalibCalo.MonitorHcalIsoTrackAlCaReco_cfi import DQMOffline.CalibCalo.MonitorHcalIsolatedBunchAlCaReco_cfi @@ -12,6 +13,8 @@ ALCARECOHcalCalPhisymDQM = DQMOffline.CalibCalo.MonitorAlCaHcalPhisym_cfi.HcalPhiSymMon.clone() +ALCARECOHcalCalIterativePhisymDQM = DQMOffline.CalibCalo.MonitorAlCaHcalIterativePhisym_cfi.HcalIterativePhiSymMon.clone() + ALCARECOHcalCalDiJetsDQM = DQMOffline.CalibCalo.MonitorHcalDiJetsAlCaReco_cfi.MonitorHcalDiJetsAlCaReco.clone() ALCARECOHcalCalIsoTrackDQM = DQMOffline.CalibCalo.MonitorHcalIsoTrackAlCaReco_cfi.MonitorHcalIsoTrackAlCaReco.clone()