ATLAS Offline Software
TileCisDefaultCalibTool.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 // Gaudi includes
6 #include "GaudiKernel/IToolSvc.h"
7 #include "GaudiKernel/MsgStream.h"
8 #include "GaudiKernel/Service.h"
9 #include "GaudiKernel/ThreadLocalContext.h"
10 
12 
13 // Athena includes
15 #include "StoreGate/ReadHandle.h"
16 
17 // Tile includes
24 
25 
26 #include "TFile.h"
27 #include "TTree.h"
28 #include "TObjString.h"
29 #include "TF1.h"
30 #include "TGraphErrors.h"
31 #include "TMap.h"
32 #include "TMath.h"
33 #include <cmath>
34 
35 TileCisDefaultCalibTool::TileCisDefaultCalibTool(const std::string& type, const std::string& name,
36  const IInterface* pParent)
37  : AthAlgTool(type, name, pParent)
38  , m_tileHWID(nullptr)
39  , m_cabling(nullptr)
40  , m_cablingSvc("TileCablingSvc", name)
41  , m_scanMap(nullptr)
42  , m_scanMapRMS(nullptr)
43  , m_tileInfo(nullptr)
44 {
45  declareInterface<ITileCalibTool>(this);
46 
47  declareProperty("NtupleID", m_ntupleID = "h3000");
48 
49  declareProperty("removePed", m_removePed = true);
50  declareProperty("useSmallCap", m_useSmallCap = false);
51  declareProperty("phaseMin", m_phaseMin = -10);
52  declareProperty("phaseMax", m_phaseMax = 300);
53 
54  declareProperty("maxPed", m_maxPed = 45.);
55 
56  declareProperty("chargeMinHi", m_chargeMinHi = 0.5);
57  declareProperty("chargeMaxHi", m_chargeMaxHi = 12.5);
58  declareProperty("chargeMinLo", m_chargeMinLo = 31.5);
59  declareProperty("chargeMaxLo", m_chargeMaxLo = 800.0);
60 
61  declareProperty("linfitMinHi", m_linfitMinHi = 3.0);
62  declareProperty("linfitMaxHi", m_linfitMaxHi = 10.0);
63  declareProperty("linfitMinLo", m_linfitMinLo = 300.0);
64  declareProperty("linfitMaxLo", m_linfitMaxLo = 700.0);
65 
66  declareProperty("linfitMinHiDemo", m_linfitMinHiDemo = 6.0);
67  declareProperty("linfitMaxHiDemo", m_linfitMaxHiDemo = 20.0);
68  declareProperty("linfitMinLoDemo", m_linfitMinLoDemo = 300.0);
69  declareProperty("linfitMaxLoDemo", m_linfitMaxLoDemo = 700.0);
70 
71  declareProperty("doSampleChecking", m_doSampleChecking = true); // do sample checking by default
72  declareProperty("TileDQstatus", m_dqStatusKey = "TileDQstatus");
73  declareProperty("TileInfoName", m_infoName = "TileInfo");
74 
75  declareProperty("FragIDsDemonstrators", m_fragIDsDemonstrators, "List of Tile frag IDs of demonstrators, which have different CIS circuits than the legacy ones");
76 
77  // Initialize arrays for results
83 
84  // Initialize sample check arrays
87 
91 }
92 
94 
95  delete[] m_calib;
96  delete[] m_qflag;
97  delete[] m_nDAC;
98  delete[] m_nDigitalErrors;
99  delete[] m_chi2;
100  delete[] m_edgeSample;
101  delete[] m_nextToEdgeSample;
102  delete[] m_sampleBit;
103  delete[] m_bitStatus;
104  delete[] m_numSamp;
105 
106 }
107 
109  ATH_MSG_INFO( "initialize()" );
110 
111  // get TileHWID helper
113 
114  // get TileCabling Service
115  CHECK( m_cablingSvc.retrieve() );
116  m_cabling = m_cablingSvc->cablingService();
117  int runPeriod = m_cabling->runPeriod();
118 
119  if (runPeriod==3) {
120  std::vector<int> v = { 0x10d }; // LBA14 is demonstrator in RUN3
121 
122  if ( m_fragIDsDemonstrators.size() == 0) {
124  }
125  }
126 
127  if ( m_fragIDsDemonstrators.size() != 0) {
128 
129  std::sort(m_fragIDsDemonstrators.begin(),m_fragIDsDemonstrators.end());
130 
131  std::ostringstream os;
132  for (int fragID : m_fragIDsDemonstrators) {
133  os << " 0x" << std::hex << fragID << std::dec;
134  }
135 
136  ATH_MSG_INFO("Special settings in histograms for demonstrator modules (frag IDs):" << os.str());
137  }
138 
140 
141  // get TileInfo
143 
144  // set important constants
145  m_dac2Charge[0] = 100.* 2.0 * 4.096 / double(m_tileInfo->ADCmax()); // 100 pF * 2 for legacy
146  m_dac2Charge[1] = 5.2 * 2.0 * 4.096 / double(m_tileInfo->ADCmax()); // effective 5.2 pF * 2 for 5 pF capacitor
147  m_dac2Charge[2] = 200.* 4.096 / double(m_tileInfo->ADCmax()); // 200 pF for demonstrator - similar to legacy
148  m_dac2Charge[3] = 5.2 * 4.096 / double(m_tileInfo->ADCmax()); // effective value of small capacitor is twice smaller for demonstrator
149 
150  // the same overflow limit for the moment, can be changed later
155 
156  m_defaultCalib[0] = 1.29;
157  m_defaultCalib[1] = 81.8;
159  m_defaultCalib[3] = m_defaultCalib[1] / 2;
160 
161  if (!m_useSmallCap) {
165  m_chargeMin[3] = m_chargeMinHi * 2;
166  }
167 
171  m_chargeMax[3] = m_chargeMaxHi * 2; // high gain in demo is up to 25 pC istead of 12.5 pC
172 
177 
182 
185 
186  return StatusCode::SUCCESS;
187 }
188 
190  ATH_MSG_INFO( "initialize(" << runNumber << "," << runType << "," << rootFile << ")" );
191 
192  return StatusCode::SUCCESS;
193 }
194 
196 
197  ATH_MSG_DEBUG( "execute()" );
198 
199  // Get the DQ digital check information
200  const EventContext& ctx = Gaudi::Hive::currentContext();
201  const TileDQstatus* theDQstatus = SG::makeHandle (m_dqStatusKey, ctx).get();
202 
203  // Get event's CIS parameters
204  const uint32_t *cispar = theDQstatus->cispar();
205  uint32_t dac = cispar[6];
206  uint32_t phase = cispar[5];
207  uint32_t cap = cispar[7];
208  int cap_ind = (cap > 10) ? 0 : 1; // 100 pF or 5 pF
209  double chargeAll[4];
210  for (int i=0; i<4; ++i)
211  chargeAll[i] = dac * m_dac2Charge[i];
212 
213  // Check if event should be used in calibration
214  bool pass = true;
215  if (cap == 100 && m_useSmallCap)
216  pass = false;
217  else if (cap == 5 && !m_useSmallCap) pass = false;
218  if (phase > m_phaseMax) pass = false;
219  if (phase < m_phaseMin) pass = false;
220  if (cispar[6] == 120) { // Reject garbage events at the beginning of files. This DAQ
221  pass = false; // setting isn't used during a normal CIS scan FYI.
222  }
223 
224  // Get TileRawChannelContainer
226  ATH_CHECK( container.isValid() );
227 
228  // Create iterator over RawChannelContainer
229  TileRawChannelContainer::const_iterator itColl = (*container).begin();
230  TileRawChannelContainer::const_iterator itCollEnd = (*container).end();
232 
233  if (pass) {
234 
235  // Go through all TileRawChannelCollections
236  for (; itColl != itCollEnd; ++itColl) {
237 
238  int fragId = (*itColl)->identify();
239  bool demonstrator = (std::binary_search(m_fragIDsDemonstrators.begin(), m_fragIDsDemonstrators.end(), fragId));
240  int gain_offset = (demonstrator) ? 2 : 0;
241  double charge = chargeAll[cap_ind+gain_offset];
242 
243  // go through all TileRawChannels in collection
244  it = (*itColl)->begin();
245  itEnd = (*itColl)->end();
246 
247  for (; it != itEnd; ++it) {
248 
249  // get hardware id to identify adc channel
250  HWIdentifier hwid = (*it)->adc_HWID();
251  int ros = m_tileHWID->ros(hwid); // LBA=1 LBC=2 EBA=3 EBC=4
252  int drawer = m_tileHWID->drawer(hwid); // 0 to 63
253  int chan = m_tileHWID->channel(hwid); // 0 to 47 channel not PMT
254  int gain = m_tileHWID->adc(hwid); // low=0 high=1
255 
256  // check if channel is connected
257  // if( !chanIsConnected(ros,chan) ) continue;
258 
259  // Is channel empty? DQ version
260  if (theDQstatus->isChEmpty(ros, drawer, chan)) continue;
261 
262  // find dac maps for adc channel
263  TDACIntMap *NEvtDacMap = (m_NEvtMap)[hwid];
264  TDACIntMap *NDigitalErrorsDacMap = (m_NDigitalErrorsMap)[hwid];
265  TDACDoubleMap *MeanDacMap = (m_MeanMap)[hwid];
266  TDACDoubleMap *MeanSqDacMap = (m_MeanSqMap)[hwid];
267 
268  // create new dac maps if they don't exist
269  if (NEvtDacMap == nullptr) {
270  NEvtDacMap = (m_NEvtMap)[hwid] = new TDACIntMap;
271  NDigitalErrorsDacMap = (m_NDigitalErrorsMap)[hwid] = new TDACIntMap;
272  MeanDacMap = (m_MeanMap)[hwid] = new TDACDoubleMap;
273  MeanSqDacMap = (m_MeanSqMap)[hwid] = new TDACDoubleMap;
274  }
275 
276  // check that charge is less than chargeMax (depends on gain)
277  if (charge > m_chargeMin[gain+gain_offset] && charge < m_chargeMax[gain+gain_offset]) {
278 
279  double amp = (*it)->amplitude();
280 
281  // Hack to get rid of pedestal events: need more sophisticated method!
282  if ( (amp > 40.) || (gain == 0 && amp > 6.) || (!m_removePed) ) {
283 
284  // Digital error check
285  if (!(theDQstatus->isAdcDQgood(ros, drawer, chan, gain))) {
286  ATH_MSG_DEBUG( "Skipping Module: " << ros << drawer + 1
287  << " channel: " << chan
288  << " ADC: " << gain
289  << " due to DQ error found." );
290 
291  (*NDigitalErrorsDacMap)[dac] += 1;
292  continue;
293 
294  } else {
295 
296  // increment entries for current dac value
297  (*NEvtDacMap)[dac] += 1;
298  (*MeanDacMap)[dac] += amp;
299  (*MeanSqDacMap)[dac] += amp*amp;
300  }
301 
302  }
303 
304  } // end if (min < charge < max)
305  }
306  }
307  } // end if pass
308 
309  if (m_doSampleChecking) {
310  // Get TileDigitsContainer
312  ATH_CHECK( digContainer.isValid() );
313 
314  // Create iterator over RawDigitsContainer
315  TileDigitsContainer::const_iterator digItColl = digContainer->begin();
316  TileDigitsContainer::const_iterator digItCollEnd = digContainer->end();
317 
318  for (; digItColl != digItCollEnd; ++digItColl) {
319 
320  TileDigitsCollection::const_iterator digIt = (*digItColl)->begin();
321  TileDigitsCollection::const_iterator digItEnd = (*digItColl)->end();
322 
323  if (digIt != digItEnd) {
324 
325  int fragId = (*digItColl)->identify();
326  bool demonstrator = (std::binary_search(m_fragIDsDemonstrators.begin(), m_fragIDsDemonstrators.end(), fragId));
327  int gain_offset = (demonstrator) ? 2 : 0;
328  double charge = chargeAll[cap_ind+gain_offset];
329 
330  HWIdentifier adc_id = (*digIt)->adc_HWID();
331  int ros = m_tileHWID->ros(adc_id); // LBA=1 LBC=2 EBA=3 EBC=4
332  int drawer = m_tileHWID->drawer(adc_id); // 0 to 63
333 
334  // not clear how to handle this. if not 7 get off? MM - 4 June 2009
335  int numSamples = (*digIt)->NtimeSamples();
336  if (numSamples != 7) {
337  m_doSampleChecking = false;
338  break;
339  }
340 
341  for (; digIt != digItEnd; ++digIt) {
342 
343  adc_id = (*digIt)->adc_HWID();
344  int chan = m_tileHWID->channel(adc_id); // 0 to 47 channel not PMT
345  int gain = m_tileHWID->adc(adc_id); // low=0 high=1
346 
347  std::vector<float> theDigits = (*digIt)->samples();
348 
349  //MM - skip channels with digital errors
350  if (!(theDQstatus->isAdcDQgood(ros, drawer, chan, gain))) {
351  continue;
352  }
353 
354  // Loop over samples for bit analysis
355  // We don't need to use the same cuts as the "Edge Sample" analysis
356  for(unsigned int sampNum = 0; sampNum < theDigits.size(); sampNum++) {
357 
358  // Count the total number of samples taken by an ADC
359  m_numSamp[ros][drawer][chan][gain] += 1;
360  int k = 0;
361  int quotient = theDigits[sampNum];
362 
363  // convert sample to binary number
364  while(quotient!=0) {
365  if((quotient % 2) == 1) {
366  // If the bit is one, store info in the array
367  m_sampleBit[ros][drawer][chan][gain][k] += 1;
368  }
369 
370  quotient = quotient / 2;
371  k += 1;
372  } // end binary conversion
373  } //end sample loop
374 
375  if (pass && charge > m_linfitMin[gain+gain_offset] && charge < m_linfitMax[gain+gain_offset]) {
376 
377  std::vector<float> theDigits = (*digIt)->samples();
378  float maxSampVal = -1.;
379  int maxSampNum = -1;
380 
381  for (unsigned int sampNum = 0; sampNum < theDigits.size(); sampNum++) {
382  if (theDigits[sampNum] > maxSampVal) {
383  maxSampVal = theDigits[sampNum];
384  maxSampNum = sampNum + 1;
385  }
386  }
387 
388  if (maxSampNum == 1 || maxSampNum == 7) {
389  m_edgeSample[ros][drawer][chan][gain] = 1;
390  } else if (maxSampNum == 2 || maxSampNum == 6) {
392  }
393 
394  } // end digits iterator
395  }
396  } // end digits collections
397 
398  } // end if pass
399 
400  } // end m_doSampleChecking
401 
402  return StatusCode::SUCCESS;
403 }
404 
406 
407  ATH_MSG_INFO( "finalizeCalculations()" );
408 
409  // The values of 81.454 and 1.295 were derived from runs:
410  // 72652 73305 72653 72661 79259 78023 79781 78026
411  // to calibrate the detector, and looking at the mean good calibration value
412  double meanCalib[4];
413  meanCalib[0] = 1.295;
414  meanCalib[1] = 81.454;
415  // values for demonstrator were taken from run 416970
416  meanCalib[2] = 1.26282;
417  meanCalib[3] = 40.9303;
418 
419  // hardware id (key to maps)
420  HWIdentifier hwid;
421 
422  // dac maps
423  TDACDoubleMap* MeanDacMap;
424  TDACDoubleMap* MeanSqDacMap;
425  TDACIntMap* NEvtDacMap;
426  TDACIntMap* NDigitalErrorsDacMap;
427 
428  // count number of points in dac map (for TGraph)
429  int npt, pt;
430 
431  // temporary objects for loop
432  TGraphErrors* gr;
433  TGraphErrors* grrms;
434  uint32_t dac;
435  double charge, mean, mean2, meansq, rms, err, ratio;
436  int nevt, ndigerr = 0;
437  int badPts;
438  double maxRMS;
439  double maxPointInFitRange;
440 
441  // linear fit for the calibration factor
442  TF1 *fslope = new TF1("fslope", "[0]*x", 0, 1000);
443 
444  m_scanMap = new TMap(20000, 1);
445  m_scanMapRMS = new TMap(20000, 1);
446 
447  // iterators over adc maps
448  TAdcDoubleMapIter adcIter(m_MeanMap.begin());
449  TAdcDoubleMapIter adcIterE(m_MeanMap.end());
450 
451  // loop over all adcs
452  for (; adcIter != adcIterE; ++adcIter) {
453  hwid = (adcIter)->first;
454  MeanDacMap = (adcIter)->second;
455  MeanSqDacMap = m_MeanSqMap[hwid];
456  NEvtDacMap = m_NEvtMap[hwid];
457  NDigitalErrorsDacMap = m_NDigitalErrorsMap[hwid];
458 
459  int ros = m_tileHWID->ros(hwid); // LBA=1 LBC=2 EBA=3 EBC=4
460  int drawer = m_tileHWID->drawer(hwid); // 0 to 63
461  int chan = m_tileHWID->channel(hwid); // 0 to 47 channel not PMT
462  int gain = m_tileHWID->adc(hwid); // low=0 high=1
463 
464  int fragId = (ros << 8) | drawer;
465  bool demonstrator = (std::binary_search(m_fragIDsDemonstrators.begin(), m_fragIDsDemonstrators.end(), fragId));
466  int gain_offset = (demonstrator) ? 2 : 0;
467  int gain_ind = gain + gain_offset;
468  int cap_ind = (m_useSmallCap) ? 1 : 0;
469  double dac2Charge = m_dac2Charge[cap_ind+gain_offset];
470  double prevMean = 0.0, deltaMean = 0.0, averSlope = 0.0;
471  double prevCharge = 0.0, deltaCharge = 0.0, deltaChargeMin = 999999.;
472  double prevSlope = 0.0, slope = 0.0, maxGoodAmp=0.0, minGoodAmp = 999999.;
473  double maxGoodCharge = m_linfitMax[gain_ind], minGoodCharge = 999999.;
474  double maxCharge = 0.0, minCharge = 999999., maxAmp = 0.0, minAmp = 999999.;
475  bool signalInRange = true;
476  int nptGood = 0;
477 
478  // find number of points in graph for this adc
479  npt = MeanDacMap->size();
480  m_nDAC[ros][drawer][chan][gain] = npt;
481  gr = new TGraphErrors(npt);
482  grrms = new TGraphErrors(npt);
483 
484  if (npt == 0) {
485  m_calib[ros][drawer][chan][gain] = 0;
486  m_chi2[ros][drawer][chan][gain] = 0.0;
487  ATH_MSG_DEBUG( "npt==0 for adc channel "
488  << ros << "/" << drawer << "/" << chan << "/" << gain );
489  } else {
490 
491  // update quality flag: adc channel is included in run
493 
494  // iterator over dacs
495  TDACDoubleMapIter dacIter((*MeanDacMap).begin());
496  TDACDoubleMapIter dacIterE((*MeanDacMap).end());
497 
498  // initialize current point
499  pt = 0;
500  badPts = 0;
501  maxPointInFitRange = 0.0;
502  maxRMS = 0.0;
503  for (; dacIter != dacIterE; ++dacIter) {
504  dac = (dacIter)->first;
505  mean = (dacIter)->second;
506  meansq = (*MeanSqDacMap)[dac];
507  nevt = (*NEvtDacMap)[dac];
508  ndigerr = (*NDigitalErrorsDacMap)[dac];
509 
510  mean = mean / nevt;
511  mean2 = mean * mean;
512  meansq = meansq / nevt;
513 
514  rms = (meansq <= mean2) ? 0. : sqrt(meansq - mean2);
515  err = sqrt(rms * rms / nevt + 0.5 * 0.5); // 0.5 is the absolute systematic uncertainty on the measurement
516 
517  // find charge for this dac
518  charge = dac * dac2Charge;
519 
520  if (mean < m_maxAmp[gain_ind] ) {
521  if (charge>maxCharge) maxCharge = charge;
522  if (charge<minCharge) minCharge = charge;
523  if (mean>maxAmp) maxAmp = mean;
524  if (mean<minAmp) minAmp = mean;
525  }
526 
527  deltaMean = mean - prevMean;
528  deltaCharge = charge - prevCharge;
529  if (deltaCharge != 0) {
530  slope = deltaMean / deltaCharge;
531  if (deltaCharge<deltaChargeMin) deltaChargeMin = deltaCharge;
532  }
533 
534  // check for problems in calibration range
535  if (charge > m_linfitMin[gain_ind] && charge < m_linfitMax[gain_ind]) {
536  if (mean > m_maxAmp[gain_ind] ) {
537  signalInRange = false;
538  ATH_MSG_DEBUG( "Too high amp in "
539  << ros << "/" << drawer
540  << "/" << chan << "/" << gain
541  << " charge " << charge
542  << " amp " << mean
543  << " => Ignoring this point ");
544  } else {
545  if (prevSlope != 0) {
546  double R = std::abs(slope/prevSlope);
547  double R1 = (nptGood>1) ? (slope / averSlope) : 1.;
548  if (R<0.025 || (nptGood>2 && R1>2.5 && R>2.5) || (nptGood==2 && R1>4.1) ) {
549  // amplitude not changed (within +/- 2.5%) or changed too much, ignore this point
550  ATH_MSG_WARNING( "Wrong amp in "
551  << ros << "/" << drawer
552  << "/" << chan << "/" << gain
553  << " charge " << charge
554  << " amp " << mean
555  << " dC " << deltaCharge
556  << " dA " << deltaMean
557  << " expected dA " << prevSlope*deltaCharge
558  << " aver dA " << averSlope*deltaCharge
559  << " rms " << rms
560  << " => Removing this point ");
561  continue;
562  }
563  }
564  if (signalInRange) {
565  maxGoodCharge = charge;
566  if (charge<minGoodCharge) minGoodCharge = charge;
567  if (mean>maxGoodAmp) maxGoodAmp = mean;
568  if (mean<minGoodAmp) minGoodAmp = mean;
569  }
570  prevMean = mean;
571  prevCharge = charge;
572  if (slope > 0) {
573  prevSlope = slope;
574  }
575  ++nptGood;
576  averSlope += (slope - averSlope) / nptGood;
577  if (slope < 0) {
578  --nptGood;
579  }
580  if (averSlope < 0) {
581  nptGood = 0;
582  averSlope = 0.;
583  }
584  }
585 
586  if (rms < 0.01) badPts++;
587  if (mean > maxPointInFitRange) maxPointInFitRange = mean;
588  if (rms > maxRMS) maxRMS = rms;
589 
590  } else if (charge <= m_linfitMin[gain_ind] && charge > 0) {
591 
592  slope = mean/charge;
593  if (prevSlope !=0 ) {
594  double R = slope / prevSlope;
595  if (R>0.4 && R<2.5) {
596  prevMean = mean;
597  prevCharge = charge;
598  prevSlope = (prevSlope + slope)/2.;
599  }
600  } else {
601  double R = slope / m_defaultCalib[gain_ind];
602  if (R>0.4 && R<2.5) {
603  prevSlope = slope;
604  }
605  }
606  } else if (nptGood < 3 && signalInRange && charge >= m_linfitMax[gain_ind] && mean < m_maxAmp[gain_ind] && prevSlope != 0) {
607  double R = slope/prevSlope;
608  if (R>0.9 && R<1.1) {
609  maxGoodCharge = charge;
610  if (charge<minGoodCharge) minGoodCharge = charge;
611  ++nptGood;
612  }
613  }
614 
615  // set point and errors in tgraph
616  gr->SetPoint(pt, charge, mean);
617  gr->SetPointError(pt, 0.0, err);
618 
619  grrms->SetPoint(pt, charge, mean);
620  grrms->SetPointError(pt, 0.0, rms);
621 
622  pt++;
623  } // end of for all DAC values
624 
625  // remove empty points at the end
626  for (int i=npt-1; i>=pt; --i)
627  gr->RemovePoint(i);
628 
629  slope = (prevMean > 0 && prevCharge > 0) ? prevMean/prevCharge : m_defaultCalib[gain_ind];
630  fslope->SetParameter(0, slope);
631  if (maxGoodCharge > m_linfitMax[gain_ind]) {
632  ATH_MSG_WARNING( "Extending fit range for "
633  << ros << "/" << drawer
634  << "/" << chan << "/" << gain
635  << " up to " << maxGoodCharge
636  << " pC; N good points " << nptGood);
637  }
638 
639  if (deltaChargeMin>999.) deltaChargeMin = 0.1;
640  else deltaChargeMin *= 0.5;
641  gr->Fit("fslope", "q", "", minGoodCharge-deltaChargeMin, maxGoodCharge+deltaChargeMin);
642  ATH_MSG_VERBOSE( "Fit for "
643  << ros << "/" << drawer
644  << "/" << chan << "/" << gain
645  << " minC " << minGoodCharge
646  << " maxC " << maxGoodCharge
647  << " deltaC " << deltaChargeMin*2
648  << " minA " << minGoodAmp
649  << " maxA " << maxGoodAmp
650  << " nptG " << nptGood
651  << " slope " << slope
652  << " fit " << fslope->GetParameter(0));
653  if (nptGood < 3) {
654  const char * bms[3] = {"No good points to fit ",
655  "Only one point to fit ",
656  "Only two points to fit "};
657  const char * ems[3] = {" => Put zero slope",
658  "",
659  ""};
660  ATH_MSG_WARNING( bms[nptGood]
661  << ros << "/" << drawer
662  << "/" << chan << "/" << gain
663  << " charge " << charge
664  << " amp " << mean
665  << " slope " << slope
666  << " fit " << fslope->GetParameter(0)
667  << ems[nptGood]);
668  }
669  slope = (nptGood > 0) ? fslope->GetParameter(0) : 0.;
670 
671  if (slope > 0.) {
672  if (maxGoodCharge > minGoodCharge) {
673  averSlope = (maxGoodAmp-minGoodAmp)/(maxGoodCharge-minGoodCharge);
674  if (slope > 2.5 * averSlope) {
675  ATH_MSG_WARNING( "Average slope and fit slope do not match "
676  << ros << "/" << drawer
677  << "/" << chan << "/" << gain
678  << " charge " << charge
679  << " amp " << mean
680  << " avslope " << averSlope
681  << " fit " << slope
682  << " => Put zero slope");
683  slope = 0.;
684  }
685  } else if (maxCharge > minCharge) {
686  averSlope = (maxAmp-minAmp)/(maxCharge-minCharge);
687  if (slope > 10. * averSlope) {
688  ATH_MSG_WARNING( "AVERAGE slope and fit slope do not match "
689  << ros << "/" << drawer
690  << "/" << chan << "/" << gain
691  << " charge " << charge
692  << " amp " << mean
693  << " AVslope " << averSlope
694  << " fit " << slope
695  << " => Put zero slope");
696  slope = 0.;
697  }
698  }
699  }
700 
701  m_nDigitalErrors[ros][drawer][chan][gain] = ndigerr;
702 
703  // Set this bit if there aren't any digital errors
704  if (ndigerr == 0) {
706  }
707 
708  m_calib[ros][drawer][chan][gain] = slope;
709  if (fslope->GetNDF() == 0)
710  m_chi2[ros][drawer][chan][gain] = 0.0;
711  else
712  m_chi2[ros][drawer][chan][gain] = fslope->GetChisquare() / fslope->GetNDF();
713 
714  // Set this bit if there is a good Chi2 probability
715  if (TMath::Prob(fslope->GetChisquare(), fslope->GetNDF()) > 2.e-6) {
717  }
718 
719  // update quality flag if calibration is successful
720  if (!badPts && fslope->GetNDF() > 0) setBit(calibratedBit, m_qflag[ros][drawer][chan][gain]);
721 
722  // update quality flag if calibration is within 5% of nominal
723  // saved for legacy support
724  ratio = (slope / m_defaultCalib[gain_ind]);
725  if (ratio > 0.95 && ratio < 1.05) setBit(rangeBit, m_qflag[ros][drawer][chan][gain]);
726 
727  // update quality flag if calibration if the probability of this calibration
728  // constant, given a 1.6% gaussian-sigma of the calibration constants, is greater
729  // than 1/10000 (number of channels)
730  //
731  // Mathemica code: NSolve[Erf[x/(1.6*Sqrt[2])] == 0.9999, x]
732  // x -> 6.22495
733  ratio = (slope / meanCalib[gain_ind]);
734  if (ratio > 0.9378 && ratio < 1.0623) setBit(probBit, m_qflag[ros][drawer][chan][gain]);
735 
736  // If the maximum response in the fit range is less than 600 ADC counts, then
737  // all the response in most likely noise
738  if (maxPointInFitRange > 600) {
740  }
741 
742  // RMS criteria. If any collection of injections at a fixed-charge has
743  // an RMS less than 5 ADC counts, then set this bit.
744  if (maxRMS < 5.0) {
746  }
747 
748  // set the sample check bits
749 
750  // this bit is set if there were no events found in the fit range
751  // with the maximum sample value in the first or last sample
752 
753  if (m_edgeSample[ros][drawer][chan][gain] == 0) {
755  }
756  // this bit is set if there were no events found in the fit range
757  // with the maximum sample value in the second or sixth sample
758  if (m_nextToEdgeSample[ros][drawer][chan][gain] == 0) {
760  }
761 
762  // Determine failure/passing of StuckBit quality flag
763  // And store information about bits in an array
764  // which will be written to the ntuple
765  int NoStuckBit = 1;
766  for(int i = 0; i < NBITS; i++) {
767  // If a bit is stuck at zero...
768  if(m_sampleBit[ros][drawer][chan][gain][i] == 0 && (m_numSamp[ros][drawer][chan][gain] != 0)) {
769  // write information to m_bitStatus array of shorts
770  // each bit in short corresponds to a bit in an adc
771  // with 6 short bits left over
772  m_bitStatus[ros][drawer][chan][gain][0] += (1<<i);
773  NoStuckBit = 0;
774  ATH_MSG_DEBUG( "\n\nBIT STUCK AT ZERO: "
775  << ros << " " << drawer << " " << chan << " " << gain << " " << i << "\n");
776 
777  }
778  // Same for a bit stuck at one
779  else if (m_sampleBit[ros][drawer][chan][gain][i] == m_numSamp[ros][drawer][chan][gain] && (m_numSamp[ros][drawer][chan][gain] != 0)) {
780  m_bitStatus[ros][drawer][chan][gain][1] += (1<<i);
781  NoStuckBit = 0;
782  ATH_MSG_DEBUG( "\n\nBIT STUCK AT ONE: "
783  << ros << " " << drawer << " " << chan << " " << gain << " " << i << "\n");
784  }
785  } //end bit loop
786 
787  // If no stuck bits are found, this adc passes StuckBit m_qflag
788  if(NoStuckBit) {
790  }
791 
792  gr->SetName("scan_" + arrayString(ros, drawer, chan, gain));
793  grrms->SetName("scan_" + arrayString(ros, drawer, chan, gain));
794 
795  m_scanMap->Add(new TObjString("scan" + arrayString(ros, drawer, chan, gain)), gr);
796  m_scanMapRMS->Add(new TObjString("scan" + arrayString(ros, drawer, chan, gain)), grrms);
797  }
798  }
799  return StatusCode::SUCCESS;
800 }
801 
803 
804  ATH_MSG_INFO( "writeNtuple(" << runNumber << "," << runType << "," << rootFile << ")" );
805 
806  TTree *t = new TTree(m_ntupleID.c_str(), "TileCalib-Ntuple");
807  t->Branch("RunNumber", &runNumber, "runNo/I");
808  t->Branch("calib", *m_calib, "calib[5][64][48][2]/F");
809  t->Branch("qflag", *m_qflag, "qflag[5][64][48][2]/I");
810  t->Branch("nDAC", *m_nDAC, "nDAC[5][64][48][2]/I");
811  t->Branch("nDigitalErrors", *m_nDigitalErrors, "nDigitalErrors[5][64][48][2]/I");
812  t->Branch("chi2", *m_chi2, "chi2[5][64][48][2]/F");
813  t->Branch("BitStatus", *m_bitStatus, "BitStatus[5][64][48][2][4]/s");
814 
815  if (!m_stuckBitsProbs.empty()) {
816  if (m_stuckBitsProbs.retrieve().isFailure()) {
817  ATH_MSG_WARNING("Impossible to get ITileStuckBitsProbsTool and stuck bits probabilities!");
818  } else {
819  m_stuckBitsProbs->saveStuckBitsProbabilities(t);
820  }
821  }
822 
823  // Fill with current values (i.e. tree will have only one entry for this whole run)
824  t->Fill();
825  t->Write();
826 
827  // Save graphs for all calibrated adc channels
828  m_scanMap->Write("cisScans", TObject::kSingleKey);
829  m_scanMapRMS->Write("cisScansRMS", TObject::kSingleKey);
830 
831  return StatusCode::SUCCESS;
832 }
833 
835 
836  ATH_MSG_INFO( "finalize()" );
837 
838  return StatusCode::SUCCESS;
839 }
TileCisDefaultCalibTool::m_sampleBit
int(* m_sampleBit)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN][NBITS]
Definition: TileCisDefaultCalibTool.h:159
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TileCisDefaultCalibTool::m_scanMap
TMap * m_scanMap
Definition: TileCisDefaultCalibTool.h:166
RunTileTBMonitoring.fragID
fragID
Definition: RunTileTBMonitoring.py:212
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
TileCablingSvc.h
TileCisDefaultCalibTool::m_chi2
float(* m_chi2)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
Definition: TileCisDefaultCalibTool.h:148
ReadOfcFromCool.phase
phase
Definition: ReadOfcFromCool.py:127
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
mean
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="")
Definition: dependence.cxx:254
TileCisDefaultCalibTool::finalize
virtual StatusCode finalize() override
Definition: TileCisDefaultCalibTool.cxx:834
TileCisDefaultCalibTool::m_infoName
std::string m_infoName
Definition: TileCisDefaultCalibTool.h:179
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
IDTPM::R
float R(const U &p)
Definition: TrackParametersHelper.h:101
TileCisDefaultCalibTool::m_cablingSvc
ServiceHandle< TileCablingSvc > m_cablingSvc
Definition: TileCisDefaultCalibTool.h:94
TileCisDefaultCalibTool::stuckbitBit
@ stuckbitBit
Definition: TileCisDefaultCalibTool.h:71
TileCisDefaultCalibTool::noiseBit
@ noiseBit
Definition: TileCisDefaultCalibTool.h:65
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TileCisDefaultCalibTool::digiErrorBit
@ digiErrorBit
Definition: TileCisDefaultCalibTool.h:67
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TileCisDefaultCalibTool::m_linfitMin
double m_linfitMin[4]
Definition: TileCisDefaultCalibTool.h:173
TileCisDefaultCalibTool::~TileCisDefaultCalibTool
virtual ~TileCisDefaultCalibTool()
Definition: TileCisDefaultCalibTool.cxx:93
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
skel.it
it
Definition: skel.GENtoEVGEN.py:423
TileCisDefaultCalibTool::m_dac2Charge
double m_dac2Charge[4]
Definition: TileCisDefaultCalibTool.h:170
test_pyathena.pt
pt
Definition: test_pyathena.py:11
TileInfo.h
gr
#define gr
TileCisDefaultCalibTool::TAdcDoubleMapIter
std::map< HWIdentifier, TDACDoubleMap * >::iterator TAdcDoubleMapIter
Definition: TileCisDefaultCalibTool.h:82
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TileCisDefaultCalibTool::m_linfitMinHiDemo
double m_linfitMinHiDemo
Definition: TileCisDefaultCalibTool.h:136
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TileCisDefaultCalibTool::m_dqStatusKey
SG::ReadHandleKey< TileDQstatus > m_dqStatusKey
Definition: TileCisDefaultCalibTool.h:98
HWIdentifier
Definition: HWIdentifier.h:13
TileCisDefaultCalibTool::m_nDigitalErrors
int(* m_nDigitalErrors)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
Definition: TileCisDefaultCalibTool.h:147
TileDQstatus::isChEmpty
static int isChEmpty(int partition, int drawer, int ch)
True if channel is not fully implemented.
TileCisDefaultCalibTool::m_chargeMinLo
double m_chargeMinLo
Definition: TileCisDefaultCalibTool.h:126
TileCisDefaultCalibTool::m_defaultCalib
double m_defaultCalib[4]
Definition: TileCisDefaultCalibTool.h:169
TileCisDefaultCalibTool::m_MeanMap
TAdcDoubleMap m_MeanMap
Definition: TileCisDefaultCalibTool.h:88
NBITS
#define NBITS
Definition: TileCisDefaultCalibTool.h:32
TileCisDefaultCalibTool::m_linfitMaxLo
double m_linfitMaxLo
Definition: TileCisDefaultCalibTool.h:131
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
TileCisDefaultCalibTool::probBit
@ probBit
Definition: TileCisDefaultCalibTool.h:64
TileCisDefaultCalibTool::m_linfitMaxHiDemo
double m_linfitMaxHiDemo
Definition: TileCisDefaultCalibTool.h:135
TileHWID::channel
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
Definition: TileHWID.h:189
TileCisDefaultCalibTool::m_stuckBitsProbs
ToolHandle< ITileStuckBitsProbsTool > m_stuckBitsProbs
Definition: TileCisDefaultCalibTool.h:95
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
TileCalibUtils::MAX_DRAWER
static const unsigned int MAX_DRAWER
Number of drawers in ROS 1-4.
Definition: TileCalibUtils.h:139
TileHWID::ros
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
Definition: TileHWID.h:167
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:269
TileCisDefaultCalibTool::m_calib
float(* m_calib)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
Definition: TileCisDefaultCalibTool.h:144
TileRawChannelContainer.h
TileCisDefaultCalibTool::rangeBit
@ rangeBit
Definition: TileCisDefaultCalibTool.h:63
TileCisDefaultCalibTool::m_linfitMinHi
double m_linfitMinHi
Definition: TileCisDefaultCalibTool.h:130
TileCisDefaultCalibTool::m_linfitMinLo
double m_linfitMinLo
Definition: TileCisDefaultCalibTool.h:132
TileDQstatus
Class that holds Data Quality fragment information and provides functions to extract the data quality...
Definition: TileDQstatus.h:49
TileCisDefaultCalibTool::TileCisDefaultCalibTool
TileCisDefaultCalibTool(const std::string &type, const std::string &name, const IInterface *pParent)
Definition: TileCisDefaultCalibTool.cxx:35
TileCisDefaultCalibTool::m_chargeMaxLo
double m_chargeMaxLo
Definition: TileCisDefaultCalibTool.h:125
TileHWID::adc
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
Definition: TileHWID.h:193
TileCisDefaultCalibTool::m_cabling
const TileCablingService * m_cabling
Definition: TileCisDefaultCalibTool.h:93
TileCisDefaultCalibTool::m_edgeSample
int(* m_edgeSample)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
Definition: TileCisDefaultCalibTool.h:153
TileHWID.h
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:193
lumiFormat.i
int i
Definition: lumiFormat.py:92
TileCisDefaultCalibTool::m_linfitMaxLoDemo
double m_linfitMaxLoDemo
Definition: TileCisDefaultCalibTool.h:137
TileCisDefaultCalibTool::m_maxPed
double m_maxPed
Definition: TileCisDefaultCalibTool.h:115
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
TileCisDefaultCalibTool::m_maxAmp
double m_maxAmp[4]
Definition: TileCisDefaultCalibTool.h:175
TileDigitsContainer.h
TileCisDefaultCalibTool::m_removePed
bool m_removePed
Definition: TileCisDefaultCalibTool.h:112
TileCisDefaultCalibTool::m_linfitMax
double m_linfitMax[4]
Definition: TileCisDefaultCalibTool.h:174
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
TileCisDefaultCalibTool::m_tileHWID
const TileHWID * m_tileHWID
Definition: TileCisDefaultCalibTool.h:92
TileCisDefaultCalibTool::TDACDoubleMap
std::map< uint32_t, double > TDACDoubleMap
Definition: TileCisDefaultCalibTool.h:76
TileCisDefaultCalibTool::m_NEvtMap
TAdcIntMap m_NEvtMap
Definition: TileCisDefaultCalibTool.h:86
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
TileCisDefaultCalibTool::m_nDAC
int(* m_nDAC)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
Definition: TileCisDefaultCalibTool.h:146
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:82
TileCisDefaultCalibTool::writeNtuple
virtual StatusCode writeNtuple(int runNumber, int runType, TFile *rootfile) override
Definition: TileCisDefaultCalibTool.cxx:802
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition: IdentifiableContainerMT.h:236
TileCisDefaultCalibTool::probChi2Bit
@ probChi2Bit
Definition: TileCisDefaultCalibTool.h:68
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
TileCalibUtils::MAX_ROS
static const unsigned int MAX_ROS
Number of ROSs
Definition: TileCalibUtils.h:138
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
TileCisDefaultCalibTool::initialize
virtual StatusCode initialize() override
Definition: TileCisDefaultCalibTool.cxx:108
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
python.OnlineISConfiguration.runType
def runType
Definition: OnlineISConfiguration.py:112
NBSTATUS
#define NBSTATUS
Definition: TileCisDefaultCalibTool.h:33
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
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
TileCisDefaultCalibTool::m_chargeMin
double m_chargeMin[4]
Definition: TileCisDefaultCalibTool.h:171
TileCisDefaultCalibTool::m_useSmallCap
bool m_useSmallCap
Definition: TileCisDefaultCalibTool.h:108
integrator_ascii2db.dac
dac
Definition: integrator_ascii2db.py:126
TileCisDefaultCalibTool::m_rawChannelContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
Definition: TileCisDefaultCalibTool.h:101
TileCisDefaultCalibTool::nextToEdgeSamp
@ nextToEdgeSamp
Definition: TileCisDefaultCalibTool.h:70
TileCisDefaultCalibTool::m_digitsContainerKey
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
Definition: TileCisDefaultCalibTool.h:99
HWIdentifier.h
TileCisDefaultCalibTool::includedBit
@ includedBit
Definition: TileCisDefaultCalibTool.h:61
TileCisDefaultCalibTool::m_bitStatus
unsigned short(* m_bitStatus)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN][NBSTATUS]
Definition: TileCisDefaultCalibTool.h:162
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
TileCisDefaultCalibTool::m_chargeMaxHi
double m_chargeMaxHi
Definition: TileCisDefaultCalibTool.h:123
TileCisDefaultCalibTool::initNtuple
virtual StatusCode initNtuple(int runNumber, int runType, TFile *rootfile) override
Definition: TileCisDefaultCalibTool.cxx:189
errorcheck.h
Helpers for checking error return status codes and reporting errors.
charge
double charge(const T &p)
Definition: AtlasPID.h:494
TileCisDefaultCalibTool::m_scanMapRMS
TMap * m_scanMapRMS
Definition: TileCisDefaultCalibTool.h:167
TileCisDefaultCalibTool::m_ntupleID
std::string m_ntupleID
Definition: TileCisDefaultCalibTool.h:105
TileCisDefaultCalibTool::m_fragIDsDemonstrators
std::vector< int > m_fragIDsDemonstrators
Definition: TileCisDefaultCalibTool.h:176
TileCisDefaultCalibTool::TDACDoubleMapIter
std::map< uint32_t, double >::iterator TDACDoubleMapIter
Definition: TileCisDefaultCalibTool.h:77
TileDQstatus::cispar
const uint32_t * cispar() const
CIS parameters.
Definition: TileDQstatus.h:152
TileCisDefaultCalibTool::m_NDigitalErrorsMap
TAdcIntMap m_NDigitalErrorsMap
Definition: TileCisDefaultCalibTool.h:87
TileCisDefaultCalibTool::m_nextToEdgeSample
int(* m_nextToEdgeSample)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
Definition: TileCisDefaultCalibTool.h:154
python.PyAthena.v
v
Definition: PyAthena.py:157
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
TileHWID::drawer
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
Definition: TileHWID.h:171
python.compareTCTs.ratio
ratio
Definition: compareTCTs.py:295
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TileCisDefaultCalibTool::m_chargeMinHi
double m_chargeMinHi
Definition: TileCisDefaultCalibTool.h:124
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TileCisDefaultCalibTool::m_phaseMax
double m_phaseMax
Definition: TileCisDefaultCalibTool.h:119
DeMoScan.first
bool first
Definition: DeMoScan.py:534
TileCisDefaultCalibTool::finalizeCalculations
virtual StatusCode finalizeCalculations() override
Definition: TileCisDefaultCalibTool.cxx:405
beamspotnt.rms
rms
Definition: bin/beamspotnt.py:1266
TileCisDefaultCalibTool::m_doSampleChecking
bool m_doSampleChecking
Definition: TileCisDefaultCalibTool.h:140
TileCisDefaultCalibTool::injRMSBit
@ injRMSBit
Definition: TileCisDefaultCalibTool.h:66
TileCisDefaultCalibTool::setBit
void setBit(QualityType qb, int &bitflag)
Definition: TileCisDefaultCalibTool.h:188
TileCisDefaultCalibTool::arrayString
TString arrayString(int ros, int drawer, int chan, int gain)
Definition: TileCisDefaultCalibTool.h:196
ReadHandle.h
Handle class for reading from StoreGate.
TileCisDefaultCalibTool::edgeSamp
@ edgeSamp
Definition: TileCisDefaultCalibTool.h:69
TileCisDefaultCalibTool::execute
virtual StatusCode execute() override
Definition: TileCisDefaultCalibTool.cxx:195
AthAlgTool
Definition: AthAlgTool.h:26
TileCalibUtils::MAX_CHAN
static const unsigned int MAX_CHAN
Number of channels in drawer.
Definition: TileCalibUtils.h:141
TileCisDefaultCalibTool::TDACIntMap
std::map< uint32_t, int > TDACIntMap
Definition: TileCisDefaultCalibTool.h:75
TileCisDefaultCalibTool::m_tileInfo
const TileInfo * m_tileInfo
Definition: TileCisDefaultCalibTool.h:180
TileCisDefaultCalibTool.h
TileCablingService::runPeriod
int runPeriod() const
Definition: TileCablingService.h:280
TileCisDefaultCalibTool::m_phaseMin
double m_phaseMin
Definition: TileCisDefaultCalibTool.h:118
TileCisDefaultCalibTool::m_linfitMinLoDemo
double m_linfitMinLoDemo
Definition: TileCisDefaultCalibTool.h:138
TileCisDefaultCalibTool::m_chargeMax
double m_chargeMax[4]
Definition: TileCisDefaultCalibTool.h:172
TileCisDefaultCalibTool::m_qflag
int(* m_qflag)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
Definition: TileCisDefaultCalibTool.h:145
TileCisDefaultCalibTool::calibratedBit
@ calibratedBit
Definition: TileCisDefaultCalibTool.h:62
TileInfo::ADCmax
int ADCmax() const
Returns the maximum ADC output (10 bits --> 1023)
Definition: TileInfo.h:71
TileCisDefaultCalibTool::m_MeanSqMap
TAdcDoubleMap m_MeanSqMap
Definition: TileCisDefaultCalibTool.h:89
fitman.k
k
Definition: fitman.py:528
TileCisDefaultCalibTool::m_numSamp
int(* m_numSamp)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
Definition: TileCisDefaultCalibTool.h:164
TileCisDefaultCalibTool::m_linfitMaxHi
double m_linfitMaxHi
Definition: TileCisDefaultCalibTool.h:129
TileCalibUtils::MAX_GAIN
static const unsigned int MAX_GAIN
Number of gains per channel
Definition: TileCalibUtils.h:142