47 int simHitsEndjob(
const std::vector<MonitorElement*> &hcalMEs);
52 nTimes_(iConfig.getParameter<
int>(
"TimeSlices")),
53 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity",0)) { }
81 std::vector<MonitorElement*> hgcalMEs;
82 std::vector<std::string> fullDirPath = ig.
getSubdirs();
84 for (
unsigned int i=0;
i<fullDirPath.size();
i++) {
88 std::vector<std::string> fullSubDirPath = ig.
getSubdirs();
90 for (
unsigned int j=0; j<fullSubDirPath.size(); j++) {
93 << fullSubDirPath.at(j);
96 if (strcmp(fullSubDirPath.at(j).c_str(), nameDirectory.c_str()) == 0) {
110 std::vector<MonitorElement*> energy_[6];
111 std::vector<MonitorElement*> EtaPhi_Plus_, EtaPhi_Minus_;
112 std::vector<MonitorElement*> HitOccupancy_Plus_, HitOccupancy_Minus_;
115 std::ostringstream
name;
118 for (
unsigned int ilayer = 0; ilayer <
layers_; ilayer++ ){
119 for (
int itimeslice = 0; itimeslice <
nTimes_; itimeslice++ ) {
121 name.str(
""); name <<
"energy_time_" << itimeslice <<
"_layer_" << ilayer;
122 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
123 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
124 energy_[itimeslice].push_back(hgcalMEs[ih]);
128 nevent = energy_[itimeslice].at(ilayer)->getEntries();
129 nbinsx = energy_[itimeslice].at(ilayer)->getNbinsX();
130 for(
int i=1;
i <= nbinsx;
i++) {
131 double binValue = energy_[itimeslice].at(ilayer)->getBinContent(
i)/
nevent;
132 energy_[itimeslice].at(ilayer)->setBinContent(
i,binValue);
137 name.str(
""); name <<
"EtaPhi_Plus_" <<
"layer_" << ilayer;
138 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
139 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
140 EtaPhi_Plus_.push_back(hgcalMEs[ih]);
144 name.str(
""); name <<
"EtaPhi_Minus_" <<
"layer_" << ilayer;
145 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
146 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0){
147 EtaPhi_Minus_.push_back(hgcalMEs[ih]);
151 nevent = EtaPhi_Plus_.at(ilayer)->getEntries();
152 nbinsx = EtaPhi_Plus_.at(ilayer)->getNbinsX();
153 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
154 for(
int i=1;
i<= nbinsx; ++
i) {
155 for(
int j=1; j<= nbinsy; ++j) {
156 double binValue = EtaPhi_Plus_.at(ilayer)->getBinContent(
i, j)/
nevent;
157 EtaPhi_Plus_.at(ilayer)->setBinContent(
i, j, binValue);
161 nevent = EtaPhi_Minus_.at(ilayer)->getEntries();
162 nbinsx = EtaPhi_Minus_.at(ilayer)->getNbinsX();
163 nbinsy = EtaPhi_Plus_.at(ilayer)->getNbinsY();
164 for(
int i=1;
i<= nbinsx; ++
i) {
165 for(
int j=1; j<= nbinsy; ++j) {
166 double binValue = EtaPhi_Minus_.at(ilayer)->getBinContent(
i, j)/
nevent;
167 EtaPhi_Minus_.at(ilayer)->setBinContent(
i, j, binValue);
172 name.str(
""); name <<
"HitOccupancy_Plus_layer_" << ilayer;
173 for (
unsigned int ih=0; ih<hgcalMEs.size(); ih++) {
174 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0) {
175 HitOccupancy_Plus_.push_back(hgcalMEs[ih]);
178 name.str(
""); name <<
"HitOccupancy_Minus_layer_" << ilayer;
179 for (
unsigned int ih=0; ih<hgcalMEs.size(); ih++) {
180 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0) {
181 HitOccupancy_Minus_.push_back(hgcalMEs[ih]);
185 nevent = HitOccupancy_Plus_.at(ilayer)->getEntries();
186 nbinsx = HitOccupancy_Plus_.at(ilayer)->getNbinsX();
187 for (
int i=1;
i<= nbinsx; ++
i) {
188 double binValue = HitOccupancy_Plus_.at(ilayer)->getBinContent(
i)/
nevent;
189 HitOccupancy_Plus_.at(ilayer)->setBinContent(
i, binValue);
192 nevent = HitOccupancy_Minus_.at(ilayer)->getEntries();
193 nbinsx = HitOccupancy_Minus_.at(ilayer)->getNbinsX();
194 for (
int i=1;
i<= nbinsx; ++
i) {
195 double binValue = HitOccupancy_Minus_.at(ilayer)->getBinContent(
i)/
nevent;
196 HitOccupancy_Minus_.at(ilayer)->setBinContent(
i, binValue);
201 name.str(
""); name <<
"MeanHitOccupancy_Plus";
202 for (
unsigned int ih=0; ih<hgcalMEs.size(); ih++) {
203 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0) {
204 MeanHitOccupancy_Plus_ = hgcalMEs[ih];
205 for (
int ilayer=0; ilayer < (
int)layers_; ++ilayer) {
206 double meanVal = HitOccupancy_Plus_.at(ilayer)->
getMean();
213 name.str(
""); name <<
"MeanHitOccupancy_Minus";
214 for(
unsigned int ih=0; ih<hgcalMEs.size(); ih++){
215 if (strcmp(hgcalMEs[ih]->getName().c_str(), name.str().c_str()) == 0) {
216 MeanHitOccupancy_Minus_ = hgcalMEs[ih];
217 for (
int ilayer=0; ilayer < (
int)layers_; ++ilayer) {
218 double meanVal = HitOccupancy_Minus_.at(ilayer)->
getMean();
std::vector< MonitorElement * > getContents(Args &&...args)
~HGCalSimHitsClient() override
void setBinContent(int binx, double content)
set content of bin (1-D)
virtual void runClient_(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
#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)
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
std::string nameDetector_
HGCalSimHitsClient(const edm::ParameterSet &)
int getMaxDepth(const int &type) const
void setCurrentFolder(const std::string &fullpath)
std::vector< std::string > getSubdirs()
int simHitsEndjob(const std::vector< MonitorElement * > &hcalMEs)