source: trunk/MagicSoft/Mars/macros/CCDataCheck.C@ 3361

Last change on this file since 3361 was 3221, checked in by reyes, 21 years ago
*** empty log message ***
File size: 49.2 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Raquel de los Reyes, 02/2004 <mailto:reyes@gae.ucm.es>
19!
20! Copyright: MAGIC Software Development, 2000-2004
21!
22!
23\* ======================================================================== *//////////////////////////////////////////////////////////////////////////////
24//
25// This macro made the check of the central control files (.rep files).
26// It displays 9 tabs:
27// - Drive system
28// - Camera status
29// - HV of power supplies and HV settings
30// - DC of power supplies
31// - LV power supplies
32// - Cooling system
33// - Trigger system
34// - Trigger macrocells
35// - Weather station
36//
37////////////////////////////////////////////////////////////////////////////
38
39void CCDataCheck(const TString filename="CC_2004_02_11.root", const TString directory="../")
40{
41
42 //
43 // Check of the raw files
44 //
45// MStatusDisplay *d = new MStatusDisplay;
46// d->SetTitle(filename);
47// d->SetLogStream(&gLog, kTRUE); // Disables output to stdout
48
49 //
50 // Create a empty Parameter List and an empty Task List
51 // The tasklist is identified in the eventloop by its name
52 //
53 MParList plist;
54
55 MTaskList tlist;
56 plist.AddToList(&tlist);
57
58 //
59 // Now setup the tasks and tasklist:
60 // ---------------------------------
61 //
62
63 // Set all the MHVsTime classes:
64 // Drive system
65 MHVsTime hZd("MReportDrive.fNominalZd");
66 hZd.SetName("Zd");
67 MHVsTime hAz("MReportDrive.fNominalAz");
68 hAz.SetName("Az");
69 MHVsTime hDState("MReportDrive.fState");
70 hDState.SetName("State");
71 // HV power supplies
72 MHVsTime hHVA("MCameraHV.fVoltageA");
73 hHVA.SetName("HVA");
74 MHVsTime hHVB("MCameraHV.fVoltageB");
75 hHVB.SetName("HVB");
76 MHVsTime hCA("MCameraHV.fCurrentA");
77 hCA.SetName("CA");
78 MHVsTime hCB("MCameraHV.fCurrentB");
79 hCB.SetName("CB");
80 // LV power supplies
81 MHVsTime hLVTemp("MCameraLV.fTemp");
82 hLVTemp.SetName("LVTemp");
83 MHVsTime hLVHum("MCameraLV.fHumidity");
84 hLVHum.SetName("LVHum");
85 MHVsTime hLVStatus("MCameraHV.fStatus");
86 hLVStatus.SetName("LVStatus");
87 MHVsTime hLVRPS("MCameraLV.fRequestPowerSupply");
88 hLVRPS.SetName("LVRPS");
89 // Cooling system
90 MHVsTime hTCenter("MCameraCooling.fTempCenter");
91 hTCenter.SetName("TCenter");
92 MHVsTime hTWall("MCameraCooling.fTempWall");
93 hTWall.SetName("TWall");
94 MHVsTime hTWater("MCameraCooling.fTempWater");
95 hTWater.SetName("TWater");
96 MHVsTime hTOptLink("MCameraCooling.fTempOptLink");
97 hTOptLink.SetName("TOptLink");
98 MHVsTime hHWall("MCameraCooling.fHumWall");
99 hHWall.SetName("HWall");
100 MHVsTime hHCenter("MCameraCooling.fHumCenter");
101 hHCenter.SetName("HCenter");
102 // Weather station
103 MHVsTime hCCHum("MReportCC.fHumidity");
104 hCCHum.SetName("CCHum");
105 MHVsTime hCCTemp("MReportCC.fTemperature");
106 hCCTemp.SetName("CCTemp");
107 MHVsTime hCCWS("MReportCC.fWindSpeed");
108 hCCWS.SetName("CCWS");
109 MHVsTime hCCSR("MReportCC.fSolarRadiation");
110 hCCSR.SetName("CCSR");
111 // Trigger system
112 MHVsTime hTrigBL2("MReportTrigger.fL2BeforePrescaler");
113 hTrigBL2.SetName("TrigBL2");
114 MHVsTime hTrigAL2("MReportTrigger.fL2AfterPrescaler");
115 hTrigAL2.SetName("TrigAL2");
116 MHVsTime hTrigStatus("MReportTrigger.fState");
117 hTrigStatus.SetName("TrigStatus");
118 // Camera status
119 MHVsTime hCamStatus("MReportCamera.fState");
120 hCamStatus.SetName("CamStatus");
121 MHVsTime hCamSentStatus("MReportCamera.fStatus");
122 hCamSentStatus.SetName("CamSentStatus");
123 MHVsTime hCamStatusDC("MReportCamera.fStatusDC");
124 hCamStatusDC.SetName("CamDCStatus");
125 MHVsTime hHVStatus("MCameraHV.fStatus");
126 hHVStatus.SetName("HVStatus");
127 MHVsTime hLidsStatus("MCameraLids.fStatus");
128 hLidsStatus.SetName("LidsStatus");
129 MHVsTime hCoolStatus("MCameraCooling.fStatus");
130 hCoolStatus.SetName("CoolingStatus");
131 MHVsTime hCamMean("MCameraHV.fMean");
132 hCamMean.SetName("CameraMean");
133
134 // Reads the trees of the root file and the analysed branches
135 MReadReports read;
136 read.AddTree("Drive");
137 read.AddTree("Camera");
138 read.AddTree("CC");
139 read.AddTree("Trigger");
140 read.AddFile(directory+filename); // after the reading of the trees!!!
141 read.AddToBranchList("MReportDrive.*");
142 read.AddToBranchList("MCameraHV.*");
143 read.AddToBranchList("MCameraLV.*");
144 read.AddToBranchList("MCameraCooling.*");
145 read.AddToBranchList("MReportCC.*");
146 read.AddToBranchList("MReportTrigger.*");
147 read.AddToBranchList("MReportCamera.*");
148 read.AddToBranchList("MCameraLids.*");
149
150 MGeomApply geomapl;
151 tlist.AddToList(&geomapl);
152
153 // Set of MHCamEvents classes
154 MHCamEvent HVdisplay("CamHV","Camera mean HV settings");
155 HVdisplay.SetBit(MHCamera::kVariance);
156 plist.AddToList(&HVdisplay);
157
158 // Set of MHPixVsTime classes (Trigger macroscells)
159 MHPixVsTime htrigmc1(0,"TrigMacrocell1");
160 htrigmc1.SetNameTime("MTimeTrigger");
161 plist.AddToList(&htrigmc1);
162 MHPixVsTime htrigmc2(1,"TrigMacrocell2");
163 htrigmc2.SetNameTime("MTimeTrigger");
164 plist.AddToList(&htrigmc2);
165 MHPixVsTime htrigmc3(2,"TrigMacrocell3");
166 htrigmc3.SetNameTime("MTimeTrigger");
167 plist.AddToList(&htrigmc3);
168 MHPixVsTime htrigmc4(3,"TrigMacrocell4");
169 htrigmc4.SetNameTime("MTimeTrigger");
170 plist.AddToList(&htrigmc4);
171 MHPixVsTime htrigmc5(4,"TrigMacrocell5");
172 htrigmc5.SetNameTime("MTimeTrigger");
173 plist.AddToList(&htrigmc5);
174 MHPixVsTime htrigmc6(5,"TrigMacrocell6");
175 htrigmc6.SetNameTime("MTimeTrigger");
176 plist.AddToList(&htrigmc6);
177 MHPixVsTime htrigmc7(6,"TrigMacrocell7");
178 htrigmc7.SetNameTime("MTimeTrigger");
179 plist.AddToList(&htrigmc7);
180 MHPixVsTime htrigmc8(7,"TrigMacrocell8");
181 htrigmc8.SetNameTime("MTimeTrigger");
182 plist.AddToList(&htrigmc8);
183 MHPixVsTime htrigmc9(8,"TrigMacrocell9");
184 htrigmc9.SetNameTime("MTimeTrigger");
185 plist.AddToList(&htrigmc9);
186 MHPixVsTime htrigmc10(9,"TrigMacrocell10");
187 htrigmc10.SetNameTime("MTimeTrigger");
188 plist.AddToList(&htrigmc10);
189 MHPixVsTime htrigmc11(10,"TrigMacrocell11");
190 htrigmc11.SetNameTime("MTimeTrigger");
191 plist.AddToList(&htrigmc11);
192 MHPixVsTime htrigmc12(11,"TrigMacrocell12");
193 htrigmc12.SetNameTime("MTimeTrigger");
194 plist.AddToList(&htrigmc12);
195 MHPixVsTime htrigmc13(12,"TrigMacrocell13");
196 htrigmc13.SetNameTime("MTimeTrigger");
197 plist.AddToList(&htrigmc13);
198 MHPixVsTime htrigmc14(13,"TrigMacrocell14");
199 htrigmc14.SetNameTime("MTimeTrigger");
200 plist.AddToList(&htrigmc14);
201 MHPixVsTime htrigmc15(14,"TrigMacrocell15");
202 htrigmc15.SetNameTime("MTimeTrigger");
203 plist.AddToList(&htrigmc15);
204 MHPixVsTime htrigmc16(15,"TrigMacrocell16");
205 htrigmc16.SetNameTime("MTimeTrigger");
206 plist.AddToList(&htrigmc16);
207 MHPixVsTime htrigmc17(16,"TrigMacrocell17");
208 htrigmc17.SetNameTime("MTimeTrigger");
209 plist.AddToList(&htrigmc17);
210 MHPixVsTime htrigmc18(17,"TrigMacrocell18");
211 htrigmc18.SetNameTime("MTimeTrigger");
212 plist.AddToList(&htrigmc18);
213 MHPixVsTime htrigmc19(18,"TrigMacrocell19");
214 htrigmc19.SetNameTime("MTimeTrigger");
215 plist.AddToList(&htrigmc19);
216
217 // Set of MH3 classes
218 MH3 hError("MReportDrive.GetAbsError*60");
219 hError.SetName("DeltaH");
220 MBinning bins("BinningDeltaH");
221 bins.SetEdges(18, 0, 3.6);
222 plist.AddToList(&bins);
223 MH3 hError2("MReportDrive.fNominalZd","MReportDrive.GetAbsError*60");
224 hError2.SetName("DeltaHvsZd");
225 MBinning bins2("BinningDeltaHvsZdX");
226 MBinning bins3("BinningDeltaHvsZdY");
227 bins2.SetEdges(90, 0, 90);
228 bins3.SetEdges(18, 0, 3.6);
229 plist.AddToList(&bins2);
230 plist.AddToList(&bins3);
231 MH3 hTempOptLink("MCameraCooling.fTempOptLink");
232 hTempOptLink.SetName("TOptLink");
233 MBinning bins4("BinningTOptLinkX");
234 bins4.SetEdges(50, 0, 50);
235 plist.AddToList(&bins4);
236 MH3 hTrigZd("MReportDrive.fNominalZd","MReportTrigger.fL2AfterPrescaler");
237 hTrigZd.SetName("TrigZd");
238 MBinning bins5("BinningTrigZdX");
239 bins5.SetEdges(90, 0, 90);
240 plist.AddToList(&bins5);
241 MBinning bins6("BinningTrigZdY");
242 bins6.SetEdges(10000, 0, 15000);
243 plist.AddToList(&bins6);
244
245
246 // Fill all the MH classes defined before
247 MFillH fillZd(&hZd, "MTimeDrive");
248 MFillH fillAz(&hAz, "MTimeDrive");
249 MFillH fillError(&hError);
250 MFillH fillDState(&hDState, "MTimeDrive");
251 MFillH fillError2(&hError2);
252 MFillH fillHVA(&hHVA, "MTimeCamera");
253 MFillH fillHVB(&hHVB, "MTimeCamera");
254 MFillH fillCA(&hCA, "MTimeCamera");
255 MFillH fillCB(&hCB, "MTimeCamera");
256 MFillH fillLVTemp(&hLVTemp, "MTimeCamera");
257 MFillH fillLVHum(&hLVHum, "MTimeCamera");
258 MFillH fillLVStatus(&hLVStatus, "MTimeCamera");
259 MFillH fillLVRPS(&hLVRPS, "MTimeCamera");
260 MFillH fillTCenter(&hTCenter, "MTimeCamera");
261 MFillH fillTWall(&hTWall, "MTimeCamera");
262 MFillH fillTWater(&hTWater, "MTimeCamera");
263 MFillH fillTOptLink(&hTOptLink, "MTimeCamera");
264 MFillH fillTempOptLink(&hTempOptLink);
265 MFillH fillHWall(&hHWall, "MTimeCamera");
266 MFillH fillHCenter(&hHCenter, "MTimeCamera");
267 MFillH fillCCHum(&hCCHum, "MTimeCC");
268 MFillH fillCCTemp(&hCCTemp, "MTimeCC");
269 MFillH fillCCWS(&hCCWS, "MTimeCC");
270 MFillH fillCCSR(&hCCSR, "MTimeCC");
271 MFillH fillTrigBL2(&hTrigBL2, "MTimeTrigger");
272 MFillH fillTrigAL2(&hTrigAL2, "MTimeTrigger");
273 MFillH fillTrigStatus(&hTrigStatus, "MTimeTrigger");
274 MFillH fillTrigZd(&hTrigZd);
275 MFillH fillCamStatus(&hCamStatus,"MTimeCamera");
276 MFillH fillCamSentStatus(&hCamSentStatus,"MTimeCamera");
277 MFillH fillCamStatusDC(&hCamStatusDC, "MTimeCamera");
278 MFillH fillHVStatus(&hHVStatus, "MTimeCamera");
279 MFillH fillLidsStatus(&hLidsStatus, "MTimeCamera");
280 MFillH fillCoolStatus(&hCoolStatus, "MTimeCamera");
281 MFillH filltrigmc1("TrigMacrocell1","MReportTrigger");
282 MFillH filltrigmc2("TrigMacrocell2","MReportTrigger");
283 MFillH filltrigmc3("TrigMacrocell3","MReportTrigger");
284 MFillH filltrigmc4("TrigMacrocell4","MReportTrigger");
285 MFillH filltrigmc5("TrigMacrocell5","MReportTrigger");
286 MFillH filltrigmc6("TrigMacrocell6","MReportTrigger");
287 MFillH filltrigmc7("TrigMacrocell7","MReportTrigger");
288 MFillH filltrigmc8("TrigMacrocell8","MReportTrigger");
289 MFillH filltrigmc9("TrigMacrocell9","MReportTrigger");
290 MFillH filltrigmc10("TrigMacrocell10","MReportTrigger");
291 MFillH filltrigmc11("TrigMacrocell11","MReportTrigger");
292 MFillH filltrigmc12("TrigMacrocell12","MReportTrigger");
293 MFillH filltrigmc13("TrigMacrocell13","MReportTrigger");
294 MFillH filltrigmc14("TrigMacrocell14","MReportTrigger");
295 MFillH filltrigmc15("TrigMacrocell15","MReportTrigger");
296 MFillH filltrigmc16("TrigMacrocell16","MReportTrigger");
297 MFillH filltrigmc17("TrigMacrocell17","MReportTrigger");
298 MFillH filltrigmc18("TrigMacrocell18","MReportTrigger");
299 MFillH filltrigmc19("TrigMacrocell19","MReportTrigger");
300 MFillH fillcammean(&hCamMean,"MTimeCamera");
301 MFillH fillHVD(&HVdisplay,"MCameraHV");
302
303 // Do not display the result given by the default draw function
304 fillZd.SetBit(MFillH::kDoNotDisplay);
305 fillAz.SetBit(MFillH::kDoNotDisplay);
306 fillError.SetBit(MFillH::kDoNotDisplay);
307 fillDState.SetBit(MFillH::kDoNotDisplay);
308 fillError2.SetBit(MFillH::kDoNotDisplay);
309 fillHVA.SetBit(MFillH::kDoNotDisplay);
310 fillHVB.SetBit(MFillH::kDoNotDisplay);
311 fillCA.SetBit(MFillH::kDoNotDisplay);
312 fillCB.SetBit(MFillH::kDoNotDisplay);
313 fillLVTemp.SetBit(MFillH::kDoNotDisplay);
314 fillLVHum.SetBit(MFillH::kDoNotDisplay);
315 fillLVStatus.SetBit(MFillH::kDoNotDisplay);
316 fillLVRPS.SetBit(MFillH::kDoNotDisplay);
317 fillTCenter.SetBit(MFillH::kDoNotDisplay);
318 fillTWall.SetBit(MFillH::kDoNotDisplay);
319 fillTWater.SetBit(MFillH::kDoNotDisplay);
320 fillTOptLink.SetBit(MFillH::kDoNotDisplay);
321 fillTempOptLink.SetBit(MFillH::kDoNotDisplay);
322 fillHWall.SetBit(MFillH::kDoNotDisplay);
323 fillHCenter.SetBit(MFillH::kDoNotDisplay);
324 fillCCHum.SetBit(MFillH::kDoNotDisplay);
325 fillCCTemp.SetBit(MFillH::kDoNotDisplay);
326 fillCCWS.SetBit(MFillH::kDoNotDisplay);
327 fillCCSR.SetBit(MFillH::kDoNotDisplay);
328 fillTrigBL2.SetBit(MFillH::kDoNotDisplay);
329 fillTrigAL2.SetBit(MFillH::kDoNotDisplay);
330 fillTrigStatus.SetBit(MFillH::kDoNotDisplay);
331 fillTrigZd.SetBit(MFillH::kDoNotDisplay);
332 fillCamStatus.SetBit(MFillH::kDoNotDisplay);
333 fillCamSentStatus.SetBit(MFillH::kDoNotDisplay);
334 fillCamStatusDC.SetBit(MFillH::kDoNotDisplay);
335 fillHVStatus.SetBit(MFillH::kDoNotDisplay);
336 fillLidsStatus.SetBit(MFillH::kDoNotDisplay);
337 fillCoolStatus.SetBit(MFillH::kDoNotDisplay);
338 filltrigmc1.SetBit(MFillH::kDoNotDisplay);
339 filltrigmc2.SetBit(MFillH::kDoNotDisplay);
340 filltrigmc3.SetBit(MFillH::kDoNotDisplay);
341 filltrigmc4.SetBit(MFillH::kDoNotDisplay);
342 filltrigmc5.SetBit(MFillH::kDoNotDisplay);
343 filltrigmc6.SetBit(MFillH::kDoNotDisplay);
344 filltrigmc7.SetBit(MFillH::kDoNotDisplay);
345 filltrigmc8.SetBit(MFillH::kDoNotDisplay);
346 filltrigmc9.SetBit(MFillH::kDoNotDisplay);
347 filltrigmc10.SetBit(MFillH::kDoNotDisplay);
348 filltrigmc11.SetBit(MFillH::kDoNotDisplay);
349 filltrigmc12.SetBit(MFillH::kDoNotDisplay);
350 filltrigmc13.SetBit(MFillH::kDoNotDisplay);
351 filltrigmc14.SetBit(MFillH::kDoNotDisplay);
352 filltrigmc15.SetBit(MFillH::kDoNotDisplay);
353 filltrigmc16.SetBit(MFillH::kDoNotDisplay);
354 filltrigmc17.SetBit(MFillH::kDoNotDisplay);
355 filltrigmc18.SetBit(MFillH::kDoNotDisplay);
356 filltrigmc19.SetBit(MFillH::kDoNotDisplay);
357 fillcammean.SetBit(MFillH::kDoNotDisplay);
358 fillHVD.SetBit(MFillH::kDoNotDisplay);
359
360 // Skip the fill function is there is no tree entries
361 fillZd.SetBit(MFillH::kCanSkip);
362 fillAz.SetBit(MFillH::kCanSkip);
363 fillError.SetBit(MFillH::kCanSkip);
364 fillDState.SetBit(MFillH::kCanSkip);
365 fillError2.SetBit(MFillH::kCanSkip);
366 fillHVA.SetBit(MFillH::kCanSkip);
367 fillHVB.SetBit(MFillH::kCanSkip);
368 fillCA.SetBit(MFillH::kCanSkip);
369 fillCB.SetBit(MFillH::kCanSkip);
370 fillLVTemp.SetBit(MFillH::kCanSkip);
371 fillLVHum.SetBit(MFillH::kCanSkip);
372 fillLVStatus.SetBit(MFillH::kCanSkip);
373 fillLVRPS.SetBit(MFillH::kCanSkip);
374 fillTCenter.SetBit(MFillH::kCanSkip);
375 fillTWall.SetBit(MFillH::kCanSkip);
376 fillTWater.SetBit(MFillH::kCanSkip);
377 fillTOptLink.SetBit(MFillH::kCanSkip);
378 fillTempOptLink.SetBit(MFillH::kCanSkip);
379 fillHWall.SetBit(MFillH::kCanSkip);
380 fillHCenter.SetBit(MFillH::kCanSkip);
381 fillCCHum.SetBit(MFillH::kCanSkip);
382 fillCCTemp.SetBit(MFillH::kCanSkip);
383 fillCCWS.SetBit(MFillH::kCanSkip);
384 fillCCSR.SetBit(MFillH::kCanSkip);
385 fillTrigBL2.SetBit(MFillH::kCanSkip);
386 fillTrigAL2.SetBit(MFillH::kCanSkip);
387 fillTrigStatus.SetBit(MFillH::kCanSkip);
388 fillTrigZd.SetBit(MFillH::kCanSkip);
389 fillCamStatus.SetBit(MFillH::kCanSkip);
390 fillCamSentStatus.SetBit(MFillH::kCanSkip);
391 fillCamStatusDC.SetBit(MFillH::kCanSkip);
392 fillHVStatus.SetBit(MFillH::kCanSkip);
393 fillLidsStatus.SetBit(MFillH::kCanSkip);
394 fillCoolStatus.SetBit(MFillH::kCanSkip);
395 filltrigmc1.SetBit(MFillH::kCanSkip);
396 filltrigmc2.SetBit(MFillH::kCanSkip);
397 filltrigmc3.SetBit(MFillH::kCanSkip);
398 filltrigmc4.SetBit(MFillH::kCanSkip);
399 filltrigmc5.SetBit(MFillH::kCanSkip);
400 filltrigmc6.SetBit(MFillH::kCanSkip);
401 filltrigmc7.SetBit(MFillH::kCanSkip);
402 filltrigmc8.SetBit(MFillH::kCanSkip);
403 filltrigmc9.SetBit(MFillH::kCanSkip);
404 filltrigmc10.SetBit(MFillH::kCanSkip);
405 filltrigmc11.SetBit(MFillH::kCanSkip);
406 filltrigmc12.SetBit(MFillH::kCanSkip);
407 filltrigmc13.SetBit(MFillH::kCanSkip);
408 filltrigmc14.SetBit(MFillH::kCanSkip);
409 filltrigmc15.SetBit(MFillH::kCanSkip);
410 filltrigmc16.SetBit(MFillH::kCanSkip);
411 filltrigmc17.SetBit(MFillH::kCanSkip);
412 filltrigmc18.SetBit(MFillH::kCanSkip);
413 filltrigmc19.SetBit(MFillH::kCanSkip);
414 fillcammean.SetBit(MFillH::kCanSkip);
415 fillHVD.SetBit(MFillH::kCanSkip);
416
417 // Add all the task to the task list
418 tlist.AddToList(&read);
419 tlist.AddToList(&fillZd, "Drive");
420 tlist.AddToList(&fillAz, "Drive");
421 tlist.AddToList(&fillError, "Drive");
422 tlist.AddToList(&fillDState, "Drive");
423 tlist.AddToList(&fillError2, "Drive");
424 tlist.AddToList(&fillHVA, "Camera");
425 tlist.AddToList(&fillHVB, "Camera");
426 tlist.AddToList(&fillCA, "Camera");
427 tlist.AddToList(&fillCB, "Camera");
428 tlist.AddToList(&fillLVTemp, "Camera");
429 tlist.AddToList(&fillLVHum, "Camera");
430 tlist.AddToList(&fillLVStatus, "Camera");
431 tlist.AddToList(&fillLVRPS, "Camera");
432 tlist.AddToList(&fillTCenter, "Camera");
433 tlist.AddToList(&fillTWall, "Camera");
434 tlist.AddToList(&fillTWater, "Camera");
435 tlist.AddToList(&fillTOptLink, "Camera");
436 tlist.AddToList(&fillTempOptLink, "Camera");
437 tlist.AddToList(&fillHWall, "Camera");
438 tlist.AddToList(&fillHCenter, "Camera");
439 tlist.AddToList(&fillCCHum, "CC");
440 tlist.AddToList(&fillCCTemp, "CC");
441 tlist.AddToList(&fillCCWS, "CC");
442 tlist.AddToList(&fillCCSR, "CC");
443 tlist.AddToList(&fillTrigBL2, "Trigger");
444 tlist.AddToList(&fillTrigAL2, "Trigger");
445 tlist.AddToList(&fillTrigStatus, "Trigger");
446 tlist.AddToList(&fillTrigZd);
447 tlist.AddToList(&fillCamStatus, "Camera");
448 tlist.AddToList(&fillCamSentStatus, "Camera");
449 tlist.AddToList(&fillCamStatusDC,"Camera");
450 tlist.AddToList(&fillHVStatus,"Camera");
451 tlist.AddToList(&fillLidsStatus,"Camera");
452 tlist.AddToList(&fillCoolStatus,"Camera");
453 tlist.AddToList(&filltrigmc1, "Trigger");
454 tlist.AddToList(&filltrigmc2, "Trigger");
455 tlist.AddToList(&filltrigmc3, "Trigger");
456 tlist.AddToList(&filltrigmc4, "Trigger");
457 tlist.AddToList(&filltrigmc5, "Trigger");
458 tlist.AddToList(&filltrigmc6, "Trigger");
459 tlist.AddToList(&filltrigmc7, "Trigger");
460 tlist.AddToList(&filltrigmc8, "Trigger");
461 tlist.AddToList(&filltrigmc9, "Trigger");
462 tlist.AddToList(&filltrigmc10, "Trigger");
463 tlist.AddToList(&filltrigmc11, "Trigger");
464 tlist.AddToList(&filltrigmc12, "Trigger");
465 tlist.AddToList(&filltrigmc13, "Trigger");
466 tlist.AddToList(&filltrigmc14, "Trigger");
467 tlist.AddToList(&filltrigmc15, "Trigger");
468 tlist.AddToList(&filltrigmc16, "Trigger");
469 tlist.AddToList(&filltrigmc17, "Trigger");
470 tlist.AddToList(&filltrigmc18, "Trigger");
471 tlist.AddToList(&filltrigmc19, "Trigger");
472 tlist.AddToList(&fillcammean, "Camera");
473 tlist.AddToList(&fillHVD);
474
475 //
476 // Create and setup the eventloop
477 //
478 MEvtLoop evtloop;
479 evtloop.SetParList(&plist);
480// evtloop.SetDisplay(d);
481
482 //
483 // Execute your analysis
484 //
485 if (!evtloop.Eventloop())
486 return;
487
488 tlist.PrintStatistics();
489
490 gStyle->SetPadGridX(kTRUE);
491 gStyle->SetPadGridY(kTRUE);
492 gStyle->SetCanvasColor(kWhite);
493 MHVsTime *clone1;
494 TGraph *g;
495 TH1 *hist;
496 TAxis *axey;
497 TAxis *axex;
498 MH3 *mh3;
499 MHPixVsTime *pixclone1;
500 MHCamera *Sum;
501 //
502 // Drive report (pointing.C from T. Bretz)
503 //
504 if ((d = evtloop.GetDisplay()))
505 TCanvas &c1 = d.AddTab("DRIVE SYSTEM");
506 else
507 TCanvas *c1 = new TCanvas();
508 // ************* Plot the telescope tracking positions on the sky ***********
509 TGraph *g1 = hZd.GetGraph();
510 TGraph *g2 = hAz.GetGraph();
511 TPad *p = new TPad("", "",0,0.05,0.6,0.95);
512 p->Draw();
513 p->cd();
514 gPad->SetTheta(-90);
515 gPad->SetPhi(90);
516 gPad->SetBorderMode(0);
517 gStyle->SetOptStat(0);
518 TH2F h("pol", "Telescope Tracking Positions on the Sky", 16, 0, 1, 9, 0, 1);
519 h.DrawClone("surf1pol");
520 gPad->Modified();
521 gPad->Update();
522 TView *view = gPad->GetView();
523 if (!view)
524 {
525 cout << "No View!" << endl;
526 return;
527 }
528 Double_t *zd=g1->GetY();
529 Double_t *az=g2->GetY();
530 Double_t old[2] = {0,0};
531 for (int i=0; i<g1->GetN(); i++)
532 {
533 az[i] += 180;
534 az[i] *= TMath::Pi()/180;
535 Double_t x[3] = { zd[i]*cos(az[i])/90, zd[i]*sin(az[i])/90, 0};
536 Double_t y[3];
537 view->WCtoNDC(x, y);
538 if (old[0]!=0 && old[1]!=1)
539 {
540 TLine *l = new TLine(y[0], y[1], old[0], old[1]);
541 l->SetLineColor(kBlue);
542 l->Draw();
543 }
544 TMarker *m = new TMarker(y[0], y[1], kFullDotMedium);
545 m->SetMarkerColor(i==g1->GetN()-1 ? kGreen : kRed);
546 m->Draw();
547 old[0] = y[0];
548 old[1] = y[1];
549 }
550 // ---------------------- Control deviation of the motors -------------------
551 c1->cd();
552 p = new TPad("", "", 0.6, 0, 1, 0.29);
553 p->Draw();
554 p->cd();
555 gStyle->SetOptStat(1110);
556 gStyle->SetStatFormat(".2g");
557 mh3 = (MH3*)hError.DrawClone("nonew");
558 mh3->GetHist()->SetXTitle("\\Delta [arcmin]");
559 mh3->GetHist()->SetYTitle("");
560 mh3->GetHist()->SetTitle("Control deviation of the motors");
561 mh3->GetHist()->SetStats(1);
562 TLine ln;
563 ln.SetLineColor(kGreen);
564 ln.DrawLine(0.5*360*60/16384., 0, 0.5*360*60/16384., hError.GetHist()->GetMaximum());
565 ln.SetLineColor(kYellow);
566 ln.DrawLine(1.0*360*60/16384., 0, 1.0*360*60/16384., hError.GetHist()->GetMaximum());
567 ln.SetLineColor(kRed);
568 ln.DrawLine(2.0*360*60/16384., 0, 2.0*360*60/16384., hError.GetHist()->GetMaximum());
569 // ---------------------- Plot the drive status vs time ---------------------
570 c1->cd();
571 p = new TPad("", "", 0.6, 0.29, 1, 0.42);
572 p->Draw();
573 p->cd();
574 MHVsTime *hvt = (MHVsTime*)hDState.DrawClone("nonew");
575 hvt->GetGraph()->SetMarkerStyle(kFullDotSmall);
576 if (hvt->GetGraph()->GetN())
577 {
578 hist = hvt->GetGraph()->GetHistogram();
579 TAxis *axey = hist->GetYaxis();
580 TAxis *axex = hist->GetXaxis();
581 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
582 hist->SetXTitle("Time");
583 hist->SetYTitle("");
584 hist->SetTitle("");
585 hist->SetStats(0);
586 hist->SetMinimum(-0.5);
587 hist->SetMaximum(4.5);
588 axey->Set(5, -0.5, 4.5);
589 axey->SetBinLabel(axey->FindFixBin(0), "Error");
590 axey->SetBinLabel(axey->FindFixBin(1), "Stopped");
591 axey->SetBinLabel(axey->FindFixBin(3), "Moving");
592 axey->SetBinLabel(axey->FindFixBin(4), "Tracking");
593 axey->SetLabelSize(0.15);
594 axex->SetLabelSize(0.08);
595 axex->SetTitleSize(0.09);
596 axex->SetTitleOffset(0.45);
597 }
598 // --------------- Control deviation of the motors vs zenith angle ----------
599 c1->cd();
600 p = new TPad("", "", 0.6, 0.71, 1, 1);
601 p->Draw();
602 p->cd();
603 gStyle->SetOptStat(1110);
604 gStyle->SetStatFormat(".2g");
605 mh3 = (MH3*)hError2.DrawClone("nonew");
606 mh3->GetHist()->SetXTitle("Zd [\\circ]");
607 mh3->GetHist()->SetYTitle("\\Delta [arcmin]");
608 mh3->GetHist()->SetTitle("Control deviation of the motors");
609 mh3->GetHist()->SetStats(1);
610 mh3->GetHist()->Draw("box");
611 // -------------------------- Zenith angle vs time --------------------------
612 c1->cd();
613 p = new TPad("", "", 0.6, 0.42, 1, 0.71);
614 p->Draw();
615 p->cd();
616 gPad->SetBorderMode(0);
617 hvt = (MHVsTime*)hZd.DrawClone("nonew");
618 hvt->GetGraph()->SetMarkerStyle(kFullDotSmall);
619 if (hvt->GetGraph()->GetN())
620 {
621 hvt->GetGraph()->GetHistogram()->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
622 hvt->GetGraph()->GetHistogram()->SetXTitle("Time");
623 hvt->GetGraph()->GetHistogram()->SetYTitle("Zd [\\circ]");
624 hvt->GetGraph()->GetHistogram()->SetTitle("Zd vs. Time");
625 hvt->GetGraph()->GetHistogram()->SetStats(0);
626 }
627
628
629 //
630 // Camera report
631 //
632 // **************************** CAMERA STATUS ********************
633 if ((d = evtloop.GetDisplay()))
634 TCanvas &c2 = d.AddTab("CAMERA STATUS");
635 else
636 TCanvas *c2 = new TCanvas();
637 c2->Divide(1,2);
638 c2->cd(1);
639 g = hCamStatus.GetGraph();
640 g->SetMarkerStyle(kFullDotSmall);
641 g->SetTitle("Camera status");
642 clone1 = (MHVsTime*)hCamStatus.DrawClone("nonew");
643 if(clone1->GetGraph()->GetN())
644 {
645 hist = clone1->GetGraph()->GetHistogram();
646 axey = hist->GetYaxis();
647 hist->SetMinimum(-0.5);
648 hist->SetMaximum(9.5);
649 axey->Set(10,-0.5,9.5);
650 axey->SetBinLabel(axey->FindFixBin(0),"EROR");
651 axey->SetBinLabel(axey->FindFixBin(1),"ALARM");
652 axey->SetBinLabel(axey->FindFixBin(2),"BLOCKED!");
653 axey->SetBinLabel(axey->FindFixBin(3),"WARM!");
654 axey->SetBinLabel(axey->FindFixBin(4),"HOT");
655 axey->SetBinLabel(axey->FindFixBin(5),"HVRAMPING");
656 axey->SetBinLabel(axey->FindFixBin(6),"OK");
657 axey->SetBinLabel(axey->FindFixBin(7),"INIT");
658 axey->SetBinLabel(axey->FindFixBin(8),"SHUTD");
659 axey->SetBinLabel(axey->FindFixBin(9),"N/A");
660 axey->SetLabelSize(0.05);
661 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
662 hist->SetXTitle("Time");
663 hist->SetYTitle("");
664 }
665 c2->cd(2);
666 g = hLidsStatus.GetGraph();
667 g->SetMarkerStyle(kFullDotSmall);
668 g->SetTitle("Camera Lids status");
669 clone1 = (MHVsTime*)hLidsStatus.DrawClone("nonew");
670 if(clone1->GetGraph()->GetN())
671 {
672 hist = clone1->GetGraph()->GetHistogram();
673 axey = hist->GetYaxis();
674 hist->SetMinimum(-0.5);
675 hist->SetMaximum(9.5);
676 axey->Set(10,-0.5,9.5);
677 axey->SetBinLabel(axey->FindFixBin(0),"Error");
678 axey->SetBinLabel(axey->FindFixBin(1),"SafetyLimit");
679 axey->SetBinLabel(axey->FindFixBin(4),"Closed");
680 axey->SetBinLabel(axey->FindFixBin(5),"Opened");
681 axey->SetBinLabel(axey->FindFixBin(6),"Moving");
682 axey->SetBinLabel(axey->FindFixBin(7),"Stopped");
683 axey->SetBinLabel(axey->FindFixBin(9),"n/a");
684 axey->SetLabelSize(0.05);
685 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
686 hist->SetXTitle("Time");
687 hist->SetYTitle("");
688 }
689 // ************************* HV of power supplies ***************************
690 if ((d = evtloop.GetDisplay()))
691 TCanvas &c3 = d.AddTab("CAMERA HV");
692 else
693 TCanvas *c3 = new TCanvas();
694 c3->Divide(2,2);
695 c3->cd(1);
696 // --------------- Power supplies and HV settings --------------------------
697 TLegend *legHV = new TLegend(0.75,0.85,0.99,0.99);
698 g = hHVA.GetGraph();
699 g->SetMarkerColor(2);
700 g->SetLineColor(2);
701 g->SetTitle("Voltages of power supplies and camera settings");
702 legHV->AddEntry(g,"PS A (hvps1)","l");
703 clone1 = (MHVsTime*)hHVA.DrawClone("nonew");
704 if(clone1->GetGraph()->GetN())
705 {
706 hist = clone1->GetGraph()->GetHistogram();
707 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
708 hist->SetXTitle("Time");
709 hist->SetYTitle("High voltage [V]");
710 hist->SetMinimum(0);
711 }
712 g = hHVB.GetGraph();
713 g->SetMarkerColor(3);
714 g->SetLineColor(3);
715 legHV->AddEntry(g,"PS B (hvps2)","l");
716 clone1 = (MHVsTime*)hHVB.DrawClone("nonewsame");
717 g = hCamMean.GetGraph();
718 g->SetMarkerColor(4);
719 g->SetLineColor(4);
720 legHV->AddEntry(g,"Camera mean HV","l");
721 clone1 = (MHVsTime*)hCamMean.DrawClone("nonewsame");
722 legHV->DrawClone();
723 // ---------------------------- HV status -----------------------------------
724 c3->cd(2);
725 g = hHVStatus.GetGraph();
726 g->SetMarkerStyle(kFullDotSmall);
727 g->SetTitle("Camera HV status");
728 clone1 = (MHVsTime*)hHVStatus.DrawClone("nonew");
729 if(clone1->GetGraph()->GetN())
730 {
731 hist = clone1->GetGraph()->GetHistogram();
732 axey = hist->GetYaxis();
733 hist->SetMinimum(-0.5);
734 hist->SetMaximum(9.5);
735 axey->Set(10,-0.5,9.5);
736 axey->SetBinLabel(axey->FindFixBin(0),"Error");
737 axey->SetBinLabel(axey->FindFixBin(1),"Mismatch");
738 axey->SetBinLabel(axey->FindFixBin(2),"Trip");
739 axey->SetBinLabel(axey->FindFixBin(3),"Ramping");
740 axey->SetBinLabel(axey->FindFixBin(4),"Off");
741 axey->SetBinLabel(axey->FindFixBin(5),"Nominal");
742 axey->SetBinLabel(axey->FindFixBin(6),"LimCurrentWarning");
743 axey->SetBinLabel(axey->FindFixBin(9),"n/a");
744 axey->SetLabelSize(0.05);
745 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
746 hist->SetXTitle("Time");
747 hist->SetYTitle("");
748 }
749 // ---------------------------- HV settings ---------------------------------
750 c3->cd(3);
751 Sum = (MHCamera*)HVdisplay.GetHistByName("sum");
752 TVirtualPad *c = gPad;
753 c->cd(1);
754 gPad->SetBorderMode(0);
755 Sum->SetYTitle("Mean");
756 Sum->DrawClone("pixelindex");
757 c3->cd(4);
758 gPad->SetBorderMode(0);
759 Sum->SetYTitle("Mean HV settings");
760 Sum->DrawClone("EPhist");
761
762 // ******************** Currents of power supplies *******************
763 if ((d = evtloop.GetDisplay()))
764 TCanvas &c4 = d.AddTab("CAMERA DC");
765 else
766 TCanvas *c4 = new TCanvas();
767 // ----------------------------- Power supplies ------------------------------
768 c4->Divide(1,2);
769 c4->cd(1);
770 TLegend *legC = new TLegend(0.85,0.75,0.99,0.99);
771 g = hCA.GetGraph();
772 g->SetMarkerColor(2);
773 g->SetLineColor(2);
774 g->SetTitle("Currents of power supplies");
775 legC->AddEntry(g,"PS A (curr1)","l");
776 clone1 = (MHVsTime*)hCA.DrawClone("nonew");
777 if(clone1->GetGraph()->GetN())
778 {
779 hist = clone1->GetGraph()->GetHistogram();
780 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
781 hist->SetXTitle("Time");
782 hist->SetYTitle("Current [mA]");
783 hist->SetMinimum(0);
784 }
785 g = hCB.GetGraph();
786 g->SetMarkerColor(3);
787 g->SetLineColor(3);
788 legC->AddEntry(g,"PS B (curr2)","l");
789 clone1 = (MHVsTime*)hCB.DrawClone("nonewsame");
790 legC->DrawClone();
791 c4->cd(2);
792 g = hCamStatusDC.GetGraph();
793 g->SetMarkerStyle(kFullDotSmall);
794 g->SetTitle("Camera DC status");
795 clone1 = (MHVsTime*)hCamStatusDC.DrawClone("nonew");
796 if(clone1->GetGraph()->GetN())
797 {
798 hist = clone1->GetGraph()->GetHistogram();
799 axey = hist->GetYaxis();
800 hist->SetMinimum(-0.5);
801 hist->SetMaximum(9.5);
802 axey->Set(10,-0.5,9.5);
803 axey->SetBinLabel(axey->FindFixBin(0),"Error");
804 axey->SetBinLabel(axey->FindFixBin(1),"Alarm");
805 axey->SetBinLabel(axey->FindFixBin(3),"Hot");
806 axey->SetBinLabel(axey->FindFixBin(5),"Ok");
807 axey->SetBinLabel(axey->FindFixBin(6),"Warm");
808 axey->SetBinLabel(axey->FindFixBin(9),"n/a");
809 axey->SetLabelSize(0.09);
810 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
811 hist->SetXTitle("Time");
812 hist->SetYTitle("");
813 }
814
815
816 // ***************************** LV power supplies **************************
817 if ((d = evtloop.GetDisplay()))
818 TCanvas &c5 = d.AddTab("CAMERA LV");
819 else
820 TCanvas *c5 = new TCanvas();
821 c5->Divide(2,2);
822 c5->cd(1);
823 g = hLVTemp.GetGraph();
824 g->SetMarkerColor(2);
825 g->SetLineColor(2);
826 g->SetTitle("LV temperature");
827 clone1 = (MHVsTime*)hLVTemp.DrawClone("nonew");
828 if(clone1->GetGraph()->GetN())
829 {
830 hist = clone1->GetGraph()->GetHistogram();
831 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
832 hist->SetXTitle("Time");
833 hist->SetYTitle("Temperature [\\circ]");
834 }
835 c5->cd(2);
836 g = hLVHum.GetGraph();
837 g->SetMarkerColor(4);
838 g->SetLineColor(4);
839 g->SetTitle("LV humidity");
840 clone1 = (MHVsTime*)hLVHum.DrawClone("nonew");
841 if(clone1->GetGraph()->GetN())
842 {
843 hist = clone1->GetGraph()->GetHistogram();
844 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
845 hist->SetXTitle("Time");
846 hist->SetYTitle("Humidity [%]");
847 }
848 c5->cd(3);
849 g = hLVStatus.GetGraph();
850 g->SetMarkerStyle(kFullDotSmall);
851 g->SetTitle("LV status");
852 clone1 = (MHVsTime*)hLVStatus.DrawClone("nonew");
853 if(clone1->GetGraph()->GetN())
854 {
855 hist = clone1->GetGraph()->GetHistogram();
856 axey = hist->GetYaxis();
857 hist->SetMinimum(-0.5);
858 hist->SetMaximum(9.5);
859 axey->Set(10,-0.5,9.5);
860 axey->SetBinLabel(axey->FindFixBin(0),"Error");
861 axey->SetBinLabel(axey->FindFixBin(1),"Alarm");
862 axey->SetBinLabel(axey->FindFixBin(2),"Trip");
863 axey->SetBinLabel(axey->FindFixBin(4),"Off");
864 axey->SetBinLabel(axey->FindFixBin(5),"On");
865 axey->SetBinLabel(axey->FindFixBin(9),"n/a");
866 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
867 hist->SetXTitle("Time");
868 hist->SetYTitle("");
869 }
870 c5->cd(4);
871 g = hLVRPS.GetGraph();
872 g->SetMarkerStyle(kFullDotSmall);
873 g->SetTitle("LV request power supply");
874 clone1 = (MHVsTime*)hLVRPS.DrawClone("nonew");
875 if(clone1->GetGraph()->GetN())
876 {
877 hist = clone1->GetGraph()->GetHistogram();
878 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
879 hist->SetXTitle("Time");
880 hist->SetYTitle("");
881 axey = hist->GetYaxis();
882 hist->SetMinimum(-0.5);
883 hist->SetMaximum(1.5);
884 axey->Set(2, -0.5, 1.5);
885 axey->SetBinLabel(axey->FindFixBin(0), "OFF");
886 axey->SetBinLabel(axey->FindFixBin(1), "ON");
887 }
888 // ****************************** Cooling ***********************************
889 if ((d = evtloop.GetDisplay()))
890 TCanvas &c6 = d.AddTab("COOLING SYSTEM");
891 else
892 TCanvas *c6 = new TCanvas();
893 gStyle->SetPadGridX(kTRUE);
894 gStyle->SetPadGridY(kTRUE);
895 c6->Divide(2,2);
896 c6->cd(1);
897 // -------------------------- Camera temperatures ---------------------------
898 TLegend *legtemp = new TLegend(0.75,0.80,0.99,0.99);
899 g = hTCenter.GetGraph();
900 g->SetMarkerColor(8);
901 g->SetLineColor(8);
902 g->SetTitle("Camera temperature");
903 legtemp->AddEntry(g,"camera center","l");
904 clone1 = (MHVsTime*)hTCenter.DrawClone("nonew");
905 if(clone1->GetGraph()->GetN())
906 {
907 hist = clone1->GetGraph()->GetHistogram();
908 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
909 hist->SetXTitle("Time");
910 hist->SetYTitle("Temperature [\\circ C]");
911 hist->SetMinimum(0);
912 }
913 g = hTWall.GetGraph();
914 g->SetMarkerColor(12);
915 g->SetLineColor(12);
916 legtemp->AddEntry(g,"camera wall","l");
917 clone1 = (MHVsTime*)hTWall.DrawClone("nonewsame");
918 g = hTWater.GetGraph();
919 g->SetMarkerColor(4);
920 g->SetLineColor(4);
921 legtemp->AddEntry(g,"water deposit","l");
922 clone1 = (MHVsTime*)hTWater.DrawClone("nonewsame");
923 g = hTOptLink.GetGraph();
924 g->SetMarkerColor(2);
925 g->SetLineColor(2);
926 legtemp->AddEntry(g,"optical links","l");
927 clone1 = (MHVsTime*)hTOptLink.DrawClone("nonewsame");
928 legtemp->DrawClone();
929 c6->cd(2);
930 g = hCoolStatus.GetGraph();
931 g->SetMarkerStyle(kFullDotSmall);
932 g->SetTitle("Camera cooling status");
933 clone1 = (MHVsTime*)hCoolStatus.DrawClone("nonew");
934 if(clone1->GetGraph()->GetN())
935 {
936 hist = clone1->GetGraph()->GetHistogram();
937 axey = hist->GetYaxis();
938 hist->SetMinimum(-0.5);
939 hist->SetMaximum(9.5);
940 axey->Set(10,-0.5,9.5);
941 axey->SetBinLabel(axey->FindFixBin(0),"Error");
942 axey->SetBinLabel(axey->FindFixBin(1),"Alarm");
943 axey->SetBinLabel(axey->FindFixBin(4),"Off");
944 axey->SetBinLabel(axey->FindFixBin(5),"Ok");
945 axey->SetBinLabel(axey->FindFixBin(6),"Temp.Warning");
946 axey->SetBinLabel(axey->FindFixBin(7),"Cond.Warning");
947 axey->SetBinLabel(axey->FindFixBin(9),"n/a");
948 axey->SetLabelSize(0.05);
949 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
950 hist->SetXTitle("Time");
951 hist->SetYTitle("");
952 }
953 // ------------------------- Camera relative humidity -----------------------
954 c6->cd(3);
955 TLegend *leghum = new TLegend(0.75,0.85,0.99,0.99);
956 g = hHCenter.GetGraph();
957 g->SetMarkerColor(8);
958 g->SetLineColor(8);
959 g->SetTitle("Camera relative humidity");
960 leghum->AddEntry(g,"camera center","l");
961 clone1 = (MHVsTime*)hHCenter.DrawClone("nonew");
962 if(clone1->GetGraph()->GetN())
963 {
964 hist = clone1->GetGraph()->GetHistogram();
965 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
966 hist->SetXTitle("Time");
967 hist->SetYTitle("Relative humidity [%]");
968 hist->SetMaximum(50);
969 hist->SetMinimum(0);
970 }
971 g = hHWall.GetGraph();
972 g->SetMarkerColor(12);
973 g->SetLineColor(12);
974 leghum->AddEntry(g,"camera wall","l");
975 clone1 = (MHVsTime*)hHWall.DrawClone("nonewsame");
976 leghum->DrawClone();
977 // ---------------------- Temperature distribution --------------------------
978 c6->cd(4);
979 hist = hTempOptLink.GetHistByName("TOptLink");
980 hist->SetXTitle("Temperature [\\circ C]");
981 hist->SetYTitle("");
982 hist->SetLineColor(2);
983 hist->SetTitle("Distribution of opt. links temperature");
984 hist->SetStats(0);
985 mh3 = (MH3*)hTempOptLink.DrawClone("nonew");
986 //
987 // **************************** Trigger report ******************************
988 //
989 if ((d = evtloop.GetDisplay()))
990 TCanvas &c7 = d.AddTab("TRIGGER SYSTEM");
991 else
992 TCanvas *c7 = new TCanvas();
993 c7->Divide(1,3);
994 c7->cd(1);
995 gStyle->SetPadGridX(kTRUE);
996 gStyle->SetPadGridY(kTRUE);
997 gPad->SetLogy();
998 TLegend *legtrig = new TLegend(0.85,0.85,0.99,0.99);
999 g = hTrigBL2.GetGraph();
1000 g->SetMarkerStyle(kFullDotSmall);
1001 g->SetMarkerColor(2);
1002 g->SetLineColor(2);
1003 g->SetTitle("L2 trigger rate");
1004 legtrig->AddEntry(g,"Before prescaler","l");
1005 clone1 = (MHVsTime*)hTrigBL2.DrawClone("nonew");
1006 if(clone1->GetGraph()->GetN())
1007 {
1008 hist = clone1->GetGraph()->GetHistogram();
1009 hist->SetMinimum(1);
1010 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
1011 hist->GetXaxis()->SetLabelSize(0.05);
1012 hist->GetYaxis()->SetLabelSize(0.05);
1013 hist->SetXTitle("Time");
1014 hist->SetYTitle("L2 trigger rate [Hz]");
1015 }
1016 g = hTrigAL2.GetGraph();
1017 g->SetMarkerColor(4);
1018 g->SetLineColor(4);
1019 legtrig->AddEntry(g,"After prescaler","l");
1020 clone1 = (MHVsTime*)hTrigAL2.DrawClone("nonewsame");
1021 legtrig->DrawClone();
1022 c7->cd(2);
1023 gPad->SetLogy();
1024 hist = hTrigZd.GetHistByName("TrigZd");
1025 hist->GetXaxis()->SetLabelSize(0.05);
1026 hist->GetYaxis()->SetLabelSize(0.05);
1027 hist->SetXTitle("Zenith angle[\\circ]");
1028 hist->SetYTitle("Trigger rate [Hz]");
1029 hist->SetMarkerColor(4);
1030 hist->SetTitle("L2 trigger rate after prescaler");
1031 hist->SetStats(0);
1032 mh3 = (MH3*)hTrigZd.DrawClone("nonew");
1033 hist->SetMinimum(1);
1034 c7->cd(3);
1035 g = hTrigStatus.GetGraph();
1036 g->SetMarkerStyle(kFullDotSmall);
1037 g->SetTitle("Trigger status");
1038 clone1 = (MHVsTime*)hTrigStatus.DrawClone("nonew");
1039 if(clone1->GetGraph()->GetN())
1040 {
1041 hist = clone1->GetGraph()->GetHistogram();
1042 axey = hist->GetYaxis();
1043 hist->SetMinimum(-0.5);
1044 hist->SetMaximum(5.5);
1045 axey->Set(6,-0.5,5.5);
1046 axey->SetBinLabel(axey->FindFixBin(0),"Error");
1047 axey->SetBinLabel(axey->FindFixBin(1),"Idle");
1048 axey->SetBinLabel(axey->FindFixBin(2),"Loading");
1049 axey->SetBinLabel(axey->FindFixBin(3),"Ready");
1050 axey->SetBinLabel(axey->FindFixBin(4),"Active");
1051 axey->SetBinLabel(axey->FindFixBin(5),"Stopped");
1052 axey->SetLabelSize(0.05);
1053 hist->GetXaxis()->SetLabelSize(0.05);
1054 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
1055 hist->SetXTitle("Time");
1056 hist->SetYTitle("");
1057 }
1058 // ***************************** Trigger of macrocells **********************
1059 if ((d = evtloop.GetDisplay()))
1060 TCanvas &c8 = d.AddTab("TRIG. MACROCELLs");
1061 else
1062 TCanvas *c8 = new TCanvas();
1063 c8->Divide(2,2);
1064 c8->cd(1);
1065 gPad->SetLogy();
1066 TLegend *legtrig = new TLegend(0.70,0.80,0.99,0.99);
1067 g = htrigmc1.GetGraph();
1068 g->SetMarkerStyle(kFullDotSmall);
1069 g->SetMarkerColor(2);
1070 legtrig->AddEntry(g,Form("Macrocell 1: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1071 g->SetTitle("Trigger rate of mc 1 : (maximum)");
1072 pixclone1 = (MHPixVsTime*)htrigmc1.DrawClone("nonew");
1073 if(clone1->GetGraph()->GetN())
1074 {
1075 hist = pixclone1->GetGraph()->GetHistogram();
1076 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1077 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1078 hist->SetMinimum(1);
1079 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
1080 hist->SetXTitle("Time");
1081 hist->SetYTitle("Trigger [Hz]");
1082 }
1083 legtrig->DrawClone();
1084 c8->cd(2);
1085 gPad->SetLogy();
1086 TLegend *legtrig = new TLegend(0.70,0.70,0.99,0.99);
1087 g = htrigmc2.GetGraph();
1088 g->SetMarkerStyle(kFullDotSmall);
1089 g->SetMarkerColor(2);
1090 legtrig->AddEntry(g,Form("Macrocell 2: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1091 g->SetTitle("Trigger rate of mc 2-7 : (maximum)");
1092 pixclone1 = (MHPixVsTime*)htrigmc2.DrawClone("nonew");
1093 if(clone1->GetGraph()->GetN())
1094 {
1095 hist = pixclone1->GetGraph()->GetHistogram();
1096 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1097 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1098 hist->SetMinimum(1);
1099 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
1100 hist->SetXTitle("Time");
1101 hist->SetYTitle("Trigger [Hz]");
1102 }
1103 g=htrigmc3.GetGraph();
1104 g->SetMarkerStyle(kFullDotSmall);
1105 g->SetMarkerColor(3);
1106 legtrig->AddEntry(g,Form("Macrocell 3: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1107 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1108 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1109 pixclone1 = (MHPixVsTime*)htrigmc3.DrawClone("nonewsame");
1110 g=htrigmc4.GetGraph();
1111 g->SetMarkerStyle(kFullDotSmall);
1112 g->SetMarkerColor(4);
1113 legtrig->AddEntry(g,Form("Macrocell 4: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1114 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1115 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1116 pixclone1 = (MHPixVsTime*)htrigmc4.DrawClone("nonewsame");
1117 g=htrigmc5.GetGraph();
1118 g->SetMarkerStyle(kFullDotSmall);
1119 g->SetMarkerColor(5);
1120 legtrig->AddEntry(g,Form("Macrocell 5: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1121 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1122 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1123 pixclone1 = (MHPixVsTime*)htrigmc5.DrawClone("nonewsame");
1124 g=htrigmc6.GetGraph();
1125 g->SetMarkerStyle(kFullDotSmall);
1126 g->SetMarkerColor(6);
1127 legtrig->AddEntry(g,Form("Macrocell 6: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1128 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1129 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1130 pixclone1 = (MHPixVsTime*)htrigmc6.DrawClone("nonewsame");
1131 g=htrigmc7.GetGraph();
1132 g->SetMarkerStyle(kFullDotSmall);
1133 g->SetMarkerColor(7);
1134 legtrig->AddEntry(g,Form("Macrocell 7: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1135 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1136 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1137 pixclone1 = (MHPixVsTime*)htrigmc7.DrawClone("nonewsame");
1138 legtrig->DrawClone();
1139 c8->cd(3);
1140 gPad->SetLogy();
1141 TLegend *legtrig = new TLegend(0.70,0.70,0.99,0.99);
1142 g = htrigmc8.GetGraph();
1143 g->SetMarkerStyle(kFullDotSmall);
1144 g->SetMarkerColor(2);
1145 legtrig->AddEntry(g,Form("Macrocell 8: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1146 g->SetTitle("Trigger rate of mc 8-13 : (maximum)");
1147 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1148 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1149 pixclone1 = (MHPixVsTime*)htrigmc8.DrawClone("nonew");
1150 if(clone1->GetGraph()->GetN())
1151 {
1152 hist = pixclone1->GetGraph()->GetHistogram();
1153 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1154 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1155 hist->SetMinimum(1);
1156 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
1157 hist->SetXTitle("Time");
1158 hist->SetYTitle("Trigger [Hz]");
1159 }
1160 g=htrigmc9.GetGraph();
1161 g->SetMarkerStyle(kFullDotSmall);
1162 g->SetMarkerColor(3);
1163 legtrig->AddEntry(g,Form("Macrocell 9: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1164 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1165 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1166 pixclone1 = (MHPixVsTime*)htrigmc9.DrawClone("nonewsame");
1167 g=htrigmc10.GetGraph();
1168 g->SetMarkerStyle(kFullDotSmall);
1169 g->SetMarkerColor(4);
1170 legtrig->AddEntry(g,Form("Macrocell 10: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1171 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1172 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1173 pixclone1 = (MHPixVsTime*)htrigmc10.DrawClone("nonewsame");
1174 g=htrigmc11.GetGraph();
1175 g->SetMarkerStyle(kFullDotSmall);
1176 g->SetMarkerColor(5);
1177 legtrig->AddEntry(g,Form("Macrocell 11: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1178 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1179 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1180 pixclone1 = (MHPixVsTime*)htrigmc11.DrawClone("nonewsame");
1181 g=htrigmc12.GetGraph();
1182 g->SetMarkerStyle(kFullDotSmall);
1183 g->SetMarkerColor(6);
1184 legtrig->AddEntry(g,Form("Macrocell 12: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1185 pixclone1 = (MHPixVsTime*)htrigmc12.DrawClone("nonewsame");
1186 g=htrigmc13.GetGraph();
1187 g->SetMarkerStyle(kFullDotSmall);
1188 g->SetMarkerColor(7);
1189 legtrig->AddEntry(g,Form("Macrocell 13: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1190 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1191 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1192 pixclone1 = (MHPixVsTime*)htrigmc13.DrawClone("nonewsame");
1193 legtrig->DrawClone();
1194 c8->cd(4);
1195 gPad->SetLogy();
1196 TLegend *legtrig = new TLegend(0.70,0.70,0.99,0.99);
1197 TGraph *g = htrigmc14.GetGraph();
1198 g->SetMarkerStyle(kFullDotSmall);
1199 g->SetMarkerColor(2);
1200 legtrig->AddEntry(g,Form("Macrocell 14: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1201 g->SetTitle("Trigger rate of mc 14-19 : (maximum)");
1202 pixclone1 = (MHPixVsTime*)htrigmc14.DrawClone("nonew");
1203 if(clone1->GetGraph()->GetN())
1204 {
1205 hist = pixclone1->GetGraph()->GetHistogram();
1206 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1207 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1208 hist->SetMinimum(1);
1209 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
1210 hist->SetXTitle("Time");
1211 hist->SetYTitle("Trigger [Hz]");
1212 }
1213 g=htrigmc15.GetGraph();
1214 g->SetMarkerStyle(kFullDotSmall);
1215 g->SetMarkerColor(3);
1216 legtrig->AddEntry(g,Form("Macrocell 15: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1217 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1218 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1219 pixclone1 = (MHPixVsTime*)htrigmc15.DrawClone("nonewsame");
1220 g=htrigmc16.GetGraph();
1221 g->SetMarkerStyle(kFullDotSmall);
1222 g->SetMarkerColor(4);
1223 legtrig->AddEntry(g,Form("Macrocell 16: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1224 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1225 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1226 pixclone1 = (MHPixVsTime*)htrigmc16.DrawClone("nonewsame");
1227 g=htrigmc17.GetGraph();
1228 g->SetMarkerStyle(kFullDotSmall);
1229 g->SetMarkerColor(5);
1230 legtrig->AddEntry(g,Form("Macrocell 17: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1231 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1232 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1233 pixclone1 = (MHPixVsTime*)htrigmc17.DrawClone("nonewsame");
1234 g=htrigmc18.GetGraph();
1235 g->SetMarkerStyle(kFullDotSmall);
1236 g->SetMarkerColor(6);
1237 legtrig->AddEntry(g,Form("Macrocell 18: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1238 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1239 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1240 pixclone1 = (MHPixVsTime*)htrigmc18.DrawClone("nonewsame");
1241 g=htrigmc19.GetGraph();
1242 g->SetMarkerStyle(kFullDotSmall);
1243 g->SetMarkerColor(7);
1244 legtrig->AddEntry(g,Form("Macrocell 19: %3.0f",g->GetHistogram()->GetMaximum()),"p");
1245 if(hist->GetMaximum()<g->GetHistogram()->GetMaximum())
1246 hist->SetMaximum(g->GetHistogram()->GetMaximum());
1247 pixclone1 = (MHPixVsTime*)htrigmc19.DrawClone("nonewsame");
1248 legtrig->DrawClone();
1249
1250 //
1251 // *************************** Weather station ******************************
1252 //
1253 if ((d = evtloop.GetDisplay()))
1254 TCanvas &c9 = d.AddTab("WEATHER STATION");
1255 else
1256 TCanvas *c9 = new TCanvas();
1257 c9->Divide(2,2);
1258 // ----------------------- Relative humidity --------------------------------
1259 c9->cd(1);
1260 g = hCCHum.GetGraph();
1261 g->SetMarkerStyle(kFullDotSmall);
1262 g->SetMarkerColor(4);
1263 g->SetLineColor(4);
1264 g->SetTitle("Relative humidity outside");
1265 clone1 = (MHVsTime*)hCCHum.DrawClone("nonew");
1266 if(clone1->GetGraph()->GetN())
1267 {
1268 hist = clone1->GetGraph()->GetHistogram();
1269 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
1270 hist->SetXTitle("Time");
1271 hist->SetYTitle("Humidity [%]");
1272 }
1273 // -------------------------- Temperature -----------------------------------
1274 c9->cd(2);
1275 g = hCCTemp.GetGraph();
1276 g->SetMarkerStyle(kFullDotSmall);
1277 g->SetMarkerColor(2);
1278 g->SetLineColor(2);
1279 g->SetTitle("Temperature outside");
1280 clone1 = (MHVsTime*)hCCTemp.DrawClone("nonew");
1281 if(clone1->GetGraph()->GetN())
1282 {
1283 hist = clone1->GetGraph()->GetHistogram();
1284 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
1285 hist->SetXTitle("Time");
1286 hist->SetYTitle("Temperature [\\circ C]");
1287 }
1288 // --------------------------- Wind speed -----------------------------------
1289 c9->cd(3);
1290 g = hCCWS.GetGraph();
1291 g->SetMarkerStyle(kFullDotSmall);
1292 g->SetMarkerColor(3);
1293 g->SetLineColor(3);
1294 g->SetTitle("Wind speed outside");
1295 clone1 = (MHVsTime*)hCCWS.DrawClone("nonew");
1296 if(clone1->GetGraph()->GetN())
1297 {
1298 hist = clone1->GetGraph()->GetHistogram();
1299 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
1300 hist->SetXTitle("Time");
1301 hist->SetYTitle("Wind speed [km/h]");
1302 }
1303 // -------------------------- Solar radiation -------------------------------
1304 c9->cd(4);
1305 g = hCCSR.GetGraph();
1306 g->SetMarkerStyle(kFullDotSmall);
1307 g->SetMarkerColor(9);
1308 g->SetLineColor(9);
1309 g->SetTitle("Solar radiation outside");
1310 clone1 = (MHVsTime*)hCCSR.DrawClone("nonew");
1311 if(clone1->GetGraph()->GetN())
1312 {
1313 hist = clone1->GetGraph()->GetHistogram();
1314 hist->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00");
1315 hist->SetXTitle("Time");
1316 hist->SetYTitle("Solar radiation [W/m^2]");
1317 }
1318
1319 // Save data in a postscriptfile (filename.ps)
1320 TString file;
1321 if (filename.Last('.')>0)
1322 file = filename(0, filename.Last('.'));
1323
1324 // Make sure the display hasn't been deleted by the user while the
1325 // eventloop was running.
1326 if ((d = evtloop.GetDisplay()))
1327 d->SaveAsPS(directory+file+".ps");
1328 else
1329 {
1330 c1->Print(directory+file+".ps(");
1331 c2->Print(directory+file+".ps");
1332 c3->Print(directory+file+".ps");
1333 c4->Print(directory+file+".ps");
1334 c5->Print(directory+file+".ps");
1335 c6->Print(directory+file+".ps");
1336 c7->Print(directory+file+".ps");
1337 c8->Print(directory+file+".ps");
1338 c9->Print(directory+file+".ps)");
1339 }
1340}
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
Note: See TracBrowser for help on using the repository browser.