58 for(
unsigned i = 0;
i < 5; ++
i){
59 if(nChannels_[
i]==0) nChannels_[
i] = 1;
78 std::vector<MonitorElement*> hcalMEs;
82 std::vector<std::string> fullPathHLTFolders = igetter.
getSubdirs();
83 for(
unsigned int i=0;
i<fullPathHLTFolders.size();
i++) {
88 std::vector<std::string> fullSubPathHLTFolders = igetter.
getSubdirs();
89 for(
unsigned int j=0;j<fullSubPathHLTFolders.size();j++) {
93 if( strcmp(fullSubPathHLTFolders[j].c_str(),
"HcalRecHitsD/HcalRecHitTask") ==0 ){
94 hcalMEs = igetter.
getContents(fullSubPathHLTFolders[j]);
114 std::vector<MonitorElement*> emap_depths;
117 std::vector<MonitorElement*> occupancy_maps;
118 std::vector<std::string> occupancyID;
121 std::vector<MonitorElement*> emean_vs_ieta;
125 std::vector<MonitorElement*> occupancy_vs_ieta;
126 std::vector<std::string> occupancy_vs_ietaID;
130 std::vector<MonitorElement*> RecHit_StatusWord;
131 std::vector<float> RecHit_StatusWord_Channels;
132 std::vector<MonitorElement*> RecHit_Aux_StatusWord;
133 std::vector<float> RecHit_Aux_StatusWord_Channels;
135 for(
unsigned int ih=0; ih<hcalMEs.size(); ih++){
139 if( hcalMEs[ih]->getName() ==
"N_HF" ){
149 if( hcalMEs[ih]->getName().find(
"emap_depth") != std::string::npos ){
150 emap_depths.push_back(hcalMEs[ih]);
154 if( hcalMEs[ih]->getName().
find(
"occupancy_map_H") != std::string::npos ){
155 occupancy_maps.push_back(hcalMEs[ih]);
165 occupancyID.push_back( hcalMEs[ih]->getName().substr(prefix.size()) );
170 if( hcalMEs[ih]->getName().find(
"emean_vs_ieta_H") != std::string::npos ){
171 emean_vs_ieta.push_back(hcalMEs[ih]);
175 if( hcalMEs[ih]->getName().
find(
"occupancy_vs_ieta_H") != std::string::npos ){
176 occupancy_vs_ieta.push_back(hcalMEs[ih]);
186 occupancy_vs_ietaID.push_back( hcalMEs[ih]->getName().substr(prefix.size()) );
191 if( hcalMEs[ih]->getName().find(
"HcalRecHitTask_RecHit_StatusWord_H") != std::string::npos ){
192 RecHit_StatusWord.push_back(hcalMEs[ih]);
194 if(hcalMEs[ih]->getName().
find(
"HB") != std::string::npos ){
195 RecHit_StatusWord_Channels.push_back((
float)
nChannels_[1]);
196 }
else if(hcalMEs[ih]->getName().
find(
"HE") != std::string::npos ){
197 RecHit_StatusWord_Channels.push_back((
float)
nChannels_[2]);
198 }
else if(hcalMEs[ih]->getName().
find(
"H0") != std::string::npos ){
199 RecHit_StatusWord_Channels.push_back((
float)
nChannels_[3]);
200 }
else if(hcalMEs[ih]->getName().
find(
"HF") != std::string::npos ){
201 RecHit_StatusWord_Channels.push_back((
float)
nChannels_[4]);
203 RecHit_StatusWord_Channels.push_back(1.);
209 if( hcalMEs[ih]->getName().
find(
"HcalRecHitTask_RecHit_Aux_StatusWord_H") != std::string::npos ){
210 RecHit_Aux_StatusWord.push_back(hcalMEs[ih]);
212 if(hcalMEs[ih]->getName().
find(
"HB") != std::string::npos ){
213 RecHit_Aux_StatusWord_Channels.push_back((
float)
nChannels_[1]);
214 }
else if(hcalMEs[ih]->getName().
find(
"HE") != std::string::npos ){
215 RecHit_Aux_StatusWord_Channels.push_back((
float)
nChannels_[2]);
216 }
else if(hcalMEs[ih]->getName().
find(
"H0") != std::string::npos ){
217 RecHit_Aux_StatusWord_Channels.push_back((
float)
nChannels_[3]);
218 }
else if(hcalMEs[ih]->getName().
find(
"HF") != std::string::npos ){
219 RecHit_Aux_StatusWord_Channels.push_back((
float)
nChannels_[4]);
221 RecHit_Aux_StatusWord_Channels.push_back(1.);
236 float fev =
float (nevtot);
237 double scaleBynevtot = 1 / fev;
241 for(
unsigned int depthIdx = 0; depthIdx < emap_depths.size(); depthIdx++){
243 int nx = emap_depths[depthIdx]->getNbinsX();
244 int ny = emap_depths[depthIdx]->getNbinsY();
249 for (
int i = 1;
i <= nx;
i++) {
250 for (
int j = 1; j <= ny; j++) {
251 cnorm = emap_depths[depthIdx]->getBinContent(
i,j) * scaleBynevtot;
252 enorm = emap_depths[depthIdx]->getBinError(
i,j) * scaleBynevtot;
253 emap_depths[depthIdx]->setBinContent(
i,j,cnorm);
254 emap_depths[depthIdx]->setBinError(
i,j,enorm);
262 bool omatched =
false;
264 for(
unsigned int occupancyIdx = 0; occupancyIdx < occupancy_maps.size(); occupancyIdx++){
266 int nx = occupancy_maps[occupancyIdx]->getNbinsX();
267 int ny = occupancy_maps[occupancyIdx]->getNbinsY();
272 unsigned int vsIetaIdx = occupancy_vs_ieta.size();
275 for(vsIetaIdx = 0; vsIetaIdx < occupancy_vs_ieta.size(); vsIetaIdx++){
276 if(occupancyID[occupancyIdx] == occupancy_vs_ietaID[vsIetaIdx]){
282 for (
int i = 1;
i <= nx;
i++) {
283 for (
int j = 1; j <= ny; j++) {
284 cnorm = occupancy_maps[occupancyIdx]->getBinContent(
i,j) * scaleBynevtot;
285 enorm = occupancy_maps[occupancyIdx]->getBinError(
i,j) * scaleBynevtot;
286 occupancy_maps[occupancyIdx]->setBinContent(
i,j,cnorm);
287 occupancy_maps[occupancyIdx]->setBinError(
i,j,enorm);
297 for (
int ieta = -41; ieta <= 41; ieta++) {
298 float phi_factor = 1.;
302 if(ieta == 0)
continue;
307 for (
int iphi = 0; iphi <= 71; iphi++) {
308 int binIeta = occupancy_maps[occupancyIdx]->getTH2F()->GetXaxis()->FindBin(
float(ieta));
309 int binIphi = occupancy_maps[occupancyIdx]->getTH2F()->GetYaxis()->FindBin(
float(iphi));
311 float content = occupancy_maps[occupancyIdx]->getBinContent(binIeta,binIphi);
312 float econtent = occupancy_maps[occupancyIdx]->getBinError(binIeta,binIphi);
315 sumphie += econtent*econtent;
318 int ietabin = occupancy_vs_ieta[vsIetaIdx]->getTH1F()->GetXaxis()->FindBin(
float(ieta));
323 cnorm = sumphi / phi_factor;
324 enorm =
sqrt(sumphie) / phi_factor;
325 occupancy_vs_ieta[vsIetaIdx]->setBinContent(ietabin, cnorm);
326 occupancy_vs_ieta[vsIetaIdx]->setBinError(ietabin,enorm);
335 for(
unsigned int StatusWordIdx = 0; StatusWordIdx < RecHit_StatusWord.size(); StatusWordIdx++){
337 int nx = RecHit_StatusWord[StatusWordIdx]->getNbinsX();
342 for (
int i = 1;
i <= nx;
i++) {
343 cnorm = RecHit_StatusWord[StatusWordIdx]->getBinContent(
i) * scaleBynevtot / RecHit_StatusWord_Channels[StatusWordIdx];
344 enorm = RecHit_StatusWord[StatusWordIdx]->getBinError(
i) * scaleBynevtot / RecHit_StatusWord_Channels[StatusWordIdx];
345 RecHit_StatusWord[StatusWordIdx]->setBinContent(
i,cnorm);
346 RecHit_StatusWord[StatusWordIdx]->setBinError(
i,enorm);
352 for(
unsigned int AuxStatusWordIdx = 0; AuxStatusWordIdx < RecHit_Aux_StatusWord.size(); AuxStatusWordIdx++){
354 int nx = RecHit_Aux_StatusWord[AuxStatusWordIdx]->getNbinsX();
359 for (
int i = 1;
i <= nx;
i++) {
360 cnorm = RecHit_Aux_StatusWord[AuxStatusWordIdx]->getBinContent(
i) * scaleBynevtot / RecHit_Aux_StatusWord_Channels[AuxStatusWordIdx];
361 enorm = RecHit_Aux_StatusWord[AuxStatusWordIdx]->getBinError(
i) * scaleBynevtot / RecHit_Aux_StatusWord_Channels[AuxStatusWordIdx];
362 RecHit_Aux_StatusWord[AuxStatusWordIdx]->setBinContent(
i,cnorm);
363 RecHit_Aux_StatusWord[AuxStatusWordIdx]->setBinError(
i,enorm);
377 if(ieta >= -20 && ieta <= 20 ){
380 if(ieta >= 40 || ieta <= -40 ){
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
const HcalDDDRecConstants * hcons
void setCurrentFolder(std::string const &fullpath)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void beginJob(void) override
float phifactor(int ieta)
int HcalRecHitsEndjob(const std::vector< MonitorElement * > &hcalMEs)
std::vector< MonitorElement * > getContents(Args &&...args)
double getEntries() const
get # of entries
int getMaxDepth(const int &type) const
HcalRecHitsDQMClient(const edm::ParameterSet &)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
ESHandle< TrackerGeometry > geometry
void beginRun(edm::Run const &, edm::EventSetup const &) override
std::vector< std::string > getSubdirs()
~HcalRecHitsDQMClient() override