33 int digisEndjob(
const std::vector<MonitorElement *> &hgcalMEs);
37 : nameDetector_(iConfig.getParameter<
std::
string>(
"DetectorName")),
38 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)),
53 std::vector<MonitorElement *> hgcalMEs;
54 std::vector<std::string> fullDirPath = ig.
getSubdirs();
56 for (
unsigned int i = 0;
i < fullDirPath.size();
i++) {
60 std::vector<std::string> fullSubDirPath = ig.
getSubdirs();
62 for (
unsigned int j = 0;
j < fullSubDirPath.size();
j++) {
66 if (strcmp(fullSubDirPath.at(
j).c_str(), nameDirectory.c_str()) == 0) {
69 edm::LogVerbatim(
"HGCalValidation") <<
"hgcalMES size : " << hgcalMEs.size();
78 std::vector<MonitorElement *> charge_;
79 std::vector<MonitorElement *> DigiOccupancy_XY_;
80 std::vector<MonitorElement *> ADC_;
81 std::vector<MonitorElement *> DigiOccupancy_Plus_;
82 std::vector<MonitorElement *> DigiOccupancy_Minus_;
83 std::vector<MonitorElement *> MeanDigiOccupancy_Plus_;
84 std::vector<MonitorElement *> MeanDigiOccupancy_Minus_;
85 std::ostringstream
name;
89 for (
int ilayer = 0; ilayer <
layers_; ilayer++) {
92 name <<
"charge_layer_" << ilayer;
93 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
94 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0)
95 charge_.push_back(hgcalMEs[ih]);
98 nevent = charge_.at(ilayer)->getEntries();
99 nbinsx = charge_.at(ilayer)->getNbinsX();
100 for (
int i = 1;
i <= nbinsx;
i++) {
101 double binValue = charge_.at(ilayer)->getBinContent(
i) /
nevent;
102 charge_.at(ilayer)->setBinContent(
i, binValue);
107 name <<
"DigiOccupancy_XY_" 108 <<
"layer_" << ilayer;
109 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
110 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0)
111 DigiOccupancy_XY_.push_back(hgcalMEs[ih]);
115 nevent = DigiOccupancy_XY_.at(ilayer)->getEntries();
116 nbinsx = DigiOccupancy_XY_.at(ilayer)->getNbinsX();
117 nbinsy = DigiOccupancy_XY_.at(ilayer)->getNbinsY();
118 for (
int i = 1;
i <= nbinsx; ++
i) {
119 for (
int j = 1;
j <= nbinsy; ++
j) {
120 double binValue = DigiOccupancy_XY_.at(ilayer)->getBinContent(
i,
j) /
nevent;
121 DigiOccupancy_XY_.at(ilayer)->setBinContent(
i,
j, binValue);
127 name <<
"ADC_layer_" << ilayer;
128 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
129 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0)
130 ADC_.push_back(hgcalMEs[ih]);
134 nevent = ADC_.at(ilayer)->getEntries();
135 nbinsx = ADC_.at(ilayer)->getNbinsX();
136 for (
int i = 1;
i <= nbinsx; ++
i) {
137 double binValue = ADC_.at(ilayer)->getBinContent(
i) /
nevent;
138 ADC_.at(ilayer)->setBinContent(
i, binValue);
143 name <<
"DigiOccupancy_Plus_layer_" << ilayer;
144 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
145 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
146 DigiOccupancy_Plus_.push_back(hgcalMEs[ih]);
151 name <<
"DigiOccupancy_Minus_layer_" << ilayer;
152 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
153 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
154 DigiOccupancy_Minus_.push_back(hgcalMEs[ih]);
159 nevent = DigiOccupancy_Plus_.at(ilayer)->getEntries();
160 nbinsx = DigiOccupancy_Plus_.at(ilayer)->getNbinsX();
161 for (
int i = 1;
i <= nbinsx; ++
i) {
162 double binValue = DigiOccupancy_Plus_.at(ilayer)->getBinContent(
i) /
nevent;
163 DigiOccupancy_Plus_.at(ilayer)->setBinContent(
i, binValue);
166 nevent = DigiOccupancy_Minus_.at(ilayer)->getEntries();
167 nbinsx = DigiOccupancy_Minus_.at(ilayer)->getNbinsX();
168 for (
int i = 1;
i <= nbinsx; ++
i) {
169 double binValue = DigiOccupancy_Minus_.at(ilayer)->getBinContent(
i) /
nevent;
170 DigiOccupancy_Minus_.at(ilayer)->setBinContent(
i, binValue);
176 name <<
"SUMOfDigiOccupancy_Plus";
177 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
178 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
179 MeanDigiOccupancy_Plus_.push_back(hgcalMEs[ih]);
180 unsigned indx = MeanDigiOccupancy_Plus_.size() - 1;
181 for (
int ilayer = 0; ilayer < (
int)
layers_; ++ilayer) {
182 double meanVal = DigiOccupancy_Plus_.at(ilayer)->getMean();
183 MeanDigiOccupancy_Plus_[indx]->setBinContent(ilayer + 1, meanVal);
190 name <<
"SUMOfDigiOccupancy_Plus";
191 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
192 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
193 MeanDigiOccupancy_Minus_.push_back(hgcalMEs[ih]);
194 unsigned indx = MeanDigiOccupancy_Minus_.size() - 1;
195 for (
int ilayer = 0; ilayer < (
int)
layers_; ++ilayer) {
196 double meanVal = DigiOccupancy_Minus_.at(ilayer)->getMean();
197 MeanDigiOccupancy_Minus_[indx]->setBinContent(ilayer + 1, meanVal);
Log< level::Info, true > LogVerbatim
virtual void setCurrentFolder(std::string const &fullpath)
#define DEFINE_FWK_MODULE(type)
void dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig) override
~HGCalDigiClient() override
unsigned int layers(bool reco) const
bool getData(T &iHolder) const
HGCalDigiClient(const edm::ParameterSet &)
void beginRun(const edm::Run &run, const edm::EventSetup &c) override
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > tok_hgcal_
TString getName(TString structure, int layer, TString geometry)
const std::string nameDetector_
void runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
int digisEndjob(const std::vector< MonitorElement *> &hgcalMEs)
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const