39 int recHitsEndjob(
const std::vector<MonitorElement *> &hgcalMEs);
43 : nameDetector_(iConfig.getParameter<std::
string>(
"DetectorName")),
44 verbosity_(iConfig.getUntrackedParameter<int>(
"Verbosity", 0)),
59 std::vector<MonitorElement *> hgcalMEs;
60 std::vector<std::string> fullDirPath = ig.
getSubdirs();
62 for (
unsigned int i = 0;
i < fullDirPath.size();
i++) {
66 std::vector<std::string> fullSubDirPath = ig.
getSubdirs();
68 for (
unsigned int j = 0;
j < fullSubDirPath.size();
j++) {
72 if (strcmp(fullSubDirPath.at(
j).c_str(), nameDirectory.c_str()) == 0) {
75 edm::LogVerbatim(
"HGCalValidation") <<
"hgcalMES size : " << hgcalMEs.size();
84 std::vector<MonitorElement *> energy_;
85 std::vector<MonitorElement *> EtaPhi_Plus_;
86 std::vector<MonitorElement *> EtaPhi_Minus_;
87 std::vector<MonitorElement *> HitOccupancy_Plus_;
88 std::vector<MonitorElement *> HitOccupancy_Minus_;
89 std::vector<MonitorElement *> MeanHitOccupancy_Plus_;
90 std::vector<MonitorElement *> MeanHitOccupancy_Minus_;
92 std::ostringstream
name;
96 for (
unsigned int ilayer = 0; ilayer <
layers_; ilayer++) {
98 name <<
"energy_layer_" << ilayer;
99 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
100 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
101 energy_.push_back(hgcalMEs[ih]);
106 nevent = energy_.at(ilayer)->getEntries();
107 nbinsx = energy_.at(ilayer)->getNbinsX();
108 for (
int i = 1;
i <= nbinsx;
i++) {
109 double binValue = energy_.at(ilayer)->getBinContent(
i) /
nevent;
110 energy_.at(ilayer)->setBinContent(
i, binValue);
115 name <<
"EtaPhi_Plus_"
116 <<
"layer_" << ilayer;
117 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
118 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
119 EtaPhi_Plus_.push_back(hgcalMEs[ih]);
124 name <<
"EtaPhi_Minus_"
125 <<
"layer_" << ilayer;
126 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
127 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
128 EtaPhi_Minus_.push_back(hgcalMEs[ih]);
133 nevent = EtaPhi_Plus_.at(ilayer)->getEntries();
134 nbinsx = EtaPhi_Plus_.at(ilayer)->getNbinsX();
135 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
136 for (
int i = 1;
i <= nbinsx; ++
i) {
137 for (
int j = 1;
j <= nbinsy; ++
j) {
138 double binValue = EtaPhi_Plus_.at(ilayer)->getBinContent(
i,
j) /
nevent;
139 EtaPhi_Plus_.at(ilayer)->setBinContent(
i,
j, binValue);
143 nevent = EtaPhi_Minus_.at(ilayer)->getEntries();
144 nbinsx = EtaPhi_Minus_.at(ilayer)->getNbinsX();
145 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
146 for (
int i = 1;
i <= nbinsx; ++
i) {
147 for (
int j = 1;
j <= nbinsy; ++
j) {
148 double binValue = EtaPhi_Minus_.at(ilayer)->getBinContent(
i,
j) /
nevent;
149 EtaPhi_Minus_.at(ilayer)->setBinContent(
i,
j, binValue);
155 name <<
"HitOccupancy_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 HitOccupancy_Plus_.push_back(hgcalMEs[ih]);
163 name <<
"HitOccupancy_Minus_layer_" << ilayer;
164 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
165 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
166 HitOccupancy_Minus_.push_back(hgcalMEs[ih]);
171 nevent = HitOccupancy_Plus_.at(ilayer)->getEntries();
172 nbinsx = HitOccupancy_Plus_.at(ilayer)->getNbinsX();
173 for (
int i = 1;
i <= nbinsx; ++
i) {
174 double binValue = HitOccupancy_Plus_.at(ilayer)->getBinContent(
i) /
nevent;
175 HitOccupancy_Plus_.at(ilayer)->setBinContent(
i, binValue);
178 nevent = HitOccupancy_Minus_.at(ilayer)->getEntries();
179 nbinsx = HitOccupancy_Minus_.at(ilayer)->getNbinsX();
180 for (
int i = 1;
i <= nbinsx; ++
i) {
181 double binValue = HitOccupancy_Minus_.at(ilayer)->getBinContent(
i) /
nevent;
182 HitOccupancy_Minus_.at(ilayer)->setBinContent(
i, binValue);
188 name <<
"SUMOfRecHitOccupancy_Plus";
189 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
190 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
191 MeanHitOccupancy_Plus_.push_back(hgcalMEs[ih]);
192 unsigned int indx = MeanHitOccupancy_Plus_.size() - 1;
193 for (
int ilayer = 0; ilayer < (int)layers_; ++ilayer) {
194 double meanVal = HitOccupancy_Plus_.at(ilayer)->getMean();
195 MeanHitOccupancy_Plus_[indx]->setBinContent(ilayer + 1, meanVal);
202 name <<
"SUMOfRecHitOccupancy_Plus";
203 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
204 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
205 MeanHitOccupancy_Minus_.push_back(hgcalMEs[ih]);
206 unsigned indx = MeanHitOccupancy_Minus_.size() - 1;
207 for (
int ilayer = 0; ilayer < (int)layers_; ++ilayer) {
208 double meanVal = HitOccupancy_Minus_.at(ilayer)->getMean();
209 MeanHitOccupancy_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
void dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig) override
bool getData(T &iHolder) const
unsigned int layers(bool reco) const
~HGCalRecHitsClient() override
HGCalRecHitsClient(const edm::ParameterSet &)
const std::string nameDetector_
int recHitsEndjob(const std::vector< MonitorElement * > &hgcalMEs)
TString getName(TString structure, int layer, TString geometry)
void beginRun(const edm::Run &run, const edm::EventSetup &c) override
virtual void runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
Log< level::Warning, false > LogWarning
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > ddc_token_