36 int digisEndjob(
const std::vector<MonitorElement *> &hcalMEs);
41 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)) {}
63 std::vector<MonitorElement *> hgcalMEs;
64 std::vector<std::string> fullDirPath = ig.
getSubdirs();
66 for (
unsigned int i = 0;
i < fullDirPath.size();
i++) {
70 std::vector<std::string> fullSubDirPath = ig.
getSubdirs();
72 for (
unsigned int j = 0;
j < fullSubDirPath.size();
j++) {
76 if (strcmp(fullSubDirPath.at(
j).c_str(), nameDirectory.c_str()) == 0) {
79 edm::LogVerbatim(
"HGCalValidation") <<
"hgcalMES size : " << hgcalMEs.size();
88 std::vector<MonitorElement *> charge_;
89 std::vector<MonitorElement *> DigiOccupancy_XY_;
90 std::vector<MonitorElement *> ADC_;
91 std::vector<MonitorElement *> DigiOccupancy_Plus_;
92 std::vector<MonitorElement *> DigiOccupancy_Minus_;
93 std::vector<MonitorElement *> MeanDigiOccupancy_Plus_;
94 std::vector<MonitorElement *> MeanDigiOccupancy_Minus_;
95 std::ostringstream
name;
99 for (
int ilayer = 0; ilayer <
layers_; ilayer++) {
102 name <<
"charge_layer_" << ilayer;
103 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
104 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0)
105 charge_.push_back(hgcalMEs[ih]);
108 nevent = charge_.at(ilayer)->getEntries();
109 nbinsx = charge_.at(ilayer)->getNbinsX();
110 for (
int i = 1;
i <= nbinsx;
i++) {
111 double binValue = charge_.at(ilayer)->getBinContent(
i) /
nevent;
112 charge_.at(ilayer)->setBinContent(
i, binValue);
117 name <<
"DigiOccupancy_XY_" 118 <<
"layer_" << ilayer;
119 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
120 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0)
121 DigiOccupancy_XY_.push_back(hgcalMEs[ih]);
125 nevent = DigiOccupancy_XY_.at(ilayer)->getEntries();
126 nbinsx = DigiOccupancy_XY_.at(ilayer)->getNbinsX();
127 nbinsy = DigiOccupancy_XY_.at(ilayer)->getNbinsY();
128 for (
int i = 1;
i <= nbinsx; ++
i) {
129 for (
int j = 1;
j <= nbinsy; ++
j) {
130 double binValue = DigiOccupancy_XY_.at(ilayer)->getBinContent(
i,
j) /
nevent;
131 DigiOccupancy_XY_.at(ilayer)->setBinContent(
i,
j, binValue);
137 name <<
"ADC_layer_" << ilayer;
138 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
139 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0)
140 ADC_.push_back(hgcalMEs[ih]);
144 nevent = ADC_.at(ilayer)->getEntries();
145 nbinsx = ADC_.at(ilayer)->getNbinsX();
146 for (
int i = 1;
i <= nbinsx; ++
i) {
147 double binValue = ADC_.at(ilayer)->getBinContent(
i) /
nevent;
148 ADC_.at(ilayer)->setBinContent(
i, binValue);
153 name <<
"DigiOccupancy_Plus_layer_" << ilayer;
154 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
155 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
156 DigiOccupancy_Plus_.push_back(hgcalMEs[ih]);
161 name <<
"DigiOccupancy_Minus_layer_" << ilayer;
162 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
163 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
164 DigiOccupancy_Minus_.push_back(hgcalMEs[ih]);
169 nevent = DigiOccupancy_Plus_.at(ilayer)->getEntries();
170 nbinsx = DigiOccupancy_Plus_.at(ilayer)->getNbinsX();
171 for (
int i = 1;
i <= nbinsx; ++
i) {
172 double binValue = DigiOccupancy_Plus_.at(ilayer)->getBinContent(
i) /
nevent;
173 DigiOccupancy_Plus_.at(ilayer)->setBinContent(
i, binValue);
176 nevent = DigiOccupancy_Minus_.at(ilayer)->getEntries();
177 nbinsx = DigiOccupancy_Minus_.at(ilayer)->getNbinsX();
178 for (
int i = 1;
i <= nbinsx; ++
i) {
179 double binValue = DigiOccupancy_Minus_.at(ilayer)->getBinContent(
i) /
nevent;
180 DigiOccupancy_Minus_.at(ilayer)->setBinContent(
i, binValue);
186 name <<
"SUMOfDigiOccupancy_Plus";
187 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
188 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
189 MeanDigiOccupancy_Plus_.push_back(hgcalMEs[ih]);
190 unsigned indx = MeanDigiOccupancy_Plus_.size() - 1;
191 for (
int ilayer = 0; ilayer < (
int)layers_; ++ilayer) {
192 double meanVal = DigiOccupancy_Plus_.at(ilayer)->getMean();
193 MeanDigiOccupancy_Plus_[indx]->setBinContent(ilayer + 1, meanVal);
200 name <<
"SUMOfDigiOccupancy_Plus";
201 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
202 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
203 MeanDigiOccupancy_Minus_.push_back(hgcalMEs[ih]);
204 unsigned indx = MeanDigiOccupancy_Minus_.size() - 1;
205 for (
int ilayer = 0; ilayer < (
int)layers_; ++ilayer) {
206 double meanVal = DigiOccupancy_Minus_.at(ilayer)->getMean();
207 MeanDigiOccupancy_Minus_[indx]->setBinContent(ilayer + 1, meanVal);
int digisEndjob(const std::vector< MonitorElement * > &hcalMEs)
std::vector< MonitorElement * > getContents(Args &&...args)
void dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig) override
~HGCalDigiClient() override
#define DEFINE_FWK_MODULE(type)
unsigned int layers(bool reco) const
HGCalDigiClient(const edm::ParameterSet &)
void beginRun(const edm::Run &run, const edm::EventSetup &c) override
TString getName(TString structure, int layer, TString geometry)
int getMaxDepth(const int &type) const
void runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
std::string nameDetector_
void setCurrentFolder(std::string const &fullpath)
std::vector< std::string > getSubdirs()