39 edm::LogInfo(
"HGCalValidation") <<
"Initialize HGCalSimHitsClient for " 51 std::vector<MonitorElement*> hgcalMEs;
52 std::vector<std::string> fullDirPath = ig.
getSubdirs();
54 for (
unsigned int i=0;
i<fullDirPath.size();
i++) {
56 edm::LogInfo(
"HGCalValidation") <<
"fullPath: " << fullDirPath.at(
i) <<
"\n";
58 std::vector<std::string> fullSubDirPath = ig.
getSubdirs();
60 for (
unsigned int j=0; j<fullSubDirPath.size(); j++) {
62 edm::LogInfo(
"HGCalValidation") <<
"fullSubPath: " << fullSubDirPath.at(j) <<
"\n";
65 if (strcmp(fullSubDirPath.at(j).c_str(), nameDirectory.c_str()) == 0) {
68 edm::LogInfo(
"HGCalValidation") <<
"hgcalMES size : " << hgcalMEs.size() <<
"\n";
78 std::vector<MonitorElement*> energy_[6];
79 std::vector<MonitorElement*> EtaPhi_Plus_, EtaPhi_Minus_;
80 std::vector<MonitorElement*> HitOccupancy_Plus_, HitOccupancy_Minus_;
83 std::ostringstream
name;
86 for (
unsigned int ilayer = 0; ilayer <
layers_; ilayer++ ){
87 for (
int itimeslice = 0; itimeslice <
nTimes_; itimeslice++ ) {
89 name.str(
""); name <<
"energy_time_" << itimeslice <<
"_layer_" << ilayer;
90 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
91 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
92 energy_[itimeslice].push_back(hgcalMEs[ih]);
96 nevent = energy_[itimeslice].at(ilayer)->getEntries();
97 nbinsx = energy_[itimeslice].at(ilayer)->getNbinsX();
98 for(
int i=1;
i <= nbinsx;
i++) {
99 double binValue = energy_[itimeslice].at(ilayer)->getBinContent(
i)/
nevent;
100 energy_[itimeslice].at(ilayer)->setBinContent(
i,binValue);
105 name.str(
""); name <<
"EtaPhi_Plus_" <<
"layer_" << ilayer;
106 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
107 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
108 EtaPhi_Plus_.push_back(hgcalMEs[ih]);
112 name.str(
""); name <<
"EtaPhi_Minus_" <<
"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 EtaPhi_Minus_.push_back(hgcalMEs[ih]);
119 nevent = EtaPhi_Plus_.at(ilayer)->getEntries();
120 nbinsx = EtaPhi_Plus_.at(ilayer)->getNbinsX();
121 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
122 for(
int i=1;
i<= nbinsx; ++
i) {
123 for(
int j=1; j<= nbinsy; ++j) {
124 double binValue = EtaPhi_Plus_.at(ilayer)->getBinContent(
i, j)/
nevent;
125 EtaPhi_Plus_.at(ilayer)->setBinContent(
i, j, binValue);
129 nevent = EtaPhi_Minus_.at(ilayer)->getEntries();
130 nbinsx = EtaPhi_Minus_.at(ilayer)->getNbinsX();
131 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
132 for(
int i=1;
i<= nbinsx; ++
i) {
133 for(
int j=1; j<= nbinsy; ++j) {
134 double binValue = EtaPhi_Minus_.at(ilayer)->getBinContent(
i, j)/
nevent;
135 EtaPhi_Minus_.at(ilayer)->setBinContent(
i, j, binValue);
140 name.str(
""); name <<
"HitOccupancy_Plus_layer_" << ilayer;
141 for (
unsigned int ih=0; ih<hgcalMEs.size(); ih++) {
142 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0) {
143 HitOccupancy_Plus_.push_back(hgcalMEs[ih]);
146 name.str(
""); name <<
"HitOccupancy_Minus_layer_" << ilayer;
147 for (
unsigned int ih=0; ih<hgcalMEs.size(); ih++) {
148 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0) {
149 HitOccupancy_Minus_.push_back(hgcalMEs[ih]);
153 nevent = HitOccupancy_Plus_.at(ilayer)->getEntries();
154 nbinsx = HitOccupancy_Plus_.at(ilayer)->getNbinsX();
155 for (
int i=1;
i<= nbinsx; ++
i) {
156 double binValue = HitOccupancy_Plus_.at(ilayer)->getBinContent(
i)/
nevent;
157 HitOccupancy_Plus_.at(ilayer)->setBinContent(
i, binValue);
160 nevent = HitOccupancy_Minus_.at(ilayer)->getEntries();
161 nbinsx = HitOccupancy_Minus_.at(ilayer)->getNbinsX();
162 for (
int i=1;
i<= nbinsx; ++
i) {
163 double binValue = HitOccupancy_Minus_.at(ilayer)->getBinContent(
i)/
nevent;
164 HitOccupancy_Minus_.at(ilayer)->setBinContent(
i, binValue);
169 name.str(
""); name <<
"MeanHitOccupancy_Plus";
170 for (
unsigned int ih=0; ih<hgcalMEs.size(); ih++) {
171 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0) {
172 MeanHitOccupancy_Plus_ = hgcalMEs[ih];
173 for (
int ilayer=0; ilayer < (
int)layers_; ++ilayer) {
174 double meanVal = HitOccupancy_Plus_.at(ilayer)->
getMean();
181 name.str(
""); name <<
"MeanHitOccupancy_Minus";
182 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
183 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0) {
184 MeanHitOccupancy_Minus_ = hgcalMEs[ih];
185 for (
int ilayer=0; ilayer < (
int)layers_; ++ilayer) {
186 double meanVal = HitOccupancy_Minus_.at(ilayer)->
getMean();
std::vector< MonitorElement * > getContents(Args &&...args)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void setBinContent(int binx, double content)
set content of bin (1-D)
virtual void runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
#define DEFINE_FWK_MODULE(type)
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
int getMaxDepth(const int type) const
unsigned int layers(bool reco) const
std::string nameDetector_
HGCalSimHitsClient(const edm::ParameterSet &)
std::vector< std::string > getSubdirs(void)
void setCurrentFolder(const std::string &fullpath)
int simHitsEndjob(const std::vector< MonitorElement * > &hcalMEs)
void dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
virtual ~HGCalSimHitsClient()