44 int recHitsEndjob(
const std::vector<MonitorElement*> &hcalMEs);
49 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity",0)) { }
73 std::vector<MonitorElement*> hgcalMEs;
74 std::vector<std::string> fullDirPath = ig.
getSubdirs();
76 for (
unsigned int i=0;
i<fullDirPath.size();
i++) {
81 std::vector<std::string> fullSubDirPath = ig.
getSubdirs();
83 for (
unsigned int j=0; j<fullSubDirPath.size(); j++) {
86 << fullSubDirPath.at(j);
88 if (strcmp(fullSubDirPath.at(j).c_str(), nameDirectory.c_str()) == 0) {
102 std::vector<MonitorElement*> energy_;
103 std::vector<MonitorElement*> EtaPhi_Plus_;
104 std::vector<MonitorElement*> EtaPhi_Minus_;
105 std::vector<MonitorElement*> HitOccupancy_Plus_;
106 std::vector<MonitorElement*> HitOccupancy_Minus_;
107 std::vector<MonitorElement*> MeanHitOccupancy_Plus_;
108 std::vector<MonitorElement*> MeanHitOccupancy_Minus_;
110 std::ostringstream
name;
114 for (
unsigned int ilayer = 0; ilayer <
layers_; ilayer++ ){
115 name.str(
""); name <<
"energy_layer_" << ilayer;
116 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
117 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0){
118 energy_.push_back(hgcalMEs[ih]);
123 nevent = energy_.at(ilayer)->getEntries();
124 nbinsx = energy_.at(ilayer)->getNbinsX();
125 for(
int i=1;
i <= nbinsx;
i++) {
126 double binValue = energy_.at(ilayer)->getBinContent(
i)/
nevent;
127 energy_.at(ilayer)->setBinContent(
i,binValue);
131 name.str(
""); name <<
"EtaPhi_Plus_" <<
"layer_" << ilayer;
132 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
133 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0){
134 EtaPhi_Plus_.push_back(hgcalMEs[ih]);
138 name.str(
""); name <<
"EtaPhi_Minus_" <<
"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 EtaPhi_Minus_.push_back(hgcalMEs[ih]);
146 nevent = EtaPhi_Plus_.at(ilayer)->getEntries();
147 nbinsx = EtaPhi_Plus_.at(ilayer)->getNbinsX();
148 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
149 for(
int i=1;
i<= nbinsx; ++
i) {
150 for(
int j=1; j<= nbinsy; ++j) {
151 double binValue = EtaPhi_Plus_.at(ilayer)->getBinContent(
i, j)/
nevent;
152 EtaPhi_Plus_.at(ilayer)->setBinContent(
i, j, binValue);
156 nevent = EtaPhi_Minus_.at(ilayer)->getEntries();
157 nbinsx = EtaPhi_Minus_.at(ilayer)->getNbinsX();
158 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
159 for(
int i=1;
i<= nbinsx; ++
i) {
160 for(
int j=1; j<= nbinsy; ++j) {
161 double binValue = EtaPhi_Minus_.at(ilayer)->getBinContent(
i, j)/
nevent;
162 EtaPhi_Minus_.at(ilayer)->setBinContent(
i, j, binValue);
167 name.str(
""); name <<
"HitOccupancy_Plus_layer_" << ilayer;
168 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
169 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0){
170 HitOccupancy_Plus_.push_back(hgcalMEs[ih]);
174 name.str(
""); name <<
"HitOccupancy_Minus_layer_" << ilayer;
175 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
176 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0){
177 HitOccupancy_Minus_.push_back(hgcalMEs[ih]);
182 nevent = HitOccupancy_Plus_.at(ilayer)->getEntries();
183 nbinsx = HitOccupancy_Plus_.at(ilayer)->getNbinsX();
184 for(
int i=1;
i<= nbinsx; ++
i) {
185 double binValue = HitOccupancy_Plus_.at(ilayer)->getBinContent(
i)/
nevent;
186 HitOccupancy_Plus_.at(ilayer)->setBinContent(
i, binValue);
189 nevent = HitOccupancy_Minus_.at(ilayer)->getEntries();
190 nbinsx = HitOccupancy_Minus_.at(ilayer)->getNbinsX();
191 for(
int i=1;
i<= nbinsx; ++
i) {
192 double binValue = HitOccupancy_Minus_.at(ilayer)->getBinContent(
i)/
nevent;
193 HitOccupancy_Minus_.at(ilayer)->setBinContent(
i, binValue);
198 name.str(
""); name <<
"SUMOfRecHitOccupancy_Plus";
199 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
200 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0){
201 MeanHitOccupancy_Plus_.push_back(hgcalMEs[ih]);
202 unsigned int indx = MeanHitOccupancy_Plus_.size()-1;
203 for (
int ilayer=0; ilayer < (
int)layers_; ++ilayer) {
204 double meanVal = HitOccupancy_Plus_.at(ilayer)->getMean();
205 MeanHitOccupancy_Plus_[indx]->setBinContent(ilayer+1, meanVal);
211 name.str(
""); name <<
"SUMOfRecHitOccupancy_Plus";
212 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
213 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0){
214 MeanHitOccupancy_Minus_.push_back(hgcalMEs[ih]);
215 unsigned indx = MeanHitOccupancy_Minus_.size()-1;
216 for (
int ilayer=0; ilayer < (
int)layers_; ++ilayer) {
217 double meanVal = HitOccupancy_Minus_.at(ilayer)->getMean();
218 MeanHitOccupancy_Minus_[indx]->setBinContent(ilayer+1, meanVal);
int recHitsEndjob(const std::vector< MonitorElement * > &hcalMEs)
void setCurrentFolder(std::string const &fullpath)
void dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig) override
std::string nameDetector_
#define DEFINE_FWK_MODULE(type)
unsigned int layers(bool reco) const
~HGCalRecHitsClient() override
HGCalRecHitsClient(const edm::ParameterSet &)
std::vector< MonitorElement * > getContents(Args &&...args)
TString getName(TString structure, int layer, TString geometry)
int getMaxDepth(const int &type) const
void beginRun(const edm::Run &run, const edm::EventSetup &c) override
virtual void runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
std::vector< std::string > getSubdirs()