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): Thomas Bretz, 1/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
|
---|
19 | ! Author(s): Markus Gaug, 02/2004 <mailto:markus@ifae.es>
|
---|
20 | !
|
---|
21 | ! Copyright: MAGIC Software Development, 2000-2005
|
---|
22 | !
|
---|
23 | !
|
---|
24 | \* ======================================================================== */
|
---|
25 |
|
---|
26 | /////////////////////////////////////////////////////////////////////////////
|
---|
27 | //
|
---|
28 | // MJCalibration
|
---|
29 | //
|
---|
30 | // Do one calibration loop over serious of runs with the same pulser
|
---|
31 | // colour and the same intensity. The following containers (rectangular) and
|
---|
32 | // tasks (ellipses) are called to produce an MCalibrationChargeCam and to
|
---|
33 | // update the MCalibrationQECam: (MCalibrate is not called from this class)
|
---|
34 | //
|
---|
35 | //Begin_Html
|
---|
36 | /*
|
---|
37 | <img src="images/CalibClasses.gif">
|
---|
38 | */
|
---|
39 | //End_Html
|
---|
40 | //
|
---|
41 | // Different signal extractors can be set with the command SetExtractor()
|
---|
42 | // Only extractors deriving from MExtractor can be set, default is MExtractSlidingWindow
|
---|
43 | //
|
---|
44 | // Different arrival time extractors can be set with the command SetTimeExtractor()
|
---|
45 | // Only extractors deriving from MExtractTime can be set, default is MExtractTimeHighestIntegral
|
---|
46 | //
|
---|
47 | // At the end of the eventloop, plots and results are displayed, depending on
|
---|
48 | // the flags set (see DisplayResult())
|
---|
49 | //
|
---|
50 | // If the flag SetFullDisplay() is set, all MHCameras will be displayed.
|
---|
51 | // if the flag SetDataCheckDisplay() is set, only the most important ones are displayed
|
---|
52 | // Otherwise, (default: SetNormalDisplay()), a good selection of plots is given
|
---|
53 | //
|
---|
54 | // The absolute light calibration devices Blind Pixel and PIN Diode can be switched on
|
---|
55 | // and off with the commands:
|
---|
56 | //
|
---|
57 | // - SetUseBlindPixel(Bool_t )
|
---|
58 | // - SetUsePINDiode(Bool_t )
|
---|
59 | //
|
---|
60 | // See also: MHCalibrationChargePix, MHCalibrationChargeCam, MHGausEvents
|
---|
61 | // MHCalibrationChargeBlindPix, MHCalibrationChargePINDiode
|
---|
62 | // MCalibrationChargePix, MCalibrationChargeCam, MCalibrationChargeCalc
|
---|
63 | // MCalibrationBlindPix, MCalibrationChargePINDiode,
|
---|
64 | // MCalibrationQECam, MBadPixelsPix, MBadPixelsCam
|
---|
65 | //
|
---|
66 | // If the flag RelTimeCalibration() is set, a calibration of the relative arrival
|
---|
67 | // times is also performed. The following containers (rectangular) and
|
---|
68 | // tasks (ellipses) are called to produce an MCalibrationRelTimeCam used by
|
---|
69 | // MCalibrateTime to correct timing offset between pixels: (MCalibrateTime is not
|
---|
70 | // called from this class)
|
---|
71 | //
|
---|
72 | //Begin_Html
|
---|
73 | /*
|
---|
74 | <img src="images/RelTimeClasses.gif">
|
---|
75 | */
|
---|
76 | //End_Html
|
---|
77 | //
|
---|
78 | // Different arrival time extractors can be set directly with the command
|
---|
79 | // SetTimeExtractor(MExtractor *)
|
---|
80 | //
|
---|
81 | // Resource file entries are case sensitive!
|
---|
82 | //
|
---|
83 | // See also: MHCalibrationRelTimePix, MHCalibrationRelTimeCam, MHGausEvents
|
---|
84 | // MCalibrationRelTimePix, MCalibrationRelTimeCam
|
---|
85 | // MBadPixelsPix, MBadPixelsCam
|
---|
86 | //
|
---|
87 | /////////////////////////////////////////////////////////////////////////////
|
---|
88 | #include "MJCalibration.h"
|
---|
89 |
|
---|
90 | #include <TFile.h>
|
---|
91 | #include <TF1.h>
|
---|
92 | #include <TStyle.h>
|
---|
93 | #include <TCanvas.h>
|
---|
94 | #include <TSystem.h>
|
---|
95 | #include <TLine.h>
|
---|
96 | #include <TLatex.h>
|
---|
97 | #include <TLegend.h>
|
---|
98 | #include <TRegexp.h>
|
---|
99 | #include <TPaveText.h>
|
---|
100 | #include <TPaveStats.h>
|
---|
101 | #include <TEnv.h>
|
---|
102 |
|
---|
103 | #include "MLog.h"
|
---|
104 | #include "MLogManip.h"
|
---|
105 |
|
---|
106 | #include "MEnv.h"
|
---|
107 | #include "MRunIter.h"
|
---|
108 | #include "MSequence.h"
|
---|
109 | #include "MParList.h"
|
---|
110 | #include "MTaskList.h"
|
---|
111 | #include "MEvtLoop.h"
|
---|
112 |
|
---|
113 | #include "MHCamEvent.h"
|
---|
114 | #include "MHCamera.h"
|
---|
115 | #include "MGeomCam.h"
|
---|
116 |
|
---|
117 | #include "MPedestalCam.h"
|
---|
118 | #include "MPedestalSubtract.h"
|
---|
119 | #include "MCalibColorSteer.h"
|
---|
120 |
|
---|
121 | #include "MCalibrationIntensityChargeCam.h"
|
---|
122 | #include "MCalibrationIntensityBlindCam.h"
|
---|
123 | #include "MCalibrationIntensityRelTimeCam.h"
|
---|
124 | #include "MCalibrationIntensityQECam.h"
|
---|
125 |
|
---|
126 | #include "MCalibrationPatternDecode.h"
|
---|
127 | #include "MCalibrationCam.h"
|
---|
128 | #include "MCalibrationQECam.h"
|
---|
129 | #include "MCalibrationQEPix.h"
|
---|
130 | #include "MCalibrationChargeCam.h"
|
---|
131 | #include "MCalibrationChargePix.h"
|
---|
132 | #include "MCalibrationChargePINDiode.h"
|
---|
133 | #include "MCalibrationBlindPix.h"
|
---|
134 | #include "MCalibrationBlindCam.h"
|
---|
135 | #include "MCalibrationBlindCamOneOldStyle.h"
|
---|
136 | #include "MCalibrationBlindCamTwoNewStyle.h"
|
---|
137 | #include "MCalibrationBlindCamThreeNewStyle.h"
|
---|
138 | #include "MCalibrationChargeCalc.h"
|
---|
139 | #include "MCalibColorSet.h"
|
---|
140 | #include "MCalibrationRelTimeCam.h"
|
---|
141 | #include "MCalibrationRelTimeCalc.h"
|
---|
142 |
|
---|
143 | #include "MHGausEvents.h"
|
---|
144 | #include "MHCalibrationCam.h"
|
---|
145 | #include "MHCalibrationChargeCam.h"
|
---|
146 | #include "MHCalibrationChargeBlindCam.h"
|
---|
147 | #include "MHCalibrationChargePINDiode.h"
|
---|
148 | #include "MHCalibrationRelTimeCam.h"
|
---|
149 | #include "MHCalibrationPix.h"
|
---|
150 |
|
---|
151 | #include "MHCamEvent.h"
|
---|
152 |
|
---|
153 | #include "MReadMarsFile.h"
|
---|
154 | #include "MPedCalcPedRun.h"
|
---|
155 | #include "MRawFileRead.h"
|
---|
156 | #include "MGeomApply.h"
|
---|
157 | #include "MPedestalSubtract.h"
|
---|
158 | #include "MTaskEnv.h"
|
---|
159 | #include "MBadPixelsMerge.h"
|
---|
160 | #include "MBadPixelsCam.h"
|
---|
161 | #include "MExtractTime.h"
|
---|
162 | #include "MExtractor.h"
|
---|
163 | #include "MExtractPINDiode.h"
|
---|
164 | #include "MExtractBlindPixel.h"
|
---|
165 | //#include "MExtractSlidingWindow.h"
|
---|
166 | //#include "MExtractTimeHighestIntegral.h"
|
---|
167 | #include "MExtractTimeAndChargeSpline.h"
|
---|
168 | #include "MFCosmics.h"
|
---|
169 | #include "MFTriggerPattern.h"
|
---|
170 | #include "MContinue.h"
|
---|
171 | #include "MFillH.h"
|
---|
172 |
|
---|
173 | #include "MTriggerPatternDecode.h"
|
---|
174 |
|
---|
175 | #include "MArrivalTimeCam.h"
|
---|
176 |
|
---|
177 | #include "MStatusDisplay.h"
|
---|
178 |
|
---|
179 | ClassImp(MJCalibration);
|
---|
180 |
|
---|
181 | using namespace std;
|
---|
182 |
|
---|
183 | const Int_t MJCalibration::gkIFAEBoxInaugurationRun = 20113;
|
---|
184 | const Int_t MJCalibration::gkSecondBlindPixelInstallation = 31693;
|
---|
185 | const Int_t MJCalibration::gkSpecialPixelsContInstallation = 34057;
|
---|
186 | const Int_t MJCalibration::gkThirdBlindPixelInstallation = 43308;
|
---|
187 | const TString MJCalibration::fgReferenceFile = "mjobs/calibrationref.rc";
|
---|
188 | const TString MJCalibration::fgHiLoCalibFile = "resources/hilocalib.rc";
|
---|
189 |
|
---|
190 | // --------------------------------------------------------------------------
|
---|
191 | //
|
---|
192 | // Default constructor.
|
---|
193 | //
|
---|
194 | // - fExtractor to NULL, fTimeExtractor to NULL, fColor to kNONE,
|
---|
195 | // fDisplay to kNormalDisplay, kRelTimes to kFALSE, kataCheck to kFALSE, kDebug to kFALSE,
|
---|
196 | // kIntensity to kFALSE
|
---|
197 | // - SetUseBlindPixel()
|
---|
198 | // - SetUsePINDiode()
|
---|
199 | //
|
---|
200 | MJCalibration::MJCalibration(const char *name, const char *title)
|
---|
201 | : fExtractor(NULL), fTimeExtractor(NULL),
|
---|
202 | fColor(MCalibrationCam::kNONE), fDisplayType(kDataCheckDisplay),
|
---|
203 | fGeometry("MGeomCamMagic")
|
---|
204 | {
|
---|
205 |
|
---|
206 | fName = name ? name : "MJCalibration";
|
---|
207 | fTitle = title ? title : "Tool to create the calibration constants for one calibration run";
|
---|
208 |
|
---|
209 | //SetHiLoCalibration();
|
---|
210 | SetRelTimeCalibration();
|
---|
211 | SetDebug(kFALSE);
|
---|
212 | SetIntensity(kFALSE);
|
---|
213 |
|
---|
214 | SetReferenceFile();
|
---|
215 | SetHiLoCalibFile();
|
---|
216 |
|
---|
217 | fConvFADC2PheMin = 0.;
|
---|
218 | fConvFADC2PheMax = 1.5;
|
---|
219 | fConvFADC2PhotMin = 0.;
|
---|
220 | fConvFADC2PhotMax = 10.;
|
---|
221 | fQEMin = 0.;
|
---|
222 | fQEMax = 0.3;
|
---|
223 | fArrivalTimeMin = 1.;
|
---|
224 | fArrivalTimeMax = 10.;
|
---|
225 | fTimeOffsetMin = -3.;
|
---|
226 | fTimeOffsetMax = 3.;
|
---|
227 | fTimeResolutionMin = 0.;
|
---|
228 | fTimeResolutionMax = 1.;
|
---|
229 |
|
---|
230 | fRefFADC2PheInner = 0.14;
|
---|
231 | fRefFADC2PheOuter = 0.4;
|
---|
232 | fRefConvFADC2PheInner = 0.14;
|
---|
233 | fRefConvFADC2PheOuter = 0.52;
|
---|
234 | fRefQEInner = 0.18;
|
---|
235 | fRefQEOuter = 0.12;
|
---|
236 | fRefArrivalTimeInner = 4.5;
|
---|
237 | fRefArrivalTimeOuter = 5.0;
|
---|
238 | fRefArrivalTimeRmsInner = 0.5;
|
---|
239 | fRefArrivalTimeRmsOuter = 0.5;
|
---|
240 | fRefTimeOffsetInner = -0.23;
|
---|
241 | fRefTimeOffsetOuter = 0.39;
|
---|
242 | fRefTimeResolutionInner = 0.153;
|
---|
243 | fRefTimeResolutionOuter = 0.128;
|
---|
244 |
|
---|
245 | }
|
---|
246 |
|
---|
247 | void MJCalibration::DrawTab(MParList &plist, const char *cont, const char *name, Option_t *opt)
|
---|
248 | {
|
---|
249 | TObject *obj = plist.FindObject(cont);
|
---|
250 | if (!obj)
|
---|
251 | return;
|
---|
252 |
|
---|
253 | fDisplay->AddTab(name);
|
---|
254 | obj->DrawClone(opt);
|
---|
255 | }
|
---|
256 |
|
---|
257 | // --------------------------------------------------------------------------
|
---|
258 | //
|
---|
259 | // Display the results in MStatusDisplay:
|
---|
260 | //
|
---|
261 | // - Add "Calibration" to the MStatusDisplay title
|
---|
262 | // - Retrieve the MGeomCam from MParList
|
---|
263 | // - Initialize the following MHCamera's:
|
---|
264 | // 1) MCalibrationPix::GetMean()
|
---|
265 | // 2) MCalibrationPix::Sigma()
|
---|
266 | // 3) MCalibrationChargePix::GetRSigma()
|
---|
267 | // 4) MCalibrationChargePix::GetRSigmaPerCharge()
|
---|
268 | // 5) MCalibrationChargePix::GetPheFFactorMethod()
|
---|
269 | // 6) MCalibrationChargePix::GetMeanConvFADC2Phe()
|
---|
270 | // 7) MCalibrationChargePix::GetMeanFFactorFADC2Phot()
|
---|
271 | // 8) MCalibrationQEPix::GetQECascadesFFactor()
|
---|
272 | // 9) MCalibrationQEPix::GetQECascadesBlindPixel()
|
---|
273 | // 10) MCalibrationQEPix::GetQECascadesPINDiode()
|
---|
274 | // 11) MCalibrationQEPix::GetQECascadesCombined()
|
---|
275 | // 12) MCalibrationQEPix::IsAverageQEFFactorAvailable()
|
---|
276 | // 13) MCalibrationQEPix::IsAverageQEBlindPixelAvailable()
|
---|
277 | // 14) MCalibrationQEPix::IsAverageQEPINDiodeAvailable()
|
---|
278 | // 15) MCalibrationQEPix::IsAverageQECombinedAvailable()
|
---|
279 | // 16) MCalibrationChargePix::IsHiGainSaturation()
|
---|
280 | // 17) MCalibrationPix::GetHiLoMeansDivided()
|
---|
281 | // 18) MCalibrationPix::GetHiLoSigmasDivided()
|
---|
282 | // 19) MCalibrationChargePix::GetHiGainPickup()
|
---|
283 | // 20) MCalibrationChargePix::GetLoGainPickup()
|
---|
284 | // 21) MCalibrationChargePix::GetHiGainBlackout()
|
---|
285 | // 22) MCalibrationChargePix::GetLoGainBlackout()
|
---|
286 | // 23) MCalibrationPix::IsExcluded()
|
---|
287 | // 24) MBadPixelsPix::IsUnsuitable(MBadPixelsPix::kUnsuitableRun)
|
---|
288 | // 25) MBadPixelsPix::IsUnsuitable(MBadPixelsPix::kUnreliableRun)
|
---|
289 | // 26) MBadPixelsPix::IsUncalibrated(MBadPixelsPix::kHiGainOscillating)
|
---|
290 | // 27) MBadPixelsPix::IsUncalibrated(MBadPixelsPix::kLoGainOscillating)
|
---|
291 | // 28) MCalibrationChargePix::GetAbsTimeMean()
|
---|
292 | // 29) MCalibrationChargePix::GetAbsTimeRms()
|
---|
293 | //
|
---|
294 | // If the flag SetFullDisplay() is set, all MHCameras will be displayed.
|
---|
295 | // if the flag SetDataCheckDisplay() is set, only the most important ones are displayed
|
---|
296 | // and otherwise, (default: SetNormalDisplay()), a good selection of plots is given
|
---|
297 | //
|
---|
298 | void MJCalibration::DisplayResult(MParList &plist)
|
---|
299 | {
|
---|
300 | if (!fDisplay)
|
---|
301 | return;
|
---|
302 |
|
---|
303 | TString drawoption = "nonew ";
|
---|
304 | if (fDisplayType == kDataCheckDisplay)
|
---|
305 | drawoption += "datacheck";
|
---|
306 | if (fDisplayType == kFullDisplay)
|
---|
307 | drawoption += "all";
|
---|
308 |
|
---|
309 | if (IsUsePINDiode())
|
---|
310 | DrawTab(plist, "MHCalibrationChargePINDiode", "PINDiode", drawoption);
|
---|
311 | if (IsUseBlindPixel())
|
---|
312 | DrawTab(plist, "MHCalibrationChargeBlindCam", "BlindPix", drawoption);
|
---|
313 | if (IsRelTimes())
|
---|
314 | DrawTab(plist, "MHCalibrationRelTimeCam", "Time", drawoption);
|
---|
315 | DrawTab(plist, "MHCalibrationChargeCam", "Charge", drawoption);
|
---|
316 |
|
---|
317 | //
|
---|
318 | // Update display
|
---|
319 | //
|
---|
320 | TString title = fDisplay->GetTitle();
|
---|
321 | title += "-- Calibration ";
|
---|
322 | title += Form("calib%08d", fSequence.GetSequence());
|
---|
323 | title += " --";
|
---|
324 | fDisplay->SetTitle(title);
|
---|
325 |
|
---|
326 | //
|
---|
327 | // Get container from list
|
---|
328 | //
|
---|
329 | MGeomCam &geomcam = *(MGeomCam*)plist.FindObject("MGeomCam");
|
---|
330 |
|
---|
331 | // Create histograms to display
|
---|
332 | MHCamera disp1 (geomcam, "Charge", "Fitted Mean Signal (Charges)");
|
---|
333 | MHCamera disp2 (geomcam, "SigmaCharge", "Sigma of Fitted Signal");
|
---|
334 | MHCamera disp3 (geomcam, "RSigma", "Reduced Sigmas");
|
---|
335 | MHCamera disp4 (geomcam, "RSigmaPerCharge", "Reduced Sigma per Charge");
|
---|
336 | MHCamera disp5 (geomcam, "NumPhes", "Number Photo-electrons");
|
---|
337 | MHCamera disp6 (geomcam, "ConvFADC2Phes", "Phes per Charge (Before Flat-Field)");
|
---|
338 | MHCamera disp7 (geomcam, "TotalFFactor", "Total F-Factor(F-Factor Method)");
|
---|
339 | MHCamera disp8 (geomcam, "CascadesQEFFactor", "Cascades QE (F-Factor Method)");
|
---|
340 | MHCamera disp9 (geomcam, "CascadesQEBlindPix","Cascades QE (Blind Pixel Method)");
|
---|
341 | MHCamera disp10(geomcam, "CascadesQEPINDiode","Cascades QE (PIN Diode Method)");
|
---|
342 | MHCamera disp11(geomcam, "CascadesQECombined","Cascades QE (Combined Method)");
|
---|
343 | MHCamera disp12(geomcam, "FFactorValid", "Pixels with Valid F-Factor Calibration");
|
---|
344 | MHCamera disp13(geomcam, "BlindPixelValid", "Pixels with valid BlindPixel Calibration");
|
---|
345 | MHCamera disp14(geomcam, "PINdiodeValid", "Pixels with Valid PINDiode Calibration");
|
---|
346 | MHCamera disp15(geomcam, "CombinedValid", "Pixels with Valid Combined Calibration");
|
---|
347 | MHCamera disp16(geomcam, "Saturation", "Pixels with Saturated Hi Gain");
|
---|
348 | MHCamera disp17(geomcam, "ConversionMeans", "Conversion HiGain.vs.LoGain Means");
|
---|
349 | MHCamera disp18(geomcam, "ConversionSigmas", "Conversion HiGain.vs.LoGain Sigmas");
|
---|
350 | MHCamera disp19(geomcam, "HiGainPickup", "Number Pickup Events Hi Gain");
|
---|
351 | MHCamera disp20(geomcam, "LoGainPickup", "Number Pickup Events Lo Gain");
|
---|
352 | MHCamera disp21(geomcam, "HiGainBlackout", "Number Blackout Events Hi Gain");
|
---|
353 | MHCamera disp22(geomcam, "LoGainBlackout", "Number Blackout Events Lo Gain");
|
---|
354 | MHCamera disp23(geomcam, "Excluded", "Pixels Previously Excluded");
|
---|
355 | MHCamera disp24(geomcam, "UnSuitable", "Pixels NOT Suited for Further Analysis");
|
---|
356 | MHCamera disp25(geomcam, "UnReliable", "Pixels Suitable, but NOT Reliable for Further Analysis");
|
---|
357 | MHCamera disp26(geomcam, "HiGainOscillating", "Oscillating Pixels High Gain");
|
---|
358 | MHCamera disp27(geomcam, "LoGainOscillating", "Oscillating Pixels Low Gain");
|
---|
359 | MHCamera disp28(geomcam, "AbsTimeMean", "Abs. Arrival Times");
|
---|
360 | MHCamera disp29(geomcam, "AbsTimeRms", "RMS of Arrival Times");
|
---|
361 | MHCamera disp30(geomcam, "MeanTime", "Mean Rel. Arrival Times");
|
---|
362 | MHCamera disp31(geomcam, "SigmaTime", "Sigma Rel. Arrival Times");
|
---|
363 | MHCamera disp32(geomcam, "TimeProb", "Probability of Time Fit");
|
---|
364 | MHCamera disp33(geomcam, "TimeNotFitValid", "Pixels with not valid Fit Results");
|
---|
365 | MHCamera disp34(geomcam, "TimeOscillating", "Oscillating Pixels");
|
---|
366 | MHCamera disp35(geomcam, "TotalConv", "Conversion Factor to Photons");
|
---|
367 | MHCamera disp36(geomcam, "RMSperMean", "Charge histogram RMS per Mean");
|
---|
368 | MHCamera disp37(geomcam, "TotalConvPhe", "Conversion Factor to equiv. Phe's");
|
---|
369 |
|
---|
370 | MCalibrationChargeCam *cam = NULL;
|
---|
371 | MCalibrationQECam *qecam = NULL;
|
---|
372 | MCalibrationRelTimeCam *relcam = NULL;
|
---|
373 | MBadPixelsCam *badcam = NULL;
|
---|
374 |
|
---|
375 | if (IsIntensity())
|
---|
376 | {
|
---|
377 | cam = (MCalibrationChargeCam*) fIntensCalibCam.GetCam();
|
---|
378 | qecam = (MCalibrationQECam*) fIntensQECam.GetCam();
|
---|
379 | relcam = (MCalibrationRelTimeCam*)fIntensRelTimeCam.GetCam();
|
---|
380 | badcam = (MBadPixelsCam*) fIntensBadCam.GetCam();
|
---|
381 | }
|
---|
382 | else
|
---|
383 | {
|
---|
384 | cam = &fCalibrationCam;
|
---|
385 | qecam = &fQECam;
|
---|
386 | relcam = &fRelTimeCam;
|
---|
387 | badcam = &fBadPixels;
|
---|
388 | }
|
---|
389 |
|
---|
390 | // Fitted charge means and sigmas
|
---|
391 | disp1.SetCamContent(*cam, 0);
|
---|
392 | disp1.SetCamError( *cam, 1);
|
---|
393 | disp2.SetCamContent(*cam, 2);
|
---|
394 | disp2.SetCamError( *cam, 3);
|
---|
395 |
|
---|
396 | // Reduced Sigmas and reduced sigmas per charge
|
---|
397 | disp3.SetCamContent(*cam, 5);
|
---|
398 | disp3.SetCamError( *cam, 6);
|
---|
399 | disp4.SetCamContent(*cam, 7);
|
---|
400 | disp4.SetCamError( *cam, 8);
|
---|
401 |
|
---|
402 | // F-Factor Method
|
---|
403 | disp5.SetCamContent(*cam, 9);
|
---|
404 | disp5.SetCamError( *cam, 10);
|
---|
405 | disp6.SetCamContent(*cam, 11);
|
---|
406 | disp6.SetCamError( *cam, 12);
|
---|
407 | disp7.SetCamContent(*cam, 13);
|
---|
408 | disp7.SetCamError( *cam, 14);
|
---|
409 |
|
---|
410 | // Quantum Efficiencies
|
---|
411 | disp8.SetCamContent (*qecam, 0 );
|
---|
412 | disp8.SetCamError (*qecam, 1 );
|
---|
413 | disp9.SetCamContent (*qecam, 2 );
|
---|
414 | disp9.SetCamError (*qecam, 3 );
|
---|
415 | disp10.SetCamContent(*qecam, 4 );
|
---|
416 | disp10.SetCamError (*qecam, 5 );
|
---|
417 | disp11.SetCamContent(*qecam, 6 );
|
---|
418 | disp11.SetCamError (*qecam, 7 );
|
---|
419 |
|
---|
420 | // Valid flags
|
---|
421 | disp12.SetCamContent(*qecam, 8 );
|
---|
422 | disp13.SetCamContent(*qecam, 9 );
|
---|
423 | disp14.SetCamContent(*qecam, 10);
|
---|
424 | disp15.SetCamContent(*qecam, 11);
|
---|
425 |
|
---|
426 | // Conversion Hi-Lo
|
---|
427 | disp16.SetCamContent(*cam, 25);
|
---|
428 | disp17.SetCamContent(*cam, 16);
|
---|
429 | disp17.SetCamError (*cam, 17);
|
---|
430 | disp18.SetCamContent(*cam, 18);
|
---|
431 | disp18.SetCamError (*cam, 19);
|
---|
432 |
|
---|
433 | // Pickup and Blackout
|
---|
434 | disp19.SetCamContent(*cam, 21);
|
---|
435 | disp20.SetCamContent(*cam, 22);
|
---|
436 | disp21.SetCamContent(*cam, 23);
|
---|
437 | disp22.SetCamContent(*cam, 24);
|
---|
438 |
|
---|
439 | // Pixels with defects
|
---|
440 | disp23.SetCamContent(*cam, 20);
|
---|
441 | disp24.SetCamContent(*badcam, 6);
|
---|
442 | disp25.SetCamContent(*badcam, 7);
|
---|
443 |
|
---|
444 | // Oscillations
|
---|
445 | disp26.SetCamContent(*badcam, 10);
|
---|
446 | disp27.SetCamContent(*badcam, 11);
|
---|
447 |
|
---|
448 | // Arrival Times
|
---|
449 | disp28.SetCamContent(*cam, 26);
|
---|
450 | disp28.SetCamError( *cam, 27);
|
---|
451 | disp29.SetCamContent(*cam, 27);
|
---|
452 |
|
---|
453 | // RMS and Mean
|
---|
454 | disp36.SetCamContent(*cam,32);
|
---|
455 | disp36.SetCamError(*cam,33);
|
---|
456 |
|
---|
457 | disp1.SetYTitle("Q [FADC cnts]");
|
---|
458 | disp2.SetYTitle("\\sigma_{Q} [FADC cnts]");
|
---|
459 |
|
---|
460 | disp3.SetYTitle("\\sqrt{\\sigma^{2}_{Q} - RMS^{2}_{Ped}} [FADC cnts]");
|
---|
461 | disp4.SetYTitle("Red.Sigma/<Q> [1]");
|
---|
462 |
|
---|
463 | disp5.SetYTitle("Photo-electons [1]");
|
---|
464 | disp6.SetYTitle("Phes/<Q> [FADC cnts^{-1}]");
|
---|
465 | disp7.SetYTitle("Total F-Factor [1]");
|
---|
466 |
|
---|
467 | disp8.SetYTitle("QE [1]");
|
---|
468 | disp9.SetYTitle("QE [1]");
|
---|
469 | disp10.SetYTitle("QE [1]");
|
---|
470 | disp11.SetYTitle("QE [1]");
|
---|
471 |
|
---|
472 | disp12.SetYTitle("[1]");
|
---|
473 | disp13.SetYTitle("[1]");
|
---|
474 | disp14.SetYTitle("[1]");
|
---|
475 | disp15.SetYTitle("[1]");
|
---|
476 | disp16.SetYTitle("[1]");
|
---|
477 |
|
---|
478 | disp17.SetYTitle("<Q>(High)/<Q>(Low) [1]");
|
---|
479 | disp18.SetYTitle("\\sigma_{Q}(High)/\\sigma_{Q}(Low) [1]");
|
---|
480 |
|
---|
481 | disp19.SetYTitle("[1]");
|
---|
482 | disp20.SetYTitle("[1]");
|
---|
483 | disp21.SetYTitle("[1]");
|
---|
484 | disp22.SetYTitle("[1]");
|
---|
485 | // disp23.SetYTitle("[1]");
|
---|
486 | // disp24.SetYTitle("[1]");
|
---|
487 | // disp25.SetYTitle("[1]");
|
---|
488 | disp26.SetYTitle("[1]");
|
---|
489 | disp27.SetYTitle("[1]");
|
---|
490 |
|
---|
491 | disp28.SetYTitle("Mean Abs. Time [FADC sl.]");
|
---|
492 | disp29.SetYTitle("RMS Abs. Time [FADC sl.]");
|
---|
493 | disp35.SetYTitle("Conv.Factor [Ph/FADC cnts]");
|
---|
494 | disp36.SetYTitle("Charge RMS/<Q> [1]");
|
---|
495 | disp37.SetYTitle("Conv.Factor [Phe/FADC cnts]");
|
---|
496 |
|
---|
497 | for (UInt_t i=0;i<geomcam.GetNumPixels();i++)
|
---|
498 | {
|
---|
499 |
|
---|
500 | MCalibrationChargePix &pix = (MCalibrationChargePix&)(*cam) [i];
|
---|
501 | MCalibrationQEPix &qe = (MCalibrationQEPix&) (*qecam)[i];
|
---|
502 |
|
---|
503 | if (!pix.IsFFactorMethodValid())
|
---|
504 | continue;
|
---|
505 |
|
---|
506 | const Float_t convphe = pix.GetMeanConvFADC2Phe();
|
---|
507 | const Float_t quaeff = qe.GetQECascadesFFactor();
|
---|
508 |
|
---|
509 | disp35.Fill(i,convphe/quaeff);
|
---|
510 | disp35.SetUsed(i);
|
---|
511 |
|
---|
512 | disp37.Fill(i,convphe/quaeff*MCalibrationQEPix::gkDefaultAverageQE);
|
---|
513 | disp37.SetUsed(i);
|
---|
514 | }
|
---|
515 |
|
---|
516 |
|
---|
517 | if (IsRelTimes())
|
---|
518 | {
|
---|
519 | disp30.SetCamContent(*relcam,0);
|
---|
520 | disp30.SetCamError( *relcam,1);
|
---|
521 | disp31.SetCamContent(*relcam,2);
|
---|
522 | disp31.SetCamError( *relcam,3);
|
---|
523 | disp32.SetCamContent(*relcam,4);
|
---|
524 | disp33.SetCamContent(fBadPixels,20);
|
---|
525 | disp34.SetCamContent(fBadPixels,21);
|
---|
526 |
|
---|
527 | disp30.SetYTitle("Time Offset [FADC units]");
|
---|
528 | disp31.SetYTitle("Timing resolution [FADC units]");
|
---|
529 | disp32.SetYTitle("P_{Time} [1]");
|
---|
530 | disp33.SetYTitle("[1]");
|
---|
531 | disp34.SetYTitle("[1]");
|
---|
532 | }
|
---|
533 |
|
---|
534 | if (fDisplayType == kDataCheckDisplay)
|
---|
535 | {
|
---|
536 |
|
---|
537 | TCanvas &c1 = fDisplay->AddTab("FitCharge");
|
---|
538 | c1.Divide(3, 3);
|
---|
539 |
|
---|
540 | //
|
---|
541 | // MEAN CHARGES
|
---|
542 | //
|
---|
543 |
|
---|
544 | c1.cd(1);
|
---|
545 | gPad->SetBorderMode(0);
|
---|
546 | gPad->SetTicks();
|
---|
547 | MHCamera *obj1=(MHCamera*)disp1.DrawCopy("hist");
|
---|
548 | //
|
---|
549 | // for the datacheck, fix the ranges!!
|
---|
550 | //
|
---|
551 | // obj1->SetMinimum(fChargeMin);
|
---|
552 | // obj1->SetMaximum(fChargeMax);
|
---|
553 | //
|
---|
554 | // Set the datacheck sizes:
|
---|
555 | //
|
---|
556 | FixDataCheckHist((TH1D*)obj1);
|
---|
557 | obj1->SetStats(kFALSE);
|
---|
558 | //
|
---|
559 | // set reference lines
|
---|
560 | //
|
---|
561 | // DisplayReferenceLines(obj1,0);
|
---|
562 |
|
---|
563 | c1.cd(4);
|
---|
564 | gPad->SetBorderMode(0);
|
---|
565 | obj1->SetPrettyPalette();
|
---|
566 | obj1->Draw();
|
---|
567 |
|
---|
568 | c1.cd(7);
|
---|
569 | gPad->SetBorderMode(0);
|
---|
570 | gPad->SetTicks();
|
---|
571 | TH1D *obj2 = (TH1D*)obj1->Projection(obj1->GetName());
|
---|
572 | obj2->Draw();
|
---|
573 | obj2->SetBit(kCanDelete);
|
---|
574 | obj2->Fit("gaus","Q");
|
---|
575 | TF1 *fun2 = obj2->GetFunction("gaus");
|
---|
576 | fun2->SetLineColor(kYellow);
|
---|
577 | gPad->Modified();
|
---|
578 | gPad->Update();
|
---|
579 | TPaveStats *st = (TPaveStats*)obj2->GetListOfFunctions()->FindObject("stats");
|
---|
580 | st->SetY1NDC(0.55);
|
---|
581 | st->SetY2NDC(0.89);
|
---|
582 | st->SetX1NDC(0.65);
|
---|
583 | st->SetX2NDC(0.99);
|
---|
584 | gPad->Modified();
|
---|
585 | gPad->Update();
|
---|
586 | //
|
---|
587 | // Set the datacheck sizes:
|
---|
588 | //
|
---|
589 | FixDataCheckHist(obj2);
|
---|
590 | obj2->SetStats(1);
|
---|
591 |
|
---|
592 | //
|
---|
593 | // Display the outliers as dead and noisy pixels
|
---|
594 | //
|
---|
595 | DisplayOutliers(obj2,"low-ampl.","high-ampl.");
|
---|
596 | TLatex flattex;
|
---|
597 | flattex.SetTextSize(0.07);
|
---|
598 | const Double_t minl = obj2->GetBinCenter(obj2->GetXaxis()->GetFirst());
|
---|
599 | const Double_t maxl = obj2->GetBinCenter(obj2->GetXaxis()->GetLast());
|
---|
600 | flattex.DrawLatex(minl+0.015*(maxl-minl),obj2->GetBinContent(obj2->GetMaximumBin())/1.35,
|
---|
601 | Form("Flatfield precision: %4.2f%%",
|
---|
602 | fun2->GetParameter(2)/fun2->GetParameter(1)*100.));
|
---|
603 |
|
---|
604 | //
|
---|
605 | // RMS per Charge
|
---|
606 | //
|
---|
607 |
|
---|
608 | c1.cd(2);
|
---|
609 | gPad->SetBorderMode(0);
|
---|
610 | gPad->SetTicks();
|
---|
611 | MHCamera *obj3=(MHCamera*)disp36.DrawCopy("hist");
|
---|
612 | //
|
---|
613 | // for the datacheck, fix the ranges!!
|
---|
614 | //
|
---|
615 | // obj3->SetMinimum(0.);
|
---|
616 | // obj3->SetMaximum(fChargeMax);
|
---|
617 | //
|
---|
618 | // Set the datacheck sizes:
|
---|
619 | //
|
---|
620 | FixDataCheckHist((TH1D*)obj3);
|
---|
621 | obj3->SetStats(kFALSE);
|
---|
622 | //
|
---|
623 | // set reference lines
|
---|
624 | //
|
---|
625 | // DisplayReferenceLines(obj3,0);
|
---|
626 |
|
---|
627 | c1.cd(5);
|
---|
628 | gPad->SetBorderMode(0);
|
---|
629 | obj3->SetPrettyPalette();
|
---|
630 | obj3->Draw();
|
---|
631 |
|
---|
632 | c1.cd(8);
|
---|
633 | gPad->SetBorderMode(0);
|
---|
634 | if (geomcam.InheritsFrom("MGeomCamMagic"))
|
---|
635 | DisplayDoubleProject(&disp36, "dead", "noisy");
|
---|
636 |
|
---|
637 | //
|
---|
638 | // PHOTO ELECTRONS
|
---|
639 | //
|
---|
640 |
|
---|
641 | c1.cd(3);
|
---|
642 | gPad->SetBorderMode(0);
|
---|
643 | gPad->SetTicks();
|
---|
644 | MHCamera *obj4=(MHCamera*)disp5.DrawCopy("hist");
|
---|
645 | //
|
---|
646 | // for the datacheck, fix the ranges!!
|
---|
647 | //
|
---|
648 | // obj3->SetMinimum(fChargeMin);
|
---|
649 | // obj3->SetMaximum(fChargeMax);
|
---|
650 | //
|
---|
651 | // Set the datacheck sizes:
|
---|
652 | //
|
---|
653 | FixDataCheckHist((TH1D*)obj4);
|
---|
654 | obj4->SetStats(kFALSE);
|
---|
655 | //
|
---|
656 | // set reference lines
|
---|
657 | //
|
---|
658 | // DisplayReferenceLines(obj3,0);
|
---|
659 |
|
---|
660 | c1.cd(6);
|
---|
661 | gPad->SetBorderMode(0);
|
---|
662 | obj4->SetPrettyPalette();
|
---|
663 | obj4->Draw();
|
---|
664 |
|
---|
665 | c1.cd(9);
|
---|
666 | gPad->SetBorderMode(0);
|
---|
667 | if (geomcam.InheritsFrom("MGeomCamMagic"))
|
---|
668 | DisplayDoubleProject(&disp5, "dead", "noisy");
|
---|
669 |
|
---|
670 | //
|
---|
671 | // CONVERSION FACTORS
|
---|
672 | //
|
---|
673 | TCanvas &c2 = fDisplay->AddTab("Conversion");
|
---|
674 | c2.Divide(3,3);
|
---|
675 |
|
---|
676 | c2.cd(1);
|
---|
677 | gPad->SetBorderMode(0);
|
---|
678 | gPad->SetTicks();
|
---|
679 | MHCamera *obj5=(MHCamera*)disp6.DrawCopy("hist");
|
---|
680 | //
|
---|
681 | // for the datacheck, fix the ranges!!
|
---|
682 | //
|
---|
683 | obj5->SetMinimum(fConvFADC2PheMin);
|
---|
684 | obj5->SetMaximum(fConvFADC2PheMax);
|
---|
685 | //
|
---|
686 | // Set the datacheck sizes:
|
---|
687 | //
|
---|
688 | FixDataCheckHist((TH1D*)obj5);
|
---|
689 | obj5->SetStats(kFALSE);
|
---|
690 | //
|
---|
691 | // set reference lines
|
---|
692 | //
|
---|
693 | DisplayReferenceLines(obj5,2);
|
---|
694 |
|
---|
695 | c2.cd(4);
|
---|
696 | gPad->SetBorderMode(0);
|
---|
697 | obj5->SetPrettyPalette();
|
---|
698 | obj5->Draw();
|
---|
699 |
|
---|
700 | c2.cd(7);
|
---|
701 | gPad->SetBorderMode(0);
|
---|
702 | if (geomcam.InheritsFrom("MGeomCamMagic"))
|
---|
703 | DisplayDoubleProject(&disp6, "noisy", "dead");
|
---|
704 |
|
---|
705 | //
|
---|
706 | // QUANTUM EFFICIENCY
|
---|
707 | //
|
---|
708 | c2.cd(2);
|
---|
709 | gPad->SetBorderMode(0);
|
---|
710 | gPad->SetTicks();
|
---|
711 | MHCamera *obj6=(MHCamera*)disp8.DrawCopy("hist");
|
---|
712 | //
|
---|
713 | // for the datacheck, fix the ranges!!
|
---|
714 | //
|
---|
715 | obj6->SetMinimum(fQEMin);
|
---|
716 | obj6->SetMaximum(fQEMax);
|
---|
717 | //
|
---|
718 | // Set the datacheck sizes:
|
---|
719 | //
|
---|
720 | FixDataCheckHist((TH1D*)obj6);
|
---|
721 | obj6->SetStats(kFALSE);
|
---|
722 | //
|
---|
723 | // set reference lines
|
---|
724 | //
|
---|
725 | DisplayReferenceLines(obj6,0);
|
---|
726 |
|
---|
727 | c2.cd(5);
|
---|
728 | gPad->SetBorderMode(0);
|
---|
729 | obj6->SetPrettyPalette();
|
---|
730 | obj6->Draw();
|
---|
731 |
|
---|
732 | c2.cd(8);
|
---|
733 | gPad->SetBorderMode(0);
|
---|
734 | if (geomcam.InheritsFrom("MGeomCamMagic"))
|
---|
735 | DisplayDoubleProject(&disp8, "noisy", "dead");
|
---|
736 |
|
---|
737 | //
|
---|
738 | // CONVERSION FADC TO PHOTONS
|
---|
739 | //
|
---|
740 |
|
---|
741 | c2.cd(3);
|
---|
742 | gPad->SetBorderMode(0);
|
---|
743 | gPad->SetTicks();
|
---|
744 | MHCamera *obj7=(MHCamera*)disp37.DrawCopy("hist");
|
---|
745 | //
|
---|
746 | // for the datacheck, fix the ranges!!
|
---|
747 | //
|
---|
748 | obj7->SetMinimum(fConvFADC2PheMin);
|
---|
749 | obj7->SetMaximum(fConvFADC2PheMax);
|
---|
750 | //
|
---|
751 | // Set the datacheck sizes:
|
---|
752 | //
|
---|
753 | FixDataCheckHist((TH1D*)obj7);
|
---|
754 | obj7->SetStats(kFALSE);
|
---|
755 | //
|
---|
756 | // set reference lines
|
---|
757 | //
|
---|
758 | DisplayReferenceLines(obj7,1);
|
---|
759 |
|
---|
760 | c2.cd(6);
|
---|
761 | gPad->SetBorderMode(0);
|
---|
762 | obj7->SetPrettyPalette();
|
---|
763 | obj7->Draw();
|
---|
764 | c2.cd(9);
|
---|
765 | gPad->SetBorderMode(0);
|
---|
766 | if (geomcam.InheritsFrom("MGeomCamMagic"))
|
---|
767 | DisplayDoubleProject(&disp37, "noisy", "dead");
|
---|
768 |
|
---|
769 | //
|
---|
770 | // ARRIVAL TIMES
|
---|
771 | //
|
---|
772 | TCanvas &c3 = fDisplay->AddTab("AbsTimes");
|
---|
773 | c3.Divide(2,3);
|
---|
774 |
|
---|
775 | c3.cd(1);
|
---|
776 | gPad->SetBorderMode(0);
|
---|
777 | gPad->SetTicks();
|
---|
778 | MHCamera *obj10=(MHCamera*)disp28.DrawCopy("hist");
|
---|
779 | //
|
---|
780 | // for the datacheck, fix the ranges!!
|
---|
781 | //
|
---|
782 | obj10->SetMinimum(fArrivalTimeMin);
|
---|
783 | obj10->SetMaximum(fArrivalTimeMax);
|
---|
784 | //
|
---|
785 | // Set the datacheck sizes:
|
---|
786 | //
|
---|
787 | FixDataCheckHist((TH1D*)obj10);
|
---|
788 | obj10->SetStats(kFALSE);
|
---|
789 | //
|
---|
790 | // set reference lines
|
---|
791 | //
|
---|
792 | DisplayReferenceLines(obj10,3);
|
---|
793 |
|
---|
794 | c3.cd(3);
|
---|
795 | gPad->SetBorderMode(0);
|
---|
796 | obj10->SetPrettyPalette();
|
---|
797 | obj10->Draw();
|
---|
798 |
|
---|
799 | c3.cd(5);
|
---|
800 | gPad->SetBorderMode(0);
|
---|
801 | if (geomcam.InheritsFrom("MGeomCamMagic"))
|
---|
802 | DisplayDoubleProject(&disp28, "early", "late");
|
---|
803 |
|
---|
804 | //
|
---|
805 | // ARRIVAL TIMES JITTER
|
---|
806 | //
|
---|
807 | c3.cd(2);
|
---|
808 | gPad->SetBorderMode(0);
|
---|
809 | gPad->SetTicks();
|
---|
810 | MHCamera *obj11=(MHCamera*)disp29.DrawCopy("hist");
|
---|
811 | //
|
---|
812 | // for the datacheck, fix the ranges!!
|
---|
813 | //
|
---|
814 | // obj11->SetMinimum(fArrivalTimeMin);
|
---|
815 | // obj11->SetMaximum(fArrivalTimeMax);
|
---|
816 | //
|
---|
817 | // Set the datacheck sizes:
|
---|
818 | //
|
---|
819 | FixDataCheckHist((TH1D*)obj11);
|
---|
820 | obj11->SetStats(kFALSE);
|
---|
821 | //
|
---|
822 | // set reference lines
|
---|
823 | //
|
---|
824 | DisplayReferenceLines(obj11,4);
|
---|
825 |
|
---|
826 | c3.cd(4);
|
---|
827 | gPad->SetBorderMode(0);
|
---|
828 | obj11->SetPrettyPalette();
|
---|
829 | obj11->Draw();
|
---|
830 |
|
---|
831 | c3.cd(6);
|
---|
832 | gPad->SetBorderMode(0);
|
---|
833 | if (geomcam.InheritsFrom("MGeomCamMagic"))
|
---|
834 | DisplayDoubleProject(&disp29, "", "jittering");
|
---|
835 |
|
---|
836 | //
|
---|
837 | // UNSUITABLE PIXELS
|
---|
838 | //
|
---|
839 | TCanvas &c4 = fDisplay->AddTab("Defect");
|
---|
840 | c4.Divide(2,2, 0.005, 0.005);
|
---|
841 |
|
---|
842 | c4.cd(1);
|
---|
843 | gPad->SetBorderMode(0);
|
---|
844 | gPad->SetTicks();
|
---|
845 | MHCamera *obj8=(MHCamera*)disp24.DrawCopy("hist");
|
---|
846 | //
|
---|
847 | // for the datacheck, fix the ranges!!
|
---|
848 | //
|
---|
849 | const Double_t max = 11.;
|
---|
850 | obj8->SetMinimum(0.);
|
---|
851 | obj8->SetMaximum(max);
|
---|
852 | //
|
---|
853 | // Set the datacheck sizes:
|
---|
854 | //
|
---|
855 | FixDataCheckHist((TH1D*)obj8);
|
---|
856 | obj8->SetStats(kFALSE);
|
---|
857 |
|
---|
858 | gStyle->SetPalette(1);
|
---|
859 | const Int_t numcol = gStyle->GetNumberOfColors()-3;
|
---|
860 |
|
---|
861 | TPaveText *pave = new TPaveText(0.05,0.02,0.975,0.99);
|
---|
862 | pave->SetBit(kCanDelete);
|
---|
863 | pave->ConvertNDCtoPad();
|
---|
864 | pave->SetTextSize(0.045);
|
---|
865 | pave->AddText(" ");
|
---|
866 | TText *t1 = pave->AddText(Form("Signal smaller 4.5 Pedestal RMS: %3i pixels",
|
---|
867 | CountBadPixels(&disp24,1)));
|
---|
868 | t1->SetTextColor(gStyle->GetColorPalette(Int_t(1./max*numcol)));
|
---|
869 | t1->SetTextAlign(12);
|
---|
870 | TText *t4 = pave->AddText(Form("Low Gain Saturation: %3i pixels",
|
---|
871 | CountBadPixels(&disp24,2)));
|
---|
872 | t4->SetTextColor(gStyle->GetColorPalette(Int_t(2./max*numcol)));
|
---|
873 | t4->SetTextAlign(12);
|
---|
874 | TText *t5 = pave->AddText(Form("Mean Arr. Time In First Extraction Bin: %3i pixels",
|
---|
875 | CountBadPixels(&disp24,3)));
|
---|
876 | t5->SetTextColor(gStyle->GetColorPalette(Int_t(3./max*numcol)));
|
---|
877 | t5->SetTextAlign(12);
|
---|
878 | TText *t6 = pave->AddText(Form("Mean Arr. Time In Last 2 Extraction Bins: %3i pixels",
|
---|
879 | CountBadPixels(&disp24,4)));
|
---|
880 | t6->SetTextColor(gStyle->GetColorPalette(Int_t(4./max*numcol)));
|
---|
881 | t6->SetTextAlign(12);
|
---|
882 | TText *t10= pave->AddText(Form("High-Gain Histogram Overflow: %3i pixels",
|
---|
883 | CountBadPixels(&disp24,5 )));
|
---|
884 | t10->SetTextColor(gStyle->GetColorPalette(Int_t(5./max*numcol)));
|
---|
885 | t10->SetTextAlign(12);
|
---|
886 | TText *t11= pave->AddText(Form("Low-Gain Histogram Overflow: %3i pixels",
|
---|
887 | CountBadPixels(&disp24,6 )));
|
---|
888 | t11->SetTextColor(gStyle->GetColorPalette(Int_t(6./max*numcol)));
|
---|
889 | t11->SetTextAlign(12);
|
---|
890 | TText *t12= pave->AddText(Form("Presumably dead from Ped. Rms: %3i pixels",
|
---|
891 | CountBadPixels(&disp24,7 )));
|
---|
892 | t12->SetTextColor(gStyle->GetColorPalette(Int_t(7./max*numcol)));
|
---|
893 | t12->SetTextAlign(12);
|
---|
894 | TText *t13= pave->AddText(Form("Fluctuating Pulse Arrival Times: %3i pixels",
|
---|
895 | CountBadPixels(&disp24,8 )));
|
---|
896 | t13->SetTextColor(gStyle->GetColorPalette(Int_t(8./max*numcol)));
|
---|
897 | t13->SetTextAlign(12);
|
---|
898 | TText *t17 = pave->AddText(Form("Deviating Number of Photo-electrons: %3i pixels",
|
---|
899 | CountBadPixels(&disp24,9 )));
|
---|
900 | t17->SetTextColor(gStyle->GetColorPalette(Int_t(9./max*numcol)));
|
---|
901 | t17->SetTextAlign(12);
|
---|
902 | TText *t15= pave->AddText(Form("Too many Low-Gain Blackout Events: %3i pixels",
|
---|
903 | CountBadPixels(&disp24,10 )));
|
---|
904 | t15->SetTextColor(gStyle->GetColorPalette(Int_t(10./max*numcol)));
|
---|
905 | t15->SetTextAlign(12);
|
---|
906 | TText *t14= pave->AddText(Form("Previously Excluded: %3i pixels",
|
---|
907 | CountBadPixels(&disp24,11)));
|
---|
908 | t14->SetTextColor(gStyle->GetColorPalette(Int_t(11./max*numcol)));
|
---|
909 | t14->SetTextAlign(12);
|
---|
910 | pave->Draw();
|
---|
911 |
|
---|
912 | c4.cd(3);
|
---|
913 | gPad->SetBorderMode(0);
|
---|
914 | obj8->Draw();
|
---|
915 | obj8->SetPrettyPalette();
|
---|
916 |
|
---|
917 | //
|
---|
918 | // UNRELIABLE PIXELS
|
---|
919 | //
|
---|
920 |
|
---|
921 | c4.cd(2);
|
---|
922 | gPad->SetBorderMode(0);
|
---|
923 | gPad->SetTicks();
|
---|
924 | MHCamera *obj9=(MHCamera*)disp25.DrawCopy("hist");
|
---|
925 | //
|
---|
926 | // for the datacheck, fix the ranges!!
|
---|
927 | //
|
---|
928 | const Double_t max2 = 9.;
|
---|
929 | obj9->SetMinimum(0.);
|
---|
930 | obj9->SetMaximum(max2);
|
---|
931 | //
|
---|
932 | // Set the datacheck sizes:
|
---|
933 | //
|
---|
934 | FixDataCheckHist((TH1D*)obj9);
|
---|
935 | obj9->SetStats(kFALSE);
|
---|
936 |
|
---|
937 | gStyle->SetPalette(1);
|
---|
938 |
|
---|
939 | TPaveText *pave2 = new TPaveText(0.025,0.02,0.95,0.99);
|
---|
940 | pave2->SetBit(kCanDelete);
|
---|
941 | pave2->ConvertNDCtoPad();
|
---|
942 | pave2->SetTextSize(0.05);
|
---|
943 | pave2->AddText(" ");
|
---|
944 | TText *t3 = pave2->AddText(Form("Signal Sigma smaller Pedestal RMS: %3i pixels",
|
---|
945 | CountBadPixels(&disp25,1)));
|
---|
946 | t3->SetTextColor(gStyle->GetColorPalette(Int_t(1./max2*numcol)));
|
---|
947 | t3->SetTextAlign(12);
|
---|
948 | TText *tt1 = pave2->AddText(Form("High Gain Signals could not be fitted: %3i pixels",
|
---|
949 | CountBadPixels(&disp25,3)));
|
---|
950 | tt1->SetTextColor(gStyle->GetColorPalette(Int_t(3./max2*numcol)));
|
---|
951 | tt1->SetTextAlign(12);
|
---|
952 | TText *tt2 = pave2->AddText(Form("Low Gain Signals could not be fitted: %3i pixels",
|
---|
953 | CountBadPixels(&disp25,4)));
|
---|
954 | tt2->SetTextColor(gStyle->GetColorPalette(Int_t(4./max2*numcol)));
|
---|
955 | tt2->SetTextAlign(12);
|
---|
956 | TText *tt3 = pave2->AddText(Form("Relative Arr. Times could not be fitted: %3i pixels",
|
---|
957 | CountBadPixels(&disp25,5)));
|
---|
958 | tt3->SetTextColor(gStyle->GetColorPalette(Int_t(5./max2*numcol)));
|
---|
959 | tt3->SetTextAlign(12);
|
---|
960 | TText *tt4 = pave2->AddText(Form("High Gain Signals Oscillation: %3i pixels",
|
---|
961 | CountBadPixels(&disp25,6)));
|
---|
962 | tt4->SetTextColor(gStyle->GetColorPalette(Int_t(6./max2*numcol)));
|
---|
963 | tt4->SetTextAlign(12);
|
---|
964 | TText *tt5 = pave2->AddText(Form("Low Gain Signals Oscillation: %3i pixels",
|
---|
965 | CountBadPixels(&disp25,7)));
|
---|
966 | tt5->SetTextColor(gStyle->GetColorPalette(Int_t(7./max2*numcol)));
|
---|
967 | tt5->SetTextAlign(12);
|
---|
968 | TText *tt6 = pave2->AddText(Form("Relative Arr. Times Oscillation: %3i pixels",
|
---|
969 | CountBadPixels(&disp25,8)));
|
---|
970 | tt6->SetTextColor(gStyle->GetColorPalette(Int_t(8./max2*numcol)));
|
---|
971 | tt6->SetTextAlign(12);
|
---|
972 | TText *tt8 = pave2->AddText(Form("Deviating global F-Factor: %3i pixels",
|
---|
973 | CountBadPixels(&disp25,9)));
|
---|
974 | tt8->SetTextColor(gStyle->GetColorPalette(Int_t(9./max2*numcol)));
|
---|
975 | tt8->SetTextAlign(12);
|
---|
976 | pave2->Draw();
|
---|
977 |
|
---|
978 | c4.cd(4);
|
---|
979 | gPad->SetBorderMode(0);
|
---|
980 | obj9->SetPrettyPalette();
|
---|
981 | obj9->Draw();
|
---|
982 |
|
---|
983 | if (IsRelTimes())
|
---|
984 | {
|
---|
985 | TCanvas &c5 = fDisplay->AddTab("RelTimes");
|
---|
986 | c5.Divide(2,3);
|
---|
987 |
|
---|
988 | //
|
---|
989 | // MEAN REL. ARR. TIMES
|
---|
990 | //
|
---|
991 | c5.cd(1);
|
---|
992 | gPad->SetBorderMode(0);
|
---|
993 | gPad->SetTicks();
|
---|
994 | MHCamera *obj10=(MHCamera*)disp30.DrawCopy("hist");
|
---|
995 | //
|
---|
996 | // for the datacheck, fix the ranges!!
|
---|
997 | //
|
---|
998 | obj10->SetMinimum(fTimeOffsetMin);
|
---|
999 | obj10->SetMaximum(fTimeOffsetMax);
|
---|
1000 | //
|
---|
1001 | // Set the datacheck sizes:
|
---|
1002 | //
|
---|
1003 | FixDataCheckHist((TH1D*)obj10);
|
---|
1004 | obj10->SetStats(kFALSE);
|
---|
1005 | //
|
---|
1006 | // set reference lines
|
---|
1007 | //
|
---|
1008 | DisplayReferenceLines(obj10,5);
|
---|
1009 |
|
---|
1010 | c5.cd(3);
|
---|
1011 | gPad->SetBorderMode(0);
|
---|
1012 | obj10->SetPrettyPalette();
|
---|
1013 | obj10->Draw();
|
---|
1014 |
|
---|
1015 | c5.cd(5);
|
---|
1016 | gPad->SetBorderMode(0);
|
---|
1017 | if (geomcam.InheritsFrom("MGeomCamMagic"))
|
---|
1018 | DisplayDoubleProject(&disp30, "early", "late");
|
---|
1019 |
|
---|
1020 | //
|
---|
1021 | // JITTER Rel. Arr. Times
|
---|
1022 | //
|
---|
1023 | c5.cd(2);
|
---|
1024 | gPad->SetBorderMode(0);
|
---|
1025 | gPad->SetTicks();
|
---|
1026 | MHCamera *obj11=(MHCamera*)disp31.DrawCopy("hist");
|
---|
1027 | //
|
---|
1028 | // for the datacheck, fix the ranges!!
|
---|
1029 | //
|
---|
1030 | obj11->SetMinimum(fTimeResolutionMin);
|
---|
1031 | obj11->SetMaximum(fTimeResolutionMax);
|
---|
1032 | //
|
---|
1033 | // Set the datacheck sizes:
|
---|
1034 | //
|
---|
1035 | FixDataCheckHist((TH1D*)obj11);
|
---|
1036 | obj11->SetStats(kFALSE);
|
---|
1037 | //
|
---|
1038 | // set reference lines
|
---|
1039 | //
|
---|
1040 | DisplayReferenceLines(obj11,6);
|
---|
1041 |
|
---|
1042 | c5.cd(4);
|
---|
1043 | gPad->SetBorderMode(0);
|
---|
1044 | obj11->SetPrettyPalette();
|
---|
1045 | obj11->Draw();
|
---|
1046 |
|
---|
1047 | c5.cd(6);
|
---|
1048 | gPad->SetBorderMode(0);
|
---|
1049 | if (geomcam.InheritsFrom("MGeomCamMagic"))
|
---|
1050 | DisplayDoubleProject(&disp31, "too stable", "jittering");
|
---|
1051 |
|
---|
1052 | }
|
---|
1053 | return;
|
---|
1054 | }
|
---|
1055 |
|
---|
1056 | if (fDisplayType == kNormalDisplay)
|
---|
1057 | {
|
---|
1058 |
|
---|
1059 | // Charges
|
---|
1060 | TCanvas &c11 = fDisplay->AddTab("FitCharge");
|
---|
1061 | c11.Divide(2, 4);
|
---|
1062 |
|
---|
1063 | disp1.CamDraw(c11, 1, 2, 5, 1);
|
---|
1064 | disp2.CamDraw(c11, 2, 2, 5, 1);
|
---|
1065 |
|
---|
1066 | // Reduced Sigmas
|
---|
1067 | TCanvas &c12 = fDisplay->AddTab("RedSigma");
|
---|
1068 | c12.Divide(2,4);
|
---|
1069 |
|
---|
1070 | disp3.CamDraw(c12, 1, 2, 5, 1);
|
---|
1071 | disp4.CamDraw(c12, 2, 2, 5, 1);
|
---|
1072 |
|
---|
1073 | // F-Factor
|
---|
1074 | TCanvas &c13 = fDisplay->AddTab("Phe's");
|
---|
1075 | c13.Divide(3,4);
|
---|
1076 |
|
---|
1077 | disp5.CamDraw(c13, 1, 3, 5, 1);
|
---|
1078 | disp6.CamDraw(c13, 2, 3, 5, 1);
|
---|
1079 | disp7.CamDraw(c13, 3, 3, 5, 1);
|
---|
1080 |
|
---|
1081 | // QE's
|
---|
1082 | TCanvas &c14 = fDisplay->AddTab("QE's");
|
---|
1083 | c14.Divide(4,4);
|
---|
1084 |
|
---|
1085 | disp8.CamDraw(c14, 1, 4, 5, 1);
|
---|
1086 | disp9.CamDraw(c14, 2, 4, 5, 1);
|
---|
1087 | disp10.CamDraw(c14, 3, 4, 5, 1);
|
---|
1088 | disp11.CamDraw(c14, 4, 4, 5, 1);
|
---|
1089 |
|
---|
1090 | // Defects
|
---|
1091 | TCanvas &c15 = fDisplay->AddTab("Defect");
|
---|
1092 | // c15.Divide(5,2);
|
---|
1093 | c15.Divide(4,2);
|
---|
1094 |
|
---|
1095 | /*
|
---|
1096 | disp23.CamDraw(c15, 1, 5, 0);
|
---|
1097 | disp24.CamDraw(c15, 2, 5, 0);
|
---|
1098 | disp25.CamDraw(c15, 3, 5, 0);
|
---|
1099 | disp26.CamDraw(c15, 4, 5, 0);
|
---|
1100 | disp27.CamDraw(c15, 5, 5, 0);
|
---|
1101 | */
|
---|
1102 | disp24.CamDraw(c15, 1, 4, 0);
|
---|
1103 | disp25.CamDraw(c15, 2, 4, 0);
|
---|
1104 | disp26.CamDraw(c15, 3, 4, 0);
|
---|
1105 | disp27.CamDraw(c15, 4, 4, 0);
|
---|
1106 |
|
---|
1107 | // Abs. Times
|
---|
1108 | TCanvas &c16 = fDisplay->AddTab("AbsTimes");
|
---|
1109 | c16.Divide(2,3);
|
---|
1110 |
|
---|
1111 | disp28.CamDraw(c16, 1, 2, 5);
|
---|
1112 | disp29.CamDraw(c16, 2, 2, 5);
|
---|
1113 |
|
---|
1114 | if (IsRelTimes())
|
---|
1115 | {
|
---|
1116 | // Rel. Times
|
---|
1117 | TCanvas &c17 = fDisplay->AddTab("RelTimes");
|
---|
1118 | c17.Divide(2,4);
|
---|
1119 |
|
---|
1120 | disp30.CamDraw(c17, 1, 2, 5, 1);
|
---|
1121 | disp31.CamDraw(c17, 2, 2, 5, 1);
|
---|
1122 | }
|
---|
1123 |
|
---|
1124 | return;
|
---|
1125 | }
|
---|
1126 |
|
---|
1127 | if (fDisplayType == kFullDisplay)
|
---|
1128 | {
|
---|
1129 | MHCalibrationCam *cam = (MHCalibrationCam*)plist.FindObject("MHCalibrationChargeCam");
|
---|
1130 |
|
---|
1131 | for (Int_t sector=1;sector<cam->GetAverageSectors();sector++)
|
---|
1132 | {
|
---|
1133 | cam->GetAverageHiGainSector(sector).DrawClone("all");
|
---|
1134 | cam->GetAverageLoGainSector(sector).DrawClone("all");
|
---|
1135 | }
|
---|
1136 |
|
---|
1137 | // Charges
|
---|
1138 | TCanvas &c21 = fDisplay->AddTab("FitCharge");
|
---|
1139 | c21.Divide(2, 4);
|
---|
1140 |
|
---|
1141 | disp1.CamDraw(c21, 1, 2, 2, 1);
|
---|
1142 | disp2.CamDraw(c21, 2, 2, 2, 1);
|
---|
1143 |
|
---|
1144 | // Reduced Sigmas
|
---|
1145 | TCanvas &c23 = fDisplay->AddTab("RedSigma");
|
---|
1146 | c23.Divide(2,4);
|
---|
1147 |
|
---|
1148 | disp3.CamDraw(c23, 1, 2, 2, 1);
|
---|
1149 | disp4.CamDraw(c23, 2, 2, 2, 1);
|
---|
1150 |
|
---|
1151 | // F-Factor
|
---|
1152 | TCanvas &c24 = fDisplay->AddTab("Phe's");
|
---|
1153 | c24.Divide(3,5);
|
---|
1154 |
|
---|
1155 | disp5.CamDraw(c24, 1, 3, 2, 1, 1);
|
---|
1156 | disp6.CamDraw(c24, 2, 3, 2, 1, 1);
|
---|
1157 | disp7.CamDraw(c24, 3, 3, 2, 1, 1);
|
---|
1158 |
|
---|
1159 | // QE's
|
---|
1160 | TCanvas &c25 = fDisplay->AddTab("QE's");
|
---|
1161 | c25.Divide(4,5);
|
---|
1162 |
|
---|
1163 | disp8.CamDraw(c25, 1, 4, 2, 1, 1);
|
---|
1164 | disp9.CamDraw(c25, 2, 4, 2, 1, 1);
|
---|
1165 | disp10.CamDraw(c25, 3, 4, 2, 1, 1);
|
---|
1166 | disp11.CamDraw(c25, 4, 4, 2, 1, 1);
|
---|
1167 |
|
---|
1168 | // Validity
|
---|
1169 | TCanvas &c26 = fDisplay->AddTab("Valid");
|
---|
1170 | c26.Divide(4,2);
|
---|
1171 |
|
---|
1172 | disp12.CamDraw(c26, 1, 4, 0);
|
---|
1173 | disp13.CamDraw(c26, 2, 4, 0);
|
---|
1174 | disp14.CamDraw(c26, 3, 4, 0);
|
---|
1175 | disp15.CamDraw(c26, 4, 4, 0);
|
---|
1176 |
|
---|
1177 | // Other info
|
---|
1178 | TCanvas &c27 = fDisplay->AddTab("HiLoGain");
|
---|
1179 | c27.Divide(3,3);
|
---|
1180 |
|
---|
1181 | disp16.CamDraw(c27, 1, 3, 0);
|
---|
1182 | disp17.CamDraw(c27, 2, 3, 1);
|
---|
1183 | disp18.CamDraw(c27, 3, 3, 1);
|
---|
1184 |
|
---|
1185 | // Pickup
|
---|
1186 | TCanvas &c28 = fDisplay->AddTab("Pickup");
|
---|
1187 | c28.Divide(4,2);
|
---|
1188 |
|
---|
1189 | disp19.CamDraw(c28, 1, 4, 0);
|
---|
1190 | disp20.CamDraw(c28, 2, 4, 0);
|
---|
1191 | disp21.CamDraw(c28, 3, 4, 0);
|
---|
1192 | disp22.CamDraw(c28, 4, 4, 0);
|
---|
1193 |
|
---|
1194 | // Defects
|
---|
1195 | TCanvas &c29 = fDisplay->AddTab("Defect");
|
---|
1196 | // c29.Divide(5,2);
|
---|
1197 | c29.Divide(4,2);
|
---|
1198 |
|
---|
1199 | disp24.CamDraw(c29, 1, 4, 0);
|
---|
1200 | disp25.CamDraw(c29, 2, 4, 0);
|
---|
1201 | disp26.CamDraw(c29, 3, 4, 0);
|
---|
1202 | disp27.CamDraw(c29, 4, 4, 0);
|
---|
1203 |
|
---|
1204 | // Abs. Times
|
---|
1205 | TCanvas &c30 = fDisplay->AddTab("AbsTimes");
|
---|
1206 | c30.Divide(2,3);
|
---|
1207 |
|
---|
1208 | disp28.CamDraw(c30, 1, 2, 2);
|
---|
1209 | disp29.CamDraw(c30, 2, 2, 1);
|
---|
1210 |
|
---|
1211 | if (IsRelTimes())
|
---|
1212 | {
|
---|
1213 | // Rel. Times
|
---|
1214 | TCanvas &c31 = fDisplay->AddTab("RelTimes");
|
---|
1215 | c31.Divide(3,5);
|
---|
1216 |
|
---|
1217 | disp30.CamDraw(c31, 1, 3, 2, 1, 1);
|
---|
1218 | disp31.CamDraw(c31, 2, 3, 2, 1, 1);
|
---|
1219 | disp32.CamDraw(c31, 3, 3, 4, 1, 1);
|
---|
1220 |
|
---|
1221 | // Time Defects
|
---|
1222 | TCanvas &c32 = fDisplay->AddTab("DefTime");
|
---|
1223 | c32.Divide(2,2);
|
---|
1224 |
|
---|
1225 | disp33.CamDraw(c32, 1, 2, 0);
|
---|
1226 | disp34.CamDraw(c32, 2, 2, 0);
|
---|
1227 |
|
---|
1228 | MHCalibrationCam *cam = (MHCalibrationCam*)plist.FindObject("MHCalibrationRelTimeCam");
|
---|
1229 |
|
---|
1230 | for (Int_t sector=1;sector<cam->GetAverageSectors();sector++)
|
---|
1231 | {
|
---|
1232 | cam->GetAverageHiGainSector(sector).DrawClone("fourierevents");
|
---|
1233 | cam->GetAverageLoGainSector(sector).DrawClone("fourierevents");
|
---|
1234 | }
|
---|
1235 |
|
---|
1236 | }
|
---|
1237 |
|
---|
1238 | return;
|
---|
1239 | }
|
---|
1240 | }
|
---|
1241 |
|
---|
1242 |
|
---|
1243 | void MJCalibration::DisplayReferenceLines(MHCamera *cam, const Int_t what) const
|
---|
1244 | {
|
---|
1245 |
|
---|
1246 | const MGeomCam *geom = cam->GetGeometry();
|
---|
1247 |
|
---|
1248 | Double_t x = geom->InheritsFrom("MGeomCamMagic") ? 397 : cam->GetNbinsX() ;
|
---|
1249 |
|
---|
1250 | TLine line;
|
---|
1251 | line.SetLineStyle(kDashed);
|
---|
1252 | line.SetLineWidth(3);
|
---|
1253 | line.SetLineColor(kBlue);
|
---|
1254 |
|
---|
1255 | TLine *l1 = NULL;
|
---|
1256 |
|
---|
1257 | switch (what)
|
---|
1258 | {
|
---|
1259 | case 0:
|
---|
1260 | l1 = line.DrawLine(0, fRefQEInner, x, fRefQEInner);
|
---|
1261 | break;
|
---|
1262 | case 1:
|
---|
1263 | l1 = line.DrawLine(0, fRefConvFADC2PheInner, x, fRefConvFADC2PheInner);
|
---|
1264 | break;
|
---|
1265 | case 2:
|
---|
1266 | l1 = line.DrawLine(0, fRefFADC2PheInner, x, fRefFADC2PheInner );
|
---|
1267 | break;
|
---|
1268 | case 3:
|
---|
1269 | l1 = line.DrawLine(0, fRefArrivalTimeInner, x, fRefArrivalTimeInner );
|
---|
1270 | break;
|
---|
1271 | case 4:
|
---|
1272 | l1 = line.DrawLine(0, fRefArrivalTimeRmsInner, x, fRefArrivalTimeRmsInner );
|
---|
1273 | break;
|
---|
1274 | case 5:
|
---|
1275 | l1 = line.DrawLine(0, fRefTimeOffsetInner, x, fRefTimeOffsetInner );
|
---|
1276 | break;
|
---|
1277 | case 6:
|
---|
1278 | l1 = line.DrawLine(0, fRefTimeResolutionInner, x, fRefTimeResolutionInner );
|
---|
1279 | break;
|
---|
1280 | default:
|
---|
1281 | break;
|
---|
1282 | }
|
---|
1283 |
|
---|
1284 | if (geom->InheritsFrom("MGeomCamMagic"))
|
---|
1285 | {
|
---|
1286 | const Double_t x2 = cam->GetNbinsX();
|
---|
1287 |
|
---|
1288 | switch (what)
|
---|
1289 | {
|
---|
1290 | case 0:
|
---|
1291 | line.DrawLine(x2, fRefQEOuter, 398, fRefQEOuter);
|
---|
1292 | break;
|
---|
1293 | case 1:
|
---|
1294 | line.DrawLine(x2, fRefConvFADC2PheOuter, 398, fRefConvFADC2PheOuter );
|
---|
1295 | break;
|
---|
1296 | case 2:
|
---|
1297 | line.DrawLine(x2, fRefFADC2PheOuter, 398, fRefFADC2PheOuter);
|
---|
1298 | break;
|
---|
1299 | case 3:
|
---|
1300 | line.DrawLine(x2, fRefArrivalTimeOuter, 398, fRefArrivalTimeOuter);
|
---|
1301 | break;
|
---|
1302 | case 4:
|
---|
1303 | line.DrawLine(x2, fRefArrivalTimeRmsOuter, 398, fRefArrivalTimeRmsOuter);
|
---|
1304 | break;
|
---|
1305 | case 5:
|
---|
1306 | line.DrawLine(x2, fRefTimeOffsetOuter, 398, fRefTimeOffsetOuter);
|
---|
1307 | break;
|
---|
1308 | case 6:
|
---|
1309 | line.DrawLine(x2, fRefTimeResolutionOuter, 398, fRefTimeResolutionOuter);
|
---|
1310 | break;
|
---|
1311 | default:
|
---|
1312 | break;
|
---|
1313 | }
|
---|
1314 | }
|
---|
1315 |
|
---|
1316 | TLegend *leg = new TLegend(0.6,0.85,0.9 ,0.95);
|
---|
1317 | leg->SetBit(kCanDelete);
|
---|
1318 | leg->AddEntry(l1, "Reference","l");
|
---|
1319 | leg->Draw();
|
---|
1320 | }
|
---|
1321 |
|
---|
1322 | void MJCalibration::DisplayOutliers(TH1D *hist, const char* whatsmall, const char* whatbig) const
|
---|
1323 | {
|
---|
1324 |
|
---|
1325 | const Int_t kNotDraw = 1<<9;
|
---|
1326 | TF1 *f = hist->GetFunction("gaus");
|
---|
1327 | f->ResetBit(kNotDraw);
|
---|
1328 |
|
---|
1329 | const Float_t mean = f->GetParameter(1);
|
---|
1330 | const Float_t lolim = mean - 4.0*f->GetParameter(2);
|
---|
1331 | const Float_t uplim = mean + 4.0*f->GetParameter(2);
|
---|
1332 | const Stat_t dead = hist->Integral(0,hist->FindBin(lolim)-1);
|
---|
1333 | const Stat_t noisy = hist->Integral(hist->FindBin(uplim)+1,hist->GetNbinsX()+1);
|
---|
1334 |
|
---|
1335 | const Double_t max = hist->GetBinContent(hist->GetMaximumBin());
|
---|
1336 |
|
---|
1337 | const Double_t minl = hist->GetBinCenter(hist->GetXaxis()->GetFirst());
|
---|
1338 | const Double_t maxl = hist->GetBinCenter(hist->GetXaxis()->GetLast());
|
---|
1339 |
|
---|
1340 | TLatex deadtex;
|
---|
1341 | deadtex.SetTextSize(0.07);
|
---|
1342 | deadtex.DrawLatex(minl+0.015*(maxl-minl),max/1.1,
|
---|
1343 | Form("%3i %s pixels",(Int_t)dead,whatsmall));
|
---|
1344 |
|
---|
1345 | TLatex noisytex;
|
---|
1346 | noisytex.SetTextSize(0.07);
|
---|
1347 | noisytex.DrawLatex(minl+0.015*(maxl-minl),max/1.2,
|
---|
1348 | Form("%3i %s pixels",(Int_t)noisy,whatbig));
|
---|
1349 |
|
---|
1350 | }
|
---|
1351 |
|
---|
1352 | void MJCalibration::FixDataCheckHist(TH1D *hist) const
|
---|
1353 | {
|
---|
1354 |
|
---|
1355 | hist->SetDirectory(NULL);
|
---|
1356 |
|
---|
1357 | //
|
---|
1358 | // set the labels bigger
|
---|
1359 | //
|
---|
1360 | TAxis *xaxe = hist->GetXaxis();
|
---|
1361 | TAxis *yaxe = hist->GetYaxis();
|
---|
1362 |
|
---|
1363 | xaxe->CenterTitle();
|
---|
1364 | yaxe->CenterTitle();
|
---|
1365 | xaxe->SetTitleSize(0.06);
|
---|
1366 | yaxe->SetTitleSize(0.06);
|
---|
1367 | xaxe->SetTitleOffset(0.8);
|
---|
1368 | yaxe->SetTitleOffset(0.85);
|
---|
1369 | xaxe->SetLabelSize(0.05);
|
---|
1370 | yaxe->SetLabelSize(0.05);
|
---|
1371 |
|
---|
1372 | }
|
---|
1373 |
|
---|
1374 | const Int_t MJCalibration::CountBadPixels(MHCamera *cam, const Int_t what) const
|
---|
1375 | {
|
---|
1376 | Int_t cnt = 0;
|
---|
1377 |
|
---|
1378 | for (UInt_t pix=0; pix<cam->GetNumPixels(); pix++)
|
---|
1379 | if (TMath::Nint(cam->GetPixContent(pix)) == what)
|
---|
1380 | cnt++;
|
---|
1381 |
|
---|
1382 | return cnt;
|
---|
1383 | }
|
---|
1384 |
|
---|
1385 | // --------------------------------------------------------------------------
|
---|
1386 | //
|
---|
1387 | // Retrieve the output file written by WriteResult()
|
---|
1388 | //
|
---|
1389 | const char* MJCalibration::GetOutputFileName() const
|
---|
1390 | {
|
---|
1391 | return Form("calib%08d.root", fSequence.GetSequence());
|
---|
1392 | }
|
---|
1393 |
|
---|
1394 | // --------------------------------------------------------------------------
|
---|
1395 | //
|
---|
1396 | // Read the following values from resource file:
|
---|
1397 | //
|
---|
1398 | // ConvFADC2PheMin
|
---|
1399 | // ConvFADC2PheMax
|
---|
1400 | // ConvFADC2PhotMin
|
---|
1401 | // ConvFADC2PhotMax
|
---|
1402 | //
|
---|
1403 | // QEMin
|
---|
1404 | // QEMax
|
---|
1405 | //
|
---|
1406 | // ArrivalTimeMin
|
---|
1407 | // ArrivalTimeMax
|
---|
1408 | //
|
---|
1409 | // TimeOffsetMin
|
---|
1410 | // TimeOffsetMax
|
---|
1411 | // TimeResolutionMin
|
---|
1412 | // TimeResolutionMax
|
---|
1413 | //
|
---|
1414 | // RefConvFADC2PheInner
|
---|
1415 | // RefConvFADC2PheOuter
|
---|
1416 | // RefConvFADC2PhotInner
|
---|
1417 | // RefConvFADC2PhotOuter
|
---|
1418 | //
|
---|
1419 | // RefQEInner
|
---|
1420 | // RefQEOuter
|
---|
1421 | //
|
---|
1422 | // RefArrivalTimeInner
|
---|
1423 | // RefArrivalTimeOuter
|
---|
1424 | // RefArrivalTimeRmsInner
|
---|
1425 | // RefArrivalTimeRmsOuter
|
---|
1426 | //
|
---|
1427 | // RefTimeOffsetInner
|
---|
1428 | // RefTimeOffsetOuter
|
---|
1429 | // RefTimeResolutionInner
|
---|
1430 | // RefTimeResolutionOuter
|
---|
1431 | //
|
---|
1432 | void MJCalibration::ReadReferenceFile()
|
---|
1433 | {
|
---|
1434 | TEnv refenv(fReferenceFile);
|
---|
1435 |
|
---|
1436 | fConvFADC2PheMin = refenv.GetValue("ConvFADC2PheMin",fConvFADC2PheMin);
|
---|
1437 | fConvFADC2PheMax = refenv.GetValue("ConvFADC2PheMax",fConvFADC2PheMax);
|
---|
1438 | fConvFADC2PhotMin = refenv.GetValue("ConvFADC2PhotMin",fConvFADC2PhotMin);
|
---|
1439 | fConvFADC2PhotMax = refenv.GetValue("ConvFADC2PhotMax",fConvFADC2PhotMax);
|
---|
1440 | fQEMin = refenv.GetValue("QEMin",fQEMin);
|
---|
1441 | fQEMax = refenv.GetValue("QEMax",fQEMax);
|
---|
1442 | fArrivalTimeMin = refenv.GetValue("ArrivalTimeMin",fArrivalTimeMin);
|
---|
1443 | fArrivalTimeMax = refenv.GetValue("ArrivalTimeMax",fArrivalTimeMax);
|
---|
1444 | fTimeOffsetMin = refenv.GetValue("TimeOffsetMin",fTimeOffsetMin);
|
---|
1445 | fTimeOffsetMax = refenv.GetValue("TimeOffsetMax",fTimeOffsetMax);
|
---|
1446 | fTimeResolutionMin = refenv.GetValue("TimeResolutionMin",fTimeResolutionMin);
|
---|
1447 | fTimeResolutionMax = refenv.GetValue("TimeResolutionMax",fTimeResolutionMax);
|
---|
1448 |
|
---|
1449 | fRefFADC2PheInner = refenv.GetValue("RefFADC2PheInner",fRefFADC2PheInner);
|
---|
1450 | fRefFADC2PheOuter = refenv.GetValue("RefFADC2PheOuter",fRefFADC2PheOuter);
|
---|
1451 | fRefConvFADC2PhotInner = refenv.GetValue("RefConvFADC2PhotInner",fRefConvFADC2PhotInner);
|
---|
1452 | fRefConvFADC2PhotOuter = refenv.GetValue("RefConvFADC2PhotOuter",fRefConvFADC2PhotOuter);
|
---|
1453 | fRefConvFADC2PheInner = refenv.GetValue("RefConvFADC2PheInner",fRefConvFADC2PheInner);
|
---|
1454 | fRefConvFADC2PheOuter = refenv.GetValue("RefConvFADC2PheOuter",fRefConvFADC2PheOuter);
|
---|
1455 | fRefQEInner = refenv.GetValue("RefQEInner",fRefQEInner);
|
---|
1456 | fRefQEOuter = refenv.GetValue("RefQEOuter",fRefQEOuter);
|
---|
1457 | fRefArrivalTimeInner = refenv.GetValue("RefArrivalTimeInner",fRefArrivalTimeInner);
|
---|
1458 | fRefArrivalTimeOuter = refenv.GetValue("RefArrivalTimeOuter",fRefArrivalTimeOuter);
|
---|
1459 | fRefArrivalTimeRmsInner = refenv.GetValue("RefArrivalTimeRmsInner",fRefArrivalTimeRmsInner);
|
---|
1460 | fRefArrivalTimeRmsOuter = refenv.GetValue("RefArrivalTimeRmsOuter",fRefArrivalTimeRmsOuter);
|
---|
1461 | fRefTimeOffsetInner = refenv.GetValue("RefTimeOffsetInner",fRefTimeOffsetInner);
|
---|
1462 | fRefTimeOffsetOuter = refenv.GetValue("RefTimeOffsetOuter",fRefTimeOffsetOuter);
|
---|
1463 | fRefTimeResolutionInner = refenv.GetValue("RefTimeResolutionInner",fRefTimeResolutionInner);
|
---|
1464 | fRefTimeResolutionOuter = refenv.GetValue("RefTimeResolutionOuter",fRefTimeResolutionOuter);
|
---|
1465 | }
|
---|
1466 |
|
---|
1467 | // --------------------------------------------------------------------------
|
---|
1468 | //
|
---|
1469 | // Read the following values from resource file.
|
---|
1470 | //
|
---|
1471 | Bool_t MJCalibration::ReadHiLoCalibFile()
|
---|
1472 | {
|
---|
1473 | if (fExtractor && !fExtractor->HasLoGain())
|
---|
1474 | return kTRUE;
|
---|
1475 |
|
---|
1476 | // if (!fIsHiLoCalibration)
|
---|
1477 | // return kTRUE;
|
---|
1478 |
|
---|
1479 | // We use the night time stamp to determine the period
|
---|
1480 | // because the night must be in the sequence file
|
---|
1481 | const MTime &night = fSequence.GetNight();
|
---|
1482 | const Int_t period = night.GetMagicPeriod();
|
---|
1483 |
|
---|
1484 | // Open resource file
|
---|
1485 | MEnv env(fHiLoCalibFile);
|
---|
1486 | if (!env.IsValid())
|
---|
1487 | {
|
---|
1488 | *fLog << err << "ERROR - Resource file " << fHiLoCalibFile;
|
---|
1489 | *fLog << " could not be opened... abort." << endl;
|
---|
1490 | return kFALSE;
|
---|
1491 | }
|
---|
1492 |
|
---|
1493 | // Defined resource id
|
---|
1494 | const TString id = IsUseMC() ? "MC" : Form("%02d", period);
|
---|
1495 |
|
---|
1496 | // Check for a valid entry for the correct period
|
---|
1497 | TString fname = env.GetValue(id, "");
|
---|
1498 | if (fname.IsNull())
|
---|
1499 | {
|
---|
1500 | *fLog << err << "ERROR - No entry for resource id '" << id;
|
---|
1501 | *fLog << "' found in " << fHiLoCalibFile << "... looking for default." << endl;
|
---|
1502 | return kFALSE;
|
---|
1503 | /*
|
---|
1504 | *fLog << warn << "WARNING - No entry for period " << period;
|
---|
1505 | *fLog << " found in " << fHiLoCalibFile << "... looking for default." << endl;
|
---|
1506 |
|
---|
1507 | fname = env.GetValue("00", "");
|
---|
1508 | if (fname.IsNull())
|
---|
1509 | {
|
---|
1510 | *fLog << err << "ERROR - No default entry (00) found in ";
|
---|
1511 | *fLog << fHiLoCalibFile << "... abort." << endl;
|
---|
1512 | return kFALSE;
|
---|
1513 | }*/
|
---|
1514 | }
|
---|
1515 |
|
---|
1516 | *fLog << inf << "Reading Hi-/Lo-Gain calibration constants from " << fname << endl;
|
---|
1517 |
|
---|
1518 | // Open file with calibration constants
|
---|
1519 | TFile file(fname, "READ");
|
---|
1520 | if (!file.IsOpen())
|
---|
1521 | {
|
---|
1522 | *fLog << err << "ERROR - Couldn't open file " << fname << " for reading... abort." << endl;
|
---|
1523 | return kFALSE;
|
---|
1524 | }
|
---|
1525 |
|
---|
1526 | // read calibration constants
|
---|
1527 | MHCamEvent hilocam;
|
---|
1528 | if (hilocam.Read()<=0)
|
---|
1529 | {
|
---|
1530 | *fLog << err << "ERROR - Unable to read MHCamEvent from " << fname << "... abort." << endl;
|
---|
1531 | return kFALSE;
|
---|
1532 | }
|
---|
1533 |
|
---|
1534 | // Get histogram with constants
|
---|
1535 | MHCamera *hist = hilocam.GetHist();
|
---|
1536 | if (!hist)
|
---|
1537 | {
|
---|
1538 | *fLog << err << "ERROR - MHCamEvent from " << fname << " empty... abort." << endl;
|
---|
1539 | return kFALSE;
|
---|
1540 | }
|
---|
1541 |
|
---|
1542 | // Do some sanity stuff
|
---|
1543 | if (fCalibrationCam.GetSize() < 1)
|
---|
1544 | fCalibrationCam.InitSize(hist->GetNumPixels());
|
---|
1545 |
|
---|
1546 | if (fBadPixels.GetSize() < 1)
|
---|
1547 | fBadPixels.InitSize(hist->GetNumPixels());
|
---|
1548 |
|
---|
1549 | if ((UInt_t)fCalibrationCam.GetSize() != hist->GetNumPixels())
|
---|
1550 | {
|
---|
1551 | *fLog << err << "ERROR - Size mismatch MHCamEvent and MCalibrationChargeCam.. abort." << endl;
|
---|
1552 | return kFALSE;
|
---|
1553 | }
|
---|
1554 |
|
---|
1555 | // Copy the constants to their final location
|
---|
1556 | // FIXME: For what the hell do we need to have the constants in
|
---|
1557 | // in MCalibrationChargeCam?
|
---|
1558 | for (UInt_t i=0; i<hist->GetNumPixels(); i++)
|
---|
1559 | {
|
---|
1560 | hist->SetBit(MHCamera::kProfile);
|
---|
1561 | Double_t v = hist->GetBinContent(i);
|
---|
1562 | hist->SetBit(MHCamera::kErrorMean);
|
---|
1563 | Double_t e = hist->GetBinError(i);
|
---|
1564 | hist->ResetBit(MHCamera::kErrorMean);
|
---|
1565 | Double_t s = hist->GetBinError(i);
|
---|
1566 |
|
---|
1567 | if (!hist->IsUsed(i))
|
---|
1568 | {
|
---|
1569 | fBadPixels[i].SetUncalibrated(MBadPixelsPix::kConversionHiLoNotValid);
|
---|
1570 | v = e = s = -1;
|
---|
1571 | }
|
---|
1572 |
|
---|
1573 | MCalibrationChargePix &cpix = (MCalibrationChargePix&)fCalibrationCam[i];
|
---|
1574 | cpix.SetConversionHiLo(v);
|
---|
1575 | cpix.SetConversionHiLoErr(e);
|
---|
1576 | cpix.SetConversionHiLoSigma(s);
|
---|
1577 | }
|
---|
1578 |
|
---|
1579 | return kTRUE;
|
---|
1580 | }
|
---|
1581 |
|
---|
1582 | // --------------------------------------------------------------------------
|
---|
1583 | //
|
---|
1584 | // MJCalibration allows to setup several option by a resource file:
|
---|
1585 | // MJCalibration.Display: full, datacheck, normal
|
---|
1586 | // MJCalibration.RelTimeCalibration: yes,no
|
---|
1587 | // MJCalibration.DataCheck: yes,no
|
---|
1588 | // MJCalibration.Debug: yes,no
|
---|
1589 | // MJCalibration.Intensity: yes,no
|
---|
1590 | // MJCalibration.UseBlindPixel: yes,no
|
---|
1591 | // MJCalibration.UsePINDiode: yes,no
|
---|
1592 | // MJCalibration.Geometry: MGeomCamMagic, MGeomCamECO1000
|
---|
1593 | //
|
---|
1594 | // Name of a file containing reference values (see ReadReferenceFile)
|
---|
1595 | // Prefix.ReferenceFile: filename
|
---|
1596 | // (see ReadReferenceFile)
|
---|
1597 | //
|
---|
1598 | // For more details see the class description and the corresponding Getters
|
---|
1599 | //
|
---|
1600 | Bool_t MJCalibration::CheckEnvLocal()
|
---|
1601 | {
|
---|
1602 | TString dis = GetEnv("Display", "");
|
---|
1603 | if (dis.BeginsWith("Full", TString::kIgnoreCase))
|
---|
1604 | SetFullDisplay();
|
---|
1605 | if (dis.BeginsWith("DataCheck", TString::kIgnoreCase))
|
---|
1606 | SetDataCheckDisplay();
|
---|
1607 | if (dis.BeginsWith("Normal", TString::kIgnoreCase))
|
---|
1608 | SetNormalDisplay();
|
---|
1609 |
|
---|
1610 | if (!MJCalib::CheckEnvLocal())
|
---|
1611 | return kFALSE;
|
---|
1612 |
|
---|
1613 | SetRelTimeCalibration(GetEnv("RelTimeCalibration", IsRelTimes()));
|
---|
1614 | SetIntensity(GetEnv("IntensityCalibration", IsIntensity()));
|
---|
1615 | SetDebug(GetEnv("Debug", IsDebug()));
|
---|
1616 |
|
---|
1617 | SetUseBlindPixel(GetEnv("UseBlindPixel", IsUseBlindPixel()));
|
---|
1618 | SetUsePINDiode(GetEnv("UsePINDiode", IsUsePINDiode()));
|
---|
1619 | SetGeometry(GetEnv("Geometry", fGeometry));
|
---|
1620 |
|
---|
1621 | fReferenceFile = GetEnv("ReferenceFile",fReferenceFile.Data());
|
---|
1622 | ReadReferenceFile();
|
---|
1623 |
|
---|
1624 | fHiLoCalibFile = GetEnv("HiLoCalibFile",fHiLoCalibFile.Data());
|
---|
1625 |
|
---|
1626 | /*
|
---|
1627 | if (IsUseMC() && !fHiLoCalibFile.EndsWith("_mc.root"))
|
---|
1628 | {
|
---|
1629 | if (!fHiLoCalibFile.EndsWith(".root"))
|
---|
1630 | {
|
---|
1631 | *fLog << warn << "WARNING - Hi-/Lo-Gain intercalibration file ";
|
---|
1632 | *fLog << fHiLoCalibFile << " has not .root as extension..." << endl;
|
---|
1633 | }
|
---|
1634 | else
|
---|
1635 | fHiLoCalibFile.Insert(fHiLoCalibFile.Length()-5, "_mc");
|
---|
1636 | }
|
---|
1637 | */
|
---|
1638 |
|
---|
1639 | return ReadHiLoCalibFile();
|
---|
1640 | }
|
---|
1641 |
|
---|
1642 | void MJCalibration::InitBlindPixel(MExtractBlindPixel &blindext,
|
---|
1643 | MHCalibrationChargeBlindCam &blindcam)
|
---|
1644 | {
|
---|
1645 | const Int_t run = fSequence.GetLastRun();
|
---|
1646 |
|
---|
1647 | //
|
---|
1648 | // Initialize the blind pixel. Unfortunately, there is a hardware
|
---|
1649 | // difference in the first blind pixel until run
|
---|
1650 | // gkSecondBlindPixelInstallation and the later setup. The first
|
---|
1651 | // needs to use a filter because of the length of spurious NSB photon
|
---|
1652 | // signals. The latter get better along extracting the amplitude
|
---|
1653 | // from a small window.
|
---|
1654 | //
|
---|
1655 | const MCalibrationBlindCamOneOldStyle one;
|
---|
1656 | const MCalibrationBlindCamTwoNewStyle two;
|
---|
1657 | const MCalibrationBlindCamThreeNewStyle three;
|
---|
1658 |
|
---|
1659 | const MCalibrationBlindCam &blindresults =
|
---|
1660 | run<gkSecondBlindPixelInstallation ? static_cast<MCalibrationBlindCam>(one) :
|
---|
1661 | (run<gkThirdBlindPixelInstallation ? static_cast<MCalibrationBlindCam>(two) : static_cast<MCalibrationBlindCam>(three));
|
---|
1662 |
|
---|
1663 | if (IsIntensity())
|
---|
1664 | blindresults.Copy(*fIntensBlindCam.GetCam());
|
---|
1665 | else
|
---|
1666 | blindresults.Copy(fCalibrationBlindCam);
|
---|
1667 |
|
---|
1668 | blindext.SetExtractionType(MExtractBlindPixel::kIntegral);
|
---|
1669 | blindext.SetExtractionType(MExtractBlindPixel::kFilter);
|
---|
1670 |
|
---|
1671 | if (run<gkSecondBlindPixelInstallation)
|
---|
1672 | {
|
---|
1673 | blindext.SetRange(10,19,0,6);
|
---|
1674 | blindext.SetNSBFilterLimit(70);
|
---|
1675 | }
|
---|
1676 | else
|
---|
1677 | {
|
---|
1678 | blindext.SetRange(5,8,0,2);
|
---|
1679 | blindext.SetNSBFilterLimit(38);
|
---|
1680 | }
|
---|
1681 |
|
---|
1682 | if (run>=gkThirdBlindPixelInstallation)
|
---|
1683 | blindext.SetDataType(MExtractBlindPixel::kRawEvt2);
|
---|
1684 | }
|
---|
1685 |
|
---|
1686 | // --------------------------------------------------------------------------
|
---|
1687 | //
|
---|
1688 | // Execute the task list and the eventloop:
|
---|
1689 | //
|
---|
1690 | // - Check the colour of the files in fRuns (FindColor()), otherwise return
|
---|
1691 | // - Check for consistency between run numbers and number of files
|
---|
1692 | // - Add fRuns to MReadMarsFile
|
---|
1693 | // - Put into MParList:
|
---|
1694 | // 1) MPedestalCam (pedcam)
|
---|
1695 | // 2) MCalibrationQECam (fQECam)
|
---|
1696 | // 3) MCalibrationChargeCam (fCalibrationCam)
|
---|
1697 | // 4) MCalibrationRelTimeCam (fRelTimeCam) (only if flag IsRelTimes() is chosen)
|
---|
1698 | // 5) MBadPixelsCam (fBadPixels)
|
---|
1699 | // 6) MCalibrationChargePINDiode
|
---|
1700 | // 7) MCalibrationBlindPix
|
---|
1701 | // - Put into the MTaskList:
|
---|
1702 | // 1) MReadMarsFile
|
---|
1703 | // 2) MBadPixelsMerge
|
---|
1704 | // 3) MGeomApply
|
---|
1705 | // 4) MExtractor
|
---|
1706 | // 5) MExtractPINDiode
|
---|
1707 | // 6) MExtractBlindPixel
|
---|
1708 | // 7) MExtractTime (only if flag IsRelTimes() is chosen)
|
---|
1709 | // 8) MContinue(MFCosmics)
|
---|
1710 | // 9) MFillH("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode", "FillPINDiode")
|
---|
1711 | // 10) MFillH("MHCalibrationChargeBlindCam", "MExtractedSignalBlindPixel", "FillBlindCam")
|
---|
1712 | // 11) MFillH("MHCalibrationChargeCam", "MExtractedSignalCam", "FillChargeCam")
|
---|
1713 | // 12) MFillH("MHCalibrationChargeCam", "MExtractedSignalCam", "FillRelTime")
|
---|
1714 | // 13) MCalibrationChargeCalc
|
---|
1715 | // 14) MFillH("MHCalibrationRelTimeCam", "MArrivalTimeCam") (only if flag IsRelTimes() is chosen)
|
---|
1716 | // 15) MCalibrationRelTimeCalc
|
---|
1717 | // - Execute MEvtLoop
|
---|
1718 | // - DisplayResult()
|
---|
1719 | // - WriteResult()
|
---|
1720 | //
|
---|
1721 | Bool_t MJCalibration::Process(MPedestalCam &pedcam)
|
---|
1722 | {
|
---|
1723 | if (!fSequence.IsValid())
|
---|
1724 | {
|
---|
1725 | *fLog << err << "ERROR - Sequence invalid..." << endl;
|
---|
1726 | return kFALSE;
|
---|
1727 | }
|
---|
1728 |
|
---|
1729 | *fLog << inf;
|
---|
1730 | fLog->Separator(GetDescriptor());
|
---|
1731 | *fLog << "Calculate calibration constants from Sequence #";
|
---|
1732 | *fLog << fSequence.GetSequence() << endl << endl;
|
---|
1733 |
|
---|
1734 | // --------------------------------------------------------------------------------
|
---|
1735 |
|
---|
1736 | if (!CheckEnv())
|
---|
1737 | return kFALSE;
|
---|
1738 |
|
---|
1739 | // --------------------------------------------------------------------------------
|
---|
1740 |
|
---|
1741 | // Setup Tasklist
|
---|
1742 | MParList plist;
|
---|
1743 | MTaskList tlist;
|
---|
1744 | plist.AddToList(&tlist);
|
---|
1745 | plist.AddToList(this); // take care of fDisplay!
|
---|
1746 |
|
---|
1747 | MDirIter iter;
|
---|
1748 | if (fSequence.SetupCalRuns(iter, 0, IsUseRawData())<=0)
|
---|
1749 | return kFALSE;
|
---|
1750 |
|
---|
1751 | //
|
---|
1752 | // Input containers
|
---|
1753 | //
|
---|
1754 | pedcam.SetName("MPedestalCam"); // MPedestalFundamental
|
---|
1755 | plist.AddToList(&pedcam);
|
---|
1756 | plist.AddToList(&fBadPixels);
|
---|
1757 |
|
---|
1758 | //
|
---|
1759 | // Calibration Results containers
|
---|
1760 | //
|
---|
1761 | if (IsIntensity())
|
---|
1762 | {
|
---|
1763 |
|
---|
1764 | MCalibrationChargeCam *cam = (MCalibrationChargeCam*)fIntensCalibCam.GetCam();
|
---|
1765 | cam->InitSize(fCalibrationCam.GetSize());
|
---|
1766 | cam->MergeHiLoConversionFactors(fCalibrationCam);
|
---|
1767 |
|
---|
1768 | plist.AddToList(&fIntensQECam);
|
---|
1769 | plist.AddToList(&fIntensCalibCam);
|
---|
1770 | // plist.AddToList(&fIntensCalibrationPINDiode);
|
---|
1771 | plist.AddToList(&fIntensRelTimeCam);
|
---|
1772 | plist.AddToList(&fIntensBadCam);
|
---|
1773 | if (IsUseBlindPixel())
|
---|
1774 | plist.AddToList(&fIntensBlindCam);
|
---|
1775 | }
|
---|
1776 | else
|
---|
1777 | {
|
---|
1778 | plist.AddToList(&fQECam);
|
---|
1779 | plist.AddToList(&fCalibrationCam);
|
---|
1780 | plist.AddToList(&fRelTimeCam);
|
---|
1781 | if (IsUseBlindPixel())
|
---|
1782 | plist.AddToList(&fCalibrationBlindCam);
|
---|
1783 | if (IsUsePINDiode())
|
---|
1784 | plist.AddToList(&fCalibrationPINDiode);
|
---|
1785 | }
|
---|
1786 |
|
---|
1787 | //
|
---|
1788 | // Initialize two histogram containers which could be modified in this class
|
---|
1789 | //
|
---|
1790 | MHCalibrationRelTimeCam reltimecam;
|
---|
1791 | MHCalibrationChargeCam chargecam;
|
---|
1792 | MHCalibrationChargeBlindCam blindcam;
|
---|
1793 | plist.AddToList(&chargecam);
|
---|
1794 |
|
---|
1795 | if (IsUseBlindPixel())
|
---|
1796 | plist.AddToList(&blindcam);
|
---|
1797 | if (IsRelTimes())
|
---|
1798 | plist.AddToList(&reltimecam);
|
---|
1799 | //
|
---|
1800 | // Data Reading tasks
|
---|
1801 | //
|
---|
1802 | MReadMarsFile read("Events");
|
---|
1803 | MRawFileRead rawread(NULL);
|
---|
1804 |
|
---|
1805 | if (IsUseRawData())
|
---|
1806 | {
|
---|
1807 | rawread.AddFiles(iter);
|
---|
1808 | tlist.AddToList(&rawread);
|
---|
1809 | }
|
---|
1810 | else
|
---|
1811 | {
|
---|
1812 | read.DisableAutoScheme();
|
---|
1813 | read.AddFiles(iter);
|
---|
1814 | tlist.AddToList(&read);
|
---|
1815 | }
|
---|
1816 |
|
---|
1817 | //
|
---|
1818 | // Other Tasks
|
---|
1819 | //
|
---|
1820 |
|
---|
1821 | // Set the default for data version earlier than 5, where no valid
|
---|
1822 | // trigger pattern exists. There should not be pin diode or other
|
---|
1823 | // types of events inside the calibration files which should be skipped,
|
---|
1824 | // anyway. So we set the default such that the MContinue ccalib
|
---|
1825 | // will never be executed.
|
---|
1826 | MTriggerPatternDecode trgpat;
|
---|
1827 | MFTriggerPattern fcalib("CalibFilter");
|
---|
1828 | fcalib.SetDefault(kFALSE);
|
---|
1829 | fcalib.DenyCalibration(MFTriggerPattern::kPrescaled);
|
---|
1830 |
|
---|
1831 | MContinue ccalib(&fcalib,"ContTrigPattern");
|
---|
1832 |
|
---|
1833 | MCalibrationPatternDecode decode;
|
---|
1834 | MGeomApply apply;
|
---|
1835 | apply.SetGeometry(fGeometry);
|
---|
1836 |
|
---|
1837 | MBadPixelsMerge merge(&fBadPixels);
|
---|
1838 | MExtractPINDiode pinext;
|
---|
1839 | MExtractBlindPixel blindext;
|
---|
1840 |
|
---|
1841 | if (IsUseBlindPixel())
|
---|
1842 | InitBlindPixel(blindext, blindcam);
|
---|
1843 |
|
---|
1844 | // MExtractSlidingWindow extract2;
|
---|
1845 | // MExtractTimeHighestIntegral timehigh;
|
---|
1846 | MCalibrationChargeCalc calcalc;
|
---|
1847 | MCalibrationRelTimeCalc timecalc;
|
---|
1848 | calcalc.SetExtractor(fExtractor);
|
---|
1849 |
|
---|
1850 | if (IsDebug())
|
---|
1851 | {
|
---|
1852 | chargecam.SetDebug();
|
---|
1853 | calcalc.SetDebug();
|
---|
1854 | }
|
---|
1855 |
|
---|
1856 | //
|
---|
1857 | // Calibration histogramming
|
---|
1858 | //
|
---|
1859 | MFillH fillpin("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode", "FillPINDiode");
|
---|
1860 | MFillH fillbnd("MHCalibrationChargeBlindCam", "MExtractedSignalBlindPixel", "FillBlindCam");
|
---|
1861 | MFillH fillcam("MHCalibrationChargeCam", "MExtractedSignalCam", "FillChargeCam");
|
---|
1862 | MFillH filltme("MHCalibrationRelTimeCam", "MArrivalTimeCam", "FillRelTime");
|
---|
1863 | fillpin.SetBit(MFillH::kDoNotDisplay);
|
---|
1864 | fillbnd.SetBit(MFillH::kDoNotDisplay);
|
---|
1865 | fillcam.SetBit(MFillH::kDoNotDisplay);
|
---|
1866 | filltme.SetBit(MFillH::kDoNotDisplay);
|
---|
1867 |
|
---|
1868 | //
|
---|
1869 | // Set default extractors in case, none has been set...
|
---|
1870 | //
|
---|
1871 | /*
|
---|
1872 | if (!fExtractor)
|
---|
1873 | fExtractor = &extract2;
|
---|
1874 | if (!fTimeExtractor)
|
---|
1875 | fTimeExtractor = &timehigh;
|
---|
1876 | */
|
---|
1877 | MExtractTimeAndChargeSpline spline;
|
---|
1878 | if (!fExtractor)
|
---|
1879 | fExtractor = &spline;
|
---|
1880 | // if (!fTimeExtractor)
|
---|
1881 | // fTimeExtractor = &timehigh;
|
---|
1882 |
|
---|
1883 | const Bool_t istimecharge = fExtractor->InheritsFrom("MExtractTimeAndCharge");
|
---|
1884 |
|
---|
1885 | //
|
---|
1886 | // Look if the extractor is a pure charge or also a time extractor
|
---|
1887 | //
|
---|
1888 | if (istimecharge)
|
---|
1889 | {
|
---|
1890 | if (fExtractorCam.GetSize() == pedcam.GetSize())
|
---|
1891 | calcalc.SetPedestals(&fExtractorCam);
|
---|
1892 | else
|
---|
1893 | {
|
---|
1894 | *fLog << err << GetDescriptor() << "ERROR - ";
|
---|
1895 | *fLog << "Used Extractor derives from MExtractTimeAndCharge, " << endl;
|
---|
1896 | *fLog << "but MExtractorCam size " << fExtractorCam.GetSize() << " ";
|
---|
1897 | *fLog << "mismatch pedcam size " << pedcam.GetSize() << "! " << endl;
|
---|
1898 | return kFALSE;
|
---|
1899 | }
|
---|
1900 | }
|
---|
1901 |
|
---|
1902 | //
|
---|
1903 | // Setup more tasks and tasklist
|
---|
1904 | //
|
---|
1905 | MTaskEnv taskenv("ExtractSignal");
|
---|
1906 | taskenv.SetDefault(fExtractor);
|
---|
1907 |
|
---|
1908 | tlist.AddToList(&trgpat);
|
---|
1909 | if (fColor != MCalibrationCam::kCT1)
|
---|
1910 | tlist.AddToList(&ccalib);
|
---|
1911 | tlist.AddToList(&decode);
|
---|
1912 | tlist.AddToList(&merge);
|
---|
1913 | tlist.AddToList(&apply);
|
---|
1914 |
|
---|
1915 | // Produce pedestal subtracted raw-data
|
---|
1916 | MPedestalSubtract pedsub;
|
---|
1917 | pedsub.SetPedestalCam(fExtractor->GetPedestals());
|
---|
1918 | tlist.AddToList(&pedsub);
|
---|
1919 |
|
---|
1920 | // Setup to use the hi-gain extraction window in the lo-gain
|
---|
1921 | // range (the start of the lo-gain range is added automatically
|
---|
1922 | // by MPedCalcFromLoGain)
|
---|
1923 | //
|
---|
1924 | // The window size of the extractor is not yet initialized,
|
---|
1925 | // so we have to stick to the extraction range
|
---|
1926 | const Int_t f = fExtractor->GetHiGainFirst();
|
---|
1927 | const Int_t l = fExtractor->GetHiGainLast();
|
---|
1928 | const Int_t w = (l-f+1)&~1;
|
---|
1929 |
|
---|
1930 | MPedCalcPedRun pedcalc;
|
---|
1931 | pedcalc.SetExtractWindow(f, w);
|
---|
1932 |
|
---|
1933 | if (IsIntensity())
|
---|
1934 | tlist.AddToList(&pedcalc);
|
---|
1935 |
|
---|
1936 | MCalibColorSet colorset;
|
---|
1937 | if (fColor != MCalibrationCam::kNONE)
|
---|
1938 | colorset.SetExplicitColor(fColor);
|
---|
1939 | tlist.AddToList(&colorset);
|
---|
1940 |
|
---|
1941 | tlist.AddToList(&taskenv);
|
---|
1942 |
|
---|
1943 | if (IsUsePINDiode())
|
---|
1944 | tlist.AddToList(&pinext);
|
---|
1945 | if (IsUseBlindPixel())
|
---|
1946 | tlist.AddToList(&blindext);
|
---|
1947 |
|
---|
1948 | MTaskEnv taskenv2("ExtractTime");
|
---|
1949 | if (!istimecharge)
|
---|
1950 | {
|
---|
1951 | taskenv2.SetDefault(fTimeExtractor);
|
---|
1952 |
|
---|
1953 | if (IsRelTimes())
|
---|
1954 | tlist.AddToList(&taskenv2);
|
---|
1955 | }
|
---|
1956 |
|
---|
1957 | //
|
---|
1958 | // Apply a filter against cosmics
|
---|
1959 | // (will have to be needed in the future
|
---|
1960 | // when the calibration hardware-trigger is working)
|
---|
1961 | //
|
---|
1962 | MFCosmics cosmics;
|
---|
1963 | cosmics.SetMaxEmptyPixels(0.05);
|
---|
1964 | cosmics.SetMaxAcceptedFraction(0.5); // max=0.5 cosmics
|
---|
1965 |
|
---|
1966 | MContinue cont(&cosmics, "ContCosmics");
|
---|
1967 | tlist.AddToList(&cont);
|
---|
1968 |
|
---|
1969 | MCalibColorSteer steer;
|
---|
1970 | if (IsIntensity())
|
---|
1971 | tlist.AddToList(&steer);
|
---|
1972 |
|
---|
1973 | if (IsRelTimes())
|
---|
1974 | {
|
---|
1975 | tlist.AddToList(&filltme);
|
---|
1976 | tlist.AddToList(&timecalc);
|
---|
1977 | }
|
---|
1978 |
|
---|
1979 | tlist.AddToList(&fillcam);
|
---|
1980 |
|
---|
1981 | if (IsUseBlindPixel())
|
---|
1982 | tlist.AddToList(&fillbnd);
|
---|
1983 | if (IsUsePINDiode())
|
---|
1984 | tlist.AddToList(&fillpin);
|
---|
1985 |
|
---|
1986 | tlist.AddToList(&calcalc);
|
---|
1987 |
|
---|
1988 |
|
---|
1989 | MHCamEvent evt2(0, "Extra'd", "Extracted Calibration Signal;;S [cnts/sl]");
|
---|
1990 | MHCamEvent evt9(4, "ArrTm", "Extracted ArrivalTime;;T");
|
---|
1991 |
|
---|
1992 | MFillH fill2(&evt2, "MExtractedSignalCam", "FillExtractedSignal");
|
---|
1993 | MFillH fill9(&evt9, "MArrivalTimeCam", "FillArrivalTime");
|
---|
1994 |
|
---|
1995 | tlist.AddToList(&fill2);
|
---|
1996 | tlist.AddToList(&fill9);
|
---|
1997 |
|
---|
1998 |
|
---|
1999 | // Create and setup the eventloop
|
---|
2000 | MEvtLoop evtloop(fName);
|
---|
2001 | evtloop.SetParList(&plist);
|
---|
2002 | evtloop.SetDisplay(fDisplay);
|
---|
2003 | evtloop.SetLogStream(fLog);
|
---|
2004 | if (!SetupEnv(evtloop))
|
---|
2005 | return kFALSE;
|
---|
2006 |
|
---|
2007 | if (!taskenv.GetTask() && !taskenv2.GetTask())
|
---|
2008 | {
|
---|
2009 | *fLog << err << "ERROR - Neither ExtractSignal nor ExtractTime initialized or both '<dummy>'." << endl;
|
---|
2010 | return kFALSE;
|
---|
2011 | }
|
---|
2012 |
|
---|
2013 | if (!WriteTasks(taskenv.GetTask(), istimecharge ? 0 : taskenv2.GetTask()))
|
---|
2014 | return kFALSE;
|
---|
2015 |
|
---|
2016 | // Execute first analysis
|
---|
2017 | const Bool_t rc = evtloop.Eventloop();
|
---|
2018 |
|
---|
2019 | if (!fCalibrationPINDiode.IsValid())
|
---|
2020 | SetUsePINDiode(kFALSE);
|
---|
2021 |
|
---|
2022 | const Int_t numexec = IsUseRawData() ? rawread.GetNumExecutions() : read.GetNumExecutions();
|
---|
2023 | if (numexec>0)
|
---|
2024 | {
|
---|
2025 | DisplayResult(plist);
|
---|
2026 | if (!WriteResult(plist))
|
---|
2027 | return kFALSE;
|
---|
2028 | }
|
---|
2029 |
|
---|
2030 | if (!rc)
|
---|
2031 | {
|
---|
2032 | *fLog << err << GetDescriptor() << ": Failed." << endl;
|
---|
2033 | return kFALSE;
|
---|
2034 | }
|
---|
2035 |
|
---|
2036 | // --------------------------------------------------------------------------------
|
---|
2037 |
|
---|
2038 | if (fIsPixelCheck)
|
---|
2039 | {
|
---|
2040 | chargecam[fCheckedPixId].DrawClone("datacheck");
|
---|
2041 | chargecam(fCheckedPixId).DrawClone("datacheck");
|
---|
2042 |
|
---|
2043 | if (IsRelTimes())
|
---|
2044 | {
|
---|
2045 | reltimecam[fCheckedPixId].DrawClone("");
|
---|
2046 | reltimecam(fCheckedPixId).DrawClone("");
|
---|
2047 | }
|
---|
2048 | }
|
---|
2049 |
|
---|
2050 | *fLog << all << GetDescriptor() << ": Done." << endl;
|
---|
2051 |
|
---|
2052 | return kTRUE;
|
---|
2053 | }
|
---|
2054 |
|
---|
2055 | /*
|
---|
2056 | Bool_t MJCalibration::WriteEventloop(MEvtLoop &evtloop) const
|
---|
2057 | {
|
---|
2058 | if (IsNoStorage())
|
---|
2059 | return kTRUE;
|
---|
2060 |
|
---|
2061 | if (fPathOut.IsNull())
|
---|
2062 | return kTRUE;
|
---|
2063 |
|
---|
2064 | const TString oname(GetOutputFile());
|
---|
2065 |
|
---|
2066 | *fLog << inf << "Writing to file: " << oname << endl;
|
---|
2067 |
|
---|
2068 | TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCalibration", 9);
|
---|
2069 | if (!file.IsOpen())
|
---|
2070 | {
|
---|
2071 | *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;
|
---|
2072 | return kFALSE;
|
---|
2073 | }
|
---|
2074 |
|
---|
2075 | if (evtloop.Write(fName)<=0)
|
---|
2076 | {
|
---|
2077 | *fLog << err << "Unable to write MEvtloop to " << oname << endl;
|
---|
2078 | return kFALSE;
|
---|
2079 | }
|
---|
2080 |
|
---|
2081 | return kTRUE;
|
---|
2082 | }
|
---|
2083 | */
|
---|
2084 |
|
---|
2085 | Bool_t MJCalibration::WriteTasks(MTask *t1, MTask *t2) const
|
---|
2086 | {
|
---|
2087 | if (IsNoStorage())
|
---|
2088 | return kTRUE;
|
---|
2089 |
|
---|
2090 | TObjArray cont;
|
---|
2091 | if (t1)
|
---|
2092 | cont.Add(t1);
|
---|
2093 | if (t2)
|
---|
2094 | cont.Add(t2);
|
---|
2095 |
|
---|
2096 | return WriteContainer(cont, GetOutputFileName(), fOverwrite?"RECREATE":"NEW");
|
---|
2097 | }
|
---|
2098 |
|
---|
2099 | // --------------------------------------------------------------------------
|
---|
2100 | //
|
---|
2101 | // Write the result into the output file GetOutputFile(), if fOutputPath exists.
|
---|
2102 | //
|
---|
2103 | // The following containers are written:
|
---|
2104 | // - MStatusDisplay
|
---|
2105 | // - MCalibrationChargeCam or MCalibrationIntensityChargeCam
|
---|
2106 | // - MCalibrationBlindCam or MCalibrationIntensityBlindCam
|
---|
2107 | // - MCalibrationQECam or MCalibrationIntensityQECam
|
---|
2108 | // - MCalibrationChargePINDiode
|
---|
2109 | // - MBadPixelsCam
|
---|
2110 | // If the flag kRelTimes is set, then also:
|
---|
2111 | // - MCalibrationRelTimeCam or MCalibrationIntensityRelTimeCam
|
---|
2112 | //
|
---|
2113 | Bool_t MJCalibration::WriteResult(MParList &plist)
|
---|
2114 | {
|
---|
2115 | if (IsNoStorage())
|
---|
2116 | return kTRUE;
|
---|
2117 |
|
---|
2118 | TObjArray cont;
|
---|
2119 |
|
---|
2120 | if (IsIntensity())
|
---|
2121 | {
|
---|
2122 | cont.Add(&fIntensBadCam);
|
---|
2123 | cont.Add(&fIntensCalibCam);
|
---|
2124 | cont.Add(&fIntensQECam);
|
---|
2125 | cont.Add(&fIntensBlindCam);
|
---|
2126 | }
|
---|
2127 | else
|
---|
2128 | {
|
---|
2129 | cont.Add(&fBadPixels);
|
---|
2130 | cont.Add(&fCalibrationCam);
|
---|
2131 | cont.Add(&fQECam);
|
---|
2132 | cont.Add(&fCalibrationBlindCam);
|
---|
2133 | }
|
---|
2134 | cont.Add(&fCalibrationPINDiode);
|
---|
2135 |
|
---|
2136 | //if (IsRelTimes())
|
---|
2137 | cont.Add(IsIntensity() ? (TObject*)&fIntensRelTimeCam : (TObject*)&fRelTimeCam);
|
---|
2138 |
|
---|
2139 | if (fExtractorCam.GetSize() != 0)
|
---|
2140 | cont.Add(&fExtractorCam);
|
---|
2141 |
|
---|
2142 | TObject *pedcam = plist.FindObject("MPedestalCam");
|
---|
2143 | if (!pedcam)
|
---|
2144 | *fLog << warn << " - WARNING - MPedestalCam (fundamental)... not found for writing!" << endl;
|
---|
2145 | else
|
---|
2146 | cont.Add(pedcam);
|
---|
2147 |
|
---|
2148 | TObject *geom = plist.FindObject("MGeomCam");
|
---|
2149 | if (!geom)
|
---|
2150 | *fLog << warn << " - WARNING - MGeomCam... not found for writing!" << endl;
|
---|
2151 | else
|
---|
2152 | cont.Add(geom);
|
---|
2153 |
|
---|
2154 | if (IsHistsStorage())
|
---|
2155 | {
|
---|
2156 | cont.Add(plist.FindObject("MHCalibrationChargeCam"));
|
---|
2157 | cont.Add(plist.FindObject("MHCalibrationChargeBlindCam"));
|
---|
2158 | cont.Add(plist.FindObject("MHCalibrationChargePINDiode"));
|
---|
2159 | if (IsRelTimes())
|
---|
2160 | cont.Add(plist.FindObject("MHCalibrationRelTimeCam"));
|
---|
2161 | }
|
---|
2162 |
|
---|
2163 | return WriteContainer(cont, GetOutputFileName(), "UPDATE");
|
---|
2164 | }
|
---|
2165 |
|
---|
2166 | void MJCalibration::DisplayDoubleProject(MHCamera *cam, const char* whatsmall, const char* whatbig) const
|
---|
2167 | {
|
---|
2168 |
|
---|
2169 | TArrayI inner(1);
|
---|
2170 | inner[0] = 0;
|
---|
2171 |
|
---|
2172 | TArrayI outer(1);
|
---|
2173 | outer[0] = 1;
|
---|
2174 |
|
---|
2175 | TArrayI s1(3);
|
---|
2176 | s1[0] = 6;
|
---|
2177 | s1[1] = 1;
|
---|
2178 | s1[2] = 2;
|
---|
2179 |
|
---|
2180 | TArrayI s2(3);
|
---|
2181 | s2[0] = 3;
|
---|
2182 | s2[1] = 4;
|
---|
2183 | s2[2] = 5;
|
---|
2184 |
|
---|
2185 | TVirtualPad *pad = gPad;
|
---|
2186 | pad->Divide(2,1);
|
---|
2187 |
|
---|
2188 | TH1D *inout[2];
|
---|
2189 |
|
---|
2190 | for (int i=0; i<2; i++)
|
---|
2191 | {
|
---|
2192 | pad->cd(i+1);
|
---|
2193 | gPad->SetBorderMode(0);
|
---|
2194 | gPad->SetTicks();
|
---|
2195 |
|
---|
2196 | inout[i] = cam->ProjectionS(TArrayI(), TArrayI(1,&i), i==0 ? "Inner" : "Outer");
|
---|
2197 | FixDataCheckHist(inout[i]);
|
---|
2198 | inout[i]->SetTitle(Form("%s %s",cam->GetTitle(),i==0 ? "Inner" : "Outer"));
|
---|
2199 | inout[i]->SetDirectory(NULL);
|
---|
2200 | inout[i]->SetLineColor(kRed+i);
|
---|
2201 | inout[i]->SetBit(kCanDelete);
|
---|
2202 | inout[i]->Draw();
|
---|
2203 | //
|
---|
2204 | // Display the outliers as dead and noisy pixels
|
---|
2205 | //
|
---|
2206 | if (!inout[i]->Fit("gaus","0Q"))
|
---|
2207 | DisplayOutliers(inout[i],whatsmall,whatbig);
|
---|
2208 |
|
---|
2209 | gPad->Modified();
|
---|
2210 | gPad->Update();
|
---|
2211 | TPaveStats *st = (TPaveStats*)inout[i]->GetListOfFunctions()->FindObject("stats");
|
---|
2212 | st->SetY1NDC(0.6);
|
---|
2213 | st->SetY2NDC(0.9);
|
---|
2214 | st->SetX1NDC(0.55);
|
---|
2215 | st->SetX2NDC(0.99);
|
---|
2216 | gPad->Modified();
|
---|
2217 | gPad->Update();
|
---|
2218 |
|
---|
2219 | TLegend *leg2 = new TLegend(0.55,0.4,0.99,0.6);
|
---|
2220 |
|
---|
2221 | //
|
---|
2222 | // Display the two half of the camera separately
|
---|
2223 | //
|
---|
2224 | TH1D *half[2];
|
---|
2225 | half[0] = cam->ProjectionS(s1, TArrayI(1,&i), "Sector 6-1-2");
|
---|
2226 | half[1] = cam->ProjectionS(s2, TArrayI(1,&i), "Sector 3-4-5");
|
---|
2227 |
|
---|
2228 | for (int j=0; j<2; j++)
|
---|
2229 | {
|
---|
2230 | half[j]->SetLineColor(kRed+i+2*j+1);
|
---|
2231 | half[j]->SetDirectory(NULL);
|
---|
2232 | half[j]->SetBit(kCanDelete);
|
---|
2233 | half[j]->Draw("same");
|
---|
2234 | leg2->AddEntry(half[j], half[j]->GetName(), "l");
|
---|
2235 | }
|
---|
2236 | leg2->Draw();
|
---|
2237 | }
|
---|
2238 | }
|
---|