ATLAS Offline Software
Loading...
Searching...
No Matches
TileRawChannelMonTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5// ********************************************************************
6//
7// NAME: TileRawChannelMonTool.cxx
8// PACKAGE:
9//
10// AUTHOR: Alexander Solodkov
11//
12//
13// ********************************************************************
14
16
23
24#include "TH1S.h"
25#include "TH2S.h"
26#include "TH1F.h"
27#include "TProfile.h"
28#include "TGraphAsymmErrors.h"
29#include "TVirtualPad.h"
30#include "TCanvas.h"
31#include "TStyle.h"
32#include "TLine.h"
33#include "TF1.h"
34
35#include <iostream>
36#include <sstream>
37#include <iomanip>
38#include <cmath>
39#include <algorithm>
40#include <array>
41
42
43/*---------------------------------------------------------*/
44TileRawChannelMonTool::TileRawChannelMonTool(const std::string & type, const std::string & name, const IInterface* parent)
45 : TilePaterMonTool(type, name, parent)
46 , m_tileToolEmscale("TileCondToolEmscale")
47 , m_cispar(0)
50 , m_drawHists(true)
51 , m_tileInfo(0)
52
53/*---------------------------------------------------------*/
54{
55 declareInterface<IMonitorToolBase>(this);
56
57 declareProperty("bookAllDrawers", m_bookAll = false);
58 declareProperty("overlaphists", m_overlaphists = false);
59 declareProperty("book2D", m_book2D = true);
60
61 // run type 1 - phys, 2 - las, 4 - ped, 8 - cis
62 declareProperty("runType", m_runType = 0);
63 declareProperty("bigain", m_bigain = true);
64 declareProperty("TileRawChannelContainer", m_contName = "TileRawChannelOpt2"); //SG RC Container
65 declareProperty("TileRawChannelContainerDSP", m_contNameDSP = "TileRawChannelCnt"); //SG DSP RC Cell Container
66
67 declareProperty("AmpQ_down_Limit", m_DownLimit = 0.7);
68 declareProperty("AmpQ_up_Limit", m_UpLimit = 1.3);
69 declareProperty("AmpQ_loIntegralLimit", m_lo_IntegralLimit = 0.005);
70 declareProperty("AmpQ_medIntegralLimit", m_med_IntegralLimit = 0.010);
71 declareProperty("AmpQ_hiIntegralLimit", m_hi_IntegralLimit = 0.015);
72 declareProperty("RatioErrorBar", m_useratioerror = true);
73 declareProperty("PlotDSP", m_plotDsp = false);
74 declareProperty("StoreGraph", m_storeGraph = true);
75 m_path = "/Tile/RawChannel"; //ROOT file directory
76 declareProperty("EfitThresh", m_efitThresh = 0.30); //threshold in pC for DSP check
77 declareProperty("TileCondToolEmscale", m_tileToolEmscale);
78 declareProperty("SummaryUpdateFrequency", m_summaryUpdateFrequency = 0);
79 declareProperty("ResetAfterSummaryUpdate", m_resetAfterSummaryUpdate = false);
80 declareProperty("DoLaserSummaryVsPMT", m_doLaserSummaryVsPMT = false);
81 declareProperty("MinAmpForCorrectedTime", m_minAmpForCorrectedTime = 0.5);
82 declareProperty("TileInfoName", m_infoName = "TileInfo");
83 declareProperty("TileDQstatus", m_DQstatusKey = "TileDQstatus");
85}
86
87/*---------------------------------------------------------*/
89/*---------------------------------------------------------*/
90{
91}
92
93/*---------------------------------------------------------*/
95/*---------------------------------------------------------*/
96{
97
98 ATH_MSG_INFO("in initialize()");
99
100 m_data = std::make_unique<Data>();
101
102 CHECK(m_tileToolEmscale.retrieve());
103
105
106 memset(m_data->m_timeCov, 0, sizeof(m_data->m_timeCov));
107 memset(m_data->m_timeCovCorr, 0, sizeof(m_data->m_timeCovCorr));
108
110
111 CHECK( detStore()->retrieve(m_tileInfo, m_infoName) );
112 if (m_tileInfo->ADCmax() == 4095) m_is12bit = true;
113
114 m_dac2Charge[0] = 100.* 2.0 * 4.096 / double(m_tileInfo->ADCmax()); // 100 pF * 2 for legacy or 200 pF for demonstrator
115 m_dac2Charge[1] = 5.2 * 2.0 * 4.096 / double(m_tileInfo->ADCmax()); // use the same number 5.2 pF as in TileCisDefaultCalibTool
116 m_dac2Charge[2] = 5.2 * 4.096 / double(m_tileInfo->ADCmax()); // effective value of small capacitor is twice smaller for demonstrator
117
118 CHECK( m_DQstatusKey.initialize() );
119
120 return StatusCode::SUCCESS;
121}
122
123/*---------------------------------------------------------*/
125/*---------------------------------------------------------*/
126{
127
128 if (msgLvl(MSG::DEBUG)) {
129 msg(MSG::DEBUG) << "in bookHists()" << endmsg;
130 msg(MSG::DEBUG) << "Using base path " << m_path << endmsg;
131 }
132
133 if (m_intCalibUnit>=0 && m_intCalibUnit<=3) {
135 }
137 if (m_runType == PhysRun) {
139 } else {
141 }
142 }
143
144 if (m_bookAll) {
145 for (int ros = 1; ros < 5; ++ros) {
146 for (int drawer = 0; drawer < 64; ++drawer) {
147 bookHists(ros, drawer);
148
149 if (m_plotDsp) bookDsp(ros, drawer);
150
151 }
152 }
153 }
154
155 /* float X_axis[48];
156 float X_errors[48];
157 for (int i = 0; i < 48; i++) {
158 X_axis[i] = i+0.5;
159 X_errors[i] = 0.;
160 }
161
162 TGraph* test = new TGraph(48,X_axis,X_errors);
163 test->SetNameTitle("LFTESTLBC01","LFTESTLBC01");
164 m_rootsvc->regGraph("/HIST1/Tile/RawChannel/Summary/LFTESTBC01", test);
165
166 TGraph* test2 = new TGraph(48,X_axis,X_errors);
167 test2->SetNameTitle("LFTESTLBC02","LFTESTLBC02");
168 m_rootsvc->regGraph("/HIST1/Tile/RawChannel/Summary/LFTESTBC02", test2);
169 */
170
171 //SetBookStatus(true);
172
173
174 return StatusCode::SUCCESS;
175}
176
177
178/*---------------------------------------------------------*/
179void TileRawChannelMonTool::bookHists(int ros, int drawer)
180/*---------------------------------------------------------*/
181{
182 const std::array<std::string, 6> gain{ "_lo", "_hi", "", " low gain", " high gain", "" };
183
184 std::ostringstream sStr;
185 std::string moduleName = TileCalibUtils::getDrawerString(ros, drawer);
186 std::string subDir = moduleName;
187 std::string histName, histTitle;
188
189 ATH_MSG_DEBUG("in bookHists() for module " << moduleName);
190
191 // for bigain run book 2 histograms per channel
192 // for monogain run book just one histogram per channel
193 int mingain = (m_bigain) ? 0 : 2;
194 int maxgain = (m_bigain) ? 2 : 3;
195
196 for (int ch = 0; ch < 48; ++ch) {
197
198 // int pmt=m_cabling->channel2hole(ros,ch); // 1:48, negative for non-connected channels
199 // int pmt0 = ((pmt > 0)? pmt-1 : pmt+1); // 0:47, negaitve for non-connected channels
200 sStr.str("");
201 sStr << std::setfill('0') << std::setw(2) << ch << std::setfill(' ');
202 // sStr << std::setfill('0') << std::setw(2) << (abs(pmt)-1) << std::setfill(' ');
203 std::string sCh = sStr.str(); // 00:47, always positive
204
205 for (int gn = mingain; gn < maxgain; ++gn) {
206
207 if ((m_runType == CisRun) || (m_runType == CisRamp)) {
208
209 std::string HistName[4] = { "_amp_ratio_100", "_amp_ratio_5", "_time_100", "_time_5" };
210 std::string HistTitle[4] = { " amp to charge ratio for 100 pF", " amp to charge ratio for 5 pF", " time for 100 pF", " time for 5 pF" };
211
212 for (int type = 0; type < 4; type++) {
213 sStr.str("");
214 sStr << moduleName << "_ch_" << sCh << gain[gn] << HistName[type];
215 histName = sStr.str();
216
217 sStr.str("");
218 if (gn+3 >= std::ssize(gain)) throw std::out_of_range("Index out of range in TileRawChannelMonTool::bookHists");
219 sStr << moduleName << " CH " << ch << gain[3 + gn] << HistTitle[type];
220 histTitle = sStr.str();
221
222 if (type < 2)
223 m_data->m_hist1[ros][drawer][ch][gn & 1].push_back(book1S(subDir, histName, histTitle, 101, -0.01, 2.01));
224 else
225 m_data->m_hist1[ros][drawer][ch][gn & 1].push_back(book1S(subDir, histName, histTitle, 101, -101.0, 101.0));
226 }
227
228 if (m_book2D) {
229 std::string Hist2DName[4] = { "_amp_vs_q_100", "_amp_vs_q_5", "_time_vs_time_100", "_time_vs_time_5" };
230 std::string Hist2DTitle[4] = { " amp vs charge 100 pF", " amp vs charge 5 pF", " time vs time 100 pF", " time vs time 5 pF" };
231 float factor_charge = m_is12bit ? 2. : 1.;
232 float factor_adc = m_is12bit ? 4. : 1.;
233 // Below, static_cast<float> is used to avoid warnings from -Wnarrowing
234 float LowX_low2D[4] = { -4., -0.5, -0.25, -0.25 };
235 float HighX_low2D[4] = { 804., 50.5, 25.25, 25.25 };
236 float LowX_hi2D[4] = { static_cast<float>(-0.0625 * factor_charge), static_cast<float>(-0.0625 * factor_charge), -0.25, -0.25 };
237 float HighX_hi2D[4] = { static_cast<float>(12.5625 * factor_charge), static_cast<float>(12.5625 * factor_charge), 25.25, 25.25 };
238 float LowY_low2D[4] = { -25., -5.3125, -64.0, -64.0 };
239 float HighY_low2D[4] = { 1025., 60.3125, 32.0, 32.0 };
240 float LowY_hi2D[4] = { static_cast<float>(-25. * factor_adc), static_cast<float>(-25. * factor_adc), -64.0, -64.0 };
241 float HighY_hi2D[4] = { static_cast<float>(1025. * factor_adc), static_cast<float>(1025. * factor_adc), 32.0, 32.0 };
242 float LowY_hi2D_pC[4] = { static_cast<float>(-.391 * factor_adc), static_cast<float>(-.391 * factor_adc), -64.0, -64.0 };
243 float HighY_hi2D_pC[4] = { static_cast<float>(16.02 * factor_adc), static_cast<float>(16.02 * factor_adc), 32.0, 32.0 };
244
245 for (int type = 0; type < 4; type++) {
246
247 sStr.str("");
248 sStr << moduleName << "_ch_" << sCh << gain[gn] << Hist2DName[type];
249 histName = sStr.str();
250
251 sStr.str("");
252 if (gn+3 >= std::ssize(gain)) throw std::out_of_range("Index out of range in TileRawChannelMonTool::bookHists");
253 sStr << moduleName << " CH " << ch << gain[3 + gn] << Hist2DTitle[type];
254 histTitle = sStr.str();
255
256 switch (gn) {
257 case 0: // low gain
258 m_data->m_hist2[ros][drawer][ch][gn & 1].push_back(
259 book2S(subDir, histName, histTitle, 51, LowX_low2D[type], HighX_low2D[type], 160, LowY_low2D[type], HighY_low2D[type]));
260 break;
261 case 1: // high gain
263 m_data->m_hist2[ros][drawer][ch][gn & 1].push_back(
264 book2S(subDir, histName, histTitle, 51, LowX_hi2D[type], HighX_hi2D[type], 160, LowY_hi2D_pC[type], HighY_hi2D_pC[type]));
265 else
266 m_data->m_hist2[ros][drawer][ch][gn & 1].push_back(
267 book2S(subDir, histName, histTitle, 51, LowX_hi2D[type], HighX_hi2D[type], 160, LowY_hi2D[type], HighY_hi2D[type]));
268 break;
269 default: // single gain mode
271 m_data->m_hist2[ros][drawer][ch][gn & 1].push_back(
272 book2S(subDir, histName, histTitle, 51, LowX_hi2D[type], HighX_hi2D[type], 160, LowY_hi2D_pC[type], HighY_hi2D_pC[type]));
273 else
274 m_data->m_hist2[ros][drawer][ch][gn & 1].push_back(
275 book2S(subDir, histName, histTitle, 51, LowX_hi2D[type], HighX_hi2D[type], 160, LowY_hi2D[type], HighY_hi2D[type]));
276 }
277 } //loop over type hist
278 } // if(book2D)
279
280 } else { // not CIS run
281
282 sStr.str("");
283 sStr << moduleName << "_ch_" << sCh << gain[gn] << "_amp";
284 histName = sStr.str();
285
286 sStr.str("");
287 if (gn+3 >= std::ssize(gain)) throw std::out_of_range("Index out of range in TileRawChannelMonTool::bookHists");
288 sStr << moduleName << " CH " << ch << gain[3 + gn] << " amp";
289 histTitle = sStr.str();
290
291 if (m_runType == PedRun) {
292 switch (gn) {
293 case 0: // low gain
294 m_data->m_hist1[ros][drawer][ch][gn].push_back(book1S(subDir, histName, histTitle, 101, -10.1, 10.1));
295 break;
296 case 1: // high gain
297 m_data->m_hist1[ros][drawer][ch][gn].push_back(book1S(subDir, histName, histTitle, 101, -0.404, 0.404));
298 break;
299 default: // single gain mode
300 m_data->m_hist1[ros][drawer][ch][gn & 1].push_back(book1S(subDir, histName, histTitle, 101, -10.1, 10.1));
301 }
302 } else {
303 switch (gn) {
304 case 0: // low gain
305 if (m_overlaphists) {
306 const Int_t nlg1 = 49;
307 const Int_t nlg2 = 500;
308 const Int_t nlg3 = 1027;
309 std::vector<Double_t> xlgbin(nlg1 + nlg2 + nlg3 + 1);
310 for(Int_t i = 0; i <= nlg1; ++i)
311 xlgbin[i] = -50.5+1.0*i;
312 for(Int_t i = 1; i <= nlg2; ++i)
313 xlgbin[i + nlg1] = -1.5 + 0.05 * i;
314 for(Int_t i = 1; i <= nlg3; ++i)
315 xlgbin[i + nlg1 + nlg2] = 23.5 + 1.0 * i;
316 m_data->m_hist1[ros][drawer][ch][gn].push_back(book1Sx(subDir, histName, histTitle, nlg1 + nlg2 + nlg3, xlgbin.data()));
317 } else {
318 m_data->m_hist1[ros][drawer][ch][gn].push_back(book1S(subDir, histName, histTitle, 1101, -50.5, 1050.5));
319 }
320 break;
321 case 1: // high gain
322 if (m_overlaphists)
323 m_data->m_hist1[ros][drawer][ch][gn].push_back(book1S(subDir, histName, histTitle, 500, -1.5, 23.5));
324 else
325 m_data->m_hist1[ros][drawer][ch][gn].push_back(book1S(subDir, histName, histTitle, 826, -1.01, 15.51));
326 break;
327 default: // single gain mode
328 if (m_runType == PhysRun) {
329 m_data->m_hist1[ros][drawer][ch][gn & 1].push_back(book1S(subDir, histName, histTitle, 206, -0.55, 20.05));
330 } else {
331 m_data->m_hist1[ros][drawer][ch][gn & 1].push_back(book1S(subDir, histName, histTitle, 801, -0.5, 800.5));
332 }
333 }
334 }
335
336 sStr.str("");
337 sStr << moduleName << "_ch_" << sCh << gain[gn] << "_time";
338 histName = sStr.str();
339
340 sStr.str("");
341 if (gn+3 >= std::ssize(gain)) throw std::out_of_range("Index out of range in TileRawChannelMonTool::bookHists");
342 sStr << moduleName << " CH " << ch << gain[3 + gn] << " time";
343 histTitle = sStr.str();
344
345 m_data->m_hist1[ros][drawer][ch][gn & 1].push_back(book1S(subDir, histName, histTitle, 201, -100.5, 100.5));
346 //Lukas
347 sStr.str("");
348 sStr << moduleName << "_ch_" << sCh << gain[gn] << "_time_corr";
349 histName = sStr.str();
350
351 sStr.str("");
352 sStr << moduleName << " CH " << ch << gain[3 + gn] << " time_corr";
353 histTitle = sStr.str();
354
355 m_data->m_hist1[ros][drawer][ch][gn & 1].push_back(book1S(subDir, histName, histTitle, 201, -100.5, 100.5));
356 //Lukas
357 }
358 }
359 }
360
362}
363
364/*---------------------------------------------------------*/
365void TileRawChannelMonTool::bookDsp(int ros, int drawer)
366/*---------------------------------------------------------*/
367{
368 const std::array<std::string, 6> gain{ "_lo", "_hi", "", " low gain", " high gain", "" };
369
370
371 std::ostringstream sStr;
372
373 std::string moduleName = TileCalibUtils::getDrawerString(ros, drawer);
374 std::string subDir = moduleName;
375 std::string histName, histTitle;
376
377 ATH_MSG_DEBUG("in bookDSP() for module " << moduleName);
378
379 // for bigain run book 2 histograms per channel
380 // for monogain run book just one histogram per channel
381 int mingain = (m_bigain) ? 0 : 2;
382 int maxgain = (m_bigain) ? 2 : 3;
383
384 for (int gn = mingain; gn < maxgain; ++gn) {
385 std::string finalsubDir = "Summary";
386 sStr.str("");
387 sStr << moduleName << gain[gn] << "_summary_chi2_amp";
388 std::string finalhistName = sStr.str();
389
390 sStr.str("");
391 if (gn+3 >= std::ssize(gain)) throw std::out_of_range("Index out of range in TileRawChannelMonTool::bookDsp");
392 sStr << moduleName << gain[3 + gn] << " Summary chi2 versus amp";
393 std::string finalhistTitle = sStr.str();
394
395 switch (gn) {
396 case 0: // low gain
397 m_data->m_finalHistDsp2[ros][drawer][gn].push_back(book2F(finalsubDir, finalhistName, finalhistTitle, 200, -45.1, 855.1, 16, 0., 16.));
398 break;
399 case 1: // high gain
400 m_data->m_finalHistDsp2[ros][drawer][gn].push_back(book2F(finalsubDir, finalhistName, finalhistTitle, 150, -7.0, 12.0, 16, 0., 16.));
401 break;
402 default: // single gain mode
403 if (m_runType == PhysRun) {
404 m_data->m_finalHistDsp2[ros][drawer][gn & 1].push_back(book2F(subDir, finalhistName, finalhistTitle, 150, -7.005, 7.005, 16, 0., 16.));
405
406 } else {
407 m_data->m_finalHistDsp2[ros][drawer][gn & 1].push_back(book2F(subDir, finalhistName, finalhistTitle, 200, -45.1, 855.1, 16, 0., 16.));
408 }
409 }
410
411 }
412
413 for (int ch = 0; ch < 48; ++ch) {
414
415 // int pmt=m_cabling->channel2hole(ros,ch); // 1:48, negative for non-connected channels
416 // int pmt0 = ((pmt > 0)? pmt-1 : pmt+1); // 0:47, negaitve for non-connected channels
417 sStr.str("");
418 // sStr << std::setfill('0') << std::setw(2) << (abs(pmt)-1) << std::setfill(' ');
419 sStr << std::setfill('0') << std::setw(2) << ch << std::setfill(' ');
420 std::string sCh = sStr.str(); // 00:47, always positive
421
422 for (int gn = mingain; gn < maxgain; ++gn) {
423
424 sStr.str("");
425 sStr << moduleName << "_ch_" << sCh << gain[gn] << "_dsp_amp";
426 histName = sStr.str();
427
428 sStr.str("");
429 if (gn+3 >= std::ssize(gain)) throw std::out_of_range("Index out of range in TileRawChannelMonTool::bookDsp");
430 sStr << moduleName << " CH " << ch << gain[3 + gn] << " Dsp Amp";
431 histTitle = sStr.str();
432
433 switch (gn) {
434 case 0: // low gain
435 m_data->m_histDsp1[ros][drawer][ch][gn].push_back(book1F(subDir, histName, histTitle, 491, -50.5, 1049.34));
436 break;
437 case 1: // high gain
438 m_data->m_histDsp1[ros][drawer][ch][gn].push_back(book1F(subDir, histName, histTitle, 413, -1.01, 15.51));
439 break;
440 default: // single gain mode
441 if (m_runType == PhysRun) {
442 m_data->m_histDsp1[ros][drawer][ch][gn & 1].push_back(book1F(subDir, histName, histTitle, 100, -0.55, 20.05));
443 } else {
444 m_data->m_histDsp1[ros][drawer][ch][gn & 1].push_back(book1F(subDir, histName, histTitle, 200, -0.5, 800.5));
445 }
446 }
447
448 sStr.str("");
449 sStr << moduleName << "_ch_" << sCh << gain[gn] << "_dsp_time";
450 histName = sStr.str();
451
452 sStr.str("");
453 sStr << moduleName << " CH " << ch << gain[3 + gn] << " Dsp Time";
454 histTitle = sStr.str();
455
456 m_data->m_histDsp1[ros][drawer][ch][gn & 1].push_back(book1F(subDir, histName, histTitle, 101, -100.5, 100.5));
457
458 sStr.str("");
459 sStr << moduleName << "_ch_" << sCh << gain[gn] << "_dsp_chi2";
460 histName = sStr.str();
461
462 sStr.str("");
463 sStr << moduleName << " CH " << ch << gain[3 + gn] << " Dsp Chi2";
464 histTitle = sStr.str();
465
466 m_data->m_histDsp1[ros][drawer][ch][gn & 1].push_back(book1F(subDir, histName, histTitle, 16, -0.5, 15.5));
467
468 sStr.str("");
469 sStr << moduleName << "_ch_" << sCh << gain[gn] << "_dsp-fit_amp_diff";
470 histName = sStr.str();
471
472 sStr.str("");
473 sStr << moduleName << " CH " << ch << gain[3 + gn] << " Dsp-OF Amp difference";
474 histTitle = sStr.str();
475
476 auto ix = (gn < 2) ? gn : (gn & 1);
477 m_data->m_histDsp1[ros][drawer][ch][ix].push_back(book1F(subDir, histName, histTitle, 404, -1.01, 1.01));
478
479 sStr.str("");
480 sStr << moduleName << "_ch_" << sCh << gain[gn] << "_dsp-fit_time_diff";
481 histName = sStr.str();
482
483 sStr.str("");
484 sStr << moduleName << " CH " << ch << gain[3 + gn] << " Dsp-OF Time diff";
485 histTitle = sStr.str();
486
487 m_data->m_histDsp1[ros][drawer][ch][gn & 1].push_back(book1F(subDir, histName, histTitle, 101, -2.02, 2.02));
488
489 sStr.str("");
490 sStr << moduleName << "_ch_" << sCh << gain[gn] << "_chi2_amp";
491 histName = sStr.str();
492
493 sStr.str("");
494 sStr << moduleName << " CH " << ch << gain[3 + gn] << " Dsp Chi2 versus Amp";
495 histTitle = sStr.str();
496
497 switch (gn) {
498 case 0: // low gain
499 m_data->m_histDsp2[ros][drawer][ch][gn].push_back(book2F(subDir, histName, histTitle, 200, -45.1, 855.1, 16, 0., 16.));
500 break;
501 case 1: // high gain
502 m_data->m_histDsp2[ros][drawer][ch][gn].push_back(book2F(subDir, histName, histTitle, 150, -7.0, 12.0, 16, 0., 16.));
503 break;
504 default: // single gain mode
505 if (m_runType == PhysRun) {
506 m_data->m_histDsp2[ros][drawer][ch][gn & 1].push_back(book2F(subDir, histName, histTitle, 150, -7.005, 7.005, 16, 0., 16.));
507 } else {
508 m_data->m_histDsp2[ros][drawer][ch][gn & 1].push_back(book2F(subDir, histName, histTitle, 200, -45.1, 855.1, 16, 0., 16.));
509 }
510 }
511
512 } //end for over gains
513 } // end for over chans
514}
515
516/*---------------------------------------------------------*/
518/*---------------------------------------------------------*/
519{
520
521 ATH_MSG_DEBUG("in fillHists()");
522
523 if (m_nEventsTileMon % 1000 == 0) ATH_MSG_INFO(m_nEventsTileMon<<" events processed so far");
524 // array of 16 CIS parameters
525 const TileDQstatus* dqStatus = SG::makeHandle (m_DQstatusKey).get();
526 m_cispar = dqStatus->cispar();
528
529 m_efitMap.clear();
530 m_tfitMap.clear();
531
532 //ndulchin: start filter code
533 const TileDigitsContainer* DigitsCnt;
534 CHECK(evtStore()->retrieve(DigitsCnt, "TileDigitsCnt"));
535
536 TileDigitsContainer::const_iterator collItr2 = DigitsCnt->begin();
537 TileDigitsContainer::const_iterator lastColl2 = DigitsCnt->end();
538
539 for (; collItr2 != lastColl2; ++collItr2) {
540 TileDigitsCollection::const_iterator digitsItr = (*collItr2)->begin();
541 TileDigitsCollection::const_iterator lastDigits = (*collItr2)->end();
542
543 if (digitsItr != lastDigits) {
544
545 HWIdentifier adc_id = (*digitsItr)->adc_HWID();
546 int ros = m_tileHWID->ros(adc_id);
547 int drawer = m_tileHWID->drawer(adc_id);
548 std::vector<uint32_t> headerVec = (*collItr2)->getFragChipHeaderWords();
549 int headsize = headerVec.size();
550 if (headsize > 16) headsize = 16;
551
552 int fragId = (*collItr2)->identify();
553 if (!std::binary_search(m_fragIDsToIgnoreDMUerrors.begin(), m_fragIDsToIgnoreDMUerrors.end(), fragId)) {
554
555 for (int dmu = 0; dmu < headsize; dmu++) {
556 m_corrup[ros][drawer][0][dmu] = checkDmuHeader(&headerVec, dmu);
557 m_corrup[ros][drawer][1][dmu] = checkDmuHeader(&headerVec, dmu);
558 }
559
560 } else {
561 for (int dmu = 0; dmu < headsize; dmu++) {
562 m_corrup[ros][drawer][0][dmu] = false;
563 m_corrup[ros][drawer][1][dmu] = false;
564 }
565 }
566
567 for (int dmu = headsize; dmu < 16; dmu++) {
568 m_corrup[ros][drawer][0][dmu] = false;
569 m_corrup[ros][drawer][1][dmu] = false;
570 }
571
572 }
573 }
574
575 //if (!isErr)
576 //ndulchin: end Filter code
577
578 const TileRawChannelContainer* RawChannelCnt;
579 CHECK(evtStore()->retrieve(RawChannelCnt, m_contName));
580
581 TileRawChannelUnit::UNIT RChUnit = RawChannelCnt->get_unit();
582
583 //Lukas
584 double avgTimePerPart[5], sumTimeCh[5];
585 int nCh[5];
586 for (int iros = 0; iros < 5; iros++) {
587 avgTimePerPart[iros] = 0;
588 sumTimeCh[iros] = 0;
589 nCh[iros] = 0;
590 } //for iros
591 //Lukas
592
593 for (int k = 0; k < 2; k++) { //Lukas
594
595 TileRawChannelContainer::const_iterator collItr = RawChannelCnt->begin();
596 TileRawChannelContainer::const_iterator lastColl = RawChannelCnt->end();
597
598 for (; collItr != lastColl; ++collItr) {
599
600 int cap = (m_cispar[7] > 10) ? 0 : 1; // 100 pF or 5 pF
601 int cap_index = cap;
602
603 double hg_small_charge = 1.; // ignore charges below 1 pC in HG
604 double lg_small_charge = (cap) ? 10. : 15.; // ignore charges below 10 pC for small cap and below 15 pC for big cap in LG
605 double hg_charge_cut = 11.5; // ignore charges above 11.5 pC in HG (full range is 12.5 pC)
606 double lg_charge_cut = 750.; // ignore charges above 750. pC in LG (full range is 800. pC)
607
608 int fragId = (*collItr)->identify();
609 bool demonstrator = (std::binary_search(m_fragIDsDemonstrators.begin(), m_fragIDsDemonstrators.end(), fragId));
610 if (demonstrator) {
611 hg_small_charge *= 2.;
612 hg_charge_cut *= 2;
613 cap_index *= 2;
614 }
615 double charge = (m_cispar[6] < 1024) ? m_cispar[6] * m_dac2Charge[cap_index] : 0;
616 double timeInj = m_cispar[5] * 0.104;
617
618 TileRawChannelCollection::const_iterator chItr = (*collItr)->begin();
619 TileRawChannelCollection::const_iterator lastCh = (*collItr)->end();
620
621 if (chItr != lastCh) {
622
623 HWIdentifier adc_id = (*chItr)->adc_HWID();
624 int ros = m_tileHWID->ros(adc_id);
625 int drawer = m_tileHWID->drawer(adc_id);
626 unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
627
628 if (m_data->m_hist1[ros][drawer][0][0].size() == 0) {
629 // m_bigain = (dqStatus->calibMode() == 1); // true if bi-gain run
630 // we fill both high and low gain plots
631 m_bigain = true;
632 if (k == 0) bookHists(ros, drawer); //Lukas
633 }
634
635 std::vector<double> efitVec(m_bigain ? 96 : 48, 0.), tfitVec(m_bigain ? 96 : 48, 0.); //I need these variables later for comparison with dsp
636
637 for (; chItr != lastCh; ++chItr) {
638
639 const TileRawChannel * rch = (*chItr);
640
641 adc_id = rch->adc_HWID();
642 unsigned int chan = m_tileHWID->channel(adc_id);
643 int adc = m_tileHWID->adc(adc_id);
644 int gain = (m_bigain) ? adc : 0; // ignore gain in monogain run
645
646 if ((m_cispar[8] == 0) /* || ( m_cispar[8] == abs(m_cabling->channel2hole(ros,chan)) )*/) { // channel is fired
647
648 double amp = rch->amplitude();
649 if (RChUnit != m_calibUnit) {
650 //Put everything in PicoCoulomb by default for all run types
651 //For Laser and Physcs calibrate in CesiumPicoCoulomb for all channels,
652 // but the MBTS channels, for which we keep the calibration in PicoCoulombCesium pC for consistency
653 //(no Cs calibration is possible)
655 if (ros < 3) //if LB then it's ok CesiumPicoCoulomb
656 {
657 amp = m_tileToolEmscale->channelCalib(drawerIdx, chan, adc, amp, RChUnit, TileRawChannelUnit::CesiumPicoCoulombs);
658 } else // check that they are not MBTS channel
659 {
660 int index, pmt;
661 /*Identifier cell_id =*/rch->cell_ID_index(index, pmt);
662 if (index < -1) // MBTS channel
663 {
664 amp = m_tileToolEmscale->channelCalib(drawerIdx, chan, adc, amp, RChUnit, TileRawChannelUnit::PicoCoulombs);
665 } else //not MBTS channel
666 {
667 amp = m_tileToolEmscale->channelCalib(drawerIdx, chan, adc, amp, RChUnit, TileRawChannelUnit::CesiumPicoCoulombs);
668 }
669 }
670 } //close if on CesiumPicoCoulomb units
671 else { //calibrate in PicoCoulomb
672 amp = m_tileToolEmscale->channelCalib(drawerIdx, chan, adc, amp, RChUnit, m_calibUnit);
673 }
674 } // no need to calibrate
675
676 efitVec[chan + gain * 48] = amp;
677 double time = rch->time();
678 double timeCorr = 0; //Lukas
679 tfitVec[chan + gain * 48] = time;
680
681 if (!m_corrup[ros][drawer][gain][chan / 3]) {
682 if ((m_runType == CisRun) || (m_runType == CisRamp)) {
683 if (k == 0) { //Lukas
684
685 if (m_book2D) {
686 m_data->m_hist2[ros][drawer][chan][gain][cap]->Fill(charge, amp);
687 }
688
689 // avoid small signals and overflows in both gains
690 if ( ( (adc == 1) && (charge < hg_charge_cut) && (charge > hg_small_charge) ) ||
691 ( (adc == 0) && (charge < lg_charge_cut) && (charge > lg_small_charge) ) ) {
692
693 double ratio = amp / charge;
694
695 m_data->m_hist1[ros][drawer][chan][gain][0 + cap]->Fill(ratio);
696 m_data->m_hist1[ros][drawer][chan][gain][2 + cap]->Fill(time);
697 if (m_book2D) {
698 m_data->m_hist2[ros][drawer][chan][gain][cap + 2]->Fill(timeInj, time);
699 }
700
701 /*TimeCov[ros][drawer][chan][gain][cap][0] += timeInj;
702 TimeCov[ros][drawer][chan][gain][cap][1] += timeInj*timeInj;
703 TimeCov[ros][drawer][chan][gain][cap][2] += time;
704 TimeCov[ros][drawer][chan][gain][cap][3] += time*time;
705 TimeCov[ros][drawer][chan][gain][cap][4] += timeInj*time;*/
706 ++m_data->m_timeCov[ros][drawer][chan][gain][cap][5];
707 }
708 } //if k==0 //Lukas
709 } else { // not CisRun
710 if (k == 0) { //Lukas
711 m_data->m_hist1[ros][drawer][chan][gain][0]->Fill(amp, 1.0);
712 if (time != 0) { // we don't fill the time when it is exactly 0, which is a conventional value to say that it is not
713 // calculated when the difference between the max(samples)-min(samples)< threshold
714 m_data->m_hist1[ros][drawer][chan][gain][1]->Fill(time, 1.0);
715 }
716
717 m_data->m_timeCov[ros][drawer][chan][gain][0][0] += amp;
718 m_data->m_timeCov[ros][drawer][chan][gain][0][1] += amp * amp;
719 m_data->m_timeCov[ros][drawer][chan][gain][0][2] += time;
720 m_data->m_timeCov[ros][drawer][chan][gain][0][3] += time * time;
721 //TimeCov[ros][drawer][chan][gain][0][4] += amp*time;
722 ++m_data->m_timeCov[ros][drawer][chan][gain][0][5];
723 /*
724 //Lukas
725 if((ros==3 && drawer==14 && (chan==12 || chan==13 || chan==18 || chan==19))||(ros==4 && drawer==17 && (chan==12 || chan==13 || chan==18 || chan==19))){
726 }else if((ros==3 || ros==4) && (chan==0 || chan==1 || chan==12 || chan==13)){
727 }else{
728 sumTimeCh[ros][gain]+=time;
729 nCh[ros][gain]+=1;
730 }
731 //Lukas
732 */
733 //Lukas
734 if (isDisconnected(ros, drawer, chan) || amp < m_minAmpForCorrectedTime) continue;
735 if ((ros == 3 || ros == 4)
736 && (chan == 0 || chan == 1 || chan == 2 || chan == 3 || chan == 4 || chan == 5 || chan == 12 || chan == 13 || chan == 18
737 || chan == 19)) {
738 } else {
739 sumTimeCh[ros] += time;
740 nCh[ros] += 1;
741 }
742 //Lukas
743
744 } //if k==0 //Lukas
745 else if (k == 1) { //Lukas
746 if (isDisconnected(ros, drawer, chan) || amp < m_minAmpForCorrectedTime) continue;
747
748 timeCorr = time - avgTimePerPart[ros]; //Lukas
749 m_data->m_hist1[ros][drawer][chan][gain][2]->Fill(timeCorr, 1.0); //Lukas
750
751 m_data->m_timeCovCorr[ros][drawer][chan][gain][0][0] += timeCorr; //Lukas
752 m_data->m_timeCovCorr[ros][drawer][chan][gain][0][1] += timeCorr * timeCorr; //Lukas
753 ++m_data->m_timeCovCorr[ros][drawer][chan][gain][0][2]; //Lukas
754
755 } //k==1 //Lukas
756 } // end of nonCisRun
757 }
758
759 } else { // if channel is not fired
760 }
761
762 } // loop over channels
763 if (k == 0) { //Lukas
764 if (m_plotDsp) {
765 m_efitMap.insert(make_pair(ros * 100 + drawer, efitVec)); // needed later for dspreco comparison
766 m_tfitMap.insert(make_pair(ros * 100 + drawer, tfitVec)); // needed later for dspreco comparison
767 }
768 } //if k==0 //Lukas
769 }
770 }
771 //Lukas
772 if (k == 0) {
773 for (int iros = 0; iros < 5; iros++) {
774 if (nCh[iros] != 0) {
775 avgTimePerPart[iros] = sumTimeCh[iros] / nCh[iros];
776 } else {
777 avgTimePerPart[iros] = 0;
778 }
779 sumTimeCh[iros] = 0;
780 nCh[iros] = 0;
781 } //for
782 } //if k==0
783 //Lukas
784 } // loop over k //Lukas
785
786 if (m_plotDsp) {
787 if (fillDsp(m_efitMap, m_tfitMap).isFailure()) ATH_MSG_WARNING("Error filling DSP histograms");
788 }
789
790
792 m_drawHists = false;
795 }
796
797
798
800 return StatusCode::SUCCESS;
801}
802
803/*---------------------------------------------------------*/
804StatusCode TileRawChannelMonTool::fillDsp(std::map<int, std::vector<double> > &efitMap, std::map<int, std::vector<double> > &tfitMap)
805/*---------------------------------------------------------*/
806{
807
808 ATH_MSG_DEBUG("in fillDsp()");
809
810 const TileRawChannelContainer* RawChannelCnt;
811 CHECK(evtStore()->retrieve(RawChannelCnt, m_contNameDSP));
812
813 TileRawChannelUnit::UNIT RChUnit = RawChannelCnt->get_unit();
814
815 TileRawChannelContainer::const_iterator collItr = RawChannelCnt->begin();
816 TileRawChannelContainer::const_iterator lastColl = RawChannelCnt->end();
817
818 for (; collItr != lastColl; ++collItr) {
819
820 TileRawChannelCollection::const_iterator chItr = (*collItr)->begin();
821 TileRawChannelCollection::const_iterator lastCh = (*collItr)->end();
822
823 if (chItr != lastCh) {
824
825 HWIdentifier adc_id = (*chItr)->adc_HWID();
826 int ros = m_tileHWID->ros(adc_id);
827 int drawer = m_tileHWID->drawer(adc_id);
828
829 if (m_data->m_histDsp1[ros][drawer][0][0].size() == 0) {
830 m_bigain = true;
831 bookDsp(ros, drawer);
832 }
833
834 for (; chItr != lastCh; ++chItr) {
835
836 const TileRawChannel * rch = (*chItr);
837
838 adc_id = rch->adc_HWID();
839 unsigned int chan = m_tileHWID->channel(adc_id);
840 int adc = m_tileHWID->adc(adc_id);
841 int gain = (m_bigain) ? adc : 0; // ignore gain in monogain run
842 unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
843
844 if ((m_cispar[8] == 0) /* || ( m_cispar[8] == abs(m_cabling->channel2hole(ros,chan)) )*/
845 && !m_corrup[ros][drawer][gain][chan / 3]) { // channel is fired and not corrupted
846
847 double amp = rch->amplitude();
848 if (RChUnit != m_calibUnit) {
849 if (m_calibUnit != TileRawChannelUnit::CesiumPicoCoulombs) { //We put everythin in the same unit
850 amp = m_tileToolEmscale->channelCalib(drawerIdx, chan, adc, amp, RChUnit, m_calibUnit);
851 } else { // it is =TileRawChannelUnit::CesiumPicoCoulombs, careful with MBTS channels
852 if (ros < 3) //if LB then it's ok CesiumPicoCoulomb
853 {
854 amp = m_tileToolEmscale->channelCalib(drawerIdx, chan, adc, amp, RChUnit, TileRawChannelUnit::CesiumPicoCoulombs);
855 //conversion factor if of the order of 1000MeV=1.05pC
856 } else // check that they are not MBTS channel
857 {
858 int index, pmt;
859 /*Identifier cell_id =*/rch->cell_ID_index(index, pmt);
860 if (index < -1) // MBTS channel
861 {
862 amp = m_tileToolEmscale->channelCalib(drawerIdx, chan, adc, amp, RChUnit, TileRawChannelUnit::PicoCoulombs);
863 } else //not MBTS channel
864 {
865 amp = m_tileToolEmscale->channelCalib(drawerIdx, chan, adc, amp, RChUnit, TileRawChannelUnit::CesiumPicoCoulombs);
866 }
867 }
868 } // end if CesiumPicoCouloumb
869 }
870
871 double time = rch->time();
872 double chi2 = rch->quality();
873
874 m_data->m_histDsp1[ros][drawer][chan][gain][Edsp]->Fill(amp, 1.0);
875 m_data->m_histDsp1[ros][drawer][chan][gain][Tdsp]->Fill(time, 1.0);
876 m_data->m_histDsp1[ros][drawer][chan][gain][chi2dsp]->Fill(chi2, 1.0);
877 m_data->m_histDsp2[ros][drawer][chan][gain][0]->Fill(amp, chi2, 1.0);
878 m_data->m_finalHistDsp2[ros][drawer][gain][0]->Fill(amp, chi2, 1.0);
879
880 std::map<int, std::vector<double> >::iterator it = efitMap.find(ros * 100 + drawer);
881 if (it != efitMap.end()) {
882 double efit = (*it).second.at(chan + gain * 48);
883 it = tfitMap.find(ros * 100 + drawer);
884 if (it != tfitMap.end()) {
885 double tfit = (*it).second.at(chan + gain * 48);
886 //convert from pC to ADC counts
887 if (TMath::Abs(efit) > m_efitThresh) { // fill the histogram only if the efit is above threshold
888 m_data->m_histDsp1[ros][drawer][chan][gain][Edsp_fit]->Fill((amp - efit) / efit, 1.0);
889 }
890
891 if (tfit != 0.) {
892 m_data->m_histDsp1[ros][drawer][chan][gain][Tdsp_fit]->Fill((time - tfit), 1.0);
893 }
894 }
895
896 }
897 }
898
899 } // loop over channels
900
901 }
902 }
903 return StatusCode::SUCCESS;
904}
905
906
907
908
909/*---------------------------------------------------------*/
911/*---------------------------------------------------------*/
912{
913
914
915 const std::array<std::string, 6> gain = { "_lo", "_hi", "", " low gain", " high gain", "" };
916
917 // for bigain run book 2 histograms per channel
918 // for monogain run book just one histogram per channel
919 int mingain = (m_bigain) ? 0 : 2;
920 int maxgain = (m_bigain) ? 2 : 3;
921
922 std::ostringstream sStr;
923
924 if ((m_runType == CisRun) || (m_runType == CisRamp)) {
925
926 const char *HistName[6] = { "_tslope", "_toffset", "_qratio", " Time slope", " Time offset", " Amp/Q ratio" };
927 const char *CapName[4] = { "_100", "_5", " 100 pF", " 5 pF" };
928
929
930 std::string moduleName = TileCalibUtils::getDrawerString(ros, drawer);
931 std::string subDir = "Summary";
932 std::string histName, histTitle;
933
934 for (int gn = mingain; gn < maxgain; ++gn) {
935 int adc = gn & 1;
936 for (int cap = 0; cap < 2; ++cap) {
937 for (int type = 0; type < 3; ++type) {
938
939 sStr.str("");
940 sStr << moduleName << gain[gn] << HistName[type] << CapName[cap];
941 histName = sStr.str();
942 sStr.str("");
943 if (gn+3 >= std::ssize(gain)) throw std::out_of_range("Index out of range in TileRawChannelMonTool::bookSummaryHistograms");
944 sStr << moduleName << gain[3 + gn] << HistName[3 + type] << CapName[2 + cap];
945 histTitle = sStr.str();
946 m_data->m_finalHist1[ros][drawer][adc][cap].push_back(book1F(subDir, histName, histTitle, 48, 0, 48));
947 }
948 } //end of loop over capacitors
949 } //end of loop over gn
950
951 } else { // not CisRun
952 const char *HistName[10] = { "_amp", "_rms", "_sigma", "_time", "_time_corr", " Amplitude", " RMS of amplitude", " Sigma amp from Gaussian fit",
953 " Average time and RMS", " Average time corr. and RMS" };
954 //Lukas
955
956 std::string moduleName = TileCalibUtils::getDrawerString(ros, drawer);
957 std::string subDir = "Summary";
958 std::string histName, histTitle;
959
960 for (int gn = mingain; gn < maxgain; ++gn) {
961
962 int adc = gn & 1;
963
964 //for (int type = 0; type < 4; ++type) {
965 for (int type = 0; type < 5; ++type) { //Lukas
966
967 sStr.str("");
968 sStr << moduleName << gain[gn] << HistName[type];
969 histName = sStr.str();
970 sStr.str("");
971 if (gn+3 >= std::ssize(gain)) throw std::out_of_range("Index out of range in TileRawChannelMonTool::bookSummaryHistograms");
972 sStr << moduleName << gain[3 + gn] << HistName[5 + type]; //Lukas
973 histTitle = sStr.str();
974 m_data->m_finalHist1[ros][drawer][adc][0].push_back(book1F(subDir, histName, histTitle, 48, 0.0, 48.0));
975
976 std::string hTitle(histTitle);
977
979
980 hTitle += " (Even PMTs)";
981 m_data->m_summaryPmts[ros][drawer][adc][0].push_back(book1F(subDir + "/pmt", histName + "_pmt_even", hTitle, 49, -0.5, 48.5));
982 m_data->m_summaryPmts[ros][drawer][adc][0].back()->SetMarkerStyle(22);
983 m_data->m_summaryPmts[ros][drawer][adc][0].back()->SetMarkerColor(2);
984 m_data->m_summaryPmts[ros][drawer][adc][0].back()->SetMarkerSize(0.75);
985
986 hTitle = histTitle;
987 hTitle += " (Odd PMTs)";
988 m_data->m_summaryPmts[ros][drawer][adc][1].push_back(book1F(subDir + "/pmt", histName + "_pmt_odd", hTitle, 49, -0.5, 48.5));
989 m_data->m_summaryPmts[ros][drawer][adc][1].back()->SetMarkerStyle(23);
990 m_data->m_summaryPmts[ros][drawer][adc][1].back()->SetMarkerColor(4);
991 m_data->m_summaryPmts[ros][drawer][adc][1].back()->SetMarkerSize(0.75);
992
993 if (ros < 3 && m_data->m_summaryPmts[0][drawer][adc][0].size() < (unsigned int)(type + 1)) {
994
995 histName.replace(histName.begin(), histName.begin() + 3, "LB");
996 histTitle.replace(histTitle.begin(), histTitle.begin() + 3, "LB");
997 hTitle = histTitle;
998
999 hTitle += " (LBA even PMTs + LBC odd PMTs: negative)";
1000 m_data->m_summaryPmts[0][drawer][adc][0].push_back(book1F(subDir + "/pmt", histName + "_pmt_LBA-even_LBC-odd", hTitle, 97, -48.5, 48.5));
1001 m_data->m_summaryPmts[0][drawer][adc][0].back()->SetMarkerStyle(22);
1002 m_data->m_summaryPmts[0][drawer][adc][0].back()->SetMarkerColor(2);
1003 m_data->m_summaryPmts[0][drawer][adc][0].back()->SetMarkerSize(0.75);
1004
1005 hTitle = histTitle;
1006 hTitle += " (LBA odd PMTs + LBC even PMTs: negative)";
1007 m_data->m_summaryPmts[0][drawer][adc][1].push_back(book1F(subDir + "/pmt", histName + "_pmt_LBA-odd_LBC-even", hTitle, 97, -48.5, 48.5));
1008 m_data->m_summaryPmts[0][drawer][adc][1].back()->SetMarkerStyle(23);
1009 m_data->m_summaryPmts[0][drawer][adc][1].back()->SetMarkerColor(4);
1010 m_data->m_summaryPmts[0][drawer][adc][1].back()->SetMarkerSize(0.75);
1011 }
1012 }
1013 }
1014
1015 } //end of loop over gn
1016 }
1017
1018}
1019
1020
1021/*---------------------------------------------------------*/
1023/*---------------------------------------------------------*/
1024{
1025
1026 memset(m_data->m_timeCov, 0, sizeof(m_data->m_timeCov));
1027 memset(m_data->m_timeCovCorr, 0, sizeof(m_data->m_timeCovCorr));
1028
1029 int mingain = (m_bigain) ? 0 : 2;
1030 int maxgain = (m_bigain) ? 2 : 3;
1031
1032 for (int ros = 1; ros < 5; ++ros) {
1033 for (int drawer = 0; drawer < 64; ++drawer) {
1034 if (m_data->m_hist1[ros][drawer][0][0].size() != 0) {
1035 for (int ch = 0; ch < 48; ++ch) {
1036 for (int gn = mingain; gn < maxgain; ++gn) {
1037 for (auto h : m_data->m_hist1[ros][drawer][ch][gn]) h->Reset();
1038 for (auto h : m_data->m_hist2[ros][drawer][ch][gn]) h->Reset();
1039 }
1040 }
1041 }
1042 }
1043 }
1044}
1045
1046
1047/*---------------------------------------------------------*/
1049/*---------------------------------------------------------*/
1050{
1051
1052 ATH_MSG_INFO("in fillFfinalHiststograms()");
1053
1054 memset(m_data->m_rangeQ, 0, sizeof(m_data->m_rangeQ));
1055
1056 TF1 * fit_gaus = new TF1("g", "gaus");
1057
1058 // for bigain run book 2 histograms per channel
1059 // for monogain run book just one histogram per channel
1060 int mingain = (m_bigain) ? 0 : 2;
1061 int maxgain = (m_bigain) ? 2 : 3;
1062
1063 if ((m_runType == CisRun) || (m_runType == CisRamp)) {
1064 for (int ros = 1; ros < 5; ++ros) {
1065 for (int drawer = 0; drawer < 64; ++drawer) {
1066 if (m_data->m_hist1[ros][drawer][0][0].size() != 0) {
1067 for (int gn = mingain; gn < maxgain; ++gn) {
1068
1069 int adc = gn & 1;
1070 for (int cap = 0; cap < 2; ++cap) {
1071 for (int ch = 0; ch < 48; ++ch) {
1072
1073 // int pmt = abs(m_cabling->channel2hole(ros,ch)); // number in range [1,48]
1074
1075 TF1* polyfunc = 0;
1076 if (m_book2D) polyfunc = GetTimeFitFunc(m_data->m_hist2[ros][drawer][ch][adc][cap + 2]);
1077 if (polyfunc) {
1078 m_data->m_finalHist1[ros][drawer][adc][cap][0]->SetBinContent(ch + 1, polyfunc->GetParameter(1));
1079 if (polyfunc->GetParError(1) > 5) {
1080 m_data->m_finalHist1[ros][drawer][adc][cap][0]->SetBinError(ch + 1, 5.);
1081 } else {
1082 m_data->m_finalHist1[ros][drawer][adc][cap][0]->SetBinError(ch + 1, polyfunc->GetParError(1));
1083 }
1084 m_data->m_finalHist1[ros][drawer][adc][cap][1]->SetBinContent(ch + 1, polyfunc->GetParameter(0));
1085 if (polyfunc->GetParError(0) > 5) {
1086 m_data->m_finalHist1[ros][drawer][adc][cap][1]->SetBinError(ch + 1, 5.);
1087 } else {
1088 m_data->m_finalHist1[ros][drawer][adc][cap][1]->SetBinError(ch + 1, polyfunc->GetParError(0));
1089 }
1090
1091 delete polyfunc; //important!
1092 }
1093
1094 else {
1095 m_data->m_finalHist1[ros][drawer][adc][cap][0]->SetBinContent(ch + 1, 0.);
1096 m_data->m_finalHist1[ros][drawer][adc][cap][0]->SetBinError(ch + 1, 0.);
1097 m_data->m_finalHist1[ros][drawer][adc][cap][1]->SetBinContent(ch + 1, 0.);
1098 m_data->m_finalHist1[ros][drawer][adc][cap][1]->SetBinError(ch + 1, 0.);
1099 }
1100
1101 TH1S * hist = m_data->m_hist1[ros][drawer][ch][adc][cap];
1102 int nbins = hist->GetNbinsX();
1103 int minbin = 1;
1104 for (; minbin < nbins; ++minbin) {
1105 if (hist->GetBinContent(minbin) > 0.0) {
1106 break;
1107 }
1108 }
1109 int maxbin = nbins;
1110 for (; maxbin > 1; --maxbin) {
1111 if (hist->GetBinContent(maxbin) > 0.0) {
1112 break;
1113 }
1114 }
1115
1116 double mean = hist->GetMean();
1117 double xmin = hist->GetBinCenter(minbin);
1118 double xmax = hist->GetBinCenter(maxbin);
1119
1120 //rangeErrorBar(xmin,xmax,mean);
1121 if (m_useratioerror) { // /use ratioerror bar or rangeerror bar ?
1122 ratioErrorBar(hist, xmin, xmax, mean);
1123 } else {
1125 }
1126
1127 //std::cout << hist->GetName() <<" mean-xmin= "<< mean-xmin <<"\n";
1128 m_data->m_rangeQ[adc][cap][0][ch] = mean;
1129 m_data->m_rangeQ[adc][cap][1][ch] = std::max(0.0, mean - xmin);
1130 m_data->m_rangeQ[adc][cap][2][ch] = std::max(0.0, xmax - mean);
1131
1132 m_data->m_finalHist1[ros][drawer][adc][cap][2]->SetBinContent(ch + 1, mean);
1133 }
1134 } //end of loop over capacitors
1135 } //end of loop over gn
1136
1137 if(m_drawHists) {
1138 std::string moduleName = TileCalibUtils::getDrawerString(ros, drawer);
1139 drawHists(ros, drawer, moduleName);
1140 }
1141 }
1142 } //end of loop over drawer
1143 } //end of loop over ros
1144
1145 } else { // not CisRun
1146
1147 for (int ros = 1; ros < 5; ++ros) {
1148 for (int drawer = 0; drawer < 64; ++drawer) {
1149 if (m_data->m_hist1[ros][drawer][0][0].size() != 0) {
1150 for (int gn = mingain; gn < maxgain; ++gn) {
1151
1152 int adc = gn & 1;
1153 for (int ch = 0; ch < 48; ++ch) {
1154
1155 // int pmt = abs(m_cabling->channel2hole(ros,ch)); // number in range [1,48]
1156
1157 double Amp = 0.0, ErrA = 0.0, RMS = 0.0, ErrR = 0.0;
1158 double Time = 0.0, RMST = 0.0, Sigma = 0.0, ErrS = 0.0;
1159 double NEvents = m_data->m_timeCov[ros][drawer][ch][adc][0][5];
1160
1161 double TimeCorr = 0.0, RMSTCorr = 0.0; //Lukas
1162 double NEventsCorr = m_data->m_timeCovCorr[ros][drawer][ch][adc][0][2]; //Lukas
1163
1164 if (NEvents > 0.0) {
1165
1166 Amp = m_data->m_timeCov[ros][drawer][ch][adc][0][0] / NEvents;
1167 RMS = m_data->m_timeCov[ros][drawer][ch][adc][0][1] / NEvents - Amp * Amp;
1168 if (RMS > 0.0) {
1169 RMS = sqrt(RMS);
1170 ErrA = RMS / sqrt(NEvents);
1171 ErrR = RMS / sqrt(2 * NEvents);
1172 } else {
1173 RMS = 0.0;
1174 }
1175
1176 Time = m_data->m_timeCov[ros][drawer][ch][adc][0][2] / NEvents;
1177 RMST = m_data->m_timeCov[ros][drawer][ch][adc][0][3] / NEvents - Time * Time;
1178 if (RMST > 0.0) {
1179 RMST = sqrt(RMST);
1180 } else {
1181 RMST = 0.0;
1182 }
1183 }
1184
1185 //Lukas
1186 if (NEventsCorr > 0.0) {
1187 TimeCorr = m_data->m_timeCovCorr[ros][drawer][ch][adc][0][0] / NEventsCorr;
1188 RMSTCorr = m_data->m_timeCovCorr[ros][drawer][ch][adc][0][1] / NEventsCorr - TimeCorr * TimeCorr;
1189 if (RMSTCorr > 0.0) {
1190 RMSTCorr = sqrt(RMSTCorr);
1191 } else {
1192 RMSTCorr = 0.0;
1193 }
1194 }
1195 //Lukas
1196
1197 if (m_data->m_hist1[ros][drawer][ch][adc][0]->GetEntries() > 0) {
1198 if (adc == 0 && m_overlaphists) { // We have for LB histograms with variable-width bins, not suitable for a fit
1199 TH1S *h4fit=new TH1S(*(m_data->m_hist1[ros][drawer][ch][adc][0]));
1200 h4fit->Scale(1,"width");
1201 h4fit->Fit("g", "NQ");
1202 delete(h4fit);
1203 } else {
1204 m_data->m_hist1[ros][drawer][ch][adc][0]->Fit("g", "NQ");
1205 }
1206 Sigma = fit_gaus->GetParameter(2);
1207 ErrS = fit_gaus->GetParError(2);
1208 }
1209
1210 m_data->m_finalHist1[ros][drawer][adc][0][0]->SetBinContent(ch + 1, Amp);
1211 m_data->m_finalHist1[ros][drawer][adc][0][0]->SetBinError(ch + 1, ErrA);
1212 m_data->m_finalHist1[ros][drawer][adc][0][1]->SetBinContent(ch + 1, RMS);
1213 m_data->m_finalHist1[ros][drawer][adc][0][1]->SetBinError(ch + 1, ErrR);
1214 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetBinContent(ch + 1, Sigma);
1215 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetBinError(ch + 1, ErrS);
1216 m_data->m_finalHist1[ros][drawer][adc][0][3]->SetBinContent(ch + 1, Time);
1217 m_data->m_finalHist1[ros][drawer][adc][0][3]->SetBinError(ch + 1, RMST);
1218 m_data->m_finalHist1[ros][drawer][adc][0][4]->SetBinContent(ch + 1, TimeCorr); //Lukas
1219 m_data->m_finalHist1[ros][drawer][adc][0][4]->SetBinError(ch + 1, RMSTCorr); //Lukas
1220
1222
1223 int pmt = m_cabling->channel2hole(ros, ch);
1224 if (pmt < 0) continue;
1225
1226 int fiber = (pmt % 2);
1227
1228 m_data->m_summaryPmts[ros][drawer][adc][fiber][0]->SetBinContent(pmt + 1, Amp);
1229 m_data->m_summaryPmts[ros][drawer][adc][fiber][0]->SetBinError(pmt + 1, ErrA);
1230 m_data->m_summaryPmts[ros][drawer][adc][fiber][1]->SetBinContent(pmt + 1, RMS);
1231 m_data->m_summaryPmts[ros][drawer][adc][fiber][1]->SetBinError(pmt + 1, ErrR);
1232 m_data->m_summaryPmts[ros][drawer][adc][fiber][2]->SetBinContent(pmt + 1, Sigma);
1233 m_data->m_summaryPmts[ros][drawer][adc][fiber][2]->SetBinError(pmt + 1, ErrS);
1234 m_data->m_summaryPmts[ros][drawer][adc][fiber][3]->SetBinContent(pmt + 1, Time);
1235 m_data->m_summaryPmts[ros][drawer][adc][fiber][3]->SetBinError(pmt + 1, RMST);
1236 m_data->m_summaryPmts[ros][drawer][adc][fiber][4]->SetBinContent(pmt + 1, TimeCorr); //Lukas
1237 m_data->m_summaryPmts[ros][drawer][adc][fiber][4]->SetBinError(pmt + 1, RMSTCorr); //Lukas
1238
1239 if (ros == 1) {
1240
1241 int bin = m_data->m_summaryPmts[0][drawer][adc][fiber][0]->FindBin(pmt);
1242
1243 m_data->m_summaryPmts[0][drawer][adc][fiber][0]->SetBinContent(bin, Amp);
1244 m_data->m_summaryPmts[0][drawer][adc][fiber][0]->SetBinError(bin, ErrA);
1245 m_data->m_summaryPmts[0][drawer][adc][fiber][1]->SetBinContent(bin, RMS);
1246 m_data->m_summaryPmts[0][drawer][adc][fiber][1]->SetBinError(bin, ErrR);
1247 m_data->m_summaryPmts[0][drawer][adc][fiber][2]->SetBinContent(bin, Sigma);
1248 m_data->m_summaryPmts[0][drawer][adc][fiber][2]->SetBinError(bin, ErrS);
1249 m_data->m_summaryPmts[0][drawer][adc][fiber][3]->SetBinContent(bin, Time);
1250 m_data->m_summaryPmts[0][drawer][adc][fiber][3]->SetBinError(bin, RMST);
1251 m_data->m_summaryPmts[0][drawer][adc][fiber][4]->SetBinContent(bin, TimeCorr); //Lukas
1252 m_data->m_summaryPmts[0][drawer][adc][fiber][4]->SetBinError(bin, RMSTCorr); //Lukas
1253
1254 }
1255
1256 if (ros == 2) {
1257
1258 int bin = m_data->m_summaryPmts[0][drawer][adc][1 - fiber][0]->FindBin(-pmt);
1259
1260 m_data->m_summaryPmts[0][drawer][adc][1 - fiber][0]->SetBinContent(bin, Amp);
1261 m_data->m_summaryPmts[0][drawer][adc][1 - fiber][0]->SetBinError(bin, ErrA);
1262 m_data->m_summaryPmts[0][drawer][adc][1 - fiber][1]->SetBinContent(bin, RMS);
1263 m_data->m_summaryPmts[0][drawer][adc][1 - fiber][1]->SetBinError(bin, ErrR);
1264 m_data->m_summaryPmts[0][drawer][adc][1 - fiber][2]->SetBinContent(bin, Sigma);
1265 m_data->m_summaryPmts[0][drawer][adc][1 - fiber][2]->SetBinError(bin, ErrS);
1266 m_data->m_summaryPmts[0][drawer][adc][1 - fiber][3]->SetBinContent(bin, Time);
1267 m_data->m_summaryPmts[0][drawer][adc][1 - fiber][3]->SetBinError(bin, RMST);
1268 m_data->m_summaryPmts[0][drawer][adc][1 - fiber][4]->SetBinContent(bin, TimeCorr); //Lukas
1269 m_data->m_summaryPmts[0][drawer][adc][1 - fiber][4]->SetBinError(bin, RMSTCorr); //Lukas
1270
1271 }
1272 }
1273
1274 }
1275 } //end of loop over gn
1276
1277 if(m_drawHists){
1278 std::string moduleName = TileCalibUtils::getDrawerString(ros, drawer);
1279 drawHists(ros, drawer, moduleName);
1280 if (m_plotDsp) {
1281 if (finalDsp(ros, drawer).isFailure()) ATH_MSG_WARNING("Error finalizing DSP histograms");
1282 }
1283 }
1284
1285 }
1286 } //loop over drawer
1287 } //loop over ros
1288 }
1289
1290 delete fit_gaus;
1291
1292 return StatusCode::SUCCESS;
1293}
1294
1295
1296
1297
1298/*---------------------------------------------------------*/
1300/*---------------------------------------------------------*/
1301{
1302 ATH_MSG_INFO("in finalHists()");
1303
1304 if (m_summaryUpdateFrequency == 0) {
1305 for (int ros = 1; ros < 5; ++ros) {
1306 for (int drawer = 0; drawer < 64; ++drawer) {
1307 if (m_data->m_hist1[ros][drawer][0][0].size() != 0) {
1308 bookSummaryHistograms(ros, drawer);
1309 }
1310 }
1311 }
1312 }
1313
1314 m_drawHists = true;
1316
1317
1318 return StatusCode::SUCCESS;
1319}
1320
1321/*---------------------------------------------------------*/
1322StatusCode TileRawChannelMonTool::finalDsp(int ros, int drawer)
1323/*---------------------------------------------------------*/
1324{
1325
1326 if (m_data->m_histDsp1[ros][drawer][0][0].size() != 0) {
1327
1329 const TileRawChannelContainer* RawChannelCntDsp;
1330
1331 unsigned int iteration = 0u;
1332 unsigned int algorithm = 0u;
1333 if (evtStore()->retrieve(RawChannelCntDsp, m_contNameDSP).isSuccess()) {
1334 uint32_t info = RawChannelCntDsp->get_bsflags() >> 24u;
1335 iteration = info & 3u;
1336 algorithm = (info >> 2u) & 1u;
1337
1338 // iteration: "NI", "I1", "I2", "I3"
1339 // algorithm: "OF1", "OF2"
1340 }
1341
1342 const char *alg_name[2] = { "OF1", "OF2" };
1343 const char * iter_name[4] = { "NI", "I1", "I2", "I3" };
1344
1345 const char *part[5] = { "AUX", "LBA", "LBC", "EBA", "EBC" };
1346 const char *gain[4] = { "_lo", "_hi", " low gain", " high gain" };
1347
1348 int mingain = 0;
1349 int maxgain = 2;
1350
1351// const char *HistName[9] = {"_dspfit_ampdiff","_dspfit_timediff","_dspamp",
1352// " Average (DSP-"," Average DSP-", " Average DSP-",
1353// " - OFF-OF2-I) divided by OFF-OF2-I Amplitudes and RMS"," - OFF-OF2-I Time and RMS", " Amplitudes and RMS"};
1354 const char *HistName[9] = { "_dspfit_ampdiff", "_dspfit_timediff", "_dspamp", " Avg. (DSP-", " Average DSP-", " Average DSP-",
1355 " - OFF-OF2-I) / OFF Amplitudes and RMS", " - OFF-OF2-I Time and RMS", " Amplitudes and RMS" };
1356
1357 std::ostringstream sStr;
1358 sStr << part[ros] << std::setfill('0') << std::setw(2) << drawer + 1 << std::setfill(' ');
1359 std::string moduleName = sStr.str();
1360 std::string subDir = "Summary";
1361 std::string histName, histTitle;
1362
1363 for (int gn = mingain; gn < maxgain; ++gn) {
1364
1365 int adc = gn & 1;
1366
1367 for (int type = sumEdsp_fit; type < NsumDsp; ++type) {
1368 sStr.str("");
1369 sStr << moduleName << gain[gn] << HistName[type];
1370 histName = sStr.str();
1371 sStr.str("");
1372 sStr << moduleName << gain[2 + gn] << HistName[3 + type] << alg_name[algorithm] << "-" << iter_name[iteration] << HistName[6 + type];
1373 histTitle = sStr.str();
1374 m_data->m_finalHistDsp1[ros][drawer][adc].push_back(book1F(subDir, histName, histTitle, 48, 0.0, 48.0));
1375 }
1376
1377 //Create hbar histograms to be used in drawDsp
1378 sStr.str("");
1379 sStr << moduleName << gain[gn] << "_dspfit_amphbar";
1380 histName = sStr.str();
1381 sStr.str("");
1382 sStr << moduleName << gain[2 + gn] << " (DSP-" << alg_name[algorithm] << "-" << iter_name[iteration]
1383 << " - OFF-OF2-I) divided by OFF Amplitudes for all chans";
1384 histTitle = sStr.str();
1385 m_data->m_hBarDsp1[ros][drawer][adc].push_back(book1F(subDir, histName, histTitle, 404, -1.01, 1.01));
1386
1387 sStr.str("");
1388 sStr << moduleName << gain[gn] << "_dspfit_timehbar";
1389 histName = sStr.str();
1390 sStr.str("");
1391 sStr << moduleName << gain[2 + gn] << " (DSP-" << alg_name[algorithm] << "-" << iter_name[iteration] << " - OFF-OF2-I) Time for all chans";
1392 histTitle = sStr.str();
1393 m_data->m_hBarDsp1[ros][drawer][adc].push_back(book1F(subDir, histName, histTitle, 101, -2.02, 2.02));
1394
1395 for (int ch = 0; ch < 48; ++ch) {
1396 // int pmt = abs(m_cabling->channel2hole(ros,ch)); // number in range [1,48]
1397
1398 if (m_data->m_histDsp1[ros][drawer][ch][adc][Edsp_fit]->GetEntries() > 0) {
1399 double dspmean = m_data->m_histDsp1[ros][drawer][ch][adc][Edsp]->GetMean();
1400 double dsprms = m_data->m_histDsp1[ros][drawer][ch][adc][Edsp]->GetRMS();
1401 double emean = m_data->m_histDsp1[ros][drawer][ch][adc][Edsp_fit]->GetMean();
1402 double erms = m_data->m_histDsp1[ros][drawer][ch][adc][Edsp_fit]->GetRMS();
1403 double tmean = m_data->m_histDsp1[ros][drawer][ch][adc][Tdsp_fit]->GetMean();
1404 double trms = m_data->m_histDsp1[ros][drawer][ch][adc][Tdsp_fit]->GetRMS();
1405
1406 m_data->m_finalHistDsp1[ros][drawer][adc][sumEdsp]->SetBinContent(ch + 1, dspmean);
1407 m_data->m_finalHistDsp1[ros][drawer][adc][sumEdsp]->SetBinError(ch + 1, dsprms);
1408 m_data->m_finalHistDsp1[ros][drawer][adc][sumEdsp_fit]->SetBinContent(ch + 1, emean);
1409 m_data->m_finalHistDsp1[ros][drawer][adc][sumEdsp_fit]->SetBinError(ch + 1, erms);
1410 m_data->m_finalHistDsp1[ros][drawer][adc][sumTdsp_fit]->SetBinContent(ch + 1, tmean);
1411 m_data->m_finalHistDsp1[ros][drawer][adc][sumTdsp_fit]->SetBinError(ch + 1, trms);
1412
1413 m_data->m_hBarDsp1[ros][drawer][adc][sumEdsp_fit]->Add(m_data->m_histDsp1[ros][drawer][ch][adc][Edsp_fit]);
1414 m_data->m_hBarDsp1[ros][drawer][adc][sumTdsp_fit]->Add(m_data->m_histDsp1[ros][drawer][ch][adc][Tdsp_fit]);
1415
1416 }
1417 }
1418 } // close loops over chans, gain
1419
1420 // log << MSG::WARNING << "LUCA Calling drawDsp" << endreq;
1421 drawDsp(ros, drawer, moduleName);
1422
1423 } //close if there are histograms for this Module
1424
1425 return StatusCode::SUCCESS;
1426}
1427
1428/*---------------------------------------------------------*/
1429StatusCode TileRawChannelMonTool::checkHists(bool /* fromFinalize */)
1430/*---------------------------------------------------------*/
1431{
1432
1433 ATH_MSG_INFO("in checkHists()");
1434
1435 return StatusCode::SUCCESS;
1436}
1437
1438/*---------------------------------------------------------*/
1439void TileRawChannelMonTool::drawHists(int ros, int drawer, const std::string& moduleName)
1440/*---------------------------------------------------------*/
1441{
1442
1443 ATH_MSG_DEBUG("in drawHists()");
1444
1445 int maxgain = (m_bigain) ? 2 : 1;
1446 double ms = (m_bigain) ? 0.75 : 1.0; // marker size
1447
1448 bool do_plots = m_savePng || m_savePs || m_saveSvg;
1449
1450 if ((m_runType == CisRun) || (m_runType == CisRamp)) {
1451
1452 float X_axis[48];
1453 float X_errors[48];
1454 for (int i = 0; i < 48; i++) {
1455 X_axis[i] = i + 0.5;
1456 X_errors[i] = 0.;
1457 }
1458
1459 const char *gain[6] = { "_lo", "_hi", "", " low gain", " high gain", "" };
1460 const char *CapName[4] = { "_100", "_5", " 100 pF", " 5 pF" };
1461 if (maxgain == 1) gain[0] = gain[1] = gain[2] = gain[3] = gain[4] = gain[5];
1462
1463 /* TGraph* test = new TGraph(48,X_errors,X_errors);
1464 test->SetName(("/HIST1/Tile/RawChannel/Summary/LFTEST"+moduleName).c_str());
1465 m_rootsvc->regGraph("/HIST1/Tile/RawChannel/Summary/LFTEST"+moduleName, test);
1466 */
1467
1468 TCanvas * Can = NULL;
1469 if (do_plots) {
1470 Can = new TCanvas("amp_ratio", "amp_ratio", 402 * maxgain, 588);
1471 Can->Divide(maxgain, 2);
1472 gStyle->SetOptStat(0);
1473 gStyle->SetTitleFontSize(0.1);
1474 }
1475
1476 TLine line(0., 1., 48., 1.); //Draw a green line to guide the sight
1477 line.SetLineColor(3);
1478
1479 std::string subDir = "Summary";
1480 std::vector<TGraphAsymmErrors*> grapherrVec;
1481
1482 for (int adc = 0; adc < maxgain; ++adc) {
1483 for (int cap = 0; cap < 2; ++cap) {
1484
1485 std::ostringstream sStr;
1486 sStr << moduleName << gain[adc] << "_tails" << CapName[cap];
1487 std::string graphName = sStr.str();
1488 sStr.str("");
1489 sStr << moduleName << gain[adc + 3] << " Mean Amp/Q ratio and up/down tails " << CapName[2 + cap];
1490 std::string graphTitle = sStr.str();
1491
1492 TVirtualPad * pad;
1493 if (do_plots) {
1494 pad = Can->cd(cap * maxgain + adc + 1);
1495 pad->SetTopMargin(0.15);
1496 pad->SetGridx();
1497 }
1498
1499 TGraphAsymmErrors * final_Egraph = bookGraphAsymmErrors(subDir, graphName, graphTitle, 48, X_axis, m_data->m_rangeQ[adc][cap][0], X_errors, X_errors,
1500 m_data->m_rangeQ[adc][cap][1], m_data->m_rangeQ[adc][cap][2]);
1501 grapherrVec.push_back(final_Egraph);
1502
1503 m_data->m_finalHist1[ros][drawer][adc][cap][2]->SetStats(kFALSE);
1504 m_data->m_finalHist1[ros][drawer][adc][cap][2]->SetMarkerStyle(21);
1505 m_data->m_finalHist1[ros][drawer][adc][cap][2]->SetMarkerSize(ms);
1506 m_data->m_finalHist1[ros][drawer][adc][cap][2]->SetLabelSize(0.06, "X");
1507 m_data->m_finalHist1[ros][drawer][adc][cap][2]->SetLabelSize(0.06, "Y");
1508 m_data->m_finalHist1[ros][drawer][adc][cap][2]->SetMaximum(2.2);
1509 m_data->m_finalHist1[ros][drawer][adc][cap][2]->SetMinimum(-0.2);
1510 if (do_plots) m_data->m_finalHist1[ros][drawer][adc][cap][2]->Draw("P0");
1511
1512 final_Egraph->SetMarkerStyle(21);
1513 final_Egraph->SetMarkerSize(ms);
1514 final_Egraph->SetMaximum(2.2);
1515 final_Egraph->SetMinimum(-0.2);
1516 final_Egraph->GetXaxis()->SetRangeUser(0, 48);
1517 if (do_plots) {
1518 final_Egraph->Draw("P0");
1519 line.Draw();
1520 }
1521
1522 }
1523 }
1524
1525 if (m_savePng) {
1526 Can->Print(TString(moduleName + "_amp_ratio.png"), "png");
1527 }
1528 if (m_savePs) {
1529 Can->Print(TString(moduleName + "_amp_ratio.ps"), "ps");
1530 }
1531 if (m_saveSvg) {
1532 Can->Print(TString(moduleName + "_amp_ratio.svg"), "svg");
1533 }
1534 if (do_plots) delete Can;
1535
1536// we have to remove TGraphAsymmErrors in 13.0.10, because THistSvc doesn't handle them well
1537 if (!m_storeGraph) {
1538 std::vector<TGraphAsymmErrors*>::const_iterator it = grapherrVec.begin();
1539 std::vector<TGraphAsymmErrors *>::const_iterator itend = grapherrVec.end();
1540 for (; it != itend; ++it) {
1541 if ((removeTObj(*it)).isFailure()) ATH_MSG_WARNING("Problems removing TObj");
1542 }
1543 }
1544
1545 if (do_plots) {
1546 Can = new TCanvas("fit_time", "fit_time", 402 * maxgain, 588);
1547 Can->Divide(maxgain, 4);
1548 gStyle->SetOptStat(0);
1549 gStyle->SetTitleFontSize(0.1);
1550 }
1551
1552 double maxy[2] = { 1.4, 15.0 };
1553 double miny[2] = { -0.1, -15.0 };
1554
1555 for (int adc = 0; adc < maxgain; ++adc) {
1556 for (int cap = 0; cap < 2; ++cap) {
1557 for (int type = 0; type < 2; ++type) {
1558
1559 TVirtualPad * pad;
1560 if (do_plots) {
1561 pad = Can->cd((type + cap * 2) * maxgain + adc + 1);
1562 pad->SetTopMargin(0.15);
1563 pad->SetGridx();
1564 }
1565
1566 if (m_data->m_finalHist1[ros][drawer][adc][cap][type]->GetMaximum() < 0.9 * maxy[type])
1567 m_data->m_finalHist1[ros][drawer][adc][cap][type]->SetMaximum(maxy[type]);
1568 if (m_data->m_finalHist1[ros][drawer][adc][cap][type]->GetMinimum() > (miny[type] + 0.1 * TMath::Abs(miny[type])))
1569 m_data->m_finalHist1[ros][drawer][adc][cap][type]->SetMinimum(miny[type]);
1570
1571 m_data->m_finalHist1[ros][drawer][adc][cap][type]->SetMarkerStyle(21);
1572 m_data->m_finalHist1[ros][drawer][adc][cap][type]->SetMarkerSize(ms);
1573 m_data->m_finalHist1[ros][drawer][adc][cap][type]->SetLabelSize(0.10, "X");
1574 m_data->m_finalHist1[ros][drawer][adc][cap][type]->SetLabelSize(0.10, "Y");
1575 if (do_plots) {
1576 m_data->m_finalHist1[ros][drawer][adc][cap][type]->Draw("P0");
1577
1578 line.SetLineColor(3);
1579 line.Draw();
1580 }
1581 }
1582 }
1583 }
1584
1585 if (m_savePng) {
1586 Can->Print(TString(moduleName + "_fit_time.png"), "png");
1587 }
1588 if (m_savePs) {
1589 Can->Print(TString(moduleName + "_fit_time.ps"), "ps");
1590 }
1591 if (m_saveSvg) {
1592 Can->Print(TString(moduleName + "_fit_time.svg"), "svg");
1593 }
1594 if (do_plots) delete Can;
1595
1596 } else {
1597 if ((m_runType == LasRun) || (m_runType == LedRun)) { //same stuff but with Laser fancy colors
1598 LaserFancyPlotting(ros, drawer, maxgain, moduleName);
1599 } else {
1600
1601 TCanvas * Can = NULL;
1602 if (do_plots) {
1603 Can = new TCanvas("fit_amp", "fit_amp", 402 * maxgain, 588);
1604 Can->Divide(maxgain, 3);
1605 gStyle->SetOptStat(0);
1606 gStyle->SetTitleFontSize(0.1);
1607 }
1608
1609 double maxy[6] = { 1.0, 0.05, 1.0, 0.05, 25.0, 25.0 };
1610 double miny[6] = { -1.0, -0.05, 0.0, 0.0, -25.0, -25.0 };
1611
1612 for (int adc = 0; adc < maxgain; ++adc) {
1613
1614 double max0 = m_data->m_finalHist1[ros][drawer][adc][0][0]->GetMaximum();
1615 double max1 = m_data->m_finalHist1[ros][drawer][adc][0][1]->GetMaximum();
1616 double max2 = m_data->m_finalHist1[ros][drawer][adc][0][2]->GetMaximum();
1617 double max3 = m_data->m_finalHist1[ros][drawer][adc][0][3]->GetMaximum();
1618 double min0 = m_data->m_finalHist1[ros][drawer][adc][0][0]->GetMinimum();
1619 double min1 = m_data->m_finalHist1[ros][drawer][adc][0][1]->GetMinimum();
1620 double min2 = m_data->m_finalHist1[ros][drawer][adc][0][2]->GetMinimum();
1621 double min3 = m_data->m_finalHist1[ros][drawer][adc][0][3]->GetMinimum();
1622
1623 TVirtualPad * pad;
1624 if (do_plots) {
1625 pad = Can->cd(adc + 1);
1626 pad->SetTopMargin(0.15);
1627 pad->SetGridx();
1628 }
1629
1630 if (max0 < 0.9 * maxy[adc]) m_data->m_finalHist1[ros][drawer][adc][0][0]->SetMaximum(maxy[adc]);
1631 if (min0 > (miny[adc] + 0.1 * TMath::Abs(miny[adc]))) m_data->m_finalHist1[ros][drawer][adc][0][0]->SetMinimum(miny[adc]);
1632
1633 m_data->m_finalHist1[ros][drawer][adc][0][0]->SetMarkerStyle(21);
1634 m_data->m_finalHist1[ros][drawer][adc][0][0]->SetMarkerSize(ms);
1635 m_data->m_finalHist1[ros][drawer][adc][0][0]->SetLabelSize(0.08, "X");
1636 m_data->m_finalHist1[ros][drawer][adc][0][0]->SetLabelSize(0.08, "Y");
1637 if (do_plots) {
1638 m_data->m_finalHist1[ros][drawer][adc][0][0]->Draw("E0");
1639 }
1640
1641 if (do_plots) {
1642 pad = Can->cd(maxgain + adc + 1);
1643 pad->SetTopMargin(0.15);
1644 pad->SetGridx();
1645 }
1646
1647 // if (max2 > 5 * max1) max2 = 2 * max1; // don't put crazy fit results on plot
1648 if (max1 < maxy[2 + adc]) {
1649 if (max2 < maxy[2 + adc])
1650 m_data->m_finalHist1[ros][drawer][adc][0][1]->SetMaximum(maxy[2 + adc]);
1651 else
1652 m_data->m_finalHist1[ros][drawer][adc][0][1]->SetMaximum(max2);
1653 } else {
1654 if (max1 < max2) m_data->m_finalHist1[ros][drawer][adc][0][1]->SetMaximum(max2);
1655 }
1656
1657 if (min1 > miny[2 + adc]) {
1658 if (min2 > miny[2 + adc])
1659 m_data->m_finalHist1[ros][drawer][adc][0][1]->SetMinimum(miny[2 + adc]);
1660 else
1661 m_data->m_finalHist1[ros][drawer][adc][0][1]->SetMinimum(min2);
1662 } else {
1663 if (min1 > min2) m_data->m_finalHist1[ros][drawer][adc][0][1]->SetMinimum(min2);
1664 }
1665
1666 m_data->m_finalHist1[ros][drawer][adc][0][1]->SetMarkerStyle(21);
1667 m_data->m_finalHist1[ros][drawer][adc][0][1]->SetMarkerSize(ms);
1668 m_data->m_finalHist1[ros][drawer][adc][0][1]->SetLabelSize(0.08, "X");
1669 m_data->m_finalHist1[ros][drawer][adc][0][1]->SetLabelSize(0.08, "Y");
1670 if (do_plots) {
1671 m_data->m_finalHist1[ros][drawer][adc][0][1]->Draw("P0");
1672 }
1673
1674 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetMaximum(m_data->m_finalHist1[ros][drawer][adc][0][1]->GetMaximum());
1675 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetMinimum(m_data->m_finalHist1[ros][drawer][adc][0][1]->GetMinimum());
1676 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetMarkerStyle(25);
1677 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetMarkerSize(ms);
1678 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetMarkerColor(4);
1679 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetLabelSize(0.08, "X");
1680 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetLabelSize(0.08, "Y");
1681 if (do_plots) {
1682 m_data->m_finalHist1[ros][drawer][adc][0][2]->Draw("sameP0");
1683 }
1684
1685 if (do_plots) {
1686 pad = Can->cd(2 * maxgain + adc + 1);
1687 pad->SetTopMargin(0.15);
1688 pad->SetGridx();
1689 }
1690
1691 if (max3 < 0.9 * maxy[4 + adc]) m_data->m_finalHist1[ros][drawer][adc][0][3]->SetMaximum(maxy[4 + adc]);
1692 if (min3 > (miny[4 + adc] + 0.1 * TMath::Abs(miny[4 + adc]))) m_data->m_finalHist1[ros][drawer][adc][0][3]->SetMinimum(miny[4 + adc]);
1693
1694 m_data->m_finalHist1[ros][drawer][adc][0][3]->SetMarkerStyle(21);
1695 m_data->m_finalHist1[ros][drawer][adc][0][3]->SetMarkerSize(ms);
1696 m_data->m_finalHist1[ros][drawer][adc][0][3]->SetLabelSize(0.08, "X");
1697 m_data->m_finalHist1[ros][drawer][adc][0][3]->SetLabelSize(0.08, "Y");
1698 if (do_plots) {
1699 m_data->m_finalHist1[ros][drawer][adc][0][3]->Draw("E0");
1700 }
1701
1702 } //end of loop over gain
1703
1704 if (m_savePng) {
1705 Can->Print(TString(moduleName + "_fit_amp.png"), "png");
1706 }
1707 if (m_savePs) {
1708 Can->Print(TString(moduleName + "_fit_amp.ps"), "ps");
1709 }
1710 if (m_saveSvg) {
1711 Can->Print(TString(moduleName + "_fit_amp.svg"), "svg");
1712 }
1713 if (do_plots) delete Can;
1714 }
1715 }
1716}
1717
1718/*---------------------------------------------------------*/
1719void TileRawChannelMonTool::drawDsp(int ros, int drawer, const std::string& moduleName)
1720/*---------------------------------------------------------*/
1721{
1722 MsgStream log(msgSvc(), name());
1723 int maxgain = (m_bigain) ? 2 : 1;
1724 double ms = (m_bigain) ? 0.75 : 1.0; // marker size
1725 bool do_plots = m_savePng || m_savePs || m_saveSvg;
1726
1727 TCanvas * Can = NULL; // for -Wmaybe-uninitialized
1728 if (do_plots) {
1729 Can = new TCanvas("dsp_amp", "dsp_amp", 402 * maxgain, 588);
1730 Can->Divide(maxgain, 3);
1731 gStyle->SetOptStat(0);
1732 gStyle->SetTitleFontSize(0.1);
1733 }
1734
1735 TLine line(0., 0., 48., 0.); //Draw a green line to guide the sight
1736 line.SetLineColor(3);
1737
1738 double maxy[6] = { 0.05, 0.05, 0.5, 0.5, 10.0, 10.0 };
1739 double miny[6] = { -0.05, -0.05, -0.5, -0.5, -0.05, -0.05 };
1740 double norm[2] = { 1., 1 };
1741 for (int adc = 0; adc < maxgain; ++adc) {
1742
1743 double maxEdsp = m_data->m_finalHistDsp1[ros][drawer][adc][sumEdsp_fit]->GetMaximum();
1744 double minEdsp = m_data->m_finalHistDsp1[ros][drawer][adc][sumEdsp_fit]->GetMinimum();
1745 double maxTdsp = m_data->m_finalHistDsp1[ros][drawer][adc][sumTdsp_fit]->GetMaximum();
1746 double minTdsp = m_data->m_finalHistDsp1[ros][drawer][adc][sumTdsp_fit]->GetMinimum();
1747 double maxchidsp = m_data->m_finalHistDsp2[ros][drawer][adc][0]->GetMaximum();
1748 double minchidsp = m_data->m_finalHistDsp2[ros][drawer][adc][0]->GetMinimum();
1749
1750 TVirtualPad * pad;
1751 if (do_plots) {
1752 pad = Can->cd(adc + 1);
1753 pad->SetTopMargin(0.15);
1754 pad->SetGridx();
1755 }
1756
1757 if (maxEdsp < 0.9 * maxy[adc]) m_data->m_finalHistDsp1[ros][drawer][adc][sumEdsp_fit]->SetMaximum(maxy[adc]);
1758 if (minEdsp > miny[adc] + 0.1 * TMath::Abs(miny[adc])) m_data->m_finalHistDsp1[ros][drawer][adc][sumEdsp_fit]->SetMinimum(miny[adc]);
1759
1760 m_data->m_finalHistDsp1[ros][drawer][adc][sumEdsp_fit]->SetMarkerStyle(21);
1761 m_data->m_finalHistDsp1[ros][drawer][adc][sumEdsp_fit]->SetMarkerSize(ms);
1762 m_data->m_finalHistDsp1[ros][drawer][adc][sumEdsp_fit]->SetLabelSize(0.08, "X");
1763 m_data->m_finalHistDsp1[ros][drawer][adc][sumEdsp_fit]->SetLabelSize(0.08, "Y");
1764 if (do_plots) m_data->m_finalHistDsp1[ros][drawer][adc][sumEdsp_fit]->Draw("");
1765
1766 //Now we add the 1d histogram on the y-axis
1767 if (m_data->m_hBarDsp1[ros][drawer][adc][sumEdsp_fit]->GetMaximum() > 0.1) { //normalize the scale to get into the frame
1768 norm[sumEdsp_fit] = 47. / m_data->m_hBarDsp1[ros][drawer][adc][sumEdsp_fit]->GetMaximum();
1769 }
1770 m_data->m_hBarDsp1[ros][drawer][adc][sumEdsp_fit]->Scale(norm[sumEdsp_fit]);
1771 //hbardsp1[ros][drawer][adc][sumEdsp_fit]->SetFillStyle(3350);
1772 m_data->m_hBarDsp1[ros][drawer][adc][sumEdsp_fit]->SetFillColor(38);
1773 if (do_plots) {
1774 m_data->m_hBarDsp1[ros][drawer][adc][sumEdsp_fit]->Draw("hbar,same");
1775
1776 m_data->m_finalHistDsp1[ros][drawer][adc][sumEdsp_fit]->Draw("E0,same");
1777
1778 line.Draw();
1779
1780 pad = Can->cd(maxgain + adc + 1);
1781 pad->SetTopMargin(0.15);
1782 pad->SetGridx();
1783 }
1784
1785 if (maxTdsp < 0.9 * maxy[2 + adc]) m_data->m_finalHistDsp1[ros][drawer][adc][sumTdsp_fit]->SetMaximum(maxy[2 + adc]);
1786 if (minTdsp > miny[2 + adc] + 0.1 * TMath::Abs(miny[2 + adc])) m_data->m_finalHistDsp1[ros][drawer][adc][sumTdsp_fit]->SetMinimum(miny[2 + adc]);
1787
1788 m_data->m_finalHistDsp1[ros][drawer][adc][sumTdsp_fit]->SetMarkerStyle(21);
1789 m_data->m_finalHistDsp1[ros][drawer][adc][sumTdsp_fit]->SetMarkerSize(ms);
1790 m_data->m_finalHistDsp1[ros][drawer][adc][sumTdsp_fit]->SetLabelSize(0.08, "X");
1791 m_data->m_finalHistDsp1[ros][drawer][adc][sumTdsp_fit]->SetLabelSize(0.08, "Y");
1792 if (do_plots) m_data->m_finalHistDsp1[ros][drawer][adc][sumTdsp_fit]->Draw("");
1793
1794 if (m_data->m_hBarDsp1[ros][drawer][adc][sumTdsp_fit]->GetMaximum() > 0.1) { //normalize the scale to get into the frame
1795 norm[sumTdsp_fit] = 47. / m_data->m_hBarDsp1[ros][drawer][adc][sumTdsp_fit]->GetMaximum();
1796 }
1797 m_data->m_hBarDsp1[ros][drawer][adc][sumTdsp_fit]->Scale(norm[sumTdsp_fit]);
1798 // hbardsp1[ros][drawer][adc][sumTdsp_fit]->SetFillStyle(3350);
1799 m_data->m_hBarDsp1[ros][drawer][adc][sumTdsp_fit]->SetFillColor(38);
1800 if (do_plots) {
1801 m_data->m_hBarDsp1[ros][drawer][adc][sumTdsp_fit]->Draw("hbar,same");
1802
1803 m_data->m_finalHistDsp1[ros][drawer][adc][sumTdsp_fit]->Draw("E0,same");
1804
1805 line.Draw();
1806
1807 pad = Can->cd(2 * maxgain + adc + 1);
1808 pad->SetTopMargin(0.15);
1809 pad->SetGridx();
1810 pad->SetGridy();
1811 }
1812
1813 if (maxchidsp < 0.9 * maxy[4 + adc]) m_data->m_finalHistDsp2[ros][drawer][adc][0]->SetMaximum(maxy[4 + adc]);
1814 if (minchidsp > miny[4 + adc] + 0.1 * TMath::Abs(miny[4 + adc])) m_data->m_finalHistDsp2[ros][drawer][adc][0]->SetMinimum(miny[4 + adc]);
1815
1816 m_data->m_finalHistDsp2[ros][drawer][adc][0]->SetLabelSize(0.08, "X");
1817 m_data->m_finalHistDsp2[ros][drawer][adc][0]->SetLabelSize(0.08, "Y");
1818 if (do_plots) {
1819 gStyle->SetPalette(1);
1820 m_data->m_finalHistDsp2[ros][drawer][adc][0]->Draw("zcol");
1821 }
1822
1823 } //end of loop over gain
1824
1825 if (m_savePng) {
1826 Can->Print(TString(moduleName + "_dsp_amp.png"), "png");
1827 }
1828 if (m_savePs) {
1829 Can->Print(TString(moduleName + "_dsp_amp.ps"), "ps");
1830 }
1831 if (m_saveSvg) {
1832 Can->Print(TString(moduleName + "_dsp_amp.svg"), "svg");
1833 }
1834 if (do_plots) delete Can;
1835
1836 for (int adc = 0; adc < maxgain; ++adc) {
1837 m_data->m_hBarDsp1[ros][drawer][adc][sumEdsp_fit]->Scale(1 / norm[sumEdsp_fit]); //back to normal
1838 m_data->m_hBarDsp1[ros][drawer][adc][sumTdsp_fit]->Scale(1 / norm[sumTdsp_fit]); //back to normal
1839 }
1840}
1841
1842/*---------------------------------------------------------*/
1843void TileRawChannelMonTool::rangeErrorBar(double& xmin, double& xmax, double mean) {
1844 /*---------------------------------------------------------*/
1851 if (m_DownLimit < mean && mean < m_UpLimit) {
1852 if (xmin > m_DownLimit) xmin = mean;
1853 if (xmax < m_UpLimit) xmax = mean;
1854 }
1855
1856}
1857
1858/*---------------------------------------------------------*/
1859void TileRawChannelMonTool::ratioErrorBar(TH1S* hist, double& xmin, double& xmax, double mean) {
1860 /*---------------------------------------------------------*/
1871 if (m_DownLimit < mean && mean < m_UpLimit) {
1872
1873 if (xmin > m_DownLimit) {
1874 xmin = mean;
1875 } else {
1876 int lo_thrbin = hist->FindBin(m_DownLimit); //
1877 double integral = hist->Integral(0, lo_thrbin); // we also want underflow, in case... Integral() is calculated including the contents of both limiting bins. As 0.7 falls in the middle of a bin, we are calculating the integral by excess
1878 double ratio = integral / (hist->GetEntries());
1879 if (ratio > m_hi_IntegralLimit) {
1880 xmin = mean - 1.05;
1881 } //larger error bar
1882 else if (ratio > m_med_IntegralLimit) {
1883 xmin = mean - 0.7;
1884 } //intermediate error bar
1885 else if (ratio > m_lo_IntegralLimit) {
1886 xmin = mean - 0.35;
1887 } //small error bar
1888 else {
1889 xmin = mean;
1890 }
1891 }
1892
1893 if (xmax < m_UpLimit) {
1894 xmax = mean;
1895 } else {
1896 int hi_thrbin = hist->FindBin(m_UpLimit);
1897 double integral = hist->Integral(hi_thrbin, (hist->GetNbinsX() + 1)); //we also want overflow, in case... Integral() is calculated including the contents of both limiting bins. As 1.3 falls in the middle of a bin, we are calculating the integral by excess.
1898 double ratio = integral / (hist->GetEntries());
1899 if (ratio > m_hi_IntegralLimit) {
1900 xmax = mean + 1.05;
1901 } //larger error bar
1902 else if (ratio > m_med_IntegralLimit) {
1903 xmax = mean + 0.7;
1904 } //intermediate error bar
1905 else if (ratio > m_lo_IntegralLimit) {
1906 xmax = mean + 0.35;
1907 } //small error bar
1908 else {
1909 xmax = mean;
1910 }
1911 }
1912 }
1914}
1915
1918/*---------------------------------------------------------*/
1920 /*---------------------------------------------------------*/
1921//the TF1 pointer is created with new, please use a delete after the parameters have been extracted!
1922 if (hist2d) {
1923 TProfile* prof = hist2d->ProfileX();
1924
1925 if (prof) {
1926 TH1S hist("hist", "TMP Histo", prof->GetNbinsX(), prof->GetBinLowEdge(1), prof->GetBinLowEdge(prof->GetNbinsX() + 1));
1927 float lastbin = -99.;
1928 float lasti = 0.;
1929 float shift = 0.;
1930 for (int i = 1; i < prof->GetNbinsX() + 1; i++) {
1931 if (prof->GetBinError(i) > 1e-7) {
1932 if ((shift < 1.) && ((prof->GetBinContent(i) - (lastbin + (i - lasti))) < -10.)) { //allow only 1 shift and only of negative sign
1933 shift = 25.;
1934 }
1935 lasti = i;
1936 lastbin = prof->GetBinContent(i);
1937 hist.SetBinContent(i, prof->GetBinContent(i) + shift);
1938 hist.SetBinError(i, prof->GetBinError(i));
1939 }
1940 } // end for loop on the histogram bins
1941 TF1* polfun = new TF1("polfun", "pol1", 0., 25.); //remember to delete!
1942 hist.Fit("polfun", "NQ");
1943
1944 polfun->SetParameter(0, polfun->GetParameter(0) - 25.); // shift by -25 ns to be consistent with previous definition
1945 delete prof; //not needed, but these profiles appears in the root files, even if they are not booked
1946 return polfun; //rember to delete!
1947 }
1948 }
1949 return 0;
1950}
1951/*---------------------------------------------------------*/
1952bool TileRawChannelMonTool::checkDmuHeader(std::vector<uint32_t>* headerVec, int dmu)
1953/*---------------------------------------------------------*/
1954{
1955 bool err = false;
1956
1957 if (checkDmuHeaderFormat((*headerVec)[dmu])) {
1958 err = true;
1959
1960 }
1961 if (checkDmuHeaderParity((*headerVec)[dmu])) {
1962 err = true;
1963
1964 }
1965 if (((*headerVec)[dmu] >> 25) & 0x1) {
1966 //Memory Parity Error
1967 err = true;
1968
1969 }
1970 if (((*headerVec)[dmu] >> 24) & 0x1) {
1971 //Single Strobe Error
1972 err = true;
1973
1974 }
1975 if (((*headerVec)[dmu] >> 23) & 0x1) {
1976 //Double Strobe Error
1977 err = true;
1978
1979 }
1980
1981 return err;
1982}
1983/*---------------------------------------------------------*/
1984void TileRawChannelMonTool::LaserFancyPlotting(int ros, int drawer, int maxgain, const std::string& moduleName) {
1985 /*---------------------------------------------------------*/
1986
1987 ATH_MSG_DEBUG("in LaserFancyPlotting...");
1988
1989 //TCanvas * Can = new TCanvas("fit_amp","fit_amp",402*maxgain,588);
1990 bool do_plots = m_savePng || m_savePs || m_saveSvg;
1991 TCanvas * Can = NULL;
1992 if (do_plots) {
1993 Can = new TCanvas("fit_amp", "fit_amp", 402 * maxgain, 735); //Lukas
1994 //Can->Divide(maxgain, 4);
1995 Can->Divide(maxgain, 5); //Lukas
1996 gStyle->SetOptStat(0);
1997 gStyle->SetTitleFontSize(0.1);
1998 }
1999 TLine *line = new TLine();
2000 line->SetLineWidth(2);
2001 line->SetLineStyle(7);
2002 line->SetLineColor(3);
2003
2004 float ms = (m_bigain) ? 0.75 : 1.0; // marker size
2005
2006 double maxy[6] = { 5.0, 0.5, 1.0, 0.05, 25.0, 25.0 };
2007 double miny[6] = { -5.0, -0.5, 0.0, 0.0, -25.0, -25.0 };
2008
2009 // Mean value
2010 TH1F* final_empty[2]; //adc, type
2011 TH1F* final_odd[2]; //adc, type
2012 TH1F* final_even[2]; //adc, type
2013
2014 // define TH1 that will contain the plots of variance/mean
2015 TH1F* pmtGain_empty[2];
2016 TH1F* pmtGain_odd[2];
2017 TH1F* pmtGain_even[2];
2018
2019 for (int g = 0; g < 2; g++) {
2020
2021 std::ostringstream hn;
2022 hn << "empty_" << g;
2023 final_empty[g] = new TH1F(hn.str().c_str(), m_data->m_finalHist1[ros][drawer][g][0][0]->GetTitle(), 48, 0, 48);
2024 hn.str("");
2025 hn << "odd_" << g;
2026 final_odd[g] = new TH1F(hn.str().c_str(), m_data->m_finalHist1[ros][drawer][g][0][0]->GetTitle(), 48, 0, 48);
2027 hn.str("");
2028 hn << "even_" << g;
2029 final_even[g] = new TH1F(hn.str().c_str(), m_data->m_finalHist1[ros][drawer][g][0][0]->GetTitle(), 48, 0, 48);
2030
2031 //---- Histograms for the ratio Var/Mean
2032 // titles...
2033 std::string title;
2034 const char* gain[2] = { "low", "high" };
2035 const char* moduleNames[5] = { "AUX", "LBA", "LBC", "EBA", "EBC" };
2036 if (drawer < 10)
2037 title = Form("%s0%i %s gain, Variance/Mean", moduleNames[ros], drawer + 1, gain[g]);
2038 else
2039 title = Form("%s%i %s gain, Variance/Mean", moduleNames[ros], drawer + 1, gain[g]);
2040
2041 std::ostringstream sStr;
2042 std::string subDir = "Summary";
2043 sStr.str("");
2044 sStr << moduleNames[ros] << std::setfill('0') << std::setw(2) << drawer + 1 << std::setfill(' ') << gain[g] << "_pmtGain_empty";
2045 std::string histName = sStr.str();
2046 pmtGain_empty[g] = book1F(subDir, histName, title, 48, 0.0, 48.0);
2047 // pmtGain_empty[g]= new TH1F(Form("pmtGain_empty_%i", g),title.c_str(), 48,0,48);
2048
2049 sStr.str("");
2050 sStr << moduleNames[ros] << std::setfill('0') << std::setw(2) << drawer + 1 << std::setfill(' ') << gain[g] << "_pmtGain_odd";
2051 histName = sStr.str();
2052 pmtGain_odd[g] = book1F(subDir, histName, title, 48, 0.0, 48.0);
2053 // pmtGain_odd[g] = new TH1F(Form("pmtGain_odd_%i", g), title.c_str(), 48,0,48);
2054
2055 sStr.str("");
2056 sStr << moduleNames[ros] << std::setfill('0') << std::setw(2) << drawer + 1 << std::setfill(' ') << gain[g] << "_pmtGain_even";
2057 histName = sStr.str();
2058 pmtGain_even[g] = book1F(subDir, histName, title, 48, 0.0, 48.0);
2059 //pmtGain_even[g] = new TH1F(Form("pmtGain_even_%i", g), title.c_str(), 48,0,48);
2060 }
2061
2062 // loop over the 2 gains values
2063 for (int adc = 0; adc < maxgain; ++adc) {
2064
2065 double max0 = m_data->m_finalHist1[ros][drawer][adc][0][0]->GetMaximum();
2066 //double max1 = final_hist1[ros][drawer][adc][0][1]->GetMaximum();
2067 //double max2 = final_hist1[ros][drawer][adc][0][2]->GetMaximum();
2068 double max3 = m_data->m_finalHist1[ros][drawer][adc][0][3]->GetMaximum();
2069 double max4 = m_data->m_finalHist1[ros][drawer][adc][0][4]->GetMaximum(); //Lukas
2070 double min0 = m_data->m_finalHist1[ros][drawer][adc][0][0]->GetMinimum();
2071 //double min1 = final_hist1[ros][drawer][adc][0][1]->GetMinimum();
2072 //double min2 = final_hist1[ros][drawer][adc][0][2]->GetMinimum();
2073 double min3 = m_data->m_finalHist1[ros][drawer][adc][0][3]->GetMinimum();
2074 double min4 = m_data->m_finalHist1[ros][drawer][adc][0][4]->GetMinimum(); //Lukas
2075
2076 if (max0 > 0.) {
2077 final_empty[adc]->SetMaximum(1.05 * max0);
2078 } else {
2079 final_empty[adc]->SetMaximum(0.);
2080 }
2081
2082 if ((max0 - min0) > 0) {
2083 final_empty[adc]->SetMinimum(max0 - 1.05 * (max0 - min0));
2084 }
2085
2086 // Select pad 1 and 2
2087 TVirtualPad * pad;
2088 if (do_plots) {
2089 pad = Can->cd(adc + 1);
2090 pad->SetTopMargin(0.15);
2091 pad->SetGridx();
2092 }
2093
2094 // bin=1 corresponds to the first pmt (#0)
2095 double Kapa = 1.30e-3;
2096 for (int ch = 0; ch < 48; ++ch) {
2097 if (isDisconnected(ros, drawer, ch)) {
2098 final_empty[adc]->SetBinContent(ch + 1, m_data->m_finalHist1[ros][drawer][adc][0][0]->GetBinContent(ch + 1) + 0.01);
2099 final_empty[adc]->SetBinError(ch + 1, m_data->m_finalHist1[ros][drawer][adc][0][0]->GetBinError(ch + 1) + 0.01);
2100 pmtGain_empty[adc]->SetBinContent(ch + 1, 0.01);
2101 pmtGain_empty[adc]->SetBinError(ch + 1, 0.01);
2102 }
2103 // connected channels
2104 else {
2105 double mean = m_data->m_finalHist1[ros][drawer][adc][0][0]->GetBinContent(ch + 1);
2106 double rms = m_data->m_finalHist1[ros][drawer][adc][0][1]->GetBinContent(ch + 1);
2107 double dmean = m_data->m_finalHist1[ros][drawer][adc][0][0]->GetBinError(ch + 1);
2108 double drms = m_data->m_finalHist1[ros][drawer][adc][0][1]->GetBinError(ch + 1);
2109 // even pmts
2110 int pmt = abs(m_cabling->channel2hole(ros, ch)); //extra safe: abs should not be necessary, because channels are connected.
2111 if (pmt % 2 == 0) {
2112 final_even[adc]->SetBinContent(ch + 1, m_data->m_finalHist1[ros][drawer][adc][0][0]->GetBinContent(ch + 1) + 0.001);
2113 final_even[adc]->SetBinError(ch + 1, m_data->m_finalHist1[ros][drawer][adc][0][0]->GetBinError(ch + 1) + 0.001);
2114
2115 // if (bin!=0)
2116 // log<<MSG::DEBUG<<"["<<ros<<"]["<<drawer+1<<"]["<<adc<<"]["<< bin <<"] : mean="
2117 // << mean <<", var="<< rms*rms<<"\tVar/mean(corrected)="<< (rms*rms/mean) - Kapa*mean <<endreq;
2118 if (mean > 10e-3) {
2119 pmtGain_even[adc]->SetBinContent(ch + 1, (rms * rms / mean) - Kapa * mean);
2120 pmtGain_even[adc]->SetBinError(ch + 1, (rms * rms / mean) * sqrt((2 * drms / rms) * (2 * drms / rms) + (dmean / mean) * (dmean / mean)));
2121 } else {
2122 pmtGain_even[adc]->SetBinContent(ch + 1, -0.5);
2123 pmtGain_even[adc]->SetBinError(ch + 1, 0.001);
2124 }
2125 }
2126 // odd pmts
2127 else {
2128 final_odd[adc]->SetBinContent(ch + 1, m_data->m_finalHist1[ros][drawer][adc][0][0]->GetBinContent(ch + 1) + 0.001);
2129 final_odd[adc]->SetBinError(ch + 1, m_data->m_finalHist1[ros][drawer][adc][0][0]->GetBinError(ch + 1) + 0.001);
2130
2131 // log<<MSG::DEBUG<<"["<<ros<<"]["<<drawer+1<<"]["<<adc<<"]["<< bin <<"] : mean="
2132 // << mean <<", var="<< rms*rms<<"\tVar/mean(corrected)="<< (rms*rms/mean) - Kapa*mean <<endreq;
2133 if (mean > 10e-3) {
2134 pmtGain_odd[adc]->SetBinContent(ch + 1, (rms * rms / mean) - Kapa * mean);
2135 pmtGain_odd[adc]->SetBinError(ch + 1, (rms * rms / mean) * sqrt((2 * drms / rms) * (2 * drms / rms) + (dmean / mean) * (dmean / mean)));
2136 } else {
2137 pmtGain_odd[adc]->SetBinContent(ch + 1, -0.5);
2138 pmtGain_odd[adc]->SetBinError(ch + 1, 0.001);
2139 }
2140 }
2141 }
2142 }
2143
2144 // we are in pads 1 and 2
2145 // retrieve the max and min of the plots
2146 double max = pmtGain_odd[adc]->GetMaximum();
2147 if (pmtGain_even[adc]->GetMaximum() > max) max = 1.05 * pmtGain_even[adc]->GetMaximum();
2148 double min = pmtGain_odd[adc]->GetMinimum();
2149 if (pmtGain_even[adc]->GetMinimum() < min) min = pmtGain_even[adc]->GetMinimum() - 0.05 * fabs(pmtGain_even[adc]->GetMinimum());
2150 if (max < 0.20) max = 0.20;
2151 if (min > -0.10) min = -0.10;
2152 //log<<MSG::INFO<<"Min and Max : "<< min <<"; "<< max <<enreq;
2153 pmtGain_empty[adc]->SetMarkerStyle(21);
2154 pmtGain_even[adc]->SetMarkerStyle(22);
2155 pmtGain_odd[adc]->SetMarkerStyle(23);
2156 pmtGain_empty[adc]->SetMarkerSize(ms);
2157 pmtGain_even[adc]->SetMarkerSize(ms);
2158 pmtGain_odd[adc]->SetMarkerSize(ms);
2159 pmtGain_empty[adc]->SetLabelSize(0.08, "X");
2160 pmtGain_empty[adc]->SetLabelSize(0.08, "Y");
2161 pmtGain_even[adc]->SetMarkerColor(2);
2162 pmtGain_odd[adc]->SetMarkerColor(4);
2163 pmtGain_empty[adc]->GetYaxis()->SetRangeUser(min, max);
2164 if (do_plots) {
2165 pmtGain_empty[adc]->Draw("e");
2166 pmtGain_even[adc]->Draw("same,e");
2167 pmtGain_odd[adc]->Draw("same,e");
2168 line->DrawLine(0, -0.01, 48, -0.01);
2169 line->DrawLine(0, 0.15, 48, 0.15);
2170
2171 // Select pads 3 and 4
2172 pad = Can->cd(maxgain + adc + 1);
2173 pad->SetTopMargin(0.15);
2174 pad->SetGridx();
2175 }
2176
2177 // Plot the evolution of the mean vs #pmt number (with different colours for odd and even pmts)
2178 if (max0 < 0.9 * maxy[adc]) final_empty[adc]->SetMaximum(maxy[adc]);
2179 if (min0 > miny[adc] + 0.1 * TMath::Abs(miny[adc])) final_empty[adc]->SetMinimum(miny[adc]);
2180
2181 final_empty[adc]->SetMarkerStyle(21);
2182 final_even[adc]->SetMarkerStyle(22);
2183 final_odd[adc]->SetMarkerStyle(23);
2184 final_empty[adc]->SetMarkerSize(ms);
2185 final_even[adc]->SetMarkerSize(ms);
2186 final_odd[adc]->SetMarkerSize(ms);
2187 final_empty[adc]->SetLabelSize(0.08, "X");
2188 final_empty[adc]->SetLabelSize(0.08, "Y");
2189 final_even[adc]->SetMarkerColor(2);
2190 final_odd[adc]->SetMarkerColor(4);
2191 if (do_plots) {
2192 final_empty[adc]->Draw("e");
2193 final_even[adc]->Draw("same,e");
2194 final_odd[adc]->Draw("same,e");
2195
2196 // Select pads 5 and 6 and plot the RMS for each pmt
2197 pad = Can->cd(2 * maxgain + adc + 1);
2198 pad->SetTopMargin(0.15);
2199 pad->SetGridx();
2200 }
2201
2202 m_data->m_finalHist1[ros][drawer][adc][0][1]->SetMarkerStyle(21);
2203 m_data->m_finalHist1[ros][drawer][adc][0][1]->SetMarkerSize(ms);
2204 m_data->m_finalHist1[ros][drawer][adc][0][1]->SetLabelSize(0.08, "X");
2205 m_data->m_finalHist1[ros][drawer][adc][0][1]->SetLabelSize(0.08, "Y");
2206 if (do_plots) m_data->m_finalHist1[ros][drawer][adc][0][1]->Draw("P0");
2207
2208 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetMaximum(m_data->m_finalHist1[ros][drawer][adc][0][1]->GetMaximum());
2209 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetMinimum(m_data->m_finalHist1[ros][drawer][adc][0][1]->GetMinimum());
2210 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetMarkerStyle(25);
2211 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetMarkerSize(ms);
2212 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetMarkerColor(4);
2213 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetLabelSize(0.08, "X");
2214 m_data->m_finalHist1[ros][drawer][adc][0][2]->SetLabelSize(0.08, "Y");
2215 if (do_plots) m_data->m_finalHist1[ros][drawer][adc][0][2]->Draw("sameP0");
2216
2217 // Select pads 7 and 8
2218 if (do_plots) {
2219 pad = Can->cd(3 * maxgain + adc + 1);
2220 pad->SetTopMargin(0.15);
2221 pad->SetGridx();
2222 }
2223
2224 if (max3 < 0.9 * maxy[4 + adc]) m_data->m_finalHist1[ros][drawer][adc][0][3]->SetMaximum(maxy[4 + adc]);
2225 if (min3 > miny[4 + adc] + 0.1 * TMath::Abs(miny[4 + adc])) m_data->m_finalHist1[ros][drawer][adc][0][3]->SetMinimum(miny[4 + adc]);
2226
2227 m_data->m_finalHist1[ros][drawer][adc][0][3]->SetMarkerStyle(21);
2228 m_data->m_finalHist1[ros][drawer][adc][0][3]->SetMarkerSize(ms);
2229 m_data->m_finalHist1[ros][drawer][adc][0][3]->SetLabelSize(0.08, "X");
2230 m_data->m_finalHist1[ros][drawer][adc][0][3]->SetLabelSize(0.08, "Y");
2231 m_data->m_finalHist1[ros][drawer][adc][0][3]->Draw("E0");
2232
2233 //Lukas
2234 // Select pads 9 and 10
2235 if (do_plots) {
2236 pad = Can->cd(4 * maxgain + adc + 1);
2237 pad->SetTopMargin(0.15);
2238 pad->SetGridx();
2239 }
2240
2241 if (max4 < 0.9 * maxy[4 + adc]) m_data->m_finalHist1[ros][drawer][adc][0][4]->SetMaximum(maxy[4 + adc]);
2242 if (min4 > miny[4 + adc] + 0.1 * TMath::Abs(miny[4 + adc])) m_data->m_finalHist1[ros][drawer][adc][0][4]->SetMinimum(miny[4 + adc]);
2243
2244 m_data->m_finalHist1[ros][drawer][adc][0][4]->SetMarkerStyle(21);
2245 m_data->m_finalHist1[ros][drawer][adc][0][4]->SetMarkerSize(ms);
2246 m_data->m_finalHist1[ros][drawer][adc][0][4]->SetLabelSize(0.08, "X");
2247 m_data->m_finalHist1[ros][drawer][adc][0][4]->SetLabelSize(0.08, "Y");
2248 if (do_plots) m_data->m_finalHist1[ros][drawer][adc][0][4]->Draw("E0");
2249 //Lukas
2250
2251 } //end of loop over gain
2252
2253 if (m_savePng) {
2254 Can->Print(TString(moduleName + "_fit_amp.png"), "png");
2255 }
2256 if (m_savePs) {
2257 Can->Print(TString(moduleName + "_fit_amp.ps"), "ps");
2258 }
2259 if (m_saveSvg) {
2260 Can->Print(TString(moduleName + "_fit_amp.svg"), "svg");
2261 }
2262 //Can->Print(TString(moduleName+"_fit_amp.cxx"),"cxx");
2263 if (do_plots) delete Can;
2264 delete line;
2265 for (int g = 0; g < 2; g++) {
2266 delete final_empty[g];
2267 delete final_odd[g];
2268 delete final_even[g];
2269 //delete pmtGain_empty[g];
2270 //delete pmtGain_odd[g];
2271 //delete pmtGain_even[g];
2272 }
2273}
#define endmsg
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
double charge(const T &p)
Definition AtlasPID.h:997
#define CHECK(...)
Evaluate an expression and check for errors.
Handle class for reading from StoreGate.
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
Header file for AthHistogramAlgorithm.
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:838
const_iterator end() const
return const_iterator for end of container
const_iterator begin() const
return const_iterator for first entry
static std::string getDrawerString(unsigned int ros, unsigned int drawer)
Return the drawer name, e.g.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Class that holds Data Quality fragment information and provides functions to extract the data quality...
const uint32_t * cispar() const
CIS parameters.
bool isDisconnected(int ros, int drawer, int ch)
TH2F * book2F(const std::string &dir, const std::string &nam, const std::string &tit, int nx, double xmin, double xmax, int ny, double ymin, double ymax, Interval_t interval=run, MgmtAttr_t attribute=ATTRIB_MANAGED, const std::string &trigChain="", const std::string &mergeAlgo="")
std::vector< int > m_fragIDsToIgnoreDMUerrors
TGraphAsymmErrors * bookGraphAsymmErrors(const std::string &dir, const std::string &nam, const std::string &tit, int N, float *X, float *Y, float *X_errors1, float *X_errors2, float *Y_errors1, float *Y_errors2)
virtual StatusCode initialize() override
StatusCode removeTObj(TObject *obj)
TH1S * book1S(const std::string &dir, const std::string &nam, const std::string &tit, int nx, double xmin, double xmax, Interval_t interval=run, MgmtAttr_t attribute=ATTRIB_MANAGED, const std::string &trigChain="", const std::string &mergeAlgo="")
TH1F * book1F(const std::string &dir, const std::string &nam, const std::string &tit, int nx, double xmin, double xmax, Interval_t interval=run, MgmtAttr_t attribute=ATTRIB_MANAGED, const std::string &trigChain="", const std::string &mergeAlgo="")
const TileHWID * m_tileHWID
const TileCablingService * m_cabling
TilePaterMonTool(const std::string &type, const std::string &name, const IInterface *parent)
std::vector< int > m_fragIDsDemonstrators
TH2S * book2S(const std::string &dir, const std::string &nam, const std::string &tit, int nx, double xmin, double xmax, int ny, double ymin, double ymax, Interval_t interval=run, MgmtAttr_t attribute=ATTRIB_MANAGED, const std::string &trigChain="", const std::string &mergeAlgo="")
TH1S * book1Sx(const std::string &dir, const std::string &nam, const std::string &tit, int nx, const Double_t *xlgbins, Interval_t interval=run, MgmtAttr_t attribute=ATTRIB_MANAGED, const std::string &trigChain="", const std::string &mergeAlgo="")
StatusCode fillDsp(std::map< int, std::vector< double > > &efitMap, std::map< int, std::vector< double > > &tfitMap)
bool m_corrup[5][64][2][16]
virtual StatusCode fillHists() override
Calls fillHists( bool, bool, bool ); if an eventBlock,lumiBlock, or run has turned over,...
void drawHists(int ros, int drawer, const std::string &moduleName)
TileRawChannelMonTool(const std::string &type, const std::string &name, const IInterface *parent)
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
void ratioErrorBar(TH1S *hist, double &xmin, double &xmax, double mean)
void drawDsp(int ros, int drawer, const std::string &moduleName)
virtual StatusCode bookHists() override
Calls bookHists( true, true, true ) and initializes lumiBlock and run numbers.
std::map< int, std::vector< double > > m_efitMap
TF1 * GetTimeFitFunc(TH2S *hist2d)
Time Slope parameters for CIS runs.
virtual StatusCode checkHists(bool fromFinalize) override
This implementation does nothing; equivalent functionality may be provided by procHists(....
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
StatusCode finalDsp(int ros, int drawer)
virtual StatusCode initialize() override
TileRawChannelUnit::UNIT m_calibUnit
bool checkDmuHeaderParity(uint32_t header)
Function to check that the DMU header parity is correct Parity of the DMU header should be odd Return...
bool checkDmuHeader(std::vector< uint32_t > *headerVec, int dmu)
The following three functions are implemented to filter data corruption, copied from TileDigitsMonToo...
void LaserFancyPlotting(int ros, int drawer, int maxgain, const std::string &moduleName)
std::unique_ptr< Data > m_data
bool checkDmuHeaderFormat(uint32_t header)
Function to check that the DMU header format is correct bit_31 of the DMU header must be 1 and bit_17...
void rangeErrorBar(double &xmin, double &max, double mean)
void bookDsp(int ros, int drawer)
virtual StatusCode finalHists() override
Calls procHists( true, true, true ).
void bookSummaryHistograms(int ros, int drawer)
std::map< int, std::vector< double > > m_tfitMap
float time(int ind=0) const
float quality(int ind=0) const
float amplitude(int ind=0) const
uint32_t get_bsflags() const
Identifier cell_ID_index(int &index, int &pmt) const
HWIdentifier adc_HWID(void) const
Definition TileRawData.h:53
double chi2(TH1 *h0, TH1 *h1)
double integral(TH1 *h)
Definition computils.cxx:59
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
std::string algorithm
Definition hcg.cxx:85
double xmax
Definition listroot.cxx:61
double xmin
Definition listroot.cxx:60
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition index.py:1
MsgStream & msg
Definition testRead.cxx:32