39 int digisEndjob(
const std::vector<MonitorElement*> &hcalMEs);
44 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity",0)) { }
69 std::vector<MonitorElement*> hgcalMEs;
70 std::vector<std::string> fullDirPath = ig.
getSubdirs();
72 for (
unsigned int i=0;
i<fullDirPath.size();
i++) {
76 std::vector<std::string> fullSubDirPath = ig.
getSubdirs();
78 for (
unsigned int j=0; j<fullSubDirPath.size(); j++) {
80 edm::LogVerbatim(
"HGCalValidation") <<
"fullSubPath: " << fullSubDirPath.at(j);
82 if (strcmp(fullSubDirPath.at(j).c_str(), nameDirectory.c_str()) == 0) {
85 edm::LogVerbatim(
"HGCalValidation") <<
"hgcalMES size : " << hgcalMEs.size();
95 std::vector<MonitorElement*> charge_;
96 std::vector<MonitorElement*> DigiOccupancy_XY_;
97 std::vector<MonitorElement*> ADC_;
98 std::vector<MonitorElement*> DigiOccupancy_Plus_;
99 std::vector<MonitorElement*> DigiOccupancy_Minus_;
100 std::vector<MonitorElement*> MeanDigiOccupancy_Plus_;
101 std::vector<MonitorElement*> MeanDigiOccupancy_Minus_;
102 std::ostringstream
name;
106 for (
int ilayer = 0; ilayer <
layers_; ilayer++ ){
108 name.str(
""); name <<
"charge_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 charge_.push_back(hgcalMEs[ih]);
114 nevent = charge_.at(ilayer)->getEntries();
115 nbinsx = charge_.at(ilayer)->getNbinsX();
116 for(
int i=1;
i <= nbinsx;
i++) {
117 double binValue = charge_.at(ilayer)->getBinContent(
i)/
nevent;
118 charge_.at(ilayer)->setBinContent(
i,binValue);
122 name.str(
""); name <<
"DigiOccupancy_XY_" <<
"layer_" << ilayer;
123 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
124 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0)
125 DigiOccupancy_XY_.push_back(hgcalMEs[ih]);
129 nevent = DigiOccupancy_XY_.at(ilayer)->getEntries();
130 nbinsx = DigiOccupancy_XY_.at(ilayer)->getNbinsX();
131 nbinsy = DigiOccupancy_XY_.at(ilayer)->getNbinsY();
132 for(
int i=1;
i<= nbinsx; ++
i) {
133 for(
int j=1; j<= nbinsy; ++j) {
134 double binValue = DigiOccupancy_XY_.at(ilayer)->getBinContent(
i, j)/
nevent;
135 DigiOccupancy_XY_.at(ilayer)->setBinContent(
i, j, binValue);
140 name.str(
""); name <<
"ADC_layer_" << ilayer;
141 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
142 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0)
143 ADC_.push_back(hgcalMEs[ih]);
147 nevent = ADC_.at(ilayer)->getEntries();
148 nbinsx = ADC_.at(ilayer)->getNbinsX();
149 for(
int i=1;
i<= nbinsx; ++
i) {
150 double binValue = ADC_.at(ilayer)->getBinContent(
i)/
nevent;
151 ADC_.at(ilayer)->setBinContent(
i, binValue);
155 name.str(
""); name <<
"DigiOccupancy_Plus_layer_" << ilayer;
156 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
157 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
158 DigiOccupancy_Plus_.push_back(hgcalMEs[ih]);
162 name.str(
""); name <<
"DigiOccupancy_Minus_layer_" << ilayer;
163 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
164 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
165 DigiOccupancy_Minus_.push_back(hgcalMEs[ih]);
170 nevent = DigiOccupancy_Plus_.at(ilayer)->getEntries();
171 nbinsx = DigiOccupancy_Plus_.at(ilayer)->getNbinsX();
172 for(
int i=1;
i<= nbinsx; ++
i) {
173 double binValue = DigiOccupancy_Plus_.at(ilayer)->getBinContent(
i)/
nevent;
174 DigiOccupancy_Plus_.at(ilayer)->setBinContent(
i, binValue);
177 nevent = DigiOccupancy_Minus_.at(ilayer)->getEntries();
178 nbinsx = DigiOccupancy_Minus_.at(ilayer)->getNbinsX();
179 for(
int i=1;
i<= nbinsx; ++
i) {
180 double binValue = DigiOccupancy_Minus_.at(ilayer)->getBinContent(
i)/
nevent;
181 DigiOccupancy_Minus_.at(ilayer)->setBinContent(
i, binValue);
186 name.str(
""); 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);
199 name.str(
""); name <<
"SUMOfDigiOccupancy_Plus";
200 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
201 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
202 MeanDigiOccupancy_Minus_.push_back(hgcalMEs[ih]);
203 unsigned indx = MeanDigiOccupancy_Minus_.size()-1;
204 for(
int ilayer=0; ilayer < (
int)layers_; ++ilayer) {
205 double meanVal = DigiOccupancy_Minus_.at(ilayer)->getMean();
206 MeanDigiOccupancy_Minus_[indx]->setBinContent(ilayer+1, meanVal);
std::vector< MonitorElement * > getContents(Args &&...args)
int digisEndjob(const std::vector< MonitorElement * > &hcalMEs)
#define DEFINE_FWK_MODULE(type)
void dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig) override
~HGCalDigiClient() override
unsigned int layers(bool reco) const
HGCalDigiClient(const edm::ParameterSet &)
void beginRun(const edm::Run &run, const edm::EventSetup &c) override
int getMaxDepth(const int &type) const
void runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
void setCurrentFolder(const std::string &fullpath)
std::vector< std::string > getSubdirs()
std::string nameDetector_