CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalRecHitsDQMClient.cc
Go to the documentation of this file.
3 
8 
10 
12 {
13 
14  outputFile_ = iConfig.getUntrackedParameter<std::string>("outputFile", "myfile.root");
15  debug_ = false;
16  verbose_ = false;
17  dirName_=iConfig.getParameter<std::string>("DQMDirName");
18 }
19 
20 
22 {
23 
24 }
25 
27 {
28 
29 
30 }
31 
32 
34 {
35  igetter.setCurrentFolder(dirName_);
36 
37  if (verbose_) std::cout << "\nrunClient" << std::endl;
38 
39  std::vector<MonitorElement*> hcalMEs;
40 
41  // Since out folders are fixed to three, we can just go over these three folders
42  // i.e., CaloTowersD/CaloTowersTask, HcalRecHitsD/HcalRecHitTask, NoiseRatesV/NoiseRatesTask.
43  std::vector<std::string> fullPathHLTFolders = igetter.getSubdirs();
44  for(unsigned int i=0;i<fullPathHLTFolders.size();i++) {
45 
46  if (verbose_) std::cout <<"\nfullPath: "<< fullPathHLTFolders[i] << std::endl;
47  igetter.setCurrentFolder(fullPathHLTFolders[i]);
48 
49  std::vector<std::string> fullSubPathHLTFolders = igetter.getSubdirs();
50  for(unsigned int j=0;j<fullSubPathHLTFolders.size();j++) {
51 
52  if (verbose_) std::cout <<"fullSub: "<<fullSubPathHLTFolders[j] << std::endl;
53 
54  if( strcmp(fullSubPathHLTFolders[j].c_str(), "HcalRecHitsD/HcalRecHitTask") ==0 ){
55  hcalMEs = igetter.getContents(fullSubPathHLTFolders[j]);
56  if (verbose_) std::cout <<"hltMES size : "<<hcalMEs.size()<<std::endl;
57  if( !HcalRecHitsEndjob(hcalMEs) ) std::cout<<"\nError in HcalRecHitsEndjob!"<<std::endl<<std::endl;
58  }
59 
60  }
61 
62  }
63 
64 }
65 
66 
67 // called after entering the HcalRecHitsD/HcalRecHitTask directory
68 // hcalMEs are within that directory
69 int HcalRecHitsDQMClient::HcalRecHitsEndjob(const std::vector<MonitorElement*> &hcalMEs){
70 
71  int useAllHistos = 0, subdet =5;
72 
73 // for ZS ...
74 // MonitorElement* emap_min_ME =0;
75  MonitorElement* ZS_HO=0, *ZS_seqHO=0;
76  MonitorElement* ZS_HB1=0, *ZS_seqHB1=0, *ZS_HB2=0, *ZS_seqHB2=0;
77  MonitorElement* ZS_HF1=0, *ZS_seqHF1=0, *ZS_HF2=0, *ZS_seqHF2=0;
78  MonitorElement* ZS_HE1=0, *ZS_seqHE1=0, *ZS_HE2=0, *ZS_seqHE2=0, *ZS_HE3=0, *ZS_seqHE3=0;
79  MonitorElement* map_depth1 =0, *map_depth2 =0, *map_depth3 =0, *map_depth4 =0;
80 // others
81  MonitorElement* Nhf=0;
82  MonitorElement* emap_depth1 =0, *emap_depth2 =0, *emap_depth3 =0, *emap_depth4 =0;
83  MonitorElement* occupancy_seqHB1 =0, *occupancy_seqHB2 =0;
84  MonitorElement* occupancy_seqHE1 =0, *occupancy_seqHE2 =0, *occupancy_seqHE3 =0;
85  MonitorElement* occupancy_seqHF1 =0, *occupancy_seqHF2 =0;
86  MonitorElement* occupancy_seqHO =0;
87  MonitorElement* emean_seqHB1 =0, *emean_seqHB2 =0;
88  MonitorElement* emean_seqHE1 =0, *emean_seqHE2 =0, *emean_seqHE3 =0;
89  MonitorElement* emean_seqHF1 =0, *emean_seqHF2 =0;
90  MonitorElement* emean_seqHO =0;
91 
92  MonitorElement* RMS_seq_HB1 =0, *RMS_seq_HB2 =0;
93  MonitorElement* RMS_seq_HE1 =0, *RMS_seq_HE2 =0, *RMS_seq_HE3 =0;
94  MonitorElement* RMS_seq_HF1 =0, *RMS_seq_HF2 =0;
95  MonitorElement* RMS_seq_HO =0;
96 
97  MonitorElement *occupancy_map_HO =0;
98  MonitorElement* occupancy_map_HB1 =0, *occupancy_map_HB2 =0;
99  MonitorElement* occupancy_map_HF1 =0, *occupancy_map_HF2 =0;
100  MonitorElement* occupancy_map_HE1 =0, *occupancy_map_HE2 =0, *occupancy_map_HE3 =0;
101 
102  MonitorElement* emean_vs_ieta_HB1 =0, *emean_vs_ieta_HB2 =0;
103  MonitorElement* emean_vs_ieta_HE1 =0, *emean_vs_ieta_HE2 =0/*, *emean_vs_ieta_HE3 =0*/;
104  //MonitorElement* emean_vs_ieta_HF1 =0, *emean_vs_ieta_HF2 =0;
105  //MonitorElement* emean_vs_ieta_HO =0;
106  MonitorElement* RMS_vs_ieta_HB1 =0, *RMS_vs_ieta_HB2 =0;
107  MonitorElement* RMS_vs_ieta_HE1 =0, *RMS_vs_ieta_HE2 =0, *RMS_vs_ieta_HE3 =0;
108  MonitorElement* RMS_vs_ieta_HF1 =0, *RMS_vs_ieta_HF2 =0;
109  MonitorElement* RMS_vs_ieta_HO =0;
110  MonitorElement* occupancy_vs_ieta_HB1 =0, *occupancy_vs_ieta_HB2 =0;
111  MonitorElement* occupancy_vs_ieta_HE1 =0, *occupancy_vs_ieta_HE2 =0, *occupancy_vs_ieta_HE3 =0;
112  MonitorElement* occupancy_vs_ieta_HF1 =0, *occupancy_vs_ieta_HF2 =0;
113  MonitorElement* occupancy_vs_ieta_HO =0;
114 
115  MonitorElement* RecHit_StatusWord_HB =0, *RecHit_StatusWord_HE=0, *RecHit_StatusWord_HO =0, *RecHit_StatusWord_HF =0, *RecHit_StatusWord_HF67 =0;
116  MonitorElement* RecHit_Aux_StatusWord_HB =0, *RecHit_Aux_StatusWord_HE=0, *RecHit_Aux_StatusWord_HO =0, *RecHit_Aux_StatusWord_HF =0;
117 
118  for(unsigned int ih=0; ih<hcalMEs.size(); ih++){
119  if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_map_depth1") ==0 ){
120  useAllHistos =1; subdet =6;
121  }
122  if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HB1") ==0 ){
123  useAllHistos =1;
124  }
125 // if( strcmp(hcalMEs[ih]->getName().c_str(), "emap_min_ME") ==0 ){ emap_min_ME = hcalMEs[ih]; }
126  if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HO") ==0 ){ ZS_HO = hcalMEs[ih]; }
127  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HO") ==0 ){ ZS_seqHO = hcalMEs[ih]; }
128  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HB1") ==0 ){ ZS_HB1 = hcalMEs[ih]; }
129  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HB1") ==0 ){ ZS_seqHB1 = hcalMEs[ih]; }
130  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HB2") ==0 ){ ZS_HB2 = hcalMEs[ih]; }
131  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HB2") ==0 ){ ZS_seqHB2 = hcalMEs[ih]; }
132  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HF1") ==0 ){ ZS_HF1 = hcalMEs[ih]; }
133  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HF1") ==0 ){ ZS_seqHF1 = hcalMEs[ih]; }
134  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HF2") ==0 ){ ZS_HF2 = hcalMEs[ih]; }
135  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HF2") ==0 ){ ZS_seqHF2 = hcalMEs[ih]; }
136  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HE1") ==0 ){ ZS_HE1 = hcalMEs[ih]; }
137  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HE1") ==0 ){ ZS_seqHE1 = hcalMEs[ih]; }
138  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HE2") ==0 ){ ZS_HE2 = hcalMEs[ih]; }
139  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HE2") ==0 ){ ZS_seqHE2 = hcalMEs[ih]; }
140  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_simple1D_HE3") ==0 ){ ZS_HE3 = hcalMEs[ih]; }
141  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_sequential1D_HE3") ==0 ){ ZS_seqHE3 = hcalMEs[ih]; }
142  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_map_depth1") ==0 ){ map_depth1= hcalMEs[ih]; }
143  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_map_depth2") ==0 ){ map_depth2= hcalMEs[ih]; }
144  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_map_depth3") ==0 ){ map_depth3= hcalMEs[ih]; }
145  else if( strcmp(hcalMEs[ih]->getName().c_str(), "ZSmin_map_depth4") ==0 ){ map_depth4= hcalMEs[ih]; }
146 
147  else if( strcmp(hcalMEs[ih]->getName().c_str(), "N_HF") ==0 ){ Nhf= hcalMEs[ih]; }
148  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emap_depth1") ==0 ){ emap_depth1= hcalMEs[ih]; }
149  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emap_depth2") ==0 ){ emap_depth2= hcalMEs[ih]; }
150  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emap_depth3") ==0 ){ emap_depth3= hcalMEs[ih]; }
151  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emap_depth4") ==0 ){ emap_depth4= hcalMEs[ih]; }
152 
153  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HB1") ==0 ){ occupancy_seqHB1= hcalMEs[ih]; }
154  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HB2") ==0 ){ occupancy_seqHB2= hcalMEs[ih]; }
155  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HE1") ==0 ){ occupancy_seqHE1= hcalMEs[ih]; }
156  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HE2") ==0 ){ occupancy_seqHE2= hcalMEs[ih]; }
157  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HE3") ==0 ){ occupancy_seqHE3= hcalMEs[ih]; }
158  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HF1") ==0 ){ occupancy_seqHF1= hcalMEs[ih]; }
159  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HF2") ==0 ){ occupancy_seqHF2= hcalMEs[ih]; }
160  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occ_sequential1D_HO") ==0 ){ occupancy_seqHO= hcalMEs[ih]; }
161  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HB1") ==0 ){ emean_seqHB1= hcalMEs[ih]; }
162  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HB2") ==0 ){ emean_seqHB2= hcalMEs[ih]; }
163  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HE1") ==0 ){ emean_seqHE1= hcalMEs[ih]; }
164  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HE2") ==0 ){ emean_seqHE2= hcalMEs[ih]; }
165  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HE3") ==0 ){ emean_seqHE3= hcalMEs[ih]; }
166  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HF1") ==0 ){ emean_seqHF1= hcalMEs[ih]; }
167  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HF2") ==0 ){ emean_seqHF2= hcalMEs[ih]; }
168  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_seq_HO") ==0 ){ emean_seqHO= hcalMEs[ih]; }
169  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HB1") ==0 ){ RMS_seq_HB1= hcalMEs[ih]; }
170  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HB2") ==0 ){ RMS_seq_HB2= hcalMEs[ih]; }
171  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HE1") ==0 ){ RMS_seq_HE1= hcalMEs[ih]; }
172  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HE2") ==0 ){ RMS_seq_HE2= hcalMEs[ih]; }
173  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HE3") ==0 ){ RMS_seq_HE3= hcalMEs[ih]; }
174  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HF1") ==0 ){ RMS_seq_HF1= hcalMEs[ih]; }
175  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HF2") ==0 ){ RMS_seq_HF2= hcalMEs[ih]; }
176  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_seq_HO") ==0 ){ RMS_seq_HO= hcalMEs[ih]; }
177  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HB1") ==0 ){ occupancy_map_HB1= hcalMEs[ih]; }
178  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HB2") ==0 ){ occupancy_map_HB2= hcalMEs[ih]; }
179  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HE1") ==0 ){ occupancy_map_HE1= hcalMEs[ih]; }
180  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HE2") ==0 ){ occupancy_map_HE2= hcalMEs[ih]; }
181  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HE3") ==0 ){ occupancy_map_HE3= hcalMEs[ih]; }
182  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HF1") ==0 ){ occupancy_map_HF1= hcalMEs[ih]; }
183  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HF2") ==0 ){ occupancy_map_HF2= hcalMEs[ih]; }
184  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_map_HO") ==0 ){ occupancy_map_HO= hcalMEs[ih]; }
185  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HB1") ==0 ){ emean_vs_ieta_HB1= hcalMEs[ih]; }
186  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HB2") ==0 ){ emean_vs_ieta_HB2= hcalMEs[ih]; }
187  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HE1") ==0 ){ emean_vs_ieta_HE1= hcalMEs[ih]; }
188  else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HE2") ==0 ){ emean_vs_ieta_HE2= hcalMEs[ih]; }
189  //else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HE3") ==0 ){ emean_vs_ieta_HE3= hcalMEs[ih]; }
190  //else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HF1") ==0 ){ emean_vs_ieta_HF1= hcalMEs[ih]; }
191  //else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HF2") ==0 ){ emean_vs_ieta_HF2= hcalMEs[ih]; }
192  //else if( strcmp(hcalMEs[ih]->getName().c_str(), "emean_vs_ieta_HO") ==0 ){ emean_vs_ieta_HO= hcalMEs[ih]; }
193  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HB1") ==0 ){ RMS_vs_ieta_HB1= hcalMEs[ih]; }
194  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HB2") ==0 ){ RMS_vs_ieta_HB2= hcalMEs[ih]; }
195  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HE1") ==0 ){ RMS_vs_ieta_HE1= hcalMEs[ih]; }
196  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HE2") ==0 ){ RMS_vs_ieta_HE2= hcalMEs[ih]; }
197  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HE3") ==0 ){ RMS_vs_ieta_HE3= hcalMEs[ih]; }
198  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HF1") ==0 ){ RMS_vs_ieta_HF1= hcalMEs[ih]; }
199  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HF2") ==0 ){ RMS_vs_ieta_HF2= hcalMEs[ih]; }
200  else if( strcmp(hcalMEs[ih]->getName().c_str(), "RMS_vs_ieta_HO") ==0 ){ RMS_vs_ieta_HO= hcalMEs[ih]; }
201  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HB1") ==0 ){ occupancy_vs_ieta_HB1= hcalMEs[ih]; }
202  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HB2") ==0 ){ occupancy_vs_ieta_HB2= hcalMEs[ih]; }
203  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HE1") ==0 ){ occupancy_vs_ieta_HE1= hcalMEs[ih]; }
204  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HE2") ==0 ){ occupancy_vs_ieta_HE2= hcalMEs[ih]; }
205  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HE3") ==0 ){ occupancy_vs_ieta_HE3= hcalMEs[ih]; }
206  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HF1") ==0 ){ occupancy_vs_ieta_HF1= hcalMEs[ih]; }
207  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HF2") ==0 ){ occupancy_vs_ieta_HF2= hcalMEs[ih]; }
208  else if( strcmp(hcalMEs[ih]->getName().c_str(), "occupancy_vs_ieta_HO") ==0 ){ occupancy_vs_ieta_HO= hcalMEs[ih]; }
209  else if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_StatusWord_HB") ==0 ){ RecHit_StatusWord_HB= hcalMEs[ih]; }
210  else if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_StatusWord_HE") ==0 ){ RecHit_StatusWord_HE= hcalMEs[ih]; }
211  else if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_StatusWord_HO") ==0 ){ RecHit_StatusWord_HO= hcalMEs[ih]; }
212  else if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_StatusWord_HF") ==0 ){ RecHit_StatusWord_HF= hcalMEs[ih]; }
213  else if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_StatusWord_HF67") ==0 ){ RecHit_StatusWord_HF67= hcalMEs[ih]; }
214  else if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_Aux_StatusWord_HB") ==0 ){ RecHit_Aux_StatusWord_HB= hcalMEs[ih]; }
215  else if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_Aux_StatusWord_HE") ==0 ){ RecHit_Aux_StatusWord_HE= hcalMEs[ih]; }
216  else if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_Aux_StatusWord_HO") ==0 ){ RecHit_Aux_StatusWord_HO= hcalMEs[ih]; }
217  else if( strcmp(hcalMEs[ih]->getName().c_str(), "HcalRecHitTask_RecHit_Aux_StatusWord_HF") ==0 ){ RecHit_Aux_StatusWord_HF= hcalMEs[ih]; }
218  }
219  if( useAllHistos !=0 && useAllHistos !=1 ) return 0;
220 
221  //None of the ZS stuff necessary for drawn histograms
222  if (subdet==6 && useAllHistos) {
223 // FIXME: a dummy emap_min! No solutions yet found.
224 // Since useAllHistos is set to disable it in our ususal validation, it's left here to be fixed later...
225  double emap_min[82][72][4][4];
226 /* NOT a valid solution
227  for(unsigned int i1=0; i1 <82; i1++){
228  for(unsigned int i2=0; i2<72; i2++){
229  for(unsigned int i3=0; i3<4; i3++){
230  for(unsigned int i4=0; i4<4; i4++){
231  int idx = i1 + i2*82 + i3*(82*72) + i4*(82*72*4);
232  emap_min[i1][i2][i3][i4] = emap_min_ME->GetBinContent(idx+1);
233  }
234  }
235  }
236  }
237 */
238  for (unsigned int i1 = 0; i1 < 82; i1++) {
239  for (unsigned int i2 = 0; i2 < 72; i2++) {
240 
241  int index = (i1-41) * 72 + i2;
242 
243  double e = emap_min[i1][i2][0][0];
244  if( e < 10000.) {
245  ZS_HB1->Fill(e);
246  ZS_seqHB1->Fill(double(index),e);
247  }
248  e = emap_min[i1][i2][1][0];
249  if( e < 10000.) {
250  ZS_HB2->Fill(e);
251  ZS_seqHB2->Fill(double(index),e);
252  }
253 
254  e = emap_min[i1][i2][0][1];
255  if( e < 10000.) {
256  ZS_HE1->Fill(e);
257  ZS_seqHE1->Fill(double(index),e);
258  }
259  e = emap_min[i1][i2][1][1];
260  if( e < 10000.) {
261  ZS_HE2->Fill(e);
262  ZS_seqHE2->Fill(double(index),e);
263  }
264  e = emap_min[i1][i2][2][1];
265  if( e < 10000.) {
266  ZS_HE3->Fill(e);
267  ZS_seqHE3->Fill(double(index),e);
268  }
269 
270  e = emap_min[i1][i2][3][2];
271  if( e < 10000.) {
272  ZS_HO->Fill(e);
273  ZS_seqHO->Fill(double(index),e);
274  }
275 
276  e = emap_min[i1][i2][0][3];
277  if( e < 10000.) {
278  ZS_HF1->Fill(e);
279  ZS_seqHF1->Fill(double(index),e);
280  }
281 
282  e = emap_min[i1][i2][1][3];
283  if( e < 10000.) {
284  ZS_HF2->Fill(e);
285  ZS_seqHF2->Fill(double(index),e);
286  }
287 
288  for (unsigned int i3 = 0; i3 < 4; i3++) { // depth
289  double emin = 100000.;
290  for (unsigned int i4 = 0; i4 < 4; i4++) { // subdet
291  /*
292  std::cout << "* ieta, iphi, depth, sub = "
293  << i1 << ", " << i2 << ", " << i3 << ", " << i4
294  << " emap_min = " << emap_min [i1][i2][i3][i4]
295  << std::endl;
296  */
297  if ( emin > emap_min [i1][i2][i3][i4])
298  emin = emap_min [i1][i2][i3][i4];
299  }
300 
301  int ieta = i1-41;
302  if( i3 == 0 && emin < 10000.) {
303  map_depth1->Fill(double(ieta),double(i2),emin);
304  /*
305  std::cout << "* Fill map_depth1 " << double(ieta) << " "
306  << double(i2) << " with " << emin << std::endl;
307  */
308  }
309  if( i3 == 1 && emin < 10000.)
310  map_depth2->Fill(double(ieta),double(i2),emin);
311  if( i3 == 2 && emin < 10000.)
312  map_depth3->Fill(double(ieta),double(i2),emin);
313  if( i3 == 3 && emin < 10000.)
314  map_depth4->Fill(double(ieta),double(i2),emin);
315  }
316  }
317  }
318  }
319  // mean energies and occupancies evaluation
320  else {
321 
322  double nevtot = Nhf->getEntries();
323  if(verbose_) std::cout<<"nevtot : "<<nevtot<<std::endl;
324 
325  int nx = occupancy_map_HB1->getNbinsX();
326  int ny = occupancy_map_HB1->getNbinsY();
327 
328  float cnorm;
329  float fev = float (nevtot);
330  // std::cout << "*** nevtot " << nevtot << std::endl;
331 
332  float sumphi_hb1, sumphi_hb2, sumphi_he1, sumphi_he2, sumphi_he3,
333  sumphi_ho, sumphi_hf1, sumphi_hf2;
334  /*
335  if(nx != 82 || ny != 72)
336  std::cout << "*** problem with binning " << std::endl;
337  */
338  float phi_factor;
339 
340  // First - special <E> maps
341  int nx1 = emap_depth1->getNbinsX();
342  int ny1 = emap_depth1->getNbinsY();
343  for (int i = 1; i <= nx1; i++) {
344  for (int j = 1; j <= ny1; j++) {
345  cnorm = emap_depth1->getBinContent(i,j) / fev;
346  emap_depth1->setBinContent(i,j,cnorm);
347  cnorm = emap_depth2->getBinContent(i,j) / fev;
348  emap_depth2->setBinContent(i,j,cnorm);
349  cnorm = emap_depth3->getBinContent(i,j) / fev;
350  emap_depth3->setBinContent(i,j,cnorm);
351  cnorm = emap_depth4->getBinContent(i,j) / fev;
352  emap_depth4->setBinContent(i,j,cnorm);
353  }
354  }
355 
356  // Second: all others regular maps
357  for (int i = 1; i <= nx; i++) {
358  sumphi_hb1 = 0.;
359  sumphi_hb2 = 0.;
360  sumphi_he1 = 0.;
361  sumphi_he2 = 0.;
362  sumphi_he3 = 0.;
363  sumphi_ho = 0.;
364  sumphi_hf1 = 0.;
365  sumphi_hf2 = 0.;
366 
367  for (int j = 1; j <= ny; j++) {
368 
369  int index = (i-42) * ny + j-1;
370 
371  //Occupancies (needed for occ vs ieta histos)
372  cnorm = occupancy_map_HB1->getBinContent(i,j) / fev;
373  occupancy_map_HB1->setBinContent(i,j,cnorm);
374 
375  cnorm = occupancy_map_HB2->getBinContent(i,j) / fev;
376  occupancy_map_HB2->setBinContent(i,j,cnorm);
377 
378  cnorm = occupancy_map_HE1->getBinContent(i,j) / fev;
379  occupancy_map_HE1->setBinContent(i,j,cnorm);
380 
381  cnorm = occupancy_map_HE2->getBinContent(i,j) / fev;
382  occupancy_map_HE2->setBinContent(i,j,cnorm);
383 
384  cnorm = occupancy_map_HE3->getBinContent(i,j) / fev;
385  occupancy_map_HE3->setBinContent(i,j,cnorm);
386 
387  cnorm = occupancy_map_HO->getBinContent(i,j) / fev;
388  occupancy_map_HO->setBinContent(i,j,cnorm);
389 
390  cnorm = occupancy_map_HF1->getBinContent(i,j) / fev;
391  occupancy_map_HF1->setBinContent(i,j,cnorm);
392 
393  cnorm = occupancy_map_HF2->getBinContent(i,j) / fev;
394  occupancy_map_HF2->setBinContent(i,j,cnorm);
395 
396  sumphi_hb1 += occupancy_map_HB1->getBinContent(i,j);
397  sumphi_hb2 += occupancy_map_HB2->getBinContent(i,j);
398  sumphi_he1 += occupancy_map_HE1->getBinContent(i,j);
399  sumphi_he2 += occupancy_map_HE2->getBinContent(i,j);
400  sumphi_he3 += occupancy_map_HE3->getBinContent(i,j);
401  sumphi_ho += occupancy_map_HO->getBinContent(i,j);
402  sumphi_hf1 += occupancy_map_HF1->getBinContent(i,j);
403  sumphi_hf2 += occupancy_map_HF2->getBinContent(i,j);
404 
405  // Occupancies - not in main drawn set of histos
406  if(useAllHistos){
407  occupancy_seqHB1->Fill(double(index),cnorm);
408  occupancy_seqHB2->Fill(double(index),cnorm);
409  occupancy_seqHE1->Fill(double(index),cnorm);
410  occupancy_seqHE2->Fill(double(index),cnorm);
411  occupancy_seqHE3->Fill(double(index),cnorm);
412  occupancy_seqHO->Fill(double(index),cnorm);
413  occupancy_seqHF1->Fill(double(index),cnorm);
414  occupancy_seqHF2->Fill(double(index),cnorm);
415  }
416  }
417 
418  int ieta = i - 42; // -41 -1, 0 40
419  if(ieta >=0 ) ieta +=1; // -41 -1, 1 41 - to make it detector-like
420 
421  if(ieta >= -20 && ieta <= 20 )
422  {phi_factor = 72.;}
423  else {
424  if(ieta >= 40 || ieta <= -40 ) {phi_factor = 18.;}
425  else
426  phi_factor = 36.;
427  }
428  if(ieta >= 0) ieta -= 1; // -41 -1, 0 40 - to bring back to histo num
429 
430  /*
431  std::cout << "*** ieta = " << ieta << " sumphi_hb1, sumphi_hb2, sumphi_he1, sumphi_he2, simphi_he3, sumphi_ho, simphi_hf1, sumphi_hf2" << std::endl
432  << sumphi_hb1 << " " << sumphi_hb2 << " " << sumphi_he1 << " "
433  << sumphi_he2 << " " << simphi_he3 << " " << sumphi_ho << " "
434  << simphi_hf1 << " " << sumphi_hf2 << std::endl << std::endl;
435  */
436  //Occupancy vs. ieta histos are drawn, RMS is not
437  cnorm = sumphi_hb1 / phi_factor;
438  occupancy_vs_ieta_HB1->Fill(float(ieta), cnorm);
439  cnorm = sumphi_hb2 / phi_factor;
440  occupancy_vs_ieta_HB2->Fill(float(ieta), cnorm);
441  cnorm = sumphi_he1 / phi_factor;
442  occupancy_vs_ieta_HE1->Fill(float(ieta), cnorm);
443  cnorm = sumphi_he2 / phi_factor;
444  occupancy_vs_ieta_HE2->Fill(float(ieta), cnorm);
445  cnorm = sumphi_he3 / phi_factor;
446  occupancy_vs_ieta_HE3->Fill(float(ieta), cnorm);
447  cnorm = sumphi_ho / phi_factor;
448  occupancy_vs_ieta_HO->Fill(float(ieta), cnorm);
449  cnorm = sumphi_hf1 / phi_factor;
450  occupancy_vs_ieta_HF1->Fill(float(ieta), cnorm);
451  cnorm = sumphi_hf2 / phi_factor;
452  occupancy_vs_ieta_HF2->Fill(float(ieta), cnorm);
453 
454  if (useAllHistos){
455  // RMS vs ieta (Emean's one)
456  cnorm = emean_vs_ieta_HB1->getBinError(i);
457  RMS_vs_ieta_HB1->Fill(ieta,cnorm);
458  cnorm = emean_vs_ieta_HB2->getBinError(i);
459  RMS_vs_ieta_HB2->Fill(ieta,cnorm);
460  cnorm = emean_vs_ieta_HE1->getBinError(i);
461  RMS_vs_ieta_HE1->Fill(ieta,cnorm);
462  cnorm = emean_vs_ieta_HE2->getBinError(i);
463  RMS_vs_ieta_HE2->Fill(ieta,cnorm);
464  cnorm = emean_vs_ieta_HE1->getBinError(i);
465  RMS_vs_ieta_HE3->Fill(ieta,cnorm);
466  cnorm = emean_vs_ieta_HB1->getBinError(i);
467  RMS_vs_ieta_HO->Fill(ieta,cnorm);
468  cnorm = emean_vs_ieta_HB1->getBinError(i);
469  RMS_vs_ieta_HF1->Fill(ieta,cnorm);
470  cnorm = emean_vs_ieta_HB1->getBinError(i);
471  RMS_vs_ieta_HF2->Fill(ieta,cnorm);
472  }
473  } // end of i-loop
474 
475 
476  // RMS seq (not drawn)
477  if(useAllHistos){
478  nx = emean_seqHB1->getNbinsX();
479  for(int ibin = 1; ibin <= nx; ibin++ ){
480  cnorm = emean_seqHB1->getBinError(ibin);
481  RMS_seq_HB1->setBinContent(ibin, cnorm);
482  cnorm = emean_seqHB2->getBinError(ibin);
483  RMS_seq_HB2->setBinContent(ibin, cnorm);
484  cnorm = emean_seqHO->getBinError(ibin);
485  RMS_seq_HO->setBinContent(ibin, cnorm);
486  }
487  nx = emean_seqHE1->getNbinsX();
488  for(int ibin = 1; ibin <= nx; ibin++ ){
489  cnorm = emean_seqHE1->getBinError(ibin);
490  RMS_seq_HE1->setBinContent(ibin, cnorm);
491  cnorm = emean_seqHE2->getBinError(ibin);
492  RMS_seq_HE2->setBinContent(ibin, cnorm);
493  cnorm = emean_seqHE3->getBinError(ibin);
494  RMS_seq_HE3->setBinContent(ibin, cnorm);
495  }
496  nx = emean_seqHF1->getNbinsX();
497  for(int ibin = 1; ibin <= nx; ibin++ ){
498  cnorm = emean_seqHF1->getBinError(ibin);
499  RMS_seq_HF1->setBinContent(ibin, cnorm);
500  cnorm = emean_seqHF2->getBinError(ibin);
501  RMS_seq_HF2->setBinContent(ibin, cnorm);
502  }
503  }
504  //Status Word (drawn)
505  nx = RecHit_StatusWord_HB->getNbinsX();
506  for (int ibin = 1; ibin <= nx; ibin++) {
507  cnorm = RecHit_StatusWord_HB->getBinContent(ibin) / (fev * 2592.);
508  RecHit_StatusWord_HB->setBinContent(ibin,cnorm);
509 
510  cnorm = RecHit_StatusWord_HE->getBinContent(ibin) / (fev * 2592.);
511  RecHit_StatusWord_HE->setBinContent(ibin,cnorm);
512 
513  cnorm = RecHit_StatusWord_HO->getBinContent(ibin) / (fev * 2160.);
514  RecHit_StatusWord_HO->setBinContent(ibin,cnorm);
515 
516  cnorm = RecHit_StatusWord_HF->getBinContent(ibin) / (fev * 1728.);
517  RecHit_StatusWord_HF->setBinContent(ibin,cnorm);
518 
519  cnorm = RecHit_Aux_StatusWord_HB->getBinContent(ibin) / (fev * 2592.);
520  RecHit_Aux_StatusWord_HB->setBinContent(ibin,cnorm);
521 
522  cnorm = RecHit_Aux_StatusWord_HE->getBinContent(ibin) / (fev * 2592.);
523  RecHit_Aux_StatusWord_HE->setBinContent(ibin,cnorm);
524 
525  cnorm = RecHit_Aux_StatusWord_HO->getBinContent(ibin) / (fev * 2160.);
526  RecHit_Aux_StatusWord_HO->setBinContent(ibin,cnorm);
527 
528  cnorm = RecHit_Aux_StatusWord_HF->getBinContent(ibin) / (fev * 1728.);
529  RecHit_Aux_StatusWord_HF->setBinContent(ibin,cnorm);
530  }
531  //HF 2-bit status word (not drawn)
532  if(useAllHistos){
533  nx = RecHit_StatusWord_HF67->getNbinsX();
534  for (int ibin = 1; ibin <= nx; ibin++) {
535  cnorm = RecHit_StatusWord_HF67->getBinContent(ibin) / (fev * 1728.);
536  RecHit_StatusWord_HF67->setBinContent(ibin,cnorm);
537  }
538  }
539  }
540 
541  return 1;
542 }
543 
std::vector< MonitorElement * > getContents(Args &&...args)
Definition: DQMStore.h:197
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
double getEntries(void) const
get # of entries
int getNbinsY(void) const
get # of bins in Y-axis
void Fill(long long x)
int j
Definition: DBlmapReader.cc:9
virtual void beginJob(void)
int HcalRecHitsEndjob(const std::vector< MonitorElement * > &hcalMEs)
double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
HcalRecHitsDQMClient(const edm::ParameterSet &)
virtual void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
std::vector< std::string > getSubdirs(void)
Definition: DQMStore.cc:306
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:330
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
tuple cout
Definition: gather_cfg.py:121