ATLAS Offline Software
TileLaserDefaultCalibTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Tile includes
11 
12 
13 #include "GaudiKernel/MsgStream.h"
14 #include "GaudiKernel/Service.h"
15 #include "GaudiKernel/IToolSvc.h"
16 #include "GaudiKernel/TypeNameString.h"
17 #include "GaudiKernel/ThreadLocalContext.h"
18 
20 #include "StoreGate/ReadHandle.h"
21 
22 
23 #include "TFile.h"
24 #include "TTree.h"
25 #include <cmath>
26 #include <iostream>
27 #include <mutex>
28 
29 /****************************************************/
30 /* TileLaserDefaultCalibTool.cxx June 2017 */
31 /* */
32 /* Henric Wilkens, following work from Seb Viret and
33  Vincent Giangiobbe
34 
35  Giulia Di Gregorio, following work from Henric
36  */
37 /****************************************************/
38 
39 TileLaserDefaultCalibTool::TileLaserDefaultCalibTool(const std::string& type, const std::string& name,const IInterface* pParent):
40  AthAlgTool(type, name, pParent),
41  m_pisaMethod2(false),
42  m_isLaserCalib(false),
43  m_tileHWID(nullptr),
44  m_cabling(nullptr),
45  m_toolRunNo(0),
46  m_ADC_problem(0),
47  m_las_filter(0),
48  m_las_requ_amp(0),
49  m_hrate(0),
50  m_flow(0),
51  m_head_temp(0),
52  m_las_time(0),
53  m_PMT(),
54  m_PMT_S(),
55  m_diode(),
56  m_diode_S(),
57  m_diode_Ped(),
58  m_diode_Alpha(),
59  m_diode_SPed(),
60  m_diode_SAlpha(),
61  m_rs_diode_signal(),
62  m_rs_PMT_signal(),
63  m_PMT1_ADC_prev(),
64  m_PMT2_ADC_prev(),
65  m_LASERII(0),
66  m_evtNr(0)
67 {
68  declareInterface<ITileCalibTool>( this );
69  declareProperty("toolNtuple", m_toolNtuple="h3000");
70  declareProperty("pisaMethod2", m_pisaMethod2=true);
71  declareProperty("TileDQstatus", m_dqStatusKey = "TileDQstatus");
72 
73  //creating multi-dim arrays on the heap and initialize all elements to zeros
78 
81 
82  m_PMT_LASERII = new float[NPMTS][NGAINS]();
83  m_PMT_S_LASERII = new float[NPMTS][NGAINS]();
85 
86  m_diode_LASERII = new float[NDIODES][NGAINS]();
87  m_diode_S_LASERII = new float[NDIODES][NGAINS]();
89 
91 
92  m_diode_Ped_LASERII = new float[NDIODES+1][NGAINS]();
93  m_diode_Ped_S_LASERII = new float[NDIODES+1][NGAINS]();
94  m_diode_Alpha_LASERII = new float[NDIODES+1][NGAINS]();
95  m_diode_Alpha_S_LASERII = new float[NDIODES+1][NGAINS]();
96  m_diode_Led_LASERII = new float[NDIODES+1][NGAINS]();
97  m_diode_Led_S_LASERII = new float[NDIODES+1][NGAINS]();
98  m_PMT_Ped_LASERII = new float[NPMTS][NGAINS]();
99  m_PMT_Ped_S_LASERII = new float[NPMTS][NGAINS]();
100 
110 
111  m_meantime = new float[NPARTITIONS][NGAINS]();
112  m_time = new float[NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]();
113  m_time_S = new float[NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]();
114 
115  m_mean = new float[NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]();
116  m_mean_S = new float[NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]();
117  m_raw_mean = new float[NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]();
119  m_entries = new int[NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]();
120  m_kappa = new float[NPARTITIONS][NDRAWERS][NFIBERS][NGAINS]();
123  m_status = new short[NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]();
124  m_HV = new float[NPARTITIONS][NDRAWERS][NCHANNELS]();
125  m_HVSet = new float[NPARTITIONS][NDRAWERS][NCHANNELS]();
126 
132 
135  m_diode_ratio_low = new float[NDIODES][NDIODES]();
136  m_diode_ratio_high = new float[NDIODES][NDIODES]();
137 
138  m_diode_ratio_sigma_low = new float[NDIODES][NDIODES]();
139  m_diode_ratio_sigma_high = new float[NDIODES][NDIODES]();
140 
141 
142 } // TileLaserDefaultCalibTool::TileLaserDefaultCalibTool
143 
145 {
146  delete[] m_ratio_LASERII;
147  delete[] m_ratio_S_LASERII;
148  delete[] m_ratio_LASERII_good;
149  delete[] m_ratio_S_LASERII_good;
150  delete[] m_rs_ratio_LASERII;
151  delete[] m_rs_ratio_LASERII_good;
152  delete[] m_PMT_LASERII;
153  delete[] m_PMT_S_LASERII;
154  delete[] m_rs_PMT_signal_LASERII;
155  delete[] m_diode_LASERII;
156  delete[] m_diode_S_LASERII;
157  delete[] m_entries_diode_LASERII;
158  delete[] m_rs_diode_signal_LASERII;
159  delete[] m_diode_Ped_LASERII;
160  delete[] m_diode_Ped_S_LASERII;
161  delete[] m_diode_Alpha_LASERII;
162  delete[] m_diode_Alpha_S_LASERII;
163  delete[] m_diode_Led_LASERII;
164  delete[] m_diode_Led_S_LASERII;
165  delete[] m_PMT_Ped_LASERII;
166  delete[] m_PMT_Ped_S_LASERII;
167  delete[] m_ratio;
168  delete[] m_ratio_S;
169  delete[] m_ratio_good;
170  delete[] m_ratio_good_S;
171  delete[] m_pmt_ratios;
172  delete[] m_pmt_S_ratios;
173  delete[] m_rs_ratio;
174  delete[] m_rs_ratio_good;
175  delete[] m_rs_pmt_ratios;
176  delete[] m_meantime;
177  delete[] m_time;
178  delete[] m_time_S;
179  delete[] m_mean;
180  delete[] m_mean_S;
181  delete[] m_raw_mean;
182  delete[] m_raw_mean_S;
183  delete[] m_entries;
184  delete[] m_kappa;
185  delete[] m_mean_slice;
186  delete[] m_variance_slice;
187  delete[] m_status;
188  delete[] m_HV;
189  delete[] m_HVSet;
190  delete[] m_rs_meantime;
191  delete[] m_rs_time;
192  delete[] m_rs_signal;
193  delete[] m_rs_raw_signal;
194  delete[] m_rs_reducedKappa;
195  delete[] m_rs_diode_ratio_low;
196  delete[] m_rs_diode_ratio_high;
197  delete[] m_diode_ratio_low;
198  delete[] m_diode_ratio_high;
199  delete[] m_diode_ratio_sigma_low;
200  delete[] m_diode_ratio_sigma_high;
201 
202 }
203 
204 
206  // Reset local parameters and load necessary service
207  ATH_MSG_DEBUG ( "initialize() TileLaserDefaultCalibTool" );
208  m_evtNr = 0;
209  m_toolRunNo = 0;
210  m_ADC_problem = 0;
211  m_las_filter = 0;
212  m_las_requ_amp = 0;
213  m_hrate = 0;
214  m_flow = 0;
215  m_head_temp = 0;
216  m_las_time = 0;
217  m_PMT1_ADC_prev = 0;
218  m_PMT2_ADC_prev = 0;
219 
220 
221  // Loop over monitoring pmts laserii
222 
223  for ( int diodei=0; diodei<NDIODES; diodei++ ) {
224  for ( int diodej=0; diodej<NDIODES; diodej++ ) {
225  m_rs_diode_ratio_low[diodei][diodej]= new RunningStat();
226  m_rs_diode_ratio_high [diodei][diodej]=new RunningStat();
227  m_diode_ratio_low [diodei][diodej]=0;
228  m_diode_ratio_high [diodei][diodej]=0;
229  m_diode_ratio_sigma_low [diodei][diodej]=0;
230  m_diode_ratio_sigma_high [diodei][diodej]=0;
231  }
232  }
233 
234 
235  for ( int diode=0; diode<NDIODES; ++diode ) {
236  for ( int gain=0; gain<NGAINS; gain++ ) {
237  m_diode_LASERII[diode][gain] = 0; // diode signal values
238  m_diode_S_LASERII[diode][gain] = 0;// Sigma of signal values
239  m_entries_diode_LASERII[diode][gain] = 0;
241  }
242  }
243 
244  for ( int diode=0; diode<NDIODES+1; ++diode ) {
245  for ( int gain=0; gain<NGAINS; gain++ ) {
246 
247  m_diode_Ped_LASERII[diode][gain] = 0; // Corresponding pedestal values
248  m_diode_Ped_S_LASERII[diode][gain] = 0;// Sigma of pedestal values
249  m_diode_Alpha_LASERII[diode][gain] = 0; // Corresponding Alpha values
250  m_diode_Alpha_S_LASERII[diode][gain] = 0;// Sigma of Alpha values
251  m_diode_Led_LASERII[diode][gain] = 0; // Corresponding LED values
252  m_diode_Led_S_LASERII[diode][gain] = 0;// Sigma of LED values
253 
254  }
255  }
256 
257  for(int pmt=0;pmt<NPMTS;++pmt){
258  for ( int gain=0; gain<NGAINS; gain++ ) {
259  m_PMT_LASERII[pmt][gain] = 0;
260  m_PMT_S_LASERII[pmt][gain] = 0;
261  m_PMT_Ped_LASERII[pmt][gain] = 0; // Corresponding pedestal values
262  m_PMT_Ped_S_LASERII[pmt][gain] = 0;// Sigma of pedestal values
263 
265  }
266  // LASERI
267  m_PMT[pmt] = 0;
268  m_PMT_S[pmt] = 0;
270  } // FOR
271 
272  // LASERI
273  for(int d=0; d<NDIODES_LASER1; ++d){
274  m_diode[d] = 0;
275  m_diode_S[d] = 0;
276  m_diode_Ped[d] = 0;
277  m_diode_Alpha[d] = 0;
278  m_diode_SPed[d] = 0;
279  m_diode_SAlpha[d]= 0;
281  } // FOR
282 
283  for ( int part=0; part<NPARTITIONS; ++part ) {
284  for ( int gain=0; gain<NGAINS; ++gain ) {
285  m_rs_meantime[part][gain] = new RunningStat();
286  m_meantime[part][gain] = 0.;
287  }
288 
289  for ( int drawer=0; drawer<NDRAWERS; ++drawer ) {
290  for ( int gain=0; gain<NGAINS; ++gain ) {
291  for (int fiber=0; fiber<NFIBERS; ++fiber){
292  m_kappa[part][drawer][fiber][gain] = 0;
293  for (int pmt1=0; pmt1<NCOUPLES-1; ++pmt1){
294  for (int pmt2=pmt1+1; pmt2<NCOUPLES; ++pmt2){
295  m_rs_reducedKappa[part][drawer][pmt1][pmt2][gain][fiber] = new RunningStat();
296  }
297  }
298  }
299 
300  for ( int channel=0; channel<NCHANNELS; ++channel ) {
304 
305  m_time[part][drawer][channel][gain] = 0;
306  m_time_S[part][drawer][channel][gain] = 0;
307 
308  m_mean[part][drawer][channel][gain] = 0;
309  m_mean_S[part][drawer][channel][gain] = 0;
312 
313  for ( int iSlice=0; iSlice<NSLICES; ++iSlice ) {
314  m_mean_slice[part][drawer][channel][iSlice][gain] = 0;
315  m_variance_slice[part][drawer][channel][iSlice][gain] = 0;
316  } // FOR
317 
318  // LASERII
319  for(int diode=0; diode<NDIODES; ++diode){
320  for (int diode_gain=0; diode_gain<NGAINS; diode_gain++) {
321  m_rs_ratio_LASERII[diode][diode_gain][part][drawer][channel][gain] = new RunningStat();
322  m_rs_ratio_LASERII_good[diode][diode_gain][part][drawer][channel][gain] = new RunningStat();
323  }
324  } // FOR
325 
329 
330  // LASERI
331  for(int d=0; d<NDIODES_LASER1; ++d){
333  m_ratio[d][part][drawer][channel][gain] = 0;
334  m_ratio_S[d][part][drawer][channel][gain] = 0;
338  } // FOR
339 
340  m_entries[part][drawer][channel][gain] = 0;
341 
342  m_HV[part][drawer][channel] = 0.;
343  m_HVSet[part][drawer][channel] = 0.;
344 
345  } // channel loop
346  } // gain loop
347  } // drawer loop
348  } // partition loop
349 
351  ATH_CHECK( m_tileToolEmscale.retrieve() );
352  ATH_CHECK( m_tileBadChanTool.retrieve() );
353 
356 
357  ATH_CHECK( m_tileDCS.retrieve() );
358 
360 
361  return StatusCode::SUCCESS;
362 }
363 
364 
366  ATH_MSG_INFO ( "initialize(" << runNumber << "," << runType << "," << rootFile << ")" );
367  return StatusCode::SUCCESS;
368 } // INITNTUPLE
369 
370 
372  const EventContext& ctx = Gaudi::Hive::currentContext();
373  const TileDQstatus* dqStatus = SG::makeHandle (m_dqStatusKey, ctx).get();
374 
375  const char* text[NGAINS] = {"LG DIODE ","HG DIODE "};
376  ++m_evtNr; // Increment event number
377  ATH_MSG_DEBUG ( "Event counter: " << m_evtNr );
378 
379  // Store laser object and rawchannel information into maps
380  ATH_MSG_DEBUG ( "execute() TileLaserDefaultCalibTool" );
381 
384 
385  ATH_CHECK( rawCnt.isValid() );
386  ATH_CHECK( laserObj.isValid() );
387 
388 
389  m_LASERII = laserObj->isLASERII();
390 
391  if(m_LASERII) ATH_MSG_DEBUG ( "LaserII version is " << laserObj->getVersion() << " DAQ Type = " << laserObj->getDaqType() );
392  else ATH_MSG_DEBUG ( "LaserI version is " << laserObj->getVersion() << " DAQ Type = " << laserObj->getDaqType() );
393 
394  const uint32_t *cispar = dqStatus->cispar();
395 
396  m_las_time = static_cast<double>(cispar[10])+static_cast<double>(cispar[11])/1000000;
397 
398  // Retrieve laser information
399  if(laserObj->getDiodeCurrOrd() == 0 || laserObj->getFiltNumber() == 0 || laserObj->getQDCTimeout()){
400  ATH_MSG_ERROR ( "No filter number or diode current: wheel moving or QDC timeout" );
401  return StatusCode::SUCCESS; // This is expected for some events
402  } // IF
403 
404  float normalization[NDIODES][NGAINS];
405  float pmt_values[NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS];
406  for (int part=0; part<NPARTITIONS; part++){
407  for (int draw=0; draw<NDRAWERS; draw++){
408  for (int chan=0; chan<NCHANNELS; chan++){
409  for (int gain=0; gain<NGAINS; gain++) {
410  pmt_values[part][draw][chan][gain]=0.;
411  }
412  }
413  }
414  }
415 
416  static std::once_flag flag; // Do only once
417  std::call_once(flag, [&]() {
418  for ( int part=0; part<NPARTITIONS; ++part ) {
419  int ros = part+1;
420  for ( int drawer=0; drawer<NDRAWERS; ++drawer ) {
421  unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros,drawer);
422  for ( int channel=0; channel<NCHANNELS; ++channel ) {
423  if ( dqStatus->isChEmpty(ros,drawer,channel) ) { // Check whether channel is connected
424  continue;
425  }
426  for ( int gain=0; gain<NGAINS; ++gain ) {
427  short status = m_tileBadChanTool->encodeStatus(m_tileBadChanTool->getAdcStatus(drawerIdx, channel, gain)) ;
428  /* --- Status of the channel in DB
429 
430  0 = isGood()
431  1 = isNoisy() : Large HF noise; Correlated noise; Large LF noise;
432  0x2 = isAffected() : ?
433  0x4 = isBad() : ADC masked (unspecified); ADC dead; Very large HF noise; No data;
434  Wrong DSP configuration; Severe stuck bit; Severe data corruption;
435  Channel masked (unspecified); No PMT connected;No HV; Wrong HV;
436  0x8 = Unknown ?!
437 
438  0x10 = bad ADC, masked on the fly
439 
440  Later we will add the transiant quality flags ---- */
441  if (status)
442  m_status[part][drawer][channel][gain] = 1 << (status-1);
443  }
444  }
445  }
446  }
447  });
448 
449  if ( m_LASERII ) { // LASERII
450  // We need to have pedestals
451 
452  if ( ! (m_have_pedestals && m_have_alpha && m_have_led ) ) {
454  switch ( laserObj->getCalibType() ) {
455 
456  case TileLaserObject::calibType::Pedestal0:
457  if ( laserObj->isSet(0, 0, TileLaserObject::calibType::Pedestal0) ) { // Pedestal are set
458  for ( int diode=0; diode<NDIODES; ++diode ) {
459  for ( int gain=0; gain<NGAINS; gain++ ) {
460  m_diode_Ped_LASERII[diode][gain] = laserObj->getMean(diode, gain, TileLaserObject::calibType::Pedestal0);
461  m_diode_Ped_S_LASERII[diode][gain] = laserObj->getSigma(diode, gain, TileLaserObject::calibType::Pedestal0);
462  }
463  }
464 
465  // PMT0 is in position 10
466  for ( int gain=0; gain<NGAINS; gain++ ) {
467  m_PMT_Ped_LASERII[0][gain] = laserObj->getMean(10, gain, TileLaserObject::calibType::Pedestal0);
468  m_PMT_Ped_S_LASERII[0][gain] = laserObj->getSigma(10, gain, TileLaserObject::calibType::Pedestal0);
469  }
470 
471  // PMT1 is in position 14
472  for ( int gain=0; gain<NGAINS; gain++ ) {
473  m_PMT_Ped_LASERII[1][gain] = laserObj->getMean(14, gain, TileLaserObject::calibType::Pedestal0);
474  m_PMT_Ped_S_LASERII[1][gain] = laserObj->getSigma(14, gain, TileLaserObject::calibType::Pedestal0);
475  }
476 
477  // PHOCAL is in position 13
478  for ( int gain=0; gain<NGAINS; gain++ ) {
479  m_diode_Ped_LASERII[NDIODES][gain] = laserObj->getMean(13, gain, TileLaserObject::calibType::Pedestal0);
480  m_diode_Ped_S_LASERII[NDIODES][gain] = laserObj->getSigma(13, gain, TileLaserObject::calibType::Pedestal0);
481  }
482  m_have_pedestals = 1;
483  }
484  break;
485 
486  case TileLaserObject::calibType::Pedestal1:
487  break;
488 
489  case TileLaserObject::calibType::Alpha:
490  if ( laserObj->isSet(0, 0, TileLaserObject::calibType::Alpha) ) { // Alpha are set
491  for ( int diode=0; diode<NDIODES; ++diode ) {
492  for ( int gain=0; gain<NGAINS; gain++ ) {
493  m_diode_Alpha_LASERII[diode][gain] = laserObj->getMean(diode, gain, TileLaserObject::calibType::Alpha);
494  m_diode_Alpha_S_LASERII[diode][gain] = laserObj->getSigma(diode, gain, TileLaserObject::calibType::Alpha);
495  }
496  }
497  // PHOCAL
498  for ( int gain=0; gain<NGAINS; gain++ ) {
499  m_diode_Alpha_LASERII[NDIODES][gain] = laserObj->getMean(13, gain, TileLaserObject::calibType::Alpha);
500  m_diode_Alpha_S_LASERII[NDIODES][gain] = laserObj->getSigma(13, gain, TileLaserObject::calibType::Alpha);
501  }
502  m_have_alpha = 1;
503  }
504  break;
505 
506  case TileLaserObject::calibType::LED:
507  if ( laserObj->isSet(0, 0, TileLaserObject::calibType::LED) ) { // LED are set
508  for ( int diode=0; diode<NDIODES; ++diode ) {
509  for ( int gain=0; gain<NGAINS; gain++ ) {
510  m_diode_Led_LASERII[diode][gain] = laserObj->getMean(diode, gain, TileLaserObject::calibType::LED);
511  m_diode_Led_S_LASERII[diode][gain] = laserObj->getSigma(diode, gain, TileLaserObject::calibType::LED);
512  }
513  //PHOCAL
514  for ( int gain=0; gain<NGAINS; gain++ ) {
515  m_diode_Led_LASERII[NDIODES][gain] = laserObj->getMean(13, gain, TileLaserObject::calibType::LED);
516  m_diode_Led_S_LASERII[NDIODES][gain] = laserObj->getSigma(13, gain, TileLaserObject::calibType::LED);
517  }
518  }
519  m_have_led = 1;
520  }
521  break;
522 
523  default:
524  ATH_MSG_ERROR ("Got an invalid calibration type from LaserObject" );
525  return StatusCode::SUCCESS; // We can't do anything yet
526  break;
527  }
528  }
529 
530  if (! m_have_pedestals) return StatusCode::SUCCESS; // We can't do anything yet
531 
532  // Now we have pedestals, start accumulating the Diode responses
533  for ( int diode=0; diode<NDIODES; ++diode ) {
534  for ( int gain=0; gain<NGAINS; gain++ ) {
535  ATH_MSG_DEBUG ( text[gain] << diode << " PED= "
536  << m_diode_Ped_LASERII[diode][gain] << "+/-" << m_diode_Ped_S_LASERII[diode][gain]
537  << " ( " << laserObj->isSet(diode, gain, 0) << " ) "
538  );
539 
540  m_rs_diode_signal_LASERII[diode][gain]->Push( laserObj->getDiodeADC(diode,gain) -
541  m_diode_Ped_LASERII[diode][gain]);
542  normalization[diode][gain] = ((float)laserObj->getDiodeADC(diode,gain)-m_diode_Ped_LASERII[diode][gain]);
543  ATH_MSG_DEBUG ( text[gain] << diode << " Signal=" << normalization[diode][gain] << " " << m_rs_diode_signal_LASERII[diode][gain]->Mean() << " " << laserObj->getDiodeADC(diode,gain) << " Ped="<< m_diode_Ped_LASERII[diode][gain] );
544  }
545  }
546  for ( int gain=0; gain<NGAINS; ++gain ) {
547  for ( int diodei=0; diodei<NDIODES; diodei++ ) {
548  for ( int diodej=0; diodej<NDIODES; diodej++ ) {
549  if (diodej>=diodei){
550  if (gain==0){m_rs_diode_ratio_low[diodei][diodej]->Push(normalization[diodei][gain]/normalization[diodej][gain]);}
551  if (gain==1){m_rs_diode_ratio_high[diodei][diodej]->Push(normalization[diodei][gain]/normalization[diodej][gain]);}
552  }
553  }
554  }
555  }
556  // And also the PMT responses
557  for (int pmt=0; pmt<NPMTS; pmt++ ) {
558  for ( int gain=0; gain<NGAINS; gain++ ) {
560  }
561  }
562 
563  } else { // laserI
564 
565  for(int d=0; d<NDIODES_LASER1; ++d){
566  m_rs_diode_signal[d]->Push(laserObj->getDiodeADC(d,0)-laserObj->getDiodePedestal(d,0));
567  }
568 
569  for(int pmt=0; pmt<NPMTS; pmt++){
570  m_rs_PMT_signal[pmt]->Push(laserObj->getPMADC(pmt,0)-laserObj->getPMPedestal(pmt,0));
571  }
572 
573  // Check that adc information has been sent
574  if(laserObj->getPMADC(0,0) == m_PMT1_ADC_prev &&
575  laserObj->getPMADC(1,0) == m_PMT2_ADC_prev ){
576  m_ADC_problem = 1;
577  ATH_MSG_WARNING ( "There is perhaps an ADC problem with this event" );
578  } // IF
579 
580  m_PMT1_ADC_prev = laserObj->getPMADC(0,0); // LG
581  m_PMT2_ADC_prev = laserObj->getPMADC(1,0); // LG
582 
583  for(int d=0; d<NDIODES_LASER1; ++d){
584  m_diode_Ped[d] = laserObj->getDiodePedestal(d,0);
585  m_diode_SPed[d] = laserObj->getDiodeSigmaPedestal(d,0);
586  m_diode_Alpha[d] = laserObj->getAlpha(d,0);
587  m_diode_SAlpha[d] = laserObj->getSigmaAlpha(d,0);
588  }
589 
590  }
591 
592  // Next parameters are constants, don't need to update them more than once
593  if(m_las_filter == 0){
594  m_las_filter = laserObj->getFiltNumber();
595  m_hrate = laserObj->getHumidity();
596  m_flow = laserObj->getGasFlux();
597  m_head_temp = laserObj->getPumpDiodeTemp();
598  m_las_requ_amp = laserObj->getDiodeCurrOrd();
599  } // IF
600 
601  double Q1Q2[NCOUPLES-1][NCOUPLES];
602  for (int pmt1=0; pmt1<NCOUPLES-1; ++pmt1){
603  for (int pmt2=0; pmt2<NCOUPLES; ++pmt2){
604  Q1Q2[pmt1][pmt2]=0.;
605  }
606  }
607  //int currentDrawer=0;
608 
609  RunningStat* avg_time[NPARTITIONS][NGAINS];
610  for(int part=0; part<NPARTITIONS; part++){
611  for(int gain=0;gain<NGAINS;++gain){
612  avg_time[part][gain] = new RunningStat();
613  }
614  }
615  /*
616  Iterator over rawchannelcontainer
617  */
618  TileRawChannelUnit::UNIT RChUnit = rawCnt->get_unit();
620  TileRawChannelContainer::const_iterator itCollEnd = rawCnt->end();
621 
622  for ( itColl=rawCnt->begin(); itColl != itCollEnd; ++itColl ) { // Loop over tilerawchannelcollections to get avg time per partition
623  HWIdentifier drawer_id = m_tileHWID->drawer_id((*itColl)->identify());
624  int part = m_tileHWID->ros(drawer_id)-1; // LBA=0 LBC=1 EBA=2 EBC=3
625  // Loop over tilerawchannels in collection
626  for ( TileRawChannelCollection::const_iterator it = (*itColl)->begin(); it != (*itColl)->end(); ++it ) {
627  HWIdentifier hwid=(*it)->adc_HWID();
628  int gain = m_tileHWID->adc(hwid); // low=0 high=1
629  float ofctime = (*it)->time();
630  if(ofctime!=0.0 and std::abs(ofctime-15.0)<30.)
631  avg_time[part][gain]->Push(ofctime);
632  }
633  } // Now we have the average time per partition for this event
634 
635  for ( itColl=rawCnt->begin(); itColl != itCollEnd; ++itColl ) { // Loop over tilerawchannelcollections
636  HWIdentifier drawer_id = m_tileHWID->drawer_id((*itColl)->identify());
637  int ros = m_tileHWID->ros(drawer_id); // LBA=0 LBC=1 EBA=2 EBC=3
638  int part = ros-1;
639  int drawer = m_tileHWID->drawer(drawer_id); // 0 to 63
640  unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros,drawer);
641 
642  // Loop over tilerawchannels in collection
643  for ( TileRawChannelCollection::const_iterator it = (*itColl)->begin(); it != (*itColl)->end(); ++it ) {
644  // Get adchash
645  HWIdentifier hwid = (*it)->adc_HWID();
646  int chan = m_tileHWID->channel(hwid); // 0 to 47 channel
647  int gain = m_tileHWID->adc(hwid); // low=0 high=1
648  float amp = (*it)->amplitude();
649  float ofctime = (*it)->time();
650  float ped = (*it)->pedestal();
651  bool is_good = true;
652 
653  if(ofctime!=0.0) ofctime -= avg_time[part][gain]->Mean();
654 
655  if ( dqStatus->isChEmpty(ros,drawer,chan) ) { // Check whether channel is connected
656  m_status[part][drawer][chan][0] = -1;
657  m_status[part][drawer][chan][1] = -1;
658  continue; // Nothing to be seen here
659  }
660 
661  if ( !dqStatus->isAdcDQgood(ros,drawer,chan,gain) ) { // Masked on the fly
662  m_status[part][drawer][chan][gain] |= 0x10;
663  is_good = false;
664  }
665 
666  int problem = int(ped + 500.)/10000;
667 
668  switch (problem) {
669  case 1: // Underflow
670  m_status[part][drawer][chan][gain] |= 0x100;
671  is_good = false;
672  break;
673  case 2: // Overflow
674  m_status[part][drawer][chan][gain] |= 0x200;
675  is_good = false;
676  break;
677  case 3: // Under and Overflow
678  m_status[part][drawer][chan][gain] |= 0x400;
679  is_good = false;
680  break;
681  case 4: // Constant signal
682  m_status[part][drawer][chan][gain] |= 0x800;
683  is_good = false;
684  break;
685  case 8: // Underflow in all channels
686  m_status[part][drawer][chan][gain] |= 0x1000;
687  is_good = false;
688  break;
689  case 9: // Overflow in all channels
690  m_status[part][drawer][chan][gain] |= 0x2000;
691  is_good = false;
692  break;
693  }
694 
695  float ampInPicoCoulombs = m_tileToolEmscale->channelCalib(drawerIdx, chan, gain, amp, RChUnit, TileRawChannelUnit::PicoCoulombs);
696 
697  m_rs_time[part][drawer][chan][gain]->Push(ofctime);
698  m_rs_signal[part][drawer][chan][gain]->Push(ampInPicoCoulombs);
700 
701  if ( m_LASERII ) {
702  for(int diode=0; diode<NDIODES; ++diode){
703  for ( int diode_gain=0; diode_gain<NGAINS; diode_gain++ ) { // MONITORING DIODES
704  if ( normalization[diode][diode_gain]!=0. ){
705  if (is_good) m_rs_ratio_LASERII_good[diode][diode_gain][part][drawer][chan][gain]->Push( ampInPicoCoulombs/normalization[diode][diode_gain] );
706  m_rs_ratio_LASERII[diode][diode_gain][part][drawer][chan][gain]->Push( ampInPicoCoulombs/normalization[diode][diode_gain] );
707  }
708  } // Diode Gains
709  } // Diodes
710  if (is_good) m_entries[part][drawer][chan][gain]++;
711  } else {
712  for(int i=0; i<NDIODES_LASER1; ++i){
713  if((laserObj->getDiodeADC(i,0)-laserObj->getDiodePedestal(i,0)) != 0) {
714  if (is_good) m_rs_ratio_good[i][part][drawer][chan][gain]->Push(ampInPicoCoulombs/(laserObj->getDiodeADC(i,0)-laserObj->getDiodePedestal(i,0)));
715  m_rs_ratio[i][part][drawer][chan][gain]->Push(ampInPicoCoulombs/(laserObj->getDiodeADC(i,0)-laserObj->getDiodePedestal(i,0)));
716  }
717  } // FOR
718  if (is_good) m_entries[part][drawer][chan][gain]++;
719  } // ELSE
720 
721  if ((is_good) && (!(m_status[part][drawer][chan][gain]&0x4)) )
722  pmt_values[part][drawer][chan][gain]=ampInPicoCoulombs;
723  else
724  pmt_values[part][drawer][chan][gain]=0.;
725 
726  } // End of the loop over the TileRawChannelCollection
727  } // End of the loop over the TileRawChannelContainer
728 
729  int chan1;
730  int chan2;
731  for (int part=0; part<NPARTITIONS; part++){
732  for (int drawer=0; drawer<NDRAWERS; ++drawer){
733  for(int pmt1=0; pmt1<NCOUPLES-1; ++pmt1){
734  for (int pmt2=0; pmt2<NCOUPLES; ++pmt2){
735  Q1Q2[pmt1][pmt2]=0.;
736  }
737  }
738  //We compute <q1.q2> for odd PMTs
739  for (int gain=0; gain<NGAINS; ++gain){
740  for (int pmt1=0; pmt1<NCOUPLES-1; ++pmt1){
741  chan1 = int(getCoupleOfPMT(part, pmt1).second);
742  if (chan1==-1) continue;
743 
744  for (int pmt2=pmt1+1; pmt2<NCOUPLES; ++pmt2){
745  chan2 = int(getCoupleOfPMT(part, pmt2).second);
746  if (chan2==-1) continue;
747 
748  Q1Q2[pmt1][pmt2]= pmt_values[part][drawer][chan1][gain]*pmt_values[part][drawer][chan2][gain];
749  if (Q1Q2[pmt1][pmt2]>0.){
750  m_rs_reducedKappa[part][drawer][pmt1][pmt2][gain][1]->Push(Q1Q2[pmt1][pmt2]);
751  }//IF
752  }//pmt2
753  }//pmt1
754 
755  //We compute <q1.q2> for even PMTs
756  for (int pmt1=0; pmt1<NCOUPLES-1; ++pmt1){
757  chan1 = int(getCoupleOfPMT(part, pmt1).first);
758  if (chan1==-1) continue;
759  for (int pmt2=pmt1+1; pmt2<NCOUPLES; ++pmt2){
760  chan2=int(getCoupleOfPMT(part, pmt2).first);
761  if (chan2==-1)
762  continue;
763  Q1Q2[pmt1][pmt2]= pmt_values[part][drawer][chan1][gain]*pmt_values[part][drawer][chan2][gain];
764  if (Q1Q2[pmt1][pmt2]>0.){
765  m_rs_reducedKappa[part][drawer][pmt1][pmt2][gain][0]->Push(Q1Q2[pmt1][pmt2]);
766  }//IF
767  }//pmt2
768  }//pmt1
769 
770 
771  }//gain
772  }//drawer
773  }//part
774 
775 
776  for(int part=0; part<NPARTITIONS; part++){
777  for(int drawer=0; drawer<NDRAWERS; ++drawer){
778  for (int chan=0; chan<NCHANNELS; ++chan){
779  for(int gain=0;gain<NGAINS;++gain){
780  int chanref = 0;
781  if(part<2){
782  chanref = 24 + chan%2;
783  }
784  else{
785  switch (chan) {
786  case 31:
787  case 39:
788  case 41:
789  chanref = 38;
790  break;
791  case 32:
792  case 36:
793  case 40:
794  chanref = 37;
795  break;
796  default:
797  chanref = 38 - chan%2;
798  }
799  }
800  if(pmt_values[part][drawer][chanref][gain]>0.001){
801  m_rs_pmt_ratios[part][drawer][chan][gain]->Push(pmt_values[part][drawer][chan][gain]/pmt_values[part][drawer][chanref][gain]);
802  }
803 
804  }
805  }
806  }
807  }
808 
809  for (int part=0; part<NPARTITIONS; part++){
810  for(int gain=0;gain<NGAINS;++gain){
811  m_rs_meantime[part][gain]->Push(avg_time[part][gain]->Mean());
812  delete(avg_time[part][gain]);
813  } // FOR
814  } // FOR
815 
816  return StatusCode::SUCCESS;
817 } // EXECUTE
818 
819 
821  // COMPUTE CALIBRATION COEFFICIENT AT THE END OF THE EVENT LOOP
822  ATH_MSG_INFO ( "finalizeCalculations()" );
823 
824  // Loop over monitors
825  if ( m_LASERII ) { // LASERII
826 
827  for ( int diodei=0; diodei<NDIODES; diodei++ ) {
828  for ( int diodej=0; diodej<NDIODES; diodej++ ) {
829  if (diodej>=diodei){
830  m_diode_ratio_low[diodei][diodej]=m_rs_diode_ratio_low[diodei][diodej]->Mean();
831  m_diode_ratio_high[diodei][diodej]=m_rs_diode_ratio_high[diodei][diodej]->Mean();
832  m_diode_ratio_sigma_low[diodei][diodej]=m_rs_diode_ratio_low[diodei][diodej]->StandardDeviation();
833  m_diode_ratio_sigma_high[diodei][diodej]=m_rs_diode_ratio_high[diodei][diodej]->StandardDeviation();}
834  }
835  }
836 
837  for(int pmt=0; pmt<NPMTS; pmt++){
838  for ( int gain=0; gain<NGAINS; ++gain ) {
841  }
842  }
843  for(int d=0; d<NDIODES; ++d){
844  for ( int gain=0; gain<NGAINS; ++gain ) {
848  }
849  }
850  } else { // LASERI
851  for(int pmt=0; pmt<NPMTS; pmt++){
854  } // FOR
855 
856  for(int d=0; d<NDIODES_LASER1; ++d){
859  } // FOR
860  }
861 
862  // Loop over barrels, modules and gains
863  for ( int partition=0; partition<NPARTITIONS; partition++ ) {
864  for ( int gain=0; gain<NGAINS; ++gain ) {
866  }
867 
868  for ( int drawer=0; drawer<NDRAWERS; ++drawer ) {
869  for ( int gain=0; gain<NGAINS; ++gain ) {
870  /* Compute the average kappa correction factor for all event and odd pmts
871  Kappa is by definition: cov(q1,q2)/<q1>*<q2> average on all couples of
872  pmts q1, q2 receiving light from the same clear fiber (only 2 independent
873  kappa for each module) */
874  int nCouplesEven=0, nCouplesOdd=0;
875 
876  int chan1;
877  int chan2;
878  double q1;
879  double q2;
880 
881  //We evaluate kappa value for odd PMTs
882  for (int pmt1=0; pmt1<NCOUPLES-1; ++pmt1){
883  for (int pmt2=pmt1+1; pmt2<NCOUPLES; ++pmt2){
884  chan1 = getCoupleOfPMT(partition, pmt1).second;
885  chan2 = getCoupleOfPMT(partition, pmt2).second;
887  q2 = m_rs_signal[partition][drawer][chan2][gain]->Mean();
888 
889  if (q1*q2<=0){
890  continue;
891  }
892  if (m_rs_reducedKappa[partition][drawer][pmt1][pmt2][gain][1]->Mean() < q1*q2){
893  continue;
894  }
895  if ((m_rs_reducedKappa[partition][drawer][pmt1][pmt2][gain][1]->Mean()/(q1*q2)-1) > 0.01 ){
896  continue;
897  }
898  m_kappa[partition][drawer][1][gain] += (m_rs_reducedKappa[partition][drawer][pmt1][pmt2][gain][1]->Mean()/(q1*q2)-1);
899  if ( m_kappa[partition][drawer][1][gain]<0.){
900  ATH_MSG_DEBUG ( "Negative kappa value: " << m_kappa[partition][drawer][1][gain] );
901  }
902  nCouplesOdd++;
903  }// pmt2
904  }// pmt1
905 
906  //We evaluate kappa value for even PMTs
907  for (int pmt1=0; pmt1<NCOUPLES-1; ++pmt1){
908  for (int pmt2=pmt1+1; pmt2<NCOUPLES; ++pmt2){
909  chan1 = getCoupleOfPMT(partition, pmt2).first;
910  chan2 = getCoupleOfPMT(partition, pmt1).first;
912  q2 = m_rs_signal[partition][drawer][chan2][gain]->Mean();
913 
914  if (q1*q2<=0){
915  continue;
916  }
917  if (m_rs_reducedKappa[partition][drawer][pmt1][pmt2][gain][0]->Mean()<q1*q2){
918  continue;
919  }
920  if ((m_rs_reducedKappa[partition][drawer][pmt1][pmt2][gain][0]->Mean()/(q1*q2)-1) >0.01){
921  continue;
922  }
923  m_kappa[partition][drawer][0][gain] += (m_rs_reducedKappa[partition][drawer][pmt1][pmt2][gain][0]->Mean()/(q1*q2)-1);
924  nCouplesEven++;
925  if (m_kappa[partition][drawer][0][gain]<0.){
926  ATH_MSG_DEBUG ( "Negative kappa value: " << m_kappa[partition][drawer][0][gain] );
927  }// if
928  }// pmt2
929  }// pmt1
930 
931  if ( nCouplesEven!=0 ){
932  m_kappa[partition][drawer][0][gain] = m_kappa[partition][drawer][0][gain]/nCouplesEven;
933  if (m_kappa[partition][drawer][0][gain]>0.01){
934  ATH_MSG_DEBUG ( "Too big kappa value: " << m_kappa[partition][drawer][0][gain] << " " << nCouplesEven);
935  }
936  }
937  if ( nCouplesOdd!=0 ){
938  m_kappa[partition][drawer][1][gain] = m_kappa[partition][drawer][1][gain]/nCouplesOdd;
939  if ( m_kappa[partition][drawer][1][gain]>0.01){
940  ATH_MSG_DEBUG ( "Too big kappa value: " << m_kappa[partition][drawer][1][gain] << " " << nCouplesOdd );
941  }
942  }
943 
944  for(int channel=0; channel<NCHANNELS; ++channel){
951 
952  //-- V.Giangiobbe : save the average charge and variance in slices of m_eventsPerSlice=1000
953  if(m_pisaMethod2){
954  int nSlices = std::min(NSLICES,m_rs_signal[partition][drawer][channel][gain]->GetNSlices());
955  for(int iSlice=0; iSlice<nSlices; ++iSlice){
958  } // FOR
959  } // IF
960 
961  if (m_LASERII) { // Laser II
962 
963  for ( int diode=0; diode<NDIODES; diode++ ) {
964  for ( int diode_gain=0; diode_gain<NGAINS; diode_gain++) {
965  m_ratio_LASERII[diode][diode_gain][partition][drawer][channel][gain] = m_rs_ratio_LASERII[diode][diode_gain][partition][drawer][channel][gain]->Mean();
967  m_ratio_LASERII_good[diode][diode_gain][partition][drawer][channel][gain] = m_rs_ratio_LASERII_good[diode][diode_gain][partition][drawer][channel][gain]->Mean();
969  } // FOR
970  }
972  if (std::abs(m_rs_pmt_ratios[partition][drawer][channel][gain]->Mean())>100000.) {
973  ATH_MSG_DEBUG( "too big value for " << partition << " " << drawer << " " << channel << " " << gain << " "
974  << m_rs_pmt_ratios[partition][drawer][channel][gain]->NumDataValues() << "status" << m_status[partition][drawer][channel][gain] );
975  }
977 
978  } else { // Laser I
979 
980  for(int d=0; d<NDIODES_LASER1; ++d){
985  } // Laser 1 diodes
986 
987  }
988 
989  } // Channels
990  } // Gain
991  } // Drawer
992  } // Partition
993 
994 
996  // Store high voltage
997  for(int part=0; part<NPARTITIONS; ++part){
998  int ros = part+1;
999  for(int drawer=0; drawer<NDRAWERS; ++drawer){
1000  for(int channel=0; channel<NCHANNELS; ++channel){
1001  m_HV[part][drawer][channel] = m_tileDCS->getChannelHV(ros, drawer, channel);
1002  m_HVSet[part][drawer][channel] = m_tileDCS->getChannelHVSet(ros, drawer, channel);
1003  } // channel
1004  } // drawers
1005  } // partitions
1006 
1007  // remove all RunningStat objects from memory
1008 
1009 for ( int diodei=0; diodei<NDIODES; diodei++ ) {
1010  for ( int diodej=0; diodej<NDIODES; diodej++ ) {
1011  delete m_rs_diode_ratio_low[diodei][diodej];
1012  delete m_rs_diode_ratio_high [diodei][diodej];
1013  }
1014  }
1015 
1016  for ( int diode=0; diode<NDIODES; ++diode ) {
1017  for ( int gain=0; gain<NGAINS; gain++ ) {
1018  delete m_rs_diode_signal_LASERII[diode][gain];
1019  }
1020  }
1021 
1022  for(int pmt=0;pmt<NPMTS;++pmt){
1023  for ( int gain=0; gain<NGAINS; gain++ ) {
1024  delete m_rs_PMT_signal_LASERII[pmt][gain];
1025  }
1026  delete m_rs_PMT_signal[pmt];
1027  }
1028 
1029  for(int d=0; d<NDIODES_LASER1; ++d){
1030  delete m_rs_diode_signal[d];
1031  }
1032 
1033  for ( int part=0; part<NPARTITIONS; ++part ) {
1034  for ( int gain=0; gain<NGAINS; ++gain ) {
1035  delete m_rs_meantime[part][gain];
1036  }
1037 
1038  for ( int drawer=0; drawer<NDRAWERS; ++drawer ) {
1039  for ( int gain=0; gain<NGAINS; ++gain ) {
1040  for (int fiber=0; fiber<NFIBERS; ++fiber){
1041  for (int pmt1=0; pmt1<NCOUPLES-1; ++pmt1){
1042  for (int pmt2=pmt1+1; pmt2<NCOUPLES; ++pmt2){
1043  delete m_rs_reducedKappa[part][drawer][pmt1][pmt2][gain][fiber];
1044  }
1045  }
1046  }
1047 
1048  for ( int channel=0; channel<NCHANNELS; ++channel ) {
1049  delete m_rs_time[part][drawer][channel][gain];
1050  delete m_rs_signal[part][drawer][channel][gain];
1051  delete m_rs_raw_signal[part][drawer][channel][gain];
1052 
1053  for(int diode=0; diode<NDIODES; ++diode){
1054  for (int diode_gain=0; diode_gain<NGAINS; diode_gain++) {
1055  delete m_rs_ratio_LASERII[diode][diode_gain][part][drawer][channel][gain];
1056  delete m_rs_ratio_LASERII_good[diode][diode_gain][part][drawer][channel][gain];
1057  }
1058  }
1059 
1060  delete m_rs_pmt_ratios[part][drawer][channel][gain];
1061 
1062  for(int d=0; d<NDIODES_LASER1; ++d){
1063  delete m_rs_ratio[d][part][drawer][channel][gain];
1064  delete m_rs_ratio_good[d][part][drawer][channel][gain];
1065  }
1066 
1067  } // channel loop
1068  } // gain loop
1069  } // drawer loop
1070  } // partition loop
1071 
1072  return StatusCode::SUCCESS;
1073 } // FINALIZECALCULATIONS
1074 
1075 
1077  // CALLED FROM LASERCALIBALG TO STORE CALIBRATION COEFFICIENTS
1078  // STORES NTUPLE AS ROOT FILE
1079  ATH_MSG_INFO ( "finalize(" << runNumber << "," << runType << "," << rootFile << ")" );
1080 
1081  // CREATE OUTPUT TREE
1083 
1084  TTree *t = new TTree(m_toolNtuple.c_str(), "TileLaserCalib-Ntuple");
1085  t->Branch("RunNumber",&m_toolRunNo, "runNo/I");
1086  t->Branch("ADC_status",&m_ADC_problem, "ADC/I");
1087  t->Branch("WheelPos",&m_las_filter, "wheelpos/I");
1088  t->Branch("RequestedAmp",&m_las_requ_amp, "requamp/F");
1089  t->Branch("TimeRun",&m_las_time, "timeofrun/F");
1090  t->Branch("MeanTime",m_meantime,"meantime[4][2]/F");
1091  t->Branch("Time",*m_time,"time[4][64][48][2]/F");
1092  t->Branch("Sigma_Time",*m_time_S,"time_s[4][64][48][2]/F");
1093  t->Branch("Signal",*m_mean,"signal[4][64][48][2]/F");
1094  t->Branch("Sigma_Signal",*m_mean_S,"signal_s[4][64][48][2]/F");
1095  t->Branch("Raw_Signal",*m_raw_mean,"rawsignal[4][64][48][2]/F");
1096  t->Branch("Raw_Sigma_Signal",*m_raw_mean_S,"rawsignal_s[4][64][48][2]/F");
1097  t->Branch("LaserEntries",*m_entries,"LASER_entries[4][64][48][2]/I");
1098  t->Branch("Kappa",*m_kappa,"Kappa[4][64][2][2]/F");
1099  t->Branch("Status",*m_status,"Status[4][64][48][2]/S");
1100  t->Branch("HV",*m_HV,"HV[4][64][48]/F");
1101  t->Branch("HVSet",*m_HVSet,"HVSet[4][64][48]/F");
1102 
1103  if(m_LASERII){
1104  /* Laser II */
1105  t->Branch("PMT_Signal",*m_PMT_LASERII, "PMT[2][2]/F");
1106  t->Branch("PMT_Sigma_Signal",*m_PMT_S_LASERII, "PMT_s[2][2]/F");
1107 
1108  t->Branch("PMT_Ped",*m_PMT_Ped_LASERII, "PMT_Ped[2][2]/F");
1109  t->Branch("PMT_Sigma_Ped",*m_PMT_Ped_S_LASERII, "PMT_sPed[2][2]/F");
1110 
1111  t->Branch("Diode_Signal",*m_diode_LASERII, "diode[10][2]/F");
1112  t->Branch("Diode_Sigma_Signal",*m_diode_S_LASERII, "diode_s[10][2]/F");
1113  t->Branch("Diode_Entries", *m_entries_diode_LASERII, "diode_entries[10][2]/I");
1114 
1115  t->Branch("Diode_Ped",*m_diode_Ped_LASERII,"diode_Ped[11][2]/F");
1116  t->Branch("Diode_Sigma_Ped",*m_diode_Ped_S_LASERII,"diode_sPed[11][2]/F");
1117 
1118  t->Branch("Diode_Alpha",*m_diode_Alpha_LASERII,"diode_Alpha[11][2]/F");
1119  t->Branch("Diode_Sigma_Alpha",*m_diode_Alpha_S_LASERII,"diode_sAlpha[11][2]/F");
1120 
1121  t->Branch("Diode_Led",*m_diode_Led_LASERII,"diode_Led[11][2]/F");
1122  t->Branch("Diode_Sigma_Led",*m_diode_Led_S_LASERII,"diode_sLed[11][2]/F");
1123 
1124  t->Branch("Ratio",*m_ratio_LASERII,"signal_cor[10][2][4][64][48][2]/F");
1125  t->Branch("Sigma_Ratio",*m_ratio_S_LASERII,"signal_cor_s[10][2][4][64][48][2]/F");
1126  t->Branch("Ratio_good",*m_ratio_LASERII_good,"signal_cor_good[10][2][4][64][48][2]/F");
1127  t->Branch("Sigma_Ratio_good",*m_ratio_S_LASERII_good,"signal_cor_good_s[10][2][4][64][48][2]/F");
1128  t->Branch("Pmt_Ratio", *m_pmt_ratios, "pmt_ratio[4][64][48][2]/F");
1129  t->Branch("Sigma_Pmt_Ratio", *m_pmt_S_ratios, "pmt_ratio_s[4][64][48][2]/F");
1130 
1131  t->Branch("Diode_ratio_Low_Gain",*m_diode_ratio_low, "diode_ratio_low[10][10]/F");
1132  t->Branch("Diode_ratio_High_Gain",*m_diode_ratio_high, "diode_ratio_high[10][10]/F");
1133  t->Branch("Diode_ratio_Sigma_Low_Gain",*m_diode_ratio_sigma_low, "diode_ratio_sigma_low[10][10]/F");
1134  t->Branch("Diode_ratio_Sigma_High_Gain",*m_diode_ratio_sigma_high, "diode_ratio_sigma_high[10][10]/F");
1135 
1136 
1137  } else {
1138  /* Laser I */
1139  t->Branch("Humidity",&m_hrate,"humid/F");
1140  t->Branch("AirFlow",&m_flow,"flow/F");
1141  t->Branch("HeadTemp",&m_head_temp,"htemp/F");
1142 
1143  t->Branch("PMT1_Signal",&m_PMT[0], "PMT_1/F");
1144  t->Branch("PMT2_Signal",&m_PMT[1], "PMT_2/F");
1145  t->Branch("PMT_Sigma_Signal",m_PMT_S, "PMT_s[2]/F");
1146  t->Branch("Diode_Signal",m_diode, "diode[4]/F");
1147  t->Branch("Diode_Sigma_Signal",m_diode_S, "diode_s[4]/F");
1148  t->Branch("Diode_Ped",m_diode_Ped, "diode_Ped[4]/F");
1149  t->Branch("Diode_Sigma_Ped",m_diode_SPed, "diode_sPed[4]/F");
1150  t->Branch("Diode_Alpha",m_diode_Alpha, "diode_Alpha[4]/F");
1151  t->Branch("Diode_Sigma_Alpha",m_diode_SAlpha, "diode_sAlpha[4]/F");
1152 
1153  t->Branch("Ratio",*m_ratio,"signal_cor[4][4][64][48][2]/F");
1154  t->Branch("Sigma_Ratio",*m_ratio_S,"signal_cor_s[4][4][64][48][2]/F");
1155  t->Branch("Ratio",*m_ratio_good,"signal_cor_good[4][4][64][48][2]/F");
1156  t->Branch("Sigma_Ratio",*m_ratio_good_S,"signal_cor_good_s[4][4][64][48][2]/F");
1157  } // ELSE
1158 
1159  if(m_pisaMethod2){
1160  t->Branch("MeanSlice",*m_mean_slice,"MeanSlice[4][64][48][100][2]/F");
1161  t->Branch("VarianceSlice",*m_variance_slice,"VarianceSlice[4][64][48][100][2]/F");
1162  } // IF
1163 
1164  if (!m_stuckBitsProbs.empty()) {
1165  if (m_stuckBitsProbs.retrieve().isFailure()) {
1166  ATH_MSG_WARNING("Impossible to get ITileStuckBitsProbsTool and stuck bits probabilities!");
1167  } else {
1168  m_stuckBitsProbs->saveStuckBitsProbabilities(t);
1169  }
1170  }
1171 
1172  // Fill values for this run
1173  t->Fill();
1174 
1175  return StatusCode::SUCCESS;
1176 } // Write ntuple
1177 
1178 
1180  ATH_MSG_INFO ( "finalize()" );
1181  return StatusCode::SUCCESS;
1182 } // FInalize
1183 
1184 
1185 std::pair<unsigned int, unsigned int> TileLaserDefaultCalibTool::getCoupleOfPMT(int part, int couple){
1186  std::pair<unsigned int, unsigned int> coupleOfPMTs;
1187 
1188  int chanLBOdd[NCOUPLES] = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 33, 35, 37, 39, 41, 45, 47};
1189  int chanLBEven[NCOUPLES] = {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 34, 36, 38, 40, 42, 44, 46};
1190 
1191  int chanEBOdd[NCOUPLES] = {1, 3, 5, 7, 9, 11, 13, 15, 17, 21, 23, 32, 35, 36, 37, 40, -1, -1, -1, -1, -1, -1};
1192  int chanEBEven[NCOUPLES] = {0, 2, 4, 6, 8, 10, 12, 14, 16, 20, 22, 30, 31, 38, 39, 41, -1, -1, -1, -1, -1, -1};
1193 
1194  if (part<2){ //----LB
1195  coupleOfPMTs.first = chanLBEven[couple];
1196  coupleOfPMTs.second = chanLBOdd[couple];
1197  } else { //----EB
1198  coupleOfPMTs.first = chanEBEven[couple];
1199  coupleOfPMTs.second = chanEBOdd[couple];
1200  }
1201 
1202  return coupleOfPMTs;
1203 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
TileLaserDefaultCalibTool::m_diode
float m_diode[NDIODES_LASER1]
Definition: TileLaserDefaultCalibTool.h:158
TileLaserDefaultCalibTool::m_PMT
float m_PMT[NPMTS]
Definition: TileLaserDefaultCalibTool.h:156
TileLaserDefaultCalibTool::m_rs_reducedKappa
RunningStat *(* m_rs_reducedKappa)[NDRAWERS][NCOUPLES-1][NCOUPLES][NGAINS][NFIBERS]
Definition: TileLaserDefaultCalibTool.h:218
TileLaserDefaultCalibTool::m_time
float(* m_time)[NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:187
TileLaserDefaultCalibTool::m_diode_Led_LASERII
float(* m_diode_Led_LASERII)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:145
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
TileLaserDefaultCalibTool::m_LASERII
bool m_LASERII
Definition: TileLaserDefaultCalibTool.h:206
TileLaserDefaultCalibTool::m_dqStatusKey
SG::ReadHandleKey< TileDQstatus > m_dqStatusKey
Definition: TileLaserDefaultCalibTool.h:83
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TileLaserDefaultCalibTool::m_PMT_Ped_S_LASERII
float(* m_PMT_Ped_S_LASERII)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:152
NPMTS
#define NPMTS
Definition: TileLaserDefaultCalibTool.h:32
TileLaserDefaultCalibTool::m_diode_Alpha_LASERII
float(* m_diode_Alpha_LASERII)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:143
TileLaserDefaultCalibTool::m_diode_SAlpha
float m_diode_SAlpha[NDIODES_LASER1]
Definition: TileLaserDefaultCalibTool.h:163
NCOUPLES
#define NCOUPLES
Definition: TileLaserDefaultCalibTool.h:37
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
TileLaserDefaultCalibTool::m_PMT2_ADC_prev
int m_PMT2_ADC_prev
Definition: TileLaserDefaultCalibTool.h:204
TileLaserDefaultCalibTool::m_raw_mean
float(* m_raw_mean)[NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:192
TileLaserDefaultCalibTool::m_hrate
float m_hrate
Definition: TileLaserDefaultCalibTool.h:102
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TileLaserDefaultCalibTool::m_pisaMethod2
bool m_pisaMethod2
Definition: TileLaserDefaultCalibTool.h:71
TileCablingService::getInstance
static const TileCablingService * getInstance()
get pointer to service instance
Definition: TileCablingService.cxx:24
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TileLaserDefaultCalibTool::m_entries
int(* m_entries)[NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:194
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TileLaserDefaultCalibTool::m_have_pedestals
int m_have_pedestals
Definition: TileLaserDefaultCalibTool.h:208
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
hist_file_dump.d
d
Definition: hist_file_dump.py:137
TileLaserObject::isLASERII
bool isLASERII() const
Definition: TileLaserObject.h:214
TileLaserObject::getPumpDiodeTemp
double getPumpDiodeTemp() const
Definition: TileLaserObject.h:234
ReadBchFromCool.pmt
pmt
Definition: ReadBchFromCool.py:62
TileLaserDefaultCalibTool::m_ratio_good_S
float(* m_ratio_good_S)[NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:167
TileLaserDefaultCalibTool::m_diode_ratio_sigma_low
float(* m_diode_ratio_sigma_low)[NDIODES]
Definition: TileLaserDefaultCalibTool.h:173
TileLaserDefaultCalibTool::m_pmt_S_ratios
float(* m_pmt_S_ratios)[NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:169
TileLaserDefaultCalibTool::m_head_temp
float m_head_temp
Definition: TileLaserDefaultCalibTool.h:104
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
TileLaserDefaultCalibTool::m_PMT_S_LASERII
float(* m_PMT_S_LASERII)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:131
TileLaserDefaultCalibTool::m_diode_SPed
float m_diode_SPed[NDIODES_LASER1]
Definition: TileLaserDefaultCalibTool.h:162
TileLaserDefaultCalibTool::m_rawChannelContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
Definition: TileLaserDefaultCalibTool.h:84
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TileLaserObject::getAlpha
double getAlpha(const unsigned int i, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:138
TileLaserDefaultCalibTool::writeNtuple
virtual StatusCode writeNtuple(int runNumber, int runType, TFile *rootfile) override
Definition: TileLaserDefaultCalibTool.cxx:1076
TileLaserDefaultCalibTool::m_evtNr
long long m_evtNr
Definition: TileLaserDefaultCalibTool.h:207
TileLaserObject::getDiodeCurrOrd
double getDiodeCurrOrd() const
Definition: TileLaserObject.h:219
TileLaserDefaultCalibTool::m_ratio
float(* m_ratio)[NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:164
TileLaserDefaultCalibTool::m_diode_Alpha
float m_diode_Alpha[NDIODES_LASER1]
Definition: TileLaserDefaultCalibTool.h:161
NDIODES_LASER1
#define NDIODES_LASER1
Definition: TileLaserDefaultCalibTool.h:30
TileCalibUtils.h
TileLaserDefaultCalibTool::m_ratio_LASERII_good
float(* m_ratio_LASERII_good)[NGAINS][NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:110
TileLaserDefaultCalibTool::m_ratio_good
float(* m_ratio_good)[NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:166
TileLaserDefaultCalibTool::m_rs_ratio
RunningStat *(* m_rs_ratio)[NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:179
TileLaserDefaultCalibTool::m_mean_slice
float(* m_mean_slice)[NDRAWERS][NCHANNELS][NSLICES][NGAINS]
Definition: TileLaserDefaultCalibTool.h:196
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TileLaserObject.h
TileLaserObject::getVersion
int getVersion() const
Definition: TileLaserObject.h:209
TileRawChannelUnit::PicoCoulombs
@ PicoCoulombs
Definition: TileRawChannelUnit.h:18
HWIdentifier
Definition: HWIdentifier.h:13
TileLaserDefaultCalibTool::m_diode_Ped
float m_diode_Ped[NDIODES_LASER1]
Definition: TileLaserDefaultCalibTool.h:160
TileDQstatus::isChEmpty
static int isChEmpty(int partition, int drawer, int ch)
True if channel is not fully implemented.
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
TileLaserObject::isSet
bool isSet(int chan, int gain, int type) const
Definition: TileLaserObject.cxx:71
TileLaserDefaultCalibTool::m_rs_diode_signal
RunningStat * m_rs_diode_signal[NDIODES_LASER1]
Definition: TileLaserDefaultCalibTool.h:177
TileLaserDefaultCalibTool::m_rs_raw_signal
RunningStat *(* m_rs_raw_signal)[NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:217
TileHWID::channel
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
Definition: TileHWID.h:189
TileLaserDefaultCalibTool::execute
virtual StatusCode execute() override
Definition: TileLaserDefaultCalibTool.cxx:371
NGAINS
#define NGAINS
Definition: TileLaserDefaultCalibTool.h:34
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
TileLaserDefaultCalibTool::m_flow
float m_flow
Definition: TileLaserDefaultCalibTool.h:103
TileLaserDefaultCalibTool::m_diode_Ped_LASERII
float(* m_diode_Ped_LASERII)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:141
TileLaserObject::getPMADC
int getPMADC(const unsigned int j, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:195
TileHWID::ros
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
Definition: TileHWID.h:167
NFIBERS
#define NFIBERS
Definition: TileLaserDefaultCalibTool.h:40
TileLaserObject::getFiltNumber
int getFiltNumber() const
Definition: TileLaserObject.h:229
TileLaserDefaultCalibTool::m_mean
float(* m_mean)[NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:190
TileLaserDefaultCalibTool::m_raw_mean_S
float(* m_raw_mean_S)[NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:193
TileLaserDefaultCalibTool::TileLaserDefaultCalibTool
TileLaserDefaultCalibTool(const std::string &type, const std::string &name, const IInterface *pParent)
Definition: TileLaserDefaultCalibTool.cxx:39
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
TileLaserDefaultCalibTool::m_tileHWID
const TileHWID * m_tileHWID
Definition: TileLaserDefaultCalibTool.h:74
TileRawChannelContainer.h
TileLaserDefaultCalibTool::m_time_S
float(* m_time_S)[NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:188
TileLaserDefaultCalibTool::m_laserContainerKey
SG::ReadHandleKey< TileLaserObject > m_laserContainerKey
Definition: TileLaserDefaultCalibTool.h:86
NPARTITIONS
#define NPARTITIONS
Definition: TileLaserDefaultCalibTool.h:35
LArG4FSStartPointFilterLegacy.draw
draw
Definition: LArG4FSStartPointFilterLegacy.py:20
TileLaserDefaultCalibTool::~TileLaserDefaultCalibTool
virtual ~TileLaserDefaultCalibTool()
Definition: TileLaserDefaultCalibTool.cxx:144
RunningStat
Definition: TileLaserDefaultCalibTool.h:232
TileLaserObject::getHumidity
double getHumidity() const
Definition: TileLaserObject.h:264
TileDQstatus
Class that holds Data Quality fragment information and provides functions to extract the data quality...
Definition: TileDQstatus.h:49
NSLICES
#define NSLICES
Definition: TileLaserDefaultCalibTool.h:39
TileHWID::adc
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
Definition: TileHWID.h:193
TileLaserObject::getMean
double getMean(int chan, int gain, int type) const
Definition: TileLaserObject.cxx:41
TileLaserDefaultCalibTool::m_rs_ratio_good
RunningStat *(* m_rs_ratio_good)[NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:180
RunningStat::Variance
double Variance() const
Definition: TileLaserDefaultCalibTool.h:281
TileLaserDefaultCalibTool::m_toolRunNo
int m_toolRunNo
Definition: TileLaserDefaultCalibTool.h:98
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TileLaserDefaultCalibTool::m_rs_diode_ratio_low
RunningStat *(* m_rs_diode_ratio_low)[NDIODES]
Definition: TileLaserDefaultCalibTool.h:183
TileLaserDefaultCalibTool::m_diode_Alpha_S_LASERII
float(* m_diode_Alpha_S_LASERII)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:144
TileLaserDefaultCalibTool::m_ratio_S_LASERII
float(* m_ratio_S_LASERII)[NGAINS][NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:109
TileCablingService.h
TileLaserDefaultCalibTool::m_rs_ratio_LASERII
RunningStat *(* m_rs_ratio_LASERII)[NGAINS][NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:113
lumiFormat.i
int i
Definition: lumiFormat.py:85
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
TileLaserDefaultCalibTool::m_diode_Led_S_LASERII
float(* m_diode_Led_S_LASERII)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:146
TileLaserDefaultCalibTool::m_las_requ_amp
float m_las_requ_amp
Definition: TileLaserDefaultCalibTool.h:101
TileLaserDefaultCalibTool::m_diode_S
float m_diode_S[NDIODES_LASER1]
Definition: TileLaserDefaultCalibTool.h:159
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TileLaserDefaultCalibTool::m_HV
float(* m_HV)[NDRAWERS][NCHANNELS]
Definition: TileLaserDefaultCalibTool.h:199
master.flag
bool flag
Definition: master.py:29
TileLaserDefaultCalibTool::initialize
virtual StatusCode initialize() override
Definition: TileLaserDefaultCalibTool.cxx:205
RunningStat::Push
void Push(double x)
Definition: TileLaserDefaultCalibTool.h:244
TileLaserDefaultCalibTool::m_ratio_S
float(* m_ratio_S)[NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:165
TileLaserDefaultCalibTool.h
TileLaserDefaultCalibTool::m_ADC_problem
int m_ADC_problem
Definition: TileLaserDefaultCalibTool.h:99
TileLaserDefaultCalibTool::m_diode_LASERII
float(* m_diode_LASERII)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:134
NCHANNELS
#define NCHANNELS
Definition: TileLaserDefaultCalibTool.h:38
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IdentifiableContainerMT::end
const_iterator end() const
return const_iterator for end of container
Definition: IdentifiableContainerMT.h:242
makeComparison.rootFile
rootFile
Definition: makeComparison.py:27
python.LArCondContChannels.chan1
chan1
Definition: LArCondContChannels.py:666
TileLaserDefaultCalibTool::m_entries_diode_LASERII
int(* m_entries_diode_LASERII)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:136
NDRAWERS
#define NDRAWERS
Definition: TileLaserDefaultCalibTool.h:36
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:82
TileLaserDefaultCalibTool::m_las_filter
int m_las_filter
Definition: TileLaserDefaultCalibTool.h:100
TileLaserObject::getCalibType
int getCalibType() const
Definition: TileLaserObject.cxx:82
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition: IdentifiableContainerMT.h:236
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
TileLaserDefaultCalibTool::m_diode_ratio_high
float(* m_diode_ratio_high)[NDIODES]
Definition: TileLaserDefaultCalibTool.h:172
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
TileLaserDefaultCalibTool::getCoupleOfPMT
static std::pair< unsigned int, unsigned int > getCoupleOfPMT(int ros, int couple)
Definition: TileLaserDefaultCalibTool.cxx:1185
TileLaserDefaultCalibTool::m_diode_ratio_low
float(* m_diode_ratio_low)[NDIODES]
Definition: TileLaserDefaultCalibTool.h:171
TileLaserDefaultCalibTool::m_rs_pmt_ratios
RunningStat *(* m_rs_pmt_ratios)[NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:181
TileRawChannelUnit::UNIT
UNIT
Definition: TileRawChannelUnit.h:16
python.OnlineISConfiguration.runType
def runType
Definition: OnlineISConfiguration.py:112
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TileLaserDefaultCalibTool::m_ratio_LASERII
float(* m_ratio_LASERII)[NGAINS][NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:108
TileDQstatus::isAdcDQgood
bool isAdcDQgood(int partition, int drawer, int ch, int gain) const
returns status of single ADC returns False if there are any errors
Definition: TileDQstatus.cxx:178
RunningStat::Mean
double Mean() const
Definition: TileLaserDefaultCalibTool.h:280
min
#define min(a, b)
Definition: cfImp.cxx:40
TileLaserDefaultCalibTool::m_toolNtuple
std::string m_toolNtuple
Definition: TileLaserDefaultCalibTool.h:66
TileLaserDefaultCalibTool::m_rs_signal
RunningStat *(* m_rs_signal)[NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:216
TileLaserDefaultCalibTool::m_stuckBitsProbs
ToolHandle< ITileStuckBitsProbsTool > m_stuckBitsProbs
Definition: TileLaserDefaultCalibTool.h:80
TileLaserObject::getQDCTimeout
bool getQDCTimeout() const
Definition: TileLaserObject.h:314
TileLaserDefaultCalibTool::m_rs_PMT_signal_LASERII
RunningStat *(* m_rs_PMT_signal_LASERII)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:132
TileLaserObject::getDiodeSigmaPedestal
double getDiodeSigmaPedestal(const unsigned int i, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:123
RunningStat::NumDataValues
int NumDataValues() const
Definition: TileLaserDefaultCalibTool.h:279
TileHWID::drawer_id
HWIdentifier drawer_id(int frag) const
ROS HWIdentifer.
Definition: TileHWID.cxx:187
HWIdentifier.h
TileLaserDefaultCalibTool::m_tileBadChanTool
ToolHandle< ITileBadChanTool > m_tileBadChanTool
Definition: TileLaserDefaultCalibTool.h:78
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TileLaserObject::getDiodeADC
int getDiodeADC(const unsigned int i, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:95
TileLaserDefaultCalibTool::m_diode_S_LASERII
float(* m_diode_S_LASERII)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:135
TileLaserDefaultCalibTool::finalize
virtual StatusCode finalize() override
Definition: TileLaserDefaultCalibTool.cxx:1179
TileLaserDefaultCalibTool::m_PMT_Ped_LASERII
float(* m_PMT_Ped_LASERII)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:151
TileLaserDefaultCalibTool::m_tileToolEmscale
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
Definition: TileLaserDefaultCalibTool.h:76
TileLaserObject::getPMPedestal
double getPMPedestal(const unsigned int j, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:223
TileDQstatus::cispar
const uint32_t * cispar() const
CIS parameters.
Definition: TileDQstatus.h:152
TileLaserDefaultCalibTool::m_PMT1_ADC_prev
int m_PMT1_ADC_prev
Definition: TileLaserDefaultCalibTool.h:203
TileLaserDefaultCalibTool::m_cabling
const TileCablingService * m_cabling
Definition: TileLaserDefaultCalibTool.h:75
TileLaserDefaultCalibTool::m_rs_ratio_LASERII_good
RunningStat *(* m_rs_ratio_LASERII_good)[NGAINS][NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:114
TileLaserDefaultCalibTool::m_HVSet
float(* m_HVSet)[NDRAWERS][NCHANNELS]
Definition: TileLaserDefaultCalibTool.h:200
Example_ReadSampleNoise.ped
ped
Definition: Example_ReadSampleNoise.py:45
TileLaserDefaultCalibTool::m_ratio_S_LASERII_good
float(* m_ratio_S_LASERII_good)[NGAINS][NPARTITIONS][NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:111
TileLaserDefaultCalibTool::m_las_time
float m_las_time
Definition: TileLaserDefaultCalibTool.h:105
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
RunningStat::StandardDeviation
double StandardDeviation() const
Definition: TileLaserDefaultCalibTool.h:282
TileLaserDefaultCalibTool::m_status
short(* m_status)[NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:198
TileHWID::drawer
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
Definition: TileHWID.h:171
TileRawDataContainer::get_unit
UNIT get_unit() const
Definition: TileRawDataContainer.h:60
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TileLaserDefaultCalibTool::m_rs_diode_signal_LASERII
RunningStat *(* m_rs_diode_signal_LASERII)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:138
TileLaserDefaultCalibTool::m_have_led
int m_have_led
Definition: TileLaserDefaultCalibTool.h:210
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DeMoScan.first
bool first
Definition: DeMoScan.py:536
TileLaserDefaultCalibTool::m_tileDCS
ToolHandle< ITileDCSTool > m_tileDCS
Definition: TileLaserDefaultCalibTool.h:89
StateLessPT_NewConfig.partition
partition
Definition: StateLessPT_NewConfig.py:49
TileLaserObject::getDiodePedestal
double getDiodePedestal(const unsigned int i, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:109
TileLaserDefaultCalibTool::m_diode_ratio_sigma_high
float(* m_diode_ratio_sigma_high)[NDIODES]
Definition: TileLaserDefaultCalibTool.h:174
NDIODES
#define NDIODES
Definition: TileLaserDefaultCalibTool.h:29
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
TileLaserDefaultCalibTool::m_variance_slice
float(* m_variance_slice)[NDRAWERS][NCHANNELS][NSLICES][NGAINS]
Definition: TileLaserDefaultCalibTool.h:197
TileLaserDefaultCalibTool::m_diode_Ped_S_LASERII
float(* m_diode_Ped_S_LASERII)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:142
merge.status
status
Definition: merge.py:17
TileLaserObject::getGasFlux
double getGasFlux() const
Definition: TileLaserObject.h:254
TileLaserDefaultCalibTool::m_PMT_LASERII
float(* m_PMT_LASERII)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:130
TileCalibUtils::getDrawerIdx
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Definition: TileCalibUtils.cxx:60
TileLaserDefaultCalibTool::m_kappa
float(* m_kappa)[NDRAWERS][NFIBERS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:195
TileLaserDefaultCalibTool::initNtuple
virtual StatusCode initNtuple(int runNumber, int runType, TFile *rootfile) override
Definition: TileLaserDefaultCalibTool.cxx:365
ReadHandle.h
Handle class for reading from StoreGate.
AthAlgTool
Definition: AthAlgTool.h:26
TileLaserObject::getSigmaAlpha
double getSigmaAlpha(const unsigned int i, const unsigned int gain=0) const
Definition: TileLaserObject.cxx:152
TileLaserDefaultCalibTool::m_have_alpha
int m_have_alpha
Definition: TileLaserDefaultCalibTool.h:209
TileLaserObject::getDaqType
int getDaqType() const
Definition: TileLaserObject.h:325
TileLaserDefaultCalibTool::m_rs_PMT_signal
RunningStat * m_rs_PMT_signal[NPMTS]
Definition: TileLaserDefaultCalibTool.h:178
TileLaserDefaultCalibTool::m_have_laser
int m_have_laser
Definition: TileLaserDefaultCalibTool.h:212
TileLaserDefaultCalibTool::m_rs_diode_ratio_high
RunningStat *(* m_rs_diode_ratio_high)[NDIODES]
Definition: TileLaserDefaultCalibTool.h:184
readCCLHist.float
float
Definition: readCCLHist.py:83
LArMonTransforms.Mean
def Mean(inputs)
Definition: LArMonTransforms.py:438
TileLaserDefaultCalibTool::m_PMT_S
float m_PMT_S[NPMTS]
Definition: TileLaserDefaultCalibTool.h:157
TileLaserDefaultCalibTool::m_pmt_ratios
float(* m_pmt_ratios)[NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:168
TileLaserDefaultCalibTool::m_have_linearity
int m_have_linearity
Definition: TileLaserDefaultCalibTool.h:211
TileLaserDefaultCalibTool::m_meantime
float(* m_meantime)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:186
TileLaserDefaultCalibTool::m_mean_S
float(* m_mean_S)[NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:191
TileLaserObject::getSigma
double getSigma(int chan, int gain, int type) const
Definition: TileLaserObject.cxx:49
TileLaserDefaultCalibTool::finalizeCalculations
virtual StatusCode finalizeCalculations() override
Definition: TileLaserDefaultCalibTool.cxx:820
TileLaserDefaultCalibTool::m_rs_time
RunningStat *(* m_rs_time)[NDRAWERS][NCHANNELS][NGAINS]
Definition: TileLaserDefaultCalibTool.h:215
TileLaserDefaultCalibTool::m_rs_meantime
RunningStat *(* m_rs_meantime)[NGAINS]
Definition: TileLaserDefaultCalibTool.h:214