44 int simHitsEndjob(
const std::vector<MonitorElement *> &hcalMEs);
49 nTimes_(iConfig.getParameter<
int>(
"TimeSlices")),
50 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)) {}
74 std::vector<MonitorElement *> hgcalMEs;
75 std::vector<std::string> fullDirPath = ig.
getSubdirs();
77 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++) {
88 if (strcmp(fullSubDirPath.at(
j).c_str(), nameDirectory.c_str()) == 0) {
91 edm::LogVerbatim(
"HGCalValidation") <<
"hgcalMES size : " << hgcalMEs.size();
100 std::vector<MonitorElement *> energy_[6];
101 std::vector<MonitorElement *> EtaPhi_Plus_, EtaPhi_Minus_;
102 std::vector<MonitorElement *> HitOccupancy_Plus_, HitOccupancy_Minus_;
105 std::ostringstream
name;
108 for (
unsigned int ilayer = 0; ilayer <
layers_; ilayer++) {
109 for (
int itimeslice = 0; itimeslice <
nTimes_; itimeslice++) {
112 name <<
"energy_time_" << itimeslice <<
"_layer_" << ilayer;
113 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
114 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
115 energy_[itimeslice].push_back(hgcalMEs[ih]);
119 nevent = energy_[itimeslice].at(ilayer)->getEntries();
120 nbinsx = energy_[itimeslice].at(ilayer)->getNbinsX();
121 for (
int i = 1;
i <= nbinsx;
i++) {
122 double binValue = energy_[itimeslice].at(ilayer)->getBinContent(
i) /
nevent;
123 energy_[itimeslice].at(ilayer)->setBinContent(
i, binValue);
129 name <<
"EtaPhi_Plus_" 130 <<
"layer_" << ilayer;
131 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
132 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
133 EtaPhi_Plus_.push_back(hgcalMEs[ih]);
138 name <<
"EtaPhi_Minus_" 139 <<
"layer_" << ilayer;
140 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
141 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
142 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);
168 name <<
"HitOccupancy_Plus_layer_" << ilayer;
169 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
170 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
171 HitOccupancy_Plus_.push_back(hgcalMEs[ih]);
175 name <<
"HitOccupancy_Minus_layer_" << ilayer;
176 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
177 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
178 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);
199 name <<
"MeanHitOccupancy_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 MeanHitOccupancy_Plus_ = hgcalMEs[ih];
203 for (
int ilayer = 0; ilayer < static_cast<int>(
layers_); ++ilayer) {
204 double meanVal = HitOccupancy_Plus_.at(ilayer)->
getMean();
212 name <<
"MeanHitOccupancy_Minus";
213 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
214 if (strcmp(hgcalMEs[ih]->
getName().c_str(), name.str().c_str()) == 0) {
215 MeanHitOccupancy_Minus_ = hgcalMEs[ih];
216 for (
int ilayer = 0; ilayer < static_cast<int>(
layers_); ++ilayer) {
217 double meanVal = HitOccupancy_Minus_.at(ilayer)->
getMean();
~HGCalSimHitsClient() override
virtual void runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
std::vector< MonitorElement * > getContents(Args &&...args)
void dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig) override
void beginRun(const edm::Run &run, const edm::EventSetup &c) override
#define DEFINE_FWK_MODULE(type)
unsigned int layers(bool reco) const
std::string nameDetector_
HGCalSimHitsClient(const edm::ParameterSet &)
TString getName(TString structure, int layer, TString geometry)
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
int getMaxDepth(const int &type) const
int simHitsEndjob(const std::vector< MonitorElement * > &hcalMEs)
void setCurrentFolder(std::string const &fullpath)
std::vector< std::string > getSubdirs()