46 std::vector<MonitorElement*> hgcalMEs;
47 std::vector<std::string> fullDirPath = ig.
getSubdirs();
49 for (
unsigned int i=0;
i<fullDirPath.size();
i++) {
51 edm::LogInfo(
"HGCalValidation") <<
"\nfullPath: " << fullDirPath.at(
i);
53 std::vector<std::string> fullSubDirPath = ig.
getSubdirs();
55 for (
unsigned int j=0;
j<fullSubDirPath.size();
j++) {
57 edm::LogInfo(
"HGCalValidation") <<
"fullSubPath: " << fullSubDirPath.at(
j);
59 if (strcmp(fullSubDirPath.at(
j).c_str(), nameDirectory.c_str()) == 0) {
62 edm::LogInfo(
"HGCalValidation") <<
"hgcalMES size : " << hgcalMEs.size();
64 edm::LogInfo(
"HGCalValidation") <<
"\nError in DigisEndjob!";
73 std::vector<MonitorElement*> charge_;
74 std::vector<MonitorElement*> DigiOccupancy_XY_;
75 std::vector<MonitorElement*> ADC_;
76 std::vector<MonitorElement*> DigiOccupancy_Plus_;
77 std::vector<MonitorElement*> DigiOccupancy_Minus_;
78 std::vector<MonitorElement*> MeanDigiOccupancy_Plus_;
79 std::vector<MonitorElement*> MeanDigiOccupancy_Minus_;
80 std::ostringstream
name;
84 for (
int ilayer = 0; ilayer <
layers_; ilayer++ ){
86 name.str(
""); name <<
"charge_layer_" << ilayer;
87 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
88 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0)
89 charge_.push_back(hgcalMEs[ih]);
92 nevent = charge_.at(ilayer)->getEntries();
93 nbinsx = charge_.at(ilayer)->getNbinsX();
94 for(
int i=1;
i <= nbinsx;
i++) {
95 double binValue = charge_.at(ilayer)->getBinContent(
i)/
nevent;
96 charge_.at(ilayer)->setBinContent(
i,binValue);
100 name.str(
""); name <<
"DigiOccupancy_XY_" <<
"layer_" << ilayer;
101 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
102 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0)
103 DigiOccupancy_XY_.push_back(hgcalMEs[ih]);
107 nevent = DigiOccupancy_XY_.at(ilayer)->getEntries();
108 nbinsx = DigiOccupancy_XY_.at(ilayer)->getNbinsX();
109 nbinsy = DigiOccupancy_XY_.at(ilayer)->getNbinsY();
110 for(
int i=1;
i<= nbinsx; ++
i) {
111 for(
int j=1;
j<= nbinsy; ++
j) {
112 double binValue = DigiOccupancy_XY_.at(ilayer)->getBinContent(
i,
j)/
nevent;
113 DigiOccupancy_XY_.at(ilayer)->setBinContent(
i,
j, binValue);
118 name.str(
""); name <<
"ADC_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 ADC_.push_back(hgcalMEs[ih]);
125 nevent = ADC_.at(ilayer)->getEntries();
126 nbinsx = ADC_.at(ilayer)->getNbinsX();
127 for(
int i=1;
i<= nbinsx; ++
i) {
128 double binValue = ADC_.at(ilayer)->getBinContent(
i)/
nevent;
129 ADC_.at(ilayer)->setBinContent(
i, binValue);
133 name.str(
""); name <<
"DigiOccupancy_Plus_layer_" << ilayer;
134 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
135 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
136 DigiOccupancy_Plus_.push_back(hgcalMEs[ih]);
140 name.str(
""); name <<
"DigiOccupancy_Minus_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 DigiOccupancy_Minus_.push_back(hgcalMEs[ih]);
148 nevent = DigiOccupancy_Plus_.at(ilayer)->getEntries();
149 nbinsx = DigiOccupancy_Plus_.at(ilayer)->getNbinsX();
150 for(
int i=1;
i<= nbinsx; ++
i) {
151 double binValue = DigiOccupancy_Plus_.at(ilayer)->getBinContent(
i)/
nevent;
152 DigiOccupancy_Plus_.at(ilayer)->setBinContent(
i, binValue);
155 nevent = DigiOccupancy_Minus_.at(ilayer)->getEntries();
156 nbinsx = DigiOccupancy_Minus_.at(ilayer)->getNbinsX();
157 for(
int i=1;
i<= nbinsx; ++
i) {
158 double binValue = DigiOccupancy_Minus_.at(ilayer)->getBinContent(
i)/
nevent;
159 DigiOccupancy_Minus_.at(ilayer)->setBinContent(
i, binValue);
164 name.str(
""); name <<
"SUMOfDigiOccupancy_Plus";
165 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
166 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0) {
167 MeanDigiOccupancy_Plus_.push_back(hgcalMEs[ih]);
168 unsigned indx = MeanDigiOccupancy_Plus_.size()-1;
169 for(
int ilayer=0; ilayer < (int)layers_; ++ilayer) {
170 double meanVal = DigiOccupancy_Plus_.at(ilayer)->getMean();
171 MeanDigiOccupancy_Plus_[indx]->setBinContent(ilayer+1, meanVal);
177 name.str(
""); 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_Minus_.push_back(hgcalMEs[ih]);
181 unsigned indx = MeanDigiOccupancy_Minus_.size()-1;
182 for(
int ilayer=0; ilayer < (int)layers_; ++ilayer) {
183 double meanVal = DigiOccupancy_Minus_.at(ilayer)->getMean();
184 MeanDigiOccupancy_Minus_[indx]->setBinContent(ilayer+1, meanVal);
std::vector< MonitorElement * > getContents(Args &&...args)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int digisEndjob(const std::vector< MonitorElement * > &hcalMEs)
virtual ~HGCalDigiClient()
#define DEFINE_FWK_MODULE(type)
int getMaxDepth(const int type) const
unsigned int layers(bool reco) const
void dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
HGCalDigiClient(const edm::ParameterSet &)
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
void runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
std::vector< std::string > getSubdirs(void)
void setCurrentFolder(const std::string &fullpath)
std::string nameDetector_