47 std::vector<MonitorElement*> hgcalMEs;
48 std::vector<std::string> fullDirPath = ig.
getSubdirs();
50 for (
unsigned int i=0;
i<fullDirPath.size();
i++) {
52 edm::LogInfo(
"HGCalValidation") <<
"\nfullPath: " << fullDirPath.at(
i);
54 std::vector<std::string> fullSubDirPath = ig.
getSubdirs();
56 for (
unsigned int j=0;
j<fullSubDirPath.size();
j++) {
58 edm::LogInfo(
"HGCalValidation") <<
"fullSubPath: " << fullSubDirPath.at(
j);
60 if (strcmp(fullSubDirPath.at(
j).c_str(), nameDirectory.c_str()) == 0) {
63 edm::LogInfo(
"HGCalValidation") <<
"hgcalMES size : " << hgcalMEs.size();
73 std::vector<MonitorElement*> energy_;
74 std::vector<MonitorElement*> EtaPhi_Plus_;
75 std::vector<MonitorElement*> EtaPhi_Minus_;
76 std::vector<MonitorElement*> HitOccupancy_Plus_;
77 std::vector<MonitorElement*> HitOccupancy_Minus_;
78 std::vector<MonitorElement*> MeanHitOccupancy_Plus_;
79 std::vector<MonitorElement*> MeanHitOccupancy_Minus_;
81 std::ostringstream
name;
85 for (
unsigned int ilayer = 0; ilayer <
layers_; ilayer++ ){
86 name.str(
""); name <<
"energy_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 energy_.push_back(hgcalMEs[ih]);
94 nevent = energy_.at(ilayer)->getEntries();
95 nbinsx = energy_.at(ilayer)->getNbinsX();
96 for(
int i=1;
i <= nbinsx;
i++) {
97 double binValue = energy_.at(ilayer)->getBinContent(
i)/
nevent;
98 energy_.at(ilayer)->setBinContent(
i,binValue);
102 name.str(
""); name <<
"EtaPhi_Plus_" <<
"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 EtaPhi_Plus_.push_back(hgcalMEs[ih]);
109 name.str(
""); name <<
"EtaPhi_Minus_" <<
"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 EtaPhi_Minus_.push_back(hgcalMEs[ih]);
117 nevent = EtaPhi_Plus_.at(ilayer)->getEntries();
118 nbinsx = EtaPhi_Plus_.at(ilayer)->getNbinsX();
119 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
120 for(
int i=1;
i<= nbinsx; ++
i) {
121 for(
int j=1;
j<= nbinsy; ++
j) {
122 double binValue = EtaPhi_Plus_.at(ilayer)->getBinContent(
i,
j)/
nevent;
123 EtaPhi_Plus_.at(ilayer)->setBinContent(
i,
j, binValue);
127 nevent = EtaPhi_Minus_.at(ilayer)->getEntries();
128 nbinsx = EtaPhi_Minus_.at(ilayer)->getNbinsX();
129 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
130 for(
int i=1;
i<= nbinsx; ++
i) {
131 for(
int j=1;
j<= nbinsy; ++
j) {
132 double binValue = EtaPhi_Minus_.at(ilayer)->getBinContent(
i,
j)/
nevent;
133 EtaPhi_Minus_.at(ilayer)->setBinContent(
i,
j, binValue);
138 name.str(
""); name <<
"HitOccupancy_Plus_layer_" << ilayer;
139 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
140 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
141 HitOccupancy_Plus_.push_back(hgcalMEs[ih]);
145 name.str(
""); name <<
"HitOccupancy_Minus_layer_" << ilayer;
146 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
147 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
148 HitOccupancy_Minus_.push_back(hgcalMEs[ih]);
153 nevent = HitOccupancy_Plus_.at(ilayer)->getEntries();
154 nbinsx = HitOccupancy_Plus_.at(ilayer)->getNbinsX();
155 for(
int i=1;
i<= nbinsx; ++
i) {
156 double binValue = HitOccupancy_Plus_.at(ilayer)->getBinContent(
i)/
nevent;
157 HitOccupancy_Plus_.at(ilayer)->setBinContent(
i, binValue);
160 nevent = HitOccupancy_Minus_.at(ilayer)->getEntries();
161 nbinsx = HitOccupancy_Minus_.at(ilayer)->getNbinsX();
162 for(
int i=1;
i<= nbinsx; ++
i) {
163 double binValue = HitOccupancy_Minus_.at(ilayer)->getBinContent(
i)/
nevent;
164 HitOccupancy_Minus_.at(ilayer)->setBinContent(
i, binValue);
169 name.str(
""); name <<
"SUMOfRecHitOccupancy_Plus";
170 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
171 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
172 MeanHitOccupancy_Plus_.push_back(hgcalMEs[ih]);
173 unsigned int indx = MeanHitOccupancy_Plus_.size()-1;
174 for (
int ilayer=0; ilayer < (
int)layers_; ++ilayer) {
175 double meanVal = HitOccupancy_Plus_.at(ilayer)->getMean();
176 MeanHitOccupancy_Plus_[indx]->setBinContent(ilayer+1, meanVal);
182 name.str(
""); name <<
"SUMOfRecHitOccupancy_Plus";
183 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
184 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
185 MeanHitOccupancy_Minus_.push_back(hgcalMEs[ih]);
186 unsigned indx = MeanHitOccupancy_Minus_.size()-1;
187 for (
int ilayer=0; ilayer < (
int)layers_; ++ilayer) {
188 double meanVal = HitOccupancy_Minus_.at(ilayer)->getMean();
189 MeanHitOccupancy_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 recHitsEndjob(const std::vector< MonitorElement * > &hcalMEs)
void dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
virtual ~HGCalRecHitsClient()
#define DEFINE_FWK_MODULE(type)
std::string nameDetector_
int getMaxDepth(const int type) const
unsigned int layers(bool reco) const
HGCalRecHitsClient(const edm::ParameterSet &)
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
virtual void runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
std::vector< std::string > getSubdirs(void)
void setCurrentFolder(const std::string &fullpath)