38 edm::LogInfo(
"HGCalValidation") <<
"Initialize HGCalSimHitsClient for "
50 std::vector<MonitorElement*> hgcalMEs;
51 std::vector<std::string> fullDirPath = ig.
getSubdirs();
53 for (
unsigned int i=0;
i<fullDirPath.size();
i++) {
55 edm::LogInfo(
"HGCalValidation") <<
"\nfullPath: " << fullDirPath.at(
i);
57 std::vector<std::string> fullSubDirPath = ig.
getSubdirs();
59 for (
unsigned int j=0;
j<fullSubDirPath.size();
j++) {
61 edm::LogInfo(
"HGCalValidation") <<
"fullSubPath: " << fullSubDirPath.at(
j);
64 if (strcmp(fullSubDirPath.at(
j).c_str(), nameDirectory.c_str()) == 0) {
67 edm::LogInfo(
"HGCalValidation") <<
"hgcalMES size : " << hgcalMEs.size();
77 std::vector<MonitorElement*> energy_[6];
78 std::vector<MonitorElement*> EtaPhi_Plus_;
79 std::vector<MonitorElement*> EtaPhi_Minus_;
80 std::vector<MonitorElement*> HitOccupancy_Plus_[4];
81 std::vector<MonitorElement*> HitOccupancy_Minus_[4];
82 std::vector<MonitorElement*> MeanHitOccupancy_Plus_;
83 std::vector<MonitorElement*> MeanHitOccupancy_Minus_;
85 std::ostringstream
name;
88 for (
unsigned int ilayer = 0; ilayer <
layers_; ilayer++ ){
89 for (
int itimeslice = 0; itimeslice < 6 ; itimeslice++ ) {
91 name.str(
""); name <<
"energy_time_" << itimeslice <<
"_layer_" << ilayer;
92 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
93 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
94 energy_[itimeslice].push_back(hgcalMEs[ih]);
98 nevent = energy_[itimeslice].at(ilayer)->getEntries();
99 nbinsx = energy_[itimeslice].at(ilayer)->getNbinsX();
100 for(
int i=1;
i <= nbinsx;
i++) {
101 double binValue = energy_[itimeslice].at(ilayer)->getBinContent(
i)/
nevent;
102 energy_[itimeslice].at(ilayer)->setBinContent(
i,binValue);
107 name.str(
""); name <<
"EtaPhi_Plus_" <<
"layer_" << ilayer;
108 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
109 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
110 EtaPhi_Plus_.push_back(hgcalMEs[ih]);
114 name.str(
""); name <<
"EtaPhi_Minus_" <<
"layer_" << ilayer;
115 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
116 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
117 EtaPhi_Minus_.push_back(hgcalMEs[ih]);
121 nevent = EtaPhi_Plus_.at(ilayer)->getEntries();
122 nbinsx = EtaPhi_Plus_.at(ilayer)->getNbinsX();
123 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
124 for(
int i=1;
i<= nbinsx; ++
i) {
125 for(
int j=1;
j<= nbinsy; ++
j) {
126 double binValue = EtaPhi_Plus_.at(ilayer)->getBinContent(
i,
j)/
nevent;
127 EtaPhi_Plus_.at(ilayer)->setBinContent(
i,
j, binValue);
131 nevent = EtaPhi_Minus_.at(ilayer)->getEntries();
132 nbinsx = EtaPhi_Minus_.at(ilayer)->getNbinsX();
133 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
134 for(
int i=1;
i<= nbinsx; ++
i) {
135 for(
int j=1;
j<= nbinsy; ++
j) {
136 double binValue = EtaPhi_Minus_.at(ilayer)->getBinContent(
i,
j)/
nevent;
137 EtaPhi_Minus_.at(ilayer)->setBinContent(
i,
j, binValue);
142 for(
int indx=0; indx<4; ++indx){
143 name.str(
""); name <<
"HitOccupancy_Plus"<< indx <<
"_layer_" << ilayer;
144 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
145 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
146 HitOccupancy_Plus_[indx].push_back(hgcalMEs[ih]);
150 name.str(
""); name <<
"HitOccupancy_Minus"<< indx <<
"_layer_" << ilayer;
151 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
152 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
153 HitOccupancy_Minus_[indx].push_back(hgcalMEs[ih]);
157 for(
int indx=0; indx<4; ++indx){
158 nevent = HitOccupancy_Plus_[indx].at(ilayer)->getEntries();
159 nbinsx = HitOccupancy_Plus_[indx].at(ilayer)->getNbinsX();
160 for(
int i=1;
i<= nbinsx; ++
i) {
161 double binValue = HitOccupancy_Plus_[indx].at(ilayer)->getBinContent(
i)/
nevent;
162 HitOccupancy_Plus_[indx].at(ilayer)->setBinContent(
i, binValue);
165 nevent = HitOccupancy_Minus_[indx].at(ilayer)->getEntries();
166 nbinsx = HitOccupancy_Minus_[indx].at(ilayer)->getNbinsX();
167 for(
int i=1;
i<= nbinsx; ++
i) {
168 double binValue = HitOccupancy_Minus_[indx].at(ilayer)->getBinContent(
i)/
nevent;
169 HitOccupancy_Minus_[indx].at(ilayer)->setBinContent(
i, binValue);
176 for(
int indx=0; indx<4; ++indx) {
177 name.str(
""); name <<
"MeanHitOccupancy_Plus"<< indx ;
178 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
179 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
180 MeanHitOccupancy_Plus_.push_back(hgcalMEs[ih]);
181 unsigned int ind = MeanHitOccupancy_Plus_.size()-1;
182 for(
int ilayer=0; ilayer < (int)layers_; ++ilayer) {
183 double meanVal = HitOccupancy_Plus_[indx].at(ilayer)->getMean();
184 MeanHitOccupancy_Plus_[ind]->setBinContent(ilayer+1, meanVal);
190 name.str(
""); name <<
"MeanHitOccupancy_Minus"<< indx ;
191 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
192 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
193 MeanHitOccupancy_Minus_.push_back(hgcalMEs[ih]);
194 unsigned int ind = MeanHitOccupancy_Minus_.size()-1;
195 for(
int ilayer=0; ilayer < (int)layers_; ++ilayer) {
196 double meanVal = HitOccupancy_Minus_[indx].at(ilayer)->getMean();
197 MeanHitOccupancy_Minus_[ind]->setBinContent(ilayer+1, meanVal);
std::vector< MonitorElement * > getContents(Args &&...args)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
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)
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()