Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run3-alca193 Add DQM for HcalIterativePhiSymAlCaReco #34784

Merged
merged 3 commits into from
Aug 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
62 changes: 62 additions & 0 deletions DQMOffline/CalibCalo/interface/DQMHcalIterativePhiSymAlCaReco.h
Original file line number Diff line number Diff line change
@@ -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 <string>

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<HBHERecHitCollection> tok_hbhe_;
edm::EDGetTokenT<HORecHitCollection> tok_ho_;
edm::EDGetTokenT<HFRecHitCollection> tok_hf_;
};

#endif
2 changes: 2 additions & 0 deletions DQMOffline/CalibCalo/plugins/SealModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
17 changes: 17 additions & 0 deletions DQMOffline/CalibCalo/python/MonitorAlCaHcalIterativePhisym_cfi.py
Original file line number Diff line number Diff line change
@@ -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
)
150 changes: 150 additions & 0 deletions DQMOffline/CalibCalo/src/DQMHcalIterativePhiSymAlCaReco.cc
Original file line number Diff line number Diff line change
@@ -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<std::string>("folderName");

// histogram parameters
tok_ho_ = consumes<HORecHitCollection>(ps.getParameter<edm::InputTag>("hoInput"));
tok_hf_ = consumes<HFRecHitCollection>(ps.getParameter<edm::InputTag>("hfInput"));
tok_hbhe_ = consumes<HBHERecHitCollection>(ps.getParameter<edm::InputTag>("hbheInput"));

// Distribution of rechits in iPhi, iEta
hiDistr_y_nbin_ = ps.getUntrackedParameter<int>("hiDistr_y_nbin", 72);
hiDistr_y_min_ = ps.getUntrackedParameter<double>("hiDistr_y_min", 0.5);
hiDistr_y_max_ = ps.getUntrackedParameter<double>("hiDistr_y_max", 72.5);
hiDistr_x_nbin_ = ps.getUntrackedParameter<int>("hiDistr_x_nbin", 83);
hiDistr_x_min_ = ps.getUntrackedParameter<double>("hiDistr_x_min", -41.5);
hiDistr_x_max_ = ps.getUntrackedParameter<double>("hiDistr_x_max", 41.5);
}

DQMHcalIterativePhiSymAlCaReco::~DQMHcalIterativePhiSymAlCaReco() {}

void DQMHcalIterativePhiSymAlCaReco::fillDescriptions(edm::ConfigurationDescriptions &descriptions) {
edm::ParameterSetDescription desc;
desc.add<std::string>("folderName", "ALCAStreamHcalIterativePhiSym");
desc.add<edm::InputTag>("hbheInput", edm::InputTag("hbhereco"));
desc.add<edm::InputTag>("hfInput", edm::InputTag("hfreco"));
desc.add<edm::InputTag>("hoInput", edm::InputTag("horeco"));
desc.addUntracked<int>("hiDistr_y_nbin", 72);
desc.addUntracked<double>("hiDistr_y_min", 0.5);
desc.addUntracked<double>("hiDistr_y_max", 72.5);
desc.addUntracked<int>("hiDistr_x_nbin", 83);
desc.addUntracked<double>("hiDistr_x_min", -41.5);
desc.addUntracked<double>("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<HBHERecHitCollection> 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<HFRecHitCollection> 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<HORecHitCollection> 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
3 changes: 3 additions & 0 deletions DQMOffline/Configuration/python/ALCARECOHcalCalDQMHI_cff.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions DQMOffline/Configuration/python/ALCARECOHcalCalDQM_cff.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()
Expand Down