Skip to content

Commit

Permalink
Clean up all the validation classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Dec 15, 2017
1 parent 6136d62 commit b3ae72e
Show file tree
Hide file tree
Showing 42 changed files with 747 additions and 1,127 deletions.
5 changes: 0 additions & 5 deletions Validation/HGCalValidation/plugins/HGCGeometryValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ HGCGeometryValidation::HGCGeometryValidation(const edm::ParameterSet &cfg) : hco
HGCGeometryValidation::~HGCGeometryValidation() { }

void HGCGeometryValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
//The following says we do not know what parameters are allowed so do no validation
// Please change this to state exactly what you do use, even if it is no parameters
edm::ParameterSetDescription desc;
desc.setUnknown();
descriptions.addDefault(desc);
Expand Down Expand Up @@ -336,6 +334,3 @@ DEFINE_FWK_MODULE(HGCGeometryValidation);






48 changes: 35 additions & 13 deletions Validation/HGCalValidation/plugins/HGCalDigiClient.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#include "Validation/HGCalValidation/plugins/HGCalDigiClient.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <unistd.h>

#include "FWCore/Framework/interface/Run.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"

#include "DQMServices/Core/interface/DQMEDHarvester.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "DetectorDescription/Core/interface/DDCompactView.h"
Expand All @@ -12,13 +21,27 @@
#include "Geometry/Records/interface/HcalRecNumberingRecord.h"
#include "Geometry/Records/interface/IdealGeometryRecord.h"

HGCalDigiClient::HGCalDigiClient(const edm::ParameterSet& iConfig) {

nameDetector_ = iConfig.getParameter<std::string>("DetectorName");
verbosity_ = iConfig.getUntrackedParameter<int>("Verbosity",0);
}
class HGCalDigiClient : public DQMEDHarvester {

private:
std::string nameDetector_;
int verbosity_;
int layers_;

public:
explicit HGCalDigiClient(const edm::ParameterSet&);
~HGCalDigiClient() override { }

HGCalDigiClient::~HGCalDigiClient() { }
void beginRun(const edm::Run& run, const edm::EventSetup& c) override;
void dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig) override;
void runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig);
int digisEndjob(const std::vector<MonitorElement*> &hcalMEs);
};

HGCalDigiClient::HGCalDigiClient(const edm::ParameterSet& iConfig) :
nameDetector_(iConfig.getParameter<std::string>("DetectorName")),
verbosity_(iConfig.getUntrackedParameter<int>("Verbosity",0)) { }

void HGCalDigiClient::beginRun(const edm::Run& run, const edm::EventSetup& iSetup) {

Expand All @@ -42,29 +65,28 @@ void HGCalDigiClient::dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig) {
void HGCalDigiClient::runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig) {

ig.setCurrentFolder("/");
if (verbosity_) edm::LogInfo("HGCalValidation") << "\nrunClient";
if (verbosity_) edm::LogVerbatim("HGCalValidation") << "\nrunClient";
std::vector<MonitorElement*> hgcalMEs;
std::vector<std::string> fullDirPath = ig.getSubdirs();

for (unsigned int i=0; i<fullDirPath.size(); i++) {
if (verbosity_)
edm::LogInfo("HGCalValidation") << "\nfullPath: " << fullDirPath.at(i);
edm::LogVerbatim("HGCalValidation") << "\nfullPath: " << fullDirPath.at(i);
ig.setCurrentFolder(fullDirPath.at(i));
std::vector<std::string> fullSubDirPath = ig.getSubdirs();

for (unsigned int j=0; j<fullSubDirPath.size(); j++) {
if (verbosity_)
edm::LogInfo("HGCalValidation") << "fullSubPath: " << fullSubDirPath.at(j);
edm::LogVerbatim("HGCalValidation") << "fullSubPath: " << fullSubDirPath.at(j);
std::string nameDirectory = "HGCalDigiV/"+nameDetector_;
if (strcmp(fullSubDirPath.at(j).c_str(), nameDirectory.c_str()) == 0) {
hgcalMEs = ig.getContents(fullSubDirPath.at(j));
if (verbosity_)
edm::LogInfo("HGCalValidation") << "hgcalMES size : " << hgcalMEs.size();
edm::LogVerbatim("HGCalValidation") << "hgcalMES size : " << hgcalMEs.size();
if (!digisEndjob(hgcalMEs))
edm::LogInfo("HGCalValidation") << "\nError in DigisEndjob!";
edm::LogVerbatim("HGCalValidation") << "\nError in DigisEndjob!";
}
}

}
}

Expand All @@ -79,7 +101,7 @@ int HGCalDigiClient::digisEndjob(const std::vector<MonitorElement*>& hgcalMEs) {
std::vector<MonitorElement*> MeanDigiOccupancy_Minus_;
std::ostringstream name;
double nevent;
int nbinsx, nbinsy;
int nbinsx, nbinsy;

for (int ilayer = 0; ilayer < layers_; ilayer++ ){
//charge
Expand Down
48 changes: 0 additions & 48 deletions Validation/HGCalValidation/plugins/HGCalDigiClient.h

This file was deleted.

0 comments on commit b3ae72e

Please sign in to comment.