Skip to content

Commit

Permalink
Code check
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Mar 9, 2022
1 parent afbde5d commit ba7cfa2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Validation/HcalRecHits/interface/NoiseRates.h
Expand Up @@ -52,8 +52,8 @@ class NoiseRates : public DQMEDAnalyzer {

// parameters
const edm::InputTag rbxCollName_; // label for the rbx collection
const double minRBXEnergy_; // RBX energy threshold
const double minHitEnergy_; // RecHit energy threshold
const double minRBXEnergy_; // RBX energy threshold
const double minHitEnergy_; // RecHit energy threshold
const bool useAllHistos_;

const edm::EDGetTokenT<reco::HcalNoiseRBXCollection> tok_rbx_;
Expand Down
16 changes: 7 additions & 9 deletions Validation/HcalRecHits/src/HcalRecHitsValidation.cc
Expand Up @@ -22,7 +22,6 @@ HcalRecHitsValidation::HcalRecHitsValidation(edm::ParameterSet const &conf)
tok_ho_(consumes<HORecHitCollection>(conf.getUntrackedParameter<edm::InputTag>("HORecHitCollectionLabel"))),
tok_HRNDC_(esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord>()),
tok_Geom_(esConsumes<CaloGeometry, CaloGeometryRecord>()) {

// DQM ROOT output
if (!outputFile_.empty()) {
edm::LogInfo("OutputInfo") << " Hcal RecHit Task histograms will be saved to '" << outputFile_.c_str() << "'";
Expand All @@ -32,7 +31,6 @@ HcalRecHitsValidation::HcalRecHitsValidation(edm::ParameterSet const &conf)

nevtot = 0;


// Collections

// register for data access
Expand Down Expand Up @@ -221,7 +219,7 @@ void HcalRecHitsValidation::analyze(edm::Event const &ev, edm::EventSetup const
double partR = 0.3;

if (imc != 0) {
const edm::Handle<edm::HepMCProduct> & evtMC = ev.getHandle(tok_evt_); // generator in late 310_preX
const edm::Handle<edm::HepMCProduct> &evtMC = ev.getHandle(tok_evt_); // generator in late 310_preX
if (!evtMC.isValid()) {
edm::LogInfo("HcalRecHitsValidation") << "no HepMCProduct found";
} else {
Expand Down Expand Up @@ -265,7 +263,7 @@ void HcalRecHitsValidation::analyze(edm::Event const &ev, edm::EventSetup const

// ECAL
if (ecalselector_ == "yes" && (subdet_ == 1 || subdet_ == 2 || subdet_ == 5)) {
const edm::Handle<EBRecHitCollection> & rhitEB = ev.getHandle(tok_EB_);
const edm::Handle<EBRecHitCollection> &rhitEB = ev.getHandle(tok_EB_);

EcalRecHitCollection::const_iterator RecHit;
EcalRecHitCollection::const_iterator RecHitEnd;
Expand All @@ -292,7 +290,7 @@ void HcalRecHitsValidation::analyze(edm::Event const &ev, edm::EventSetup const
}
}

const edm::Handle<EERecHitCollection> & rhitEE = ev.getHandle(tok_EE_);
const edm::Handle<EERecHitCollection> &rhitEE = ev.getHandle(tok_EE_);

if (rhitEE.isValid()) {
RecHit = rhitEE.product()->begin();
Expand Down Expand Up @@ -427,7 +425,7 @@ void HcalRecHitsValidation::analyze(edm::Event const &ev, edm::EventSetup const
// SimHits vs. RecHits
if (subdet_ > 0 && subdet_ < 6 && imc != 0) { // not noise

const edm::Handle<PCaloHitContainer> & hcalHits = ev.getHandle(tok_hh_);
const edm::Handle<PCaloHitContainer> &hcalHits = ev.getHandle(tok_hh_);
if (hcalHits.isValid()) {
const PCaloHitContainer *SimHitResult = hcalHits.product();

Expand Down Expand Up @@ -532,7 +530,7 @@ void HcalRecHitsValidation::fillRecHitsTmp(int subdet_, edm::Event const &ev) {

if (subdet_ == 1 || subdet_ == 2 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
// HBHE
const edm::Handle<HBHERecHitCollection> & hbhecoll = ev.getHandle(tok_hbhe_);
const edm::Handle<HBHERecHitCollection> &hbhecoll = ev.getHandle(tok_hbhe_);
if (hbhecoll.isValid()) {
for (HBHERecHitCollection::const_iterator j = hbhecoll->begin(); j != hbhecoll->end(); j++) {
HcalDetId cell(j->id());
Expand Down Expand Up @@ -567,7 +565,7 @@ void HcalRecHitsValidation::fillRecHitsTmp(int subdet_, edm::Event const &ev) {

if (subdet_ == 4 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
// HF
const edm::Handle<HFRecHitCollection> & hfcoll = ev.getHandle(tok_hf_);
const edm::Handle<HFRecHitCollection> &hfcoll = ev.getHandle(tok_hf_);
if (hfcoll.isValid()) {
for (HFRecHitCollection::const_iterator j = hfcoll->begin(); j != hfcoll->end(); j++) {
HcalDetId cell(j->id());
Expand Down Expand Up @@ -601,7 +599,7 @@ void HcalRecHitsValidation::fillRecHitsTmp(int subdet_, edm::Event const &ev) {

// HO
if (subdet_ == 3 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
const edm::Handle<HORecHitCollection> & hocoll = ev.getHandle(tok_ho_);
const edm::Handle<HORecHitCollection> &hocoll = ev.getHandle(tok_ho_);
if (hocoll.isValid()) {
for (HORecHitCollection::const_iterator j = hocoll->begin(); j != hocoll->end(); j++) {
HcalDetId cell(j->id());
Expand Down
8 changes: 4 additions & 4 deletions Validation/HcalRecHits/src/NoiseRates.cc
Expand Up @@ -14,8 +14,8 @@
// constructors and destructor
//

NoiseRates::NoiseRates(const edm::ParameterSet &iConfig) :
outputFile_(iConfig.getUntrackedParameter<std::string>("outputFile", "myfile.root")),
NoiseRates::NoiseRates(const edm::ParameterSet &iConfig)
: outputFile_(iConfig.getUntrackedParameter<std::string>("outputFile", "myfile.root")),
rbxCollName_(iConfig.getUntrackedParameter<edm::InputTag>("rbxCollName")),
minRBXEnergy_(iConfig.getUntrackedParameter<double>("minRBXEnergy")),
minHitEnergy_(iConfig.getUntrackedParameter<double>("minHitEnergy")),
Expand Down Expand Up @@ -96,15 +96,15 @@ void NoiseRates::analyze(const edm::Event &iEvent, const edm::EventSetup &evSetu
lumiCountMap_[lumiSection]++;

// get the RBX Noise collection
const edm::Handle<reco::HcalNoiseRBXCollection> & handle = iEvent.getHandle(tok_rbx_);
const edm::Handle<reco::HcalNoiseRBXCollection> &handle = iEvent.getHandle(tok_rbx_);
if (!handle.isValid()) {
throw edm::Exception(edm::errors::ProductNotFound)
<< " could not find HcalNoiseRBXCollection named " << rbxCollName_ << ".\n";
return;
}

// get the Noise summary object
const edm::Handle<HcalNoiseSummary> & summary_h = iEvent.getHandle(noisetoken_);
const edm::Handle<HcalNoiseSummary> &summary_h = iEvent.getHandle(noisetoken_);
if (!summary_h.isValid()) {
throw edm::Exception(edm::errors::ProductNotFound) << " could not find HcalNoiseSummary.\n";
return;
Expand Down
14 changes: 7 additions & 7 deletions Validation/HcalRecHits/test/HcalDumpHits.cc
Expand Up @@ -79,7 +79,7 @@ void HcalDumpHits::beginRun(const edm::Run&, const edm::EventSetup& iSetup) { hc

void HcalDumpHits::analyze(const edm::Event& iEvent, const edm::EventSetup&) {
// first SimHits
const edm::Handle<edm::PCaloHitContainer> & theCaloHitContainer = iEvent.getHandle(simHitSource_);
const edm::Handle<edm::PCaloHitContainer>& theCaloHitContainer = iEvent.getHandle(simHitSource_);
if (theCaloHitContainer.isValid()) {
edm::LogVerbatim("HcalValidation") << theCaloHitContainer->size() << " SimHits in HCAL";
unsigned int k(0);
Expand All @@ -92,7 +92,7 @@ void HcalDumpHits::analyze(const edm::Event& iEvent, const edm::EventSetup&) {
}

// Digis (HBHE/HF/HO)
const edm::Handle<QIE11DigiCollection> & hbheDigiCollection = iEvent.getHandle(hbheDigiSource_);
const edm::Handle<QIE11DigiCollection>& hbheDigiCollection = iEvent.getHandle(hbheDigiSource_);
if (hbheDigiCollection.isValid()) {
edm::LogVerbatim("HcalValidation") << hbheDigiCollection->size() << " Digis for HB/HE";
unsigned int k(0);
Expand All @@ -107,7 +107,7 @@ void HcalDumpHits::analyze(const edm::Event& iEvent, const edm::EventSetup&) {
++k;
}
}
const edm::Handle<QIE10DigiCollection> & hfDigiCollection = iEvent.getHandle(hfDigiSource_);
const edm::Handle<QIE10DigiCollection>& hfDigiCollection = iEvent.getHandle(hfDigiSource_);
if (hfDigiCollection.isValid()) {
edm::LogVerbatim("HcalValidation") << hfDigiCollection->size() << " Digis for HF";
unsigned int k(0);
Expand All @@ -122,7 +122,7 @@ void HcalDumpHits::analyze(const edm::Event& iEvent, const edm::EventSetup&) {
++k;
}
}
const edm::Handle<HODigiCollection> & hoDigiCollection = iEvent.getHandle(hoDigiSource_);
const edm::Handle<HODigiCollection>& hoDigiCollection = iEvent.getHandle(hoDigiSource_);
if (hoDigiCollection.isValid()) {
edm::LogVerbatim("HcalValidation") << hoDigiCollection->size() << " Digis for HO";
unsigned int k(0);
Expand All @@ -138,7 +138,7 @@ void HcalDumpHits::analyze(const edm::Event& iEvent, const edm::EventSetup&) {
}

// RecHits (HBHE/HF/HO)
const edm::Handle<HBHERecHitCollection> & hbhecoll = iEvent.getHandle(hbheRecHitSource_);
const edm::Handle<HBHERecHitCollection>& hbhecoll = iEvent.getHandle(hbheRecHitSource_);
if (hbhecoll.isValid()) {
edm::LogVerbatim("HcalValidation") << hbhecoll->size() << " RecHits for HB/HE";
unsigned int k(0);
Expand All @@ -148,7 +148,7 @@ void HcalDumpHits::analyze(const edm::Event& iEvent, const edm::EventSetup&) {
++k;
}
}
const edm::Handle<HFRecHitCollection> & hfcoll = iEvent.getHandle(hfRecHitSource_);
const edm::Handle<HFRecHitCollection>& hfcoll = iEvent.getHandle(hfRecHitSource_);
if (hfcoll.isValid()) {
edm::LogVerbatim("HcalValidation") << hfcoll->size() << " RecHits for HF";
unsigned int k(0);
Expand All @@ -158,7 +158,7 @@ void HcalDumpHits::analyze(const edm::Event& iEvent, const edm::EventSetup&) {
++k;
}
}
const edm::Handle<HORecHitCollection> & hocoll = iEvent.getHandle(hoRecHitSource_);
const edm::Handle<HORecHitCollection>& hocoll = iEvent.getHandle(hoRecHitSource_);
if (hocoll.isValid()) {
edm::LogVerbatim("HcalValidation") << hocoll->size() << " RecHits for HO";
unsigned int k(0);
Expand Down

0 comments on commit ba7cfa2

Please sign in to comment.