76 std::string hist1[4] = {
"TotEdepStep",
"dX",
"dY",
"dZ"};
77 std::string hist2[10]= {
"LayerVsEnStep",
"XG4VsId",
"YG4VsId",
"ZG4VsId",
"dxVsX",
78 "dyVsY",
"dzVsZ",
"dxVsLayer",
"dyVsLayer",
"dzVsLayer"};
79 std::vector<MonitorElement*> hist1_;
80 std::vector<MonitorElement*> hist2_;
83 for (
unsigned int idet=0; idet<3; ++idet) {
85 for (
unsigned int kh=0; kh<4; ++kh) {
86 sprintf(name,
"%s%s", dets[idet].c_str(), hist1[kh].c_str());
87 for (
unsigned int ih=0; ih<hgcalMEs.size(); ih++) {
88 if (strcmp(hgcalMEs[ih]->getName().c_str(), name) == 0) {
89 hist1_.push_back(hgcalMEs[ih]);
90 double nevent = hist1_.back()->getEntries();
91 int nbinsx = hist1_.back()->getNbinsX();
92 for (
int i=1;
i<= nbinsx; ++
i) {
93 double binValue = hist1_.back()->getBinContent(
i)/
nevent;
94 hist1_.back()->setBinContent(
i,binValue);
99 for (
unsigned int kh=0; kh<10; ++kh) {
100 sprintf(name,
"%s%s", dets[idet].c_str(), hist2[kh].c_str());
101 for (
unsigned int ih=0; ih<hgcalMEs.size(); ih++) {
102 if (strcmp(hgcalMEs[ih]->getName().c_str(), name) == 0) {
103 hist2_.push_back(hgcalMEs[ih]);
104 double nevent = hist2_.back()->getEntries();
105 int nbinsx = hist2_.back()->getNbinsX();
106 int nbinsy = hist2_.back()->getNbinsY();
107 for (
int i=1;
i<= nbinsx; ++
i) {
108 for (
int j=1; j<= nbinsy; ++j) {
109 double binValue = hist2_.back()->getBinContent(
i,j)/
nevent;
110 hist2_.back()->setBinContent(
i,j,binValue);