34 int digisEndjob(
const std::vector<MonitorElement *> &hgcalMEs);
38 : nameDetector_(iConfig.getParameter<std::
string>(
"DetectorName")),
39 verbosity_(iConfig.getUntrackedParameter<int>(
"Verbosity", 0)),
54 std::vector<MonitorElement *> hgcalMEs;
55 std::vector<std::string> fullDirPath = ig.
getSubdirs();
57 for (
unsigned int i = 0;
i < fullDirPath.size();
i++) {
61 std::vector<std::string> fullSubDirPath = ig.
getSubdirs();
63 for (
unsigned int j = 0;
j < fullSubDirPath.size();
j++) {
67 if (strcmp(fullSubDirPath.at(
j).c_str(), nameDirectory.c_str()) == 0) {
70 edm::LogVerbatim(
"HGCalValidation") <<
"hgcalMES size : " << hgcalMEs.size();
79 std::vector<MonitorElement *> charge_;
80 std::vector<MonitorElement *> DigiOccupancy_XY_;
81 std::vector<MonitorElement *> ADC_;
82 std::vector<MonitorElement *> DigiOccupancy_Plus_;
83 std::vector<MonitorElement *> DigiOccupancy_Minus_;
84 std::vector<MonitorElement *> MeanDigiOccupancy_Plus_;
85 std::vector<MonitorElement *> MeanDigiOccupancy_Minus_;
86 std::ostringstream
name;
90 for (
int ilayer = 0; ilayer <
layers_; ilayer++) {
93 name <<
"charge_layer_" << ilayer;
94 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
95 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0)
96 charge_.push_back(hgcalMEs[ih]);
99 nevent = charge_.at(ilayer)->getEntries();
100 nbinsx = charge_.at(ilayer)->getNbinsX();
101 for (
int i = 1;
i <= nbinsx;
i++) {
102 double binValue = charge_.at(ilayer)->getBinContent(
i) /
nevent;
103 charge_.at(ilayer)->setBinContent(
i, binValue);
108 name <<
"DigiOccupancy_XY_"
109 <<
"layer_" << ilayer;
110 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
111 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0)
112 DigiOccupancy_XY_.push_back(hgcalMEs[ih]);
116 nevent = DigiOccupancy_XY_.at(ilayer)->getEntries();
117 nbinsx = DigiOccupancy_XY_.at(ilayer)->getNbinsX();
118 nbinsy = DigiOccupancy_XY_.at(ilayer)->getNbinsY();
119 for (
int i = 1;
i <= nbinsx; ++
i) {
120 for (
int j = 1;
j <= nbinsy; ++
j) {
121 double binValue = DigiOccupancy_XY_.at(ilayer)->getBinContent(
i,
j) /
nevent;
122 DigiOccupancy_XY_.at(ilayer)->setBinContent(
i,
j, binValue);
128 name <<
"ADC_layer_" << ilayer;
129 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
130 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0)
131 ADC_.push_back(hgcalMEs[ih]);
135 nevent = ADC_.at(ilayer)->getEntries();
136 nbinsx = ADC_.at(ilayer)->getNbinsX();
137 for (
int i = 1;
i <= nbinsx; ++
i) {
138 double binValue = ADC_.at(ilayer)->getBinContent(
i) /
nevent;
139 ADC_.at(ilayer)->setBinContent(
i, binValue);
144 name <<
"DigiOccupancy_Plus_layer_" << ilayer;
145 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
146 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
147 DigiOccupancy_Plus_.push_back(hgcalMEs[ih]);
152 name <<
"DigiOccupancy_Minus_layer_" << ilayer;
153 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
154 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
155 DigiOccupancy_Minus_.push_back(hgcalMEs[ih]);
160 nevent = DigiOccupancy_Plus_.at(ilayer)->getEntries();
161 nbinsx = DigiOccupancy_Plus_.at(ilayer)->getNbinsX();
162 for (
int i = 1;
i <= nbinsx; ++
i) {
163 double binValue = DigiOccupancy_Plus_.at(ilayer)->getBinContent(
i) /
nevent;
164 DigiOccupancy_Plus_.at(ilayer)->setBinContent(
i, binValue);
167 nevent = DigiOccupancy_Minus_.at(ilayer)->getEntries();
168 nbinsx = DigiOccupancy_Minus_.at(ilayer)->getNbinsX();
169 for (
int i = 1;
i <= nbinsx; ++
i) {
170 double binValue = DigiOccupancy_Minus_.at(ilayer)->getBinContent(
i) /
nevent;
171 DigiOccupancy_Minus_.at(ilayer)->setBinContent(
i, binValue);
177 name <<
"SUMOfDigiOccupancy_Plus";
178 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
179 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
180 MeanDigiOccupancy_Plus_.push_back(hgcalMEs[ih]);
181 unsigned indx = MeanDigiOccupancy_Plus_.size() - 1;
182 for (
int ilayer = 0; ilayer < (int)layers_; ++ilayer) {
183 double meanVal = DigiOccupancy_Plus_.at(ilayer)->getMean();
184 MeanDigiOccupancy_Plus_[indx]->setBinContent(ilayer + 1, meanVal);
191 name <<
"SUMOfDigiOccupancy_Plus";
192 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
193 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
194 MeanDigiOccupancy_Minus_.push_back(hgcalMEs[ih]);
195 unsigned indx = MeanDigiOccupancy_Minus_.size() - 1;
196 for (
int ilayer = 0; ilayer < (int)layers_; ++ilayer) {
197 double meanVal = DigiOccupancy_Minus_.at(ilayer)->getMean();
198 MeanDigiOccupancy_Minus_[indx]->setBinContent(ilayer + 1, meanVal);
Log< level::Info, true > LogVerbatim
const edm::EventSetup & c
virtual void setCurrentFolder(std::string const &fullpath)
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
#define DEFINE_FWK_MODULE(type)
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
int digisEndjob(const std::vector< MonitorElement * > &hgcalMEs)
void dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig) override
~HGCalDigiClient() override
bool getData(T &iHolder) const
unsigned int layers(bool reco) 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)