39 int simHitsEndjob(
const std::vector<MonitorElement *> &hgcalMEs);
43 : nameDetector_(iConfig.getParameter<
std::
string>(
"DetectorName")),
44 nTimes_(iConfig.getParameter<
int>(
"TimeSlices")),
45 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)),
62 std::vector<MonitorElement *> hgcalMEs;
63 std::vector<std::string> fullDirPath = ig.
getSubdirs();
65 for (
unsigned int i = 0;
i < fullDirPath.size();
i++) {
69 std::vector<std::string> fullSubDirPath = ig.
getSubdirs();
71 for (
unsigned int j = 0;
j < fullSubDirPath.size();
j++) {
76 if (strcmp(fullSubDirPath.at(
j).c_str(), nameDirectory.c_str()) == 0) {
79 edm::LogVerbatim(
"HGCalValidation") <<
"hgcalMES size : " << hgcalMEs.size();
88 std::vector<MonitorElement *> energy_[6];
89 std::vector<MonitorElement *> EtaPhi_Plus_, EtaPhi_Minus_;
90 std::vector<MonitorElement *> HitOccupancy_Plus_, HitOccupancy_Minus_;
93 std::ostringstream
name;
96 for (
unsigned int ilayer = 0; ilayer <
layers_; ilayer++) {
97 for (
int itimeslice = 0; itimeslice <
nTimes_; itimeslice++) {
100 name <<
"energy_time_" << itimeslice <<
"_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 energy_[itimeslice].push_back(hgcalMEs[ih]);
107 nevent = energy_[itimeslice].at(ilayer)->getEntries();
108 nbinsx = energy_[itimeslice].at(ilayer)->getNbinsX();
109 for (
int i = 1;
i <= nbinsx;
i++) {
110 double binValue = energy_[itimeslice].at(ilayer)->getBinContent(
i) /
nevent;
111 energy_[itimeslice].at(ilayer)->setBinContent(
i, binValue);
117 name <<
"EtaPhi_Plus_" 118 <<
"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 EtaPhi_Plus_.push_back(hgcalMEs[ih]);
126 name <<
"EtaPhi_Minus_" 127 <<
"layer_" << ilayer;
128 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
129 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
130 EtaPhi_Minus_.push_back(hgcalMEs[ih]);
134 nevent = EtaPhi_Plus_.at(ilayer)->getEntries();
135 nbinsx = EtaPhi_Plus_.at(ilayer)->getNbinsX();
136 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
137 for (
int i = 1;
i <= nbinsx; ++
i) {
138 for (
int j = 1;
j <= nbinsy; ++
j) {
139 double binValue = EtaPhi_Plus_.at(ilayer)->getBinContent(
i,
j) /
nevent;
140 EtaPhi_Plus_.at(ilayer)->setBinContent(
i,
j, binValue);
144 nevent = EtaPhi_Minus_.at(ilayer)->getEntries();
145 nbinsx = EtaPhi_Minus_.at(ilayer)->getNbinsX();
146 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
147 for (
int i = 1;
i <= nbinsx; ++
i) {
148 for (
int j = 1;
j <= nbinsy; ++
j) {
149 double binValue = EtaPhi_Minus_.at(ilayer)->getBinContent(
i,
j) /
nevent;
150 EtaPhi_Minus_.at(ilayer)->setBinContent(
i,
j, binValue);
156 name <<
"HitOccupancy_Plus_layer_" << ilayer;
157 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
158 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
159 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]);
170 nevent = HitOccupancy_Plus_.at(ilayer)->getEntries();
171 nbinsx = HitOccupancy_Plus_.at(ilayer)->getNbinsX();
172 for (
int i = 1;
i <= nbinsx; ++
i) {
173 double binValue = HitOccupancy_Plus_.at(ilayer)->getBinContent(
i) /
nevent;
174 HitOccupancy_Plus_.at(ilayer)->setBinContent(
i, binValue);
177 nevent = HitOccupancy_Minus_.at(ilayer)->getEntries();
178 nbinsx = HitOccupancy_Minus_.at(ilayer)->getNbinsX();
179 for (
int i = 1;
i <= nbinsx; ++
i) {
180 double binValue = HitOccupancy_Minus_.at(ilayer)->getBinContent(
i) /
nevent;
181 HitOccupancy_Minus_.at(ilayer)->setBinContent(
i, binValue);
187 name <<
"MeanHitOccupancy_Plus";
188 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
189 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
190 MeanHitOccupancy_Plus_ = hgcalMEs[ih];
191 for (
int ilayer = 0; ilayer < static_cast<int>(
layers_); ++ilayer) {
192 double meanVal = HitOccupancy_Plus_.at(ilayer)->
getMean();
200 name <<
"MeanHitOccupancy_Minus";
201 for (
unsigned int ih = 0; ih < hgcalMEs.size(); ih++) {
202 if (strcmp(hgcalMEs[ih]->
getName().c_str(),
name.str().c_str()) == 0) {
203 MeanHitOccupancy_Minus_ = hgcalMEs[ih];
204 for (
int ilayer = 0; ilayer < static_cast<int>(
layers_); ++ilayer) {
205 double meanVal = HitOccupancy_Minus_.at(ilayer)->
getMean();
Log< level::Info, true > LogVerbatim
~HGCalSimHitsClient() override
virtual void setCurrentFolder(std::string const &fullpath)
virtual void runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
#define DEFINE_FWK_MODULE(type)
int simHitsEndjob(const std::vector< MonitorElement *> &hgcalMEs)
void dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig) override
void beginRun(const edm::Run &run, const edm::EventSetup &c) override
unsigned int layers(bool reco) const
bool getData(T &iHolder) const
HGCalSimHitsClient(const edm::ParameterSet &)
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > tok_hgcal_
TString getName(TString structure, int layer, TString geometry)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
const std::string nameDetector_
Log< level::Warning, false > LogWarning
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const