CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CastorHIMonitor.cc
Go to the documentation of this file.
4 
5 //***************************************************//
6 //********** CastorHIMonitor: *******************//
7 //********** Author: Dmytro Volyanskyy ************//
8 //********** Date : 14.10.2010 (first version) ******//
9 //***************************************************//
12 
13 //==================================================================//
14 //======================= Constructor ==============================//
15 //==================================================================//
17  {
18 // if(fVerbosity>0) std::cout << "CastorHIMonitor() (start)" << std::endl;
19 
20  doPerChannel_ = true;
21  // occThresh_ = 1;
22  ievt_ = 0;
23  module = -99;
24  sector = -99;
25  energy = -99;
26  time = -99;
27  EtotalEM =-99;
28  EtotalHAD =-99;
29  EtotalCASTOR =-99;
30 
31 // if(fVerbosity>0) std::cout << "CastorHIMonitor() (end)" << std::endl;
32  }
33 
34 //==================================================================//
35 //======================= Destructor ==============================//
36 //==================================================================//
38 }
39 
40 
41 //==================================================================//
42 //======================= Reset ====================================//
43 //==================================================================//
45  {
46 
47  }
48 
49 
50 //==========================================================//
51 //========================= setup ==========================//
52 //==========================================================//
53 
55  {
57 
58  if(fVerbosity>0) std::cout << "CastorHIMonitor::setup (start)" << std::endl;
59 
60  baseFolder_ = rootFolder_+"CastorHIMonitor/EnergyUnits";
61 
62  if ( ps.getUntrackedParameter<bool>("RecHitsPerChannel", false) )
63  {
64  doPerChannel_ = true;
65  }
66 
67  ievt_=0; EtotalEM =0; EtotalHAD =0; EtotalCASTOR =0;
68 
69 
71  for (int mod=0; mod<14; mod++)
72  {
73  for (int sec=0; sec<16; sec++)
74  {
75  energyInEachChannel[mod][sec] = 0;
76  energyTotalChannel[mod][sec] = 0;
77  }
78  }
79 
81  for (int sec=0; sec<16; sec++)
82  {
83  energyHADsector[sec] = 0;
84  energySectors[sec] = 0;
85  energyTotalSector[sec] =0;
86  }
87 
88  if(fVerbosity>0) std::cout << "CastorHIMonitor::setup (start)" << std::endl;
89 
90  return;
91 }
92 
93 
94 //==========================================================//
95 //================== beginRun ==============================//
96 //==========================================================//
98  {
99  if(fVerbosity>0) std::cout << "CastorHIMonitor::beginRun (start)" << std::endl;
100 
101  if ( m_dbe !=NULL )
102  {
104 
105 
107 
108 
112 
114  meEtotalCASTOR = m_dbe->book1D("CASTOR Absolute RecHit Energy per event","CASTOR Absolute RecHit Energy per event",400,0,2000);
115 
117  meEtotalSector = m_dbe->book1D("CASTOR Total RecHit Energy in phi-sectors per run","Total RecHit Energy in phi-sectors per run",16,0,16);
118 
120  meEtotalEM = m_dbe->book1D("CASTOR Total EM RecHit Energy per event","Total EM RecHit Energy per event",300,0,1500);
121 
123  meEtotalHAD = m_dbe->book1D("CASTOR Total HAD RecHit Energy per event","Total HAD RecHit Energy per event",300,0,1500);
124 
126  meEtotalEMvsHAD = m_dbe->book1D("CASTOR Total Energy ratio EM to HAD per event","Total Energy ratio EM to HAD per event",50,0,5);
127 
128 
130 meEsector1 = m_dbe->book1D("RecHit Energy in phi-sector1 vs z-module","RecHit Energy in phi-sector1 vs z-module",14,0,14);
131 meEsector2 = m_dbe->book1D("RecHit Energy in phi-sector2 vs z-module","RecHit Energy in phi-sector2 vs z-module",14,0,14);
132 meEsector3 = m_dbe->book1D("RecHit Energy in phi-sector3 vs z-module","RecHit Energy in phi-sector3 vs z-module",14,0,14);
133 meEsector4 = m_dbe->book1D("RecHit Energy in phi-sector4 vs z-module","RecHit Energy in phi-sector4 vs z-module",14,0,14);
134 meEsector5 = m_dbe->book1D("RecHit Energy in phi-sector5 vs z-module","RecHit Energy in phi-sector5 vs z-module",14,0,14);
135 meEsector6 = m_dbe->book1D("RecHit Energy in phi-sector6 vs z-module","RecHit Energy in phi-sector6 vs z-module",14,0,14);
136 meEsector7 = m_dbe->book1D("RecHit Energy in phi-sector7 vs z-module","RecHit Energy in phi-sector7 vs z-module",14,0,14);
137 meEsector8 = m_dbe->book1D("RecHit Energy in phi-sector8 vs z-module","RecHit Energy in phi-sector8 vs z-module",14,0,14);
138 meEsector9 = m_dbe->book1D("RecHit Energy in phi-sector9 vs z-module","RecHit Energy in phi-sector9 vs z-module",14,0,14);
139 meEsector10 = m_dbe->book1D("RecHit Energy in phi-sector10 vs z-module","RecHit Energy in phi-sector10 vs z-module",14,0,14);
140 meEsector11 = m_dbe->book1D("RecHit Energy in phi-sector11 vs z-module","RecHit Energy in phi-sector11 vs z-module",14,0,14);
141 meEsector12 = m_dbe->book1D("RecHit Energy in phi-sector12 vs z-module","RecHit Energy in phi-sector12 vs z-module",14,0,14);
142 meEsector13 = m_dbe->book1D("RecHit Energy in phi-sector13 vs z-module","RecHit Energy in phi-sector13 vs z-module",14,0,14);
143 meEsector14 = m_dbe->book1D("RecHit Energy in phi-sector14 vs z-module","RecHit Energy in phi-sector14 vs z-module",14,0,14);
144 meEsector15 = m_dbe->book1D("RecHit Energy in phi-sector15 vs z-module","RecHit Energy in phi-sector15 vs z-module",14,0,14);
145 meEsector16 = m_dbe->book1D("RecHit Energy in phi-sector16 vs z-module","RecHit Energy in phi-sector16 vs z-module",14,0,14);
146 
147 
148 
149  m_dbe->setCurrentFolder(baseFolder_+"/furtherPlots");
150 
152 meEVT_ = m_dbe->bookInt("HI Event Number");
153 
155 meEmodule1 = m_dbe->book1D("RecHit Energy in z-module1 vs phi-sector","RecHit Energy in z-module1 vs phi-sector",16,0,16);
156 meEmodule2 = m_dbe->book1D("RecHit Energy in z-module2 vs phi-sector","RecHit Energy in z-module2 vs phi-sector",16,0,16);
157 meEmodule3 = m_dbe->book1D("RecHit Energy in z-module3 vs phi-sector","RecHit Energy in z-module3 vs phi-sector",16,0,16);
158 meEmodule4 = m_dbe->book1D("RecHit Energy in z-module4 vs phi-sector","RecHit Energy in z-module4 vs phi-sector",16,0,16);
159 meEmodule5 = m_dbe->book1D("RecHit Energy in z-module5 vs phi-sector","RecHit Energy in z-module5 vs phi-sector",16,0,16);
160 meEmodule6 = m_dbe->book1D("RecHit Energy in z-module6 vs phi-sector","RecHit Energy in z-module6 vs phi-sector",16,0,16);
161 meEmodule7 = m_dbe->book1D("RecHit Energy in z-module7 vs phi-sector","RecHit Energy in z-module7 vs phi-sector",16,0,16);
162 meEmodule8 = m_dbe->book1D("RecHit Energy in z-module8 vs phi-sector","RecHit Energy in z-module8 vs phi-sector",16,0,16);
163 meEmodule9 = m_dbe->book1D("RecHit Energy in z-module9 vs phi-sector","RecHit Energy in z-module9 vs phi-sector",16,0,16);
164 meEmodule10 = m_dbe->book1D("RecHit Energy in z-module10 vs phi-sector","RecHit Energy in z-module10 vs phi-sector",16,0,16);
165 meEmodule11 = m_dbe->book1D("RecHit Energy in z-module11 vs phi-sector","RecHit Energy in z-module11 vs phi-sector",16,0,16);
166 meEmodule12 = m_dbe->book1D("RecHit Energy in z-module12 vs phi-sector","RecHit Energy in z-module12 vs phi-sector",16,0,16);
167 meEmodule13 = m_dbe->book1D("RecHit Energy in z-module13 vs phi-sector","RecHit Energy in z-module13 vs phi-sector",16,0,16);
168 meEmodule14 = m_dbe->book1D("RecHit Energy in z-module14 vs phi-sector","RecHit Energy in z-module14 vs phi-sector",16,0,16);
169 
170  double EmaxSector=800;
171  double NbinsSector=200;
172 
174 meEsectorEM1 = m_dbe->book1D("RecHit Energy in EM phi-sector1","RecHit Energy in EM phi-sector1",NbinsSector,0,EmaxSector);
175 meEsectorEM2 = m_dbe->book1D("RecHit Energy in EM phi-sector2","RecHit Energy in EM phi-sector2",NbinsSector,0,EmaxSector);
176 meEsectorEM3 = m_dbe->book1D("RecHit Energy in EM phi-sector3","RecHit Energy in EM phi-sector3",NbinsSector,0,EmaxSector);
177 meEsectorEM4 = m_dbe->book1D("RecHit Energy in EM phi-sector4","RecHit Energy in EM phi-sector4",NbinsSector,0,EmaxSector);
178 meEsectorEM5 = m_dbe->book1D("RecHit Energy in EM phi-sector5","RecHit Energy in EM phi-sector5",NbinsSector,0,EmaxSector);
179 meEsectorEM6 = m_dbe->book1D("RecHit Energy in EM phi-sector6","RecHit Energy in EM phi-sector6",NbinsSector,0,EmaxSector);
180 meEsectorEM7 = m_dbe->book1D("RecHit Energy in EM phi-sector7","RecHit Energy in EM phi-sector7",NbinsSector,0,EmaxSector);
181 meEsectorEM8 = m_dbe->book1D("RecHit Energy in EM phi-sector8","RecHit Energy in EM phi-sector8",NbinsSector,0,EmaxSector);
182 meEsectorEM9 = m_dbe->book1D("RecHit Energy in EM phi-sector9","RecHit Energy in EM phi-sector9",NbinsSector,0,EmaxSector);
183 meEsectorEM10 = m_dbe->book1D("RecHit Energy in EM phi-sector10","RecHit Energy in EM phi-sector10",NbinsSector,0,EmaxSector);
184 meEsectorEM11 = m_dbe->book1D("RecHit Energy in EM phi-sector11","RecHit Energy in EM phi-sector11",NbinsSector,0,EmaxSector);
185 meEsectorEM12 = m_dbe->book1D("RecHit Energy in EM phi-sector12","RecHit Energy in EM phi-sector12",NbinsSector,0,EmaxSector);
186 meEsectorEM13 = m_dbe->book1D("RecHit Energy in EM phi-sector13","RecHit Energy in EM phi-sector13",NbinsSector,0,EmaxSector);
187 meEsectorEM14 = m_dbe->book1D("RecHit Energy in EM phi-sector14","RecHit Energy in EM phi-sector14",NbinsSector,0,EmaxSector);
188 meEsectorEM15 = m_dbe->book1D("RecHit Energy in EM phi-sector15","RecHit Energy in EM phi-sector15",NbinsSector,0,EmaxSector);
189 meEsectorEM16 = m_dbe->book1D("RecHit Energy in EM phi-sector16","RecHit Energy in EM phi-sector16",NbinsSector,0,EmaxSector);
190 
192 meEsectorHAD1 = m_dbe->book1D("RecHit Energy in HAD phi-sector1","RecHit Energy in HAD phi-sector1",NbinsSector,0,EmaxSector);
193 meEsectorHAD2 = m_dbe->book1D("RecHit Energy in HAD phi-sector2","RecHit Energy in HAD phi-sector2",NbinsSector,0,EmaxSector);
194 meEsectorHAD3 = m_dbe->book1D("RecHit Energy in HAD phi-sector3","RecHit Energy in HAD phi-sector3",NbinsSector,0,EmaxSector);
195 meEsectorHAD4 = m_dbe->book1D("RecHit Energy in HAD phi-sector4","RecHit Energy in HAD phi-sector4",NbinsSector,0,EmaxSector);
196 meEsectorHAD5 = m_dbe->book1D("RecHit Energy in HAD phi-sector5","RecHit Energy in HAD phi-sector5",NbinsSector,0,EmaxSector);
197 meEsectorHAD6 = m_dbe->book1D("RecHit Energy in HAD phi-sector6","RecHit Energy in HAD phi-sector6",NbinsSector,0,EmaxSector);
198 meEsectorHAD7 = m_dbe->book1D("RecHit Energy in HAD phi-sector7","RecHit Energy in HAD phi-sector7",NbinsSector,0,EmaxSector);
199 meEsectorHAD8 = m_dbe->book1D("RecHit Energy in HAD phi-sector8","RecHit Energy in HAD phi-sector8",NbinsSector,0,EmaxSector);
200 meEsectorHAD9 = m_dbe->book1D("RecHit Energy in HAD phi-sector9","RecHit Energy in HAD phi-sector9",NbinsSector,0,EmaxSector);
201 meEsectorHAD10 = m_dbe->book1D("RecHit Energy in HAD phi-sector10","RecHit Energy in HAD phi-sector10",NbinsSector,0,EmaxSector);
202 meEsectorHAD11 = m_dbe->book1D("RecHit Energy in HAD phi-sector11","RecHit Energy in HAD phi-sector11",NbinsSector,0,EmaxSector);
203 meEsectorHAD12 = m_dbe->book1D("RecHit Energy in HAD phi-sector12","RecHit Energy in HAD phi-sector12",NbinsSector,0,EmaxSector);
204 meEsectorHAD13 = m_dbe->book1D("RecHit Energy in HAD phi-sector13","RecHit Energy in HAD phi-sector13",NbinsSector,0,EmaxSector);
205 meEsectorHAD14 = m_dbe->book1D("RecHit Energy in HAD phi-sector14","RecHit Energy in HAD phi-sector14",NbinsSector,0,EmaxSector);
206 meEsectorHAD15 = m_dbe->book1D("RecHit Energy in HAD phi-sector15","RecHit Energy in HAD phi-sector15",NbinsSector,0,EmaxSector);
207 meEsectorHAD16 = m_dbe->book1D("RecHit Energy in HAD phi-sector16","RecHit Energy in HAD phi-sector16",NbinsSector,0,EmaxSector);
208 
209 
211 meEsectorEMvsHAD1 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector1","Ratio E_EM to E_HAD phi-sector1",50,0,5);
212 meEsectorEMvsHAD2 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector2","Ratio E_EM to E_HAD phi-sector2",50,0,5);
213 meEsectorEMvsHAD3 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector3","Ratio E_EM to E_HAD phi-sector3",50,0,5);
214 meEsectorEMvsHAD4 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector4","Ratio E_EM to E_HAD phi-sector4",50,0,5);
215 meEsectorEMvsHAD5 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector5","Ratio E_EM to E_HAD phi-sector5",50,0,5);
216 meEsectorEMvsHAD6 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector6","Ratio E_EM to E_HAD phi-sector6",50,0,5);
217 meEsectorEMvsHAD7 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector7","Ratio E_EM to E_HAD phi-sector7",50,0,5);
218 meEsectorEMvsHAD8 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector8","Ratio E_EM to E_HAD phi-sector8",50,0,5);
219 meEsectorEMvsHAD9 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector9","Ratio E_EM to E_HAD phi-sector9",50,0,5);
220 meEsectorEMvsHAD10 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector10","Ratio E_EM to E_HAD phi-sector10",50,0,5);
221 meEsectorEMvsHAD11 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector11","Ratio E_EM to E_HAD phi-sector11",50,0,5);
222 meEsectorEMvsHAD12 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector12","Ratio E_EM to E_HAD phi-sector12",50,0,5);
223 meEsectorEMvsHAD13 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector13","Ratio E_EM to E_HAD phi-sector13",50,0,5);
224 meEsectorEMvsHAD14 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector14","Ratio E_EM to E_HAD phi-sector14",50,0,5);
225 meEsectorEMvsHAD15 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector15","Ratio E_EM to E_HAD phi-sector15",50,0,5);
226 meEsectorEMvsHAD16 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector16","Ratio E_EM to E_HAD phi-sector16",50,0,5);
227 
228 
229 
230 
231  /*
232 
236 
237  m_dbe->setCurrentFolder(rootFolder_+"CastorHIMonitor/Charge_fC");
238 
240  meChargeTotalCASTOR = m_dbe->book1D("CASTOR Total Charge per event","CASTOR Total Charge per event",100,0,400);
241 
243  meChargeTotalSector = m_dbe->book1D("Total Charge in phi-sectors per event","Total Charge in phi-sectors per event",16,0,16);
244 
246  meChargeTotalEM = m_dbe->book1D("Total EM Charge per event","Total EM Charge per event",100,0,400);
247 
249  meChargeTotalHAD = m_dbe->book1D("Total HAD Charge per event","Total HAD Charge per event",100,0,400);
250 
252  meChargeTotalEMvsHAD = m_dbe->book1D("Total Charge ratio EM to HAD per event","Total Charge ratio EM to HAD per event",50,0,5);
253 
255 meChargeSector1 = m_dbe->book1D("Charge in phi-sector1 vs z-module","Charge in phi-sector1 vs z-module",14,0,14);
256 meChargeSector2 = m_dbe->book1D("Charge in phi-sector2 vs z-module","Charge in phi-sector2 vs z-module",14,0,14);
257 meChargeSector3 = m_dbe->book1D("Charge in phi-sector3 vs z-module","Charge in phi-sector3 vs z-module",14,0,14);
258 meChargeSector4 = m_dbe->book1D("Charge in phi-sector4 vs z-module","Charge in phi-sector4 vs z-module",14,0,14);
259 meChargeSector5 = m_dbe->book1D("Charge in phi-sector5 vs z-module","Charge in phi-sector5 vs z-module",14,0,14);
260 meChargeSector6 = m_dbe->book1D("Charge in phi-sector6 vs z-module","Charge in phi-sector6 vs z-module",14,0,14);
261 meChargeSector7 = m_dbe->book1D("Charge in phi-sector7 vs z-module","Charge in phi-sector7 vs z-module",14,0,14);
262 meChargeSector8 = m_dbe->book1D("Charge in phi-sector8 vs z-module","Charge in phi-sector8 vs z-module",14,0,14);
263 meChargeSector9 = m_dbe->book1D("Charge in phi-sector9 vs z-module","Charge in phi-sector9 vs z-module",14,0,14);
264 meChargeSector10 = m_dbe->book1D("Charge in phi-sector10 vs z-module","Charge in phi-sector10 vs z-module",14,0,14);
265 meChargeSector11 = m_dbe->book1D("Charge in phi-sector11 vs z-module","Charge in phi-sector11 vs z-module",14,0,14);
266 meChargeSector12 = m_dbe->book1D("Charge in phi-sector12 vs z-module","Charge in phi-sector12 vs z-module",14,0,14);
267 meChargeSector13 = m_dbe->book1D("Charge in phi-sector13 vs z-module","Charge in phi-sector13 vs z-module",14,0,14);
268 meChargeSector14 = m_dbe->book1D("Charge in phi-sector14 vs z-module","Charge in phi-sector14 vs z-module",14,0,14);
269 meChargeSector15 = m_dbe->book1D("Charge in phi-sector15 vs z-module","Charge in phi-sector15 vs z-module",14,0,14);
270 meChargeSector16 = m_dbe->book1D("Charge in phi-sector16 vs z-module","Charge in phi-sector16 vs z-module",14,0,14);
271 
272  m_dbe->setCurrentFolder(rootFolder_+"CastorHIMonitor/Charge_fC/furtherPlots");
273 
275 meChargeModule1 = m_dbe->book1D("Charge in z-module1 vs phi-sector","Charge in z-module1 vs phi-sector",16,0,16);
276 meChargeModule2 = m_dbe->book1D("Charge in z-module2 vs phi-sector","Charge in z-module2 vs phi-sector",16,0,16);
277 meChargeModule3 = m_dbe->book1D("Charge in z-module3 vs phi-sector","Charge in z-module3 vs phi-sector",16,0,16);
278 meChargeModule4 = m_dbe->book1D("Charge in z-module4 vs phi-sector","Charge in z-module4 vs phi-sector",16,0,16);
279 meChargeModule5 = m_dbe->book1D("Charge in z-module5 vs phi-sector","Charge in z-module5 vs phi-sector",16,0,16);
280 meChargeModule6 = m_dbe->book1D("Charge in z-module6 vs phi-sector","Charge in z-module6 vs phi-sector",16,0,16);
281 meChargeModule7 = m_dbe->book1D("Charge in z-module7 vs phi-sector","Charge in z-module7 vs phi-sector",16,0,16);
282 meChargeModule8 = m_dbe->book1D("Charge in z-module8 vs phi-sector","Charge in z-module8 vs phi-sector",16,0,16);
283 meChargeModule9 = m_dbe->book1D("Charge in z-module9 vs phi-sector","Charge in z-module9 vs phi-sector",16,0,16);
284 meChargeModule10 = m_dbe->book1D("Charge in z-module10 vs phi-sector","Charge in z-module10 vs phi-sector",16,0,16);
285 meChargeModule11 = m_dbe->book1D("Charge in z-module11 vs phi-sector","Charge in z-module11 vs phi-sector",16,0,16);
286 meChargeModule12 = m_dbe->book1D("Charge in z-module12 vs phi-sector","Charge in z-module12 vs phi-sector",16,0,16);
287 meChargeModule13 = m_dbe->book1D("Charge in z-module13 vs phi-sector","Charge in z-module13 vs phi-sector",16,0,16);
288 meChargeModule14 = m_dbe->book1D("Charge in z-module14 vs phi-sector","Charge in z-module14 vs phi-sector",16,0,16);
289 
290 
292 meChargeSectorEM1 = m_dbe->book1D("Charge in EM phi-sector1","Charge in EM phi-sector1",50,0,200);
293 meChargeSectorEM2 = m_dbe->book1D("Charge in EM phi-sector2","Charge in EM phi-sector2",50,0,200);
294 meChargeSectorEM3 = m_dbe->book1D("Charge in EM phi-sector3","Charge in EM phi-sector3",50,0,200);
295 meChargeSectorEM4 = m_dbe->book1D("Charge in EM phi-sector4","Charge in EM phi-sector4",50,0,200);
296 meChargeSectorEM5 = m_dbe->book1D("Charge in EM phi-sector5","Charge in EM phi-sector5",50,0,200);
297 meChargeSectorEM6 = m_dbe->book1D("Charge in EM phi-sector6","Charge in EM phi-sector6",50,0,200);
298 meChargeSectorEM7 = m_dbe->book1D("Charge in EM phi-sector7","Charge in EM phi-sector7",50,0,200);
299 meChargeSectorEM8 = m_dbe->book1D("Charge in EM phi-sector8","Charge in EM phi-sector8",50,0,200);
300 meChargeSectorEM9 = m_dbe->book1D("Charge in EM phi-sector9","Charge in EM phi-sector9",50,0,200);
301 meChargeSectorEM10 = m_dbe->book1D("Charge in EM phi-sector10","Charge in EM phi-sector10",50,0,200);
302 meChargeSectorEM11 = m_dbe->book1D("Charge in EM phi-sector11","Charge in EM phi-sector11",50,0,200);
303 meChargeSectorEM12 = m_dbe->book1D("Charge in EM phi-sector12","Charge in EM phi-sector12",50,0,200);
304 meChargeSectorEM13 = m_dbe->book1D("Charge in EM phi-sector13","Charge in EM phi-sector13",50,0,200);
305 meChargeSectorEM14 = m_dbe->book1D("Charge in EM phi-sector14","Charge in EM phi-sector14",50,0,200);
306 meChargeSectorEM15 = m_dbe->book1D("Charge in EM phi-sector15","Charge in EM phi-sector15",50,0,200);
307 meChargeSectorEM16 = m_dbe->book1D("Charge in EM phi-sector16","Charge in EM phi-sector16",50,0,200);
308 
310 meChargeSectorHAD1 = m_dbe->book1D("Charge in HAD phi-sector1","Charge in HAD phi-sector1",50,0,200);
311 meChargeSectorHAD2 = m_dbe->book1D("Charge in HAD phi-sector2","Charge in HAD phi-sector2",50,0,200);
312 meChargeSectorHAD3 = m_dbe->book1D("Charge in HAD phi-sector3","Charge in HAD phi-sector3",50,0,200);
313 meChargeSectorHAD4 = m_dbe->book1D("Charge in HAD phi-sector4","Charge in HAD phi-sector4",50,0,200);
314 meChargeSectorHAD5 = m_dbe->book1D("Charge in HAD phi-sector5","Charge in HAD phi-sector5",50,0,200);
315 meChargeSectorHAD6 = m_dbe->book1D("Charge in HAD phi-sector6","Charge in HAD phi-sector6",50,0,200);
316 meChargeSectorHAD7 = m_dbe->book1D("Charge in HAD phi-sector7","Charge in HAD phi-sector7",50,0,200);
317 meChargeSectorHAD8 = m_dbe->book1D("Charge in HAD phi-sector8","Charge in HAD phi-sector8",50,0,200);
318 meChargeSectorHAD9 = m_dbe->book1D("Charge in HAD phi-sector9","Charge in HAD phi-sector9",50,0,200);
319 meChargeSectorHAD10 = m_dbe->book1D("Charge in HAD phi-sector10","Charge in HAD phi-sector10",50,0,200);
320 meChargeSectorHAD11 = m_dbe->book1D("Charge in HAD phi-sector11","Charge in HAD phi-sector11",50,0,200);
321 meChargeSectorHAD12 = m_dbe->book1D("Charge in HAD phi-sector12","Charge in HAD phi-sector12",50,0,200);
322 meChargeSectorHAD13 = m_dbe->book1D("Charge in HAD phi-sector13","Charge in HAD phi-sector13",50,0,200);
323 meChargeSectorHAD14 = m_dbe->book1D("Charge in HAD phi-sector14","Charge in HAD phi-sector14",50,0,200);
324 meChargeSectorHAD15 = m_dbe->book1D("Charge in HAD phi-sector15","Charge in HAD phi-sector15",50,0,200);
325 meChargeSectorHAD16 = m_dbe->book1D("Charge in HAD phi-sector16","Charge in HAD phi-sector16",50,0,200);
326 
327 
328 
330 meChargeSectorEMvsHAD1 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector1","Ratio E_EM to E_HAD phi-sector1",50,0,5);
331 meChargeSectorEMvsHAD2 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector2","Ratio E_EM to E_HAD phi-sector2",50,0,5);
332 meChargeSectorEMvsHAD3 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector3","Ratio E_EM to E_HAD phi-sector3",50,0,5);
333 meChargeSectorEMvsHAD4 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector4","Ratio E_EM to E_HAD phi-sector4",50,0,5);
334 meChargeSectorEMvsHAD5 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector5","Ratio E_EM to E_HAD phi-sector5",50,0,5);
335 meChargeSectorEMvsHAD6 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector6","Ratio E_EM to E_HAD phi-sector6",50,0,5);
336 meChargeSectorEMvsHAD7 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector7","Ratio E_EM to E_HAD phi-sector7",50,0,5);
337 meChargeSectorEMvsHAD8 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector8","Ratio E_EM to E_HAD phi-sector8",50,0,5);
338 meChargeSectorEMvsHAD9 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector9","Ratio E_EM to E_HAD phi-sector9",50,0,5);
339 meChargeSectorEMvsHAD10 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector10","Ratio E_EM to E_HAD phi-sector10",50,0,5);
340 meChargeSectorEMvsHAD11 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector11","Ratio E_EM to E_HAD phi-sector11",50,0,5);
341 meChargeSectorEMvsHAD12 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector12","Ratio E_EM to E_HAD phi-sector12",50,0,5);
342 meChargeSectorEMvsHAD13 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector13","Ratio E_EM to E_HAD phi-sector13",50,0,5);
343 meChargeSectorEMvsHAD14 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector14","Ratio E_EM to E_HAD phi-sector14",50,0,5);
344 meChargeSectorEMvsHAD15 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector15","Ratio E_EM to E_HAD phi-sector15",50,0,5);
345 meChargeSectorEMvsHAD16 = m_dbe->book1D("Ratio E_EM to E_HAD phi-sector16","Ratio E_EM to E_HAD phi-sector16",50,0,5);
346 
347 
348 
349  */
350 
351 
352  }//-- end of if
353 
354  else
355  {
356  if(fVerbosity>0) std::cout << "CastorHIMonitor::beginRun - NO DQMStore service" << std::endl;
357  }
358 
359  if(fVerbosity>0) std::cout << "CastorHIMonitor::beginRun (end)" << std::endl;
360 
361  }
362 
363 //==========================================================//
364 //================== processEvent ==========================//
365 //==========================================================//
366 
367 
369  {
370  if(fVerbosity>0) std::cout << "CastorHIMonitor::processEvent (begin)"<< std::endl;
371 
372  if(!m_dbe) {
373  if(fVerbosity>0) std::cout <<"CastorHIMonitor::processEvent => DQMStore is not instantiated !!!"<<std::endl;
374  return;
375  }
376 
378  meEVT_->Fill(ievt_);
379 
381  EtotalEM =0; EtotalHAD =0; EtotalCASTOR =0;
382 
384  for (int mod=0; mod<14; mod++) {
385  for (int sec=0; sec<16; sec++) {
386  energyInEachChannel[mod][sec] = 0;
387  }
388  }
389 
391  for (int sec=0; sec<16; sec++)
392  energyHADsector[sec] = 0;
393 
394 
395 
398  if (showTiming) { cpu_timer.reset(); cpu_timer.start(); }
399 
400  //********************************************************//
401  //************ working with RecHits *********************//
402  //*******************************************************//
403 
404  if(castorHits.size()>0)
405  {
406 
407  if(fVerbosity>1) std::cout << "==>CastorHIMonitor::processEvent: castorHits.size()>0 !!!" << std::endl;
408 
410  for (CASTORiter=castorHits.begin(); CASTORiter!=castorHits.end(); ++CASTORiter) {
411 
413  HcalCastorDetId id(CASTORiter->detid().rawId());
415  module = (int)id.module();
416  sector = (int)id.sector();
417  //zside = (int)id.zside();
419  energy = CASTORiter->energy();
420  time = CASTORiter->time();
421 
422  if(fVerbosity>1)
423  std::cout<<"CastorHIMonitor==> module:"<< module << " sector:"<< sector << " energy:" << energy<<std::endl;
424 
426  if (energy<0) energy=0;
427 
429  energyInEachChannel[module-1][sector-1] = energy;
430 
432  energyTotalChannel[module-1][sector-1] += energy;
433 
434 
435  }
436  //-- end of the loop over all hits
437 
438 
439  //-----------------------------------//
440  //------- fill energy in sectors ----//
441  //-- energy distribution in depth --//
442  //----------------------------------//
443  for (int mod=0; mod<14;mod++){
445  meEsector2->Fill(mod,energyInEachChannel[mod][1]);
446  meEsector3->Fill(mod,energyInEachChannel[mod][2]);
447  meEsector4->Fill(mod,energyInEachChannel[mod][3]);
448  meEsector5->Fill(mod,energyInEachChannel[mod][4]);
449  meEsector6->Fill(mod,energyInEachChannel[mod][5]);
450  meEsector7->Fill(mod,energyInEachChannel[mod][6]);
451  meEsector8->Fill(mod,energyInEachChannel[mod][7]);
452  meEsector9->Fill(mod,energyInEachChannel[mod][8]);
453  meEsector10->Fill(mod,energyInEachChannel[mod][9]);
454  meEsector11->Fill(mod,energyInEachChannel[mod][10]);
455  meEsector12->Fill(mod,energyInEachChannel[mod][11]);
456  meEsector13->Fill(mod,energyInEachChannel[mod][12]);
457  meEsector14->Fill(mod,energyInEachChannel[mod][13]);
458  meEsector15->Fill(mod,energyInEachChannel[mod][14]);
459  meEsector16->Fill(mod,energyInEachChannel[mod][15]);
460  }
461 
462 
463  //------------------------------------------//
464  //-- fill energy in modules --//
465  //-- energy distribution in each of the rings vs phi-sector --//
466  //---------------------------//
467  for (int sec=0; sec<16;sec++){
468  meEmodule1->Fill(sec,energyInEachChannel[0][sec]);
469  meEmodule2->Fill(sec,energyInEachChannel[1][sec]);
470  meEmodule3->Fill(sec,energyInEachChannel[2][sec]);
471  meEmodule4->Fill(sec,energyInEachChannel[3][sec]);
472  meEmodule5->Fill(sec,energyInEachChannel[4][sec]);
473  meEmodule6->Fill(sec,energyInEachChannel[5][sec]);
474  meEmodule7->Fill(sec,energyInEachChannel[6][sec]);
475  meEmodule8->Fill(sec,energyInEachChannel[7][sec]);
476  meEmodule9->Fill(sec,energyInEachChannel[8][sec]);
477  meEmodule10->Fill(sec,energyInEachChannel[9][sec]);
478  meEmodule11->Fill(sec,energyInEachChannel[10][sec]);
479  meEmodule12->Fill(sec,energyInEachChannel[11][sec]);
480  meEmodule13->Fill(sec,energyInEachChannel[12][sec]);
481  meEmodule14->Fill(sec,energyInEachChannel[13][sec]);
482  }
483 
484 
485 
486  //-------------------------------//
487  //-- fill energy in EM sectors --//
488  //-------------------------------//
505 
506 
507 
508  //-------------------------------//
509  //-- fill energy in HAD sectors --//
510  //-------------------------------//
511 
512  for(int sec=0; sec<16;sec++){
513 
519  }
520 
537 
538  //-----------------------------------------//
539  //-- fill energy ratio EM/HAD in sectors --//
540  //------------------------------------------//
557 
558 
559  //------------------------------------------//
560  //-- fill the total EM energy per event --//
561  //------------------------------------------//
562 
564  for(int mod=0; mod<2;mod++)
565  for(int sec=0; sec<16;sec++)
567 
568 
570 
571  //--------------------------------------------//
572  //-- fill the total HAD energy per event --//
573  //-------------------------------------------//
574 
576  for(int mod=2; mod<14;mod++)
577  for(int sec=0; sec<16;sec++)
579 
580 
582 
583  //----------------------------------------------------//
584  //-- fill the total energy ratio EM/HAD per event --//
585  //----------------------------------------------------//
586 
588 
589  //----------------------------------------------------//
590  //-- fill the total energy in CASTOR per event --//
591  //----------------------------------------------------//
592  for(int mod=0; mod<14;mod++)
593  for(int sec=0; sec<16;sec++)
595 
597 
598 
599  //-------------------------------------------------------//
600  //-- fill the total energy in CASTOR sectors per run --//
601  //------------------------------------------------------//
602 
603  for(int sec=0; sec<16;sec++){
604 
609  energyTotalChannel[9][sec]+energyTotalChannel[10][sec]+energyTotalChannel[11][sec]+
610  energyTotalChannel[12][sec]+energyTotalChannel[13][sec];
611  }
612 
613  for(int sec=0; sec<16;sec++)
615 
616 
617 
618  } //-- end of working with RecHits
619 
620  else { if(fVerbosity>0) std::cout<<"CastorHIMonitor::processEvent NO Castor RecHits !!!"<<std::endl; }
621 
622 
623 
624  //********************************************************//
625  //************ working with Digis ***********************//
626  //*******************************************************//
627 
628 
629 
630  if(castorDigis.size()>0) {
631 
633 
634  }
635 
636 
637 
638 
639 
640  else { if(fVerbosity>0) std::cout<<"CastorHIMonitor::processEvent NO Castor Digis !!!"<<std::endl; }
641 
642 
643  if (showTiming) {
644  cpu_timer.stop(); std::cout << " TIMER::CastorRecHit -> " << cpu_timer.cpuTime() << std::endl;
646  }
647 
648  ievt_++;
649 
650  if(fVerbosity>0) std::cout << "CastorHIMonitor::processEvent (end)"<< std::endl;
651 
652  return;
653 
654  }
MonitorElement * meEsectorEM2
float energySectors[16]
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meEsectorEMvsHAD15
edm::CPUTimer cpu_timer
MonitorElement * meEsectorHAD10
MonitorElement * meEmodule3
void processEvent(const CastorRecHitCollection &castorHits, const CastorDigiCollection &cast, const CastorDbService &cond)
MonitorElement * meEsectorEMvsHAD7
virtual void setup(const edm::ParameterSet &ps, DQMStore *dbe)
MonitorElement * meEmodule8
MonitorElement * meEsectorEM6
void start()
Definition: CPUTimer.cc:74
MonitorElement * meEsectorEMvsHAD16
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
MonitorElement * meEsector14
MonitorElement * meEsectorHAD16
void beginRun(const edm::EventSetup &iSetup)
MonitorElement * meEsector15
MonitorElement * meEsector4
MonitorElement * meEsector5
MonitorElement * meEsectorHAD1
MonitorElement * meEsectorHAD3
MonitorElement * meEsectorEM3
MonitorElement * meEsectorEMvsHAD1
MonitorElement * meEsectorEM9
MonitorElement * meEmodule10
float energyTotalChannel[14][16]
MonitorElement * meEtotalEM
std::vector< CastorRecHit >::const_iterator const_iterator
void reset()
Definition: CPUTimer.cc:107
#define NULL
Definition: scimark2.h:8
MonitorElement * meEsectorEMvsHAD11
void setup(const edm::ParameterSet &ps, DQMStore *dbe)
MonitorElement * meEmodule14
MonitorElement * meEsector10
MonitorElement * meEsectorEM8
MonitorElement * meEmodule7
MonitorElement * meEsectorEMvsHAD12
float energyTotalSector[16]
MonitorElement * meEmodule13
MonitorElement * meEsectorEM16
void Fill(long long x)
MonitorElement * meEsectorEMvsHAD9
MonitorElement * meEsectorEMvsHAD3
MonitorElement * meEsector12
MonitorElement * meEsectorEM11
MonitorElement * meEsectorHAD14
MonitorElement * meEsector8
MonitorElement * meEsectorHAD4
std::string baseFolder_
MonitorElement * meEsector2
MonitorElement * meEsectorHAD2
MonitorElement * meEsectorEM12
MonitorElement * meEmodule4
MonitorElement * meEsectorHAD15
MonitorElement * meEmodule1
MonitorElement * meEsectorEMvsHAD5
MonitorElement * meEsector11
MonitorElement * meEsectorEM13
Times stop()
Definition: CPUTimer.cc:94
float energyHADsector[16]
MonitorElement * meEsectorEMvsHAD13
MonitorElement * meEsectorHAD8
MonitorElement * meEmodule6
const_iterator end() const
MonitorElement * meEsector16
MonitorElement * meEsectorEM5
double cpuTime() const
Definition: CPUTimer.cc:158
MonitorElement * meEmodule2
MonitorElement * meEsector6
MonitorElement * meEmodule11
MonitorElement * meEsectorHAD7
MonitorElement * meEsectorEMvsHAD6
MonitorElement * meEVT_
float energyInEachChannel[14][16]
MonitorElement * meEmodule12
MonitorElement * meEmodule5
MonitorElement * meEsectorEM4
MonitorElement * meEsectorEMvsHAD8
MonitorElement * meEsectorHAD13
MonitorElement * meEsectorEM7
size_type size() const
MonitorElement * meEtotalSector
MonitorElement * meEsectorHAD12
MonitorElement * meEsectorEM15
std::string rootFolder_
MonitorElement * meEsectorEMvsHAD10
tuple cout
Definition: gather_cfg.py:121
MonitorElement * meEsector3
MonitorElement * meEsectorEMvsHAD4
MonitorElement * meEsectorEMvsHAD2
MonitorElement * meEsectorHAD5
MonitorElement * meEtotalCASTOR
MonitorElement * meEsector1
MonitorElement * meEtotalHAD
MonitorElement * meEmodule9
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:849
MonitorElement * meEsector9
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
MonitorElement * meEsectorEM14
Definition: vlib.h:208
MonitorElement * meEtotalEMvsHAD
MonitorElement * meEsector13
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
MonitorElement * meEsectorEMvsHAD14
const_iterator begin() const
MonitorElement * meEsectorHAD6
MonitorElement * meEsectorEM1
MonitorElement * meEsectorHAD11
MonitorElement * meEsectorHAD9
MonitorElement * meEsectorEM10
MonitorElement * meEsector7