ATLAS Offline Software
CscCalibMonToolSlope.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 #include "CscCalibMonToolSlope.h"
6 
7 
8 
11 
12 #include "TProfile.h"
13 #include "TGraphErrors.h"
14 #include "TH1F.h"
15 #include "TH1I.h"
16 #include "TF1.h"
17 
18 #include <cassert>
19 #include <cmath>
20 #include <sstream>
21 #include <iomanip>
22 #include <fstream>
23 
24 CscCalibMonToolSlope::CscCalibMonToolSlope(const std::string & type, const std::string & name,
25  const IInterface* parent) :
27  declareProperty("MaxSlopeDiff",m_slopeMaxDiff=0.5);
28  declareProperty("MaxIntercept",m_interceptMax = 5.0);
29  declareProperty("MaxChi2_NDF",m_chi2Max = 100);
30  declareProperty("MaxFracDev",m_fracDevMax = .5);
31  declareProperty("MaxPeaktDiff",m_peaktMaxDiff= 10);
32  m_calibResultKey = "CscCalibResultSlope";
33  declareProperty("calGraphKey", m_histKey = "cscSlopeCalibReport");
34  declareProperty("subDir", m_subDir ="");
35  declareProperty("DeadPulserLevelCutoff", m_deadPulserLevelCutoff = 50);
36  declareProperty("DeadADCCutoff", m_deadADCCutoff =100); //Cutoff after ped subtraction
37  declareProperty("DoNeighborRatio", m_doNeighborRatios = true);
38  declareProperty("HistAttenLevels", m_histAttenLevels = false , "Make histograms for all attenuation levels. Potentially requires a LOT of RAM.");
39 
40 
41  /*##From CscCalibMonToolBase.cxx, for reference. Do not uncomment!
42  declareProperty("MakeHashValueHist",m_makeHashHist=true);
43  declareProperty("MakeLayerValueHists",m_makeLayerHists=false);
44  declareProperty("DetailedResultHashIds",m_detailedHashIds);
45  */
46 
47 }
48 
50 {
51  ATH_MSG_DEBUG( "Slope Finalizing " );
52  delete m_slopeNewColl;
53  delete m_slopeOldColl;
54  delete m_slopeDiffColl;
55  delete m_interceptColl;
56  delete m_chi2Coll;
57  delete m_deadNewColl;
58  delete m_deadDiffColl;
59  delete m_peaktNewColl;
60  delete m_peaktOldColl;
61  delete m_peaktDiffColl;
62 
64 }
65 
67 {
70 
71  ATH_MSG_DEBUG( "Expected chamber layer is " << m_expectedChamberLayer );
72 
73  for(unsigned int hash = 0 ; hash <= m_maxHashId; hash++)
74  {
75  m_fracProfs.push_back(nullptr);
76  }
77  m_generic_path_csccalibmonitoring = "MUON_CSC_PULSER";
78 
79  return StatusCode::SUCCESS;
80 }
81 
82 
84 {
86  ATH_MSG_DEBUG( "CscCalibMonToolSlope : in bookHistograms()" );
87 
88  if (newRunFlag())
89  {
90  std::string name,title,xaxis,yaxis;
91  int highbound,lowbound,nbins;
92 
93  std::string geoPath = getGeoPath();
94  std::string path = getFullPath(geoPath, "Misc", "");
96 
97  //num bad histograms
98  name = "h_csc_calib_numSignificant";
99  title = "Number of significant results.";
100  xaxis = "Catagory";
101  yaxis = "Num channels with bad value.";
102  lowbound = 1;
103  highbound = 8;
104  m_h_numBad = new TH1I(name.c_str(),title.c_str(),highbound-lowbound,lowbound,highbound);
105  m_h_numBad->GetYaxis()->SetTitle(yaxis.c_str());
106  m_h_numBad->GetXaxis()->SetTitle(xaxis.c_str());
107  m_h_numBad->GetXaxis()->SetBinLabel(m_slopeBadBin,"slope diff");
108  m_h_numBad->GetXaxis()->SetBinLabel(m_interceptBadBin,"intercept diff");
109  m_h_numBad->GetXaxis()->SetBinLabel(m_chi2BadBin,"chi^2/ndf ");
110  m_h_numBad->GetXaxis()->SetBinLabel(m_peaktBadBin,"Peaking Time Diff");
111  m_h_numBad->GetXaxis()->SetBinLabel(m_fracBadBin,"Fractional Deviation");
112  m_h_numBad->GetXaxis()->SetBinLabel(m_deadBadBin,"New (or fixed) Dead Channel");
113  m_h_numBad->GetXaxis()->SetBinLabel(m_missingBadBin,"Num chans w/ no data");
114  m_h_numBad->SetFillColor(m_histCol);
115  monGroup.regHist(m_h_numBad).ignore();
116 
117  //--overview histograms-----------------------------------------------------------------
118  /*
119  name = "h_csc_calib_peaktCompareOverview";
120 
121 
122  title = "Differences between measured peaking time and values stored in condtions database";
123  xaxis = "Difference (ns)";
124  yaxis = "";
125  lowbound = -10;
126  highbound = 10;
127  nbins = 100;
128  m_h_peaktCompareOverview = new TH1F(name.c_str(),title.c_str(),nbins,lowbound,highbound);
129  m_h_peaktCompareOverview->GetXaxis()->SetTitle(xaxis.c_str());
130  m_h_peaktCompareOverview->GetYaxis()->SetTitle(yaxis.c_str());
131  m_h_peaktCompareOverview->SetFillColor(m_histCol);
132  sc = monGroup.regHist(m_h_peaktCompareOverview);
133 
134  name = "h_csc_calib_slopeCompareOverview";
135  title = "Differences between measured slope and values stored in condtions database";
136  xaxis = "Difference (fC/ADC)";
137  yaxis = "";
138  lowbound = -10;
139  highbound = 10;
140  nbins = 100;
141  m_h_slopeCompareOverview = new TH1F(name.c_str(),title.c_str(),nbins,lowbound,highbound);
142  m_h_slopeCompareOverview->GetXaxis()->SetTitle(xaxis.c_str());
143  m_h_slopeCompareOverview->GetYaxis()->SetTitle(yaxis.c_str());
144  m_h_slopeCompareOverview->SetFillColor(m_histCol);
145  sc = monGroup.regHist(m_h_slopeCompareOverview);
146 
147  name = "h_csc_calib_interceptOverview";
148  title = "Intercepts";
149  xaxis = "Intercept (ADC count)";
150  yaxis = "";
151  lowbound = 0;
152  highbound = 10;
153  nbins = 100;
154  m_h_interceptOverview = new TH1F(name.c_str(),title.c_str(),nbins,lowbound,highbound);
155  m_h_interceptOverview->GetXaxis()->SetTitle(xaxis.c_str());
156  m_h_interceptOverview->GetYaxis()->SetTitle(yaxis.c_str());
157  m_h_interceptOverview->SetFillColor(m_histCol);
158  sc = monGroup.regHist(m_h_interceptOverview);
159 
160  name = "h_csc_calib_chi2Overview";
161  title = "chi^2/ndf for slope fits";
162  xaxis = "chi^2/ndf";
163  yaxis = "";
164  lowbound = 0;
165  highbound = 10;
166  nbins = 100;
167  m_h_chi2Overview = new TH1F(name.c_str(),title.c_str(),nbins,lowbound,highbound);
168  m_h_chi2Overview->GetXaxis()->SetTitle(xaxis.c_str());
169  m_h_chi2Overview->GetYaxis()->SetTitle(yaxis.c_str());
170  m_h_chi2Overview->SetFillColor(m_histCol);
171  sc = monGroup.regHist(m_h_chi2Overview);
172  */
173  name = "h_csc_calib_deadOverview";
174  title = "Number of dead channels";
175  lowbound = 1;
176  highbound = 5;
177  nbins = 4;
178  m_h_deadOverview = new TH1F(name.c_str(),title.c_str(),nbins,lowbound,highbound);
179  m_h_deadOverview->GetXaxis()->SetBinLabel(m_totalLiveBin,"Total Live channels");
180  m_h_deadOverview->GetXaxis()->SetBinLabel(m_totalDeadBin,"Total Dead channels");
181  m_h_deadOverview->GetXaxis()->SetBinLabel(m_newLiveBin,"New Live Channels");
182  m_h_deadOverview->GetXaxis()->SetBinLabel(m_newDeadBin,"New Dead Channels");
183  m_h_deadOverview->SetFillColor(m_histColAlert);
184  monGroup.regHist(m_h_deadOverview).ignore();
185 
186  name = "h_csc_calib_slopeMissingChans";
187  title = "Number of dead channels";
188  xaxis = "Channel (Hash ID)";
189  yaxis = "";
190  lowbound = 0;
191  highbound = m_maxHashId+1;
192  nbins = m_maxHashId+1;
193  m_h_slopeMissingChans = new TH1F(name.c_str(),title.c_str(),nbins,lowbound,highbound);
194  m_h_slopeMissingChans->GetXaxis()->SetTitle(xaxis.c_str());
195  m_h_slopeMissingChans->GetYaxis()->SetTitle(yaxis.c_str());
196  m_h_slopeMissingChans->SetFillColor(m_histColAlert);
197  monGroup.regHist(m_h_slopeMissingChans).ignore();
198 
199 
200  std::string peaktDataName = "peakt";
201  std::string peaktDataTitle = "Peaking Time";
202  std::string peaktSubDir = "Peakt";
203 
204  std::string slopeDataName = "slope";
205  std::string slopeDataTitle = "Pulser Gain Slope";
206  std::string slopeSubDir = "Slope";
207 
208  std::string slopeRatioDataName = "slopeRatio";
209  std::string slopeRatioDataTitle = "Ratio of N : N+1 Channel Slopes";
210  std::string slopeRatioSubDir = "SlopeRatio";
211 
212  std::string interceptDataName = "intercept";
213  std::string interceptDataTitle = "Intercept";
214  std::string interceptSubDir = "Intercept";
215 
216  std::string chi2DataName = "chi2";
217  std::string chi2DataTitle = "Chi^2/ndf for gain slope fit";
218  std::string chi2SubDir = "Chi2";
219 
220  std::string deadDataName = "dead";
221  std::string deadDataTitle = "Dead";
222  std::string deadSubDir = "Dead";
223 
224  std::string fitResDataName = "fitRes";
225  std::string fitResDataTitle = "Fit Return Value";
226  std::string fitResSubDir = "FitResult";
227 
228  //Set naming parameters for histogram category names
229  std::string newCatName = "new";
230  std::string newCatTitle = "New";
231 
232  std::string oldCatName = "old";
233  std::string oldCatTitle = "COOL";
234 
235  std::string diffCatName = "diff";
236  std::string diffCatTitle = "Difference Between New and COOL";
237 
238  //axis info
239  std::string peaktAxisLabel = "Peaking Time (ns)";
240  std::string peaktDiffAxisLabel = "Peaking Time Difference (ns)";
241  int peaktNumBins = 100;
242  float peaktLowBound = 0;
243  float peaktHighBound = 100;
244 
245  std::string slopeAxisLabel = "Gain (fC/ADC)";
246  std::string slopeDiffAxisLabel = "Gain Difference (fC/ADC)";
247  int slopeNumBins =300;
248  float slopeLowBound = 0;
249  float slopeHighBound = 5;
250 
251  std::string slopeRatioAxisLabel = "Ratio of N/(N+1) channel";
252  int slopeRatioNumBins = 500;
253  float slopeRatioLowBound = 0;
254  float slopeRatioHighBound = 5;
255 
256  std::string interceptAxisLabel = "Intercept (ADC counts)";
257  int interceptNumBins = 200;
258  float interceptLowBound = -100;
259  float interceptHighBound = 100;
260 
261  std::string chi2AxisLabel = "Chi^2/ndf";
262  int chi2NumBins = 1000;
263  float chi2LowBound = 0;
264  float chi2HighBound = 3000;
265 
266  std::string deadAxisLabel = "Is Dead";
267  int deadNumBins = 3;
268  float deadLowBound = -1.5;
269  float deadHighBound = 1.5;
270 
271  std::string fitResAxisLabel = "Fit Return Value";
272  int fitResNumBins =10000;
273  float fitResLowBound = 0;
274  float fitResHighBound = 10000;
275 
276  //Initialize histogram collections
278  m_peaktNewColl->ignoreY = false;
280  m_peaktOldColl->ignoreY = false;
282  m_peaktDiffColl->ignoreY = false;
283 
284 
285  if(m_doNeighborRatios){
287  m_slopeRatioColl->ignoreY = true;
288  }
289 
291  m_slopeNewColl->ignoreY = true;
293  m_slopeOldColl->ignoreY = true;
295  m_slopeDiffColl->ignoreY = true;
296 
298  m_interceptColl->ignoreY = true;
299 
301  m_chi2Coll->ignoreY = true;
302 
303 
305  m_deadNewColl->ignoreY = false;
307  m_deadDiffColl->ignoreY = false;
308 
310  m_fitResColl->ignoreY = true;
311 
312  //Set subdirectory in monitoring root file
313 
314  //initialize, name, and book histograms in histogram collections using the bookHistCollection()
315  //function
316 
317  ATH_CHECK( bookHistCollection(m_peaktNewColl, peaktDataName, peaktDataTitle, newCatName,
318  newCatTitle, peaktAxisLabel, peaktNumBins, peaktLowBound, peaktHighBound, peaktSubDir) );
319 
320  ATH_MSG_DEBUG( "Registering peaktOldColl" );
321  ATH_CHECK( bookHistCollection(m_peaktOldColl, peaktDataName, peaktDataTitle, oldCatName, oldCatTitle,
322  peaktAxisLabel, peaktNumBins, peaktLowBound, peaktHighBound, peaktSubDir) );
323 
324  ATH_MSG_DEBUG( "Registering peaktDiffColl" );
325  ATH_CHECK( bookHistCollection(m_peaktDiffColl, peaktDataName, peaktDataTitle, diffCatName, diffCatTitle,
326  peaktDiffAxisLabel, peaktNumBins, peaktLowBound, peaktHighBound, peaktSubDir) );
327 
328  ATH_MSG_DEBUG( "Registering slopeRatioColl" );
329  ATH_CHECK( bookHistCollection(m_slopeNewColl, slopeDataName, slopeDataTitle, newCatName,
330  newCatTitle, slopeAxisLabel, slopeNumBins, slopeLowBound, slopeHighBound, slopeSubDir) );
331 
332  ATH_MSG_DEBUG( "Registering slopeNewColl" );
333  ATH_CHECK( bookHistCollection(m_slopeRatioColl, slopeRatioDataName, slopeRatioDataTitle, "",
334  "", slopeRatioAxisLabel, slopeRatioNumBins, slopeRatioLowBound, slopeRatioHighBound, slopeRatioSubDir) );
335 
336  ATH_MSG_DEBUG( "Registering slopeOldColl" );
337  ATH_CHECK( bookHistCollection(m_slopeOldColl, slopeDataName, slopeDataTitle, oldCatName, oldCatTitle,
338  slopeAxisLabel, slopeNumBins, slopeLowBound, slopeHighBound, slopeSubDir) );
339 
340  ATH_MSG_DEBUG( "Registering slopeDiffColl" );
341  ATH_CHECK( bookHistCollection(m_slopeDiffColl, slopeDataName, slopeDataTitle, diffCatName, diffCatTitle,
342  slopeDiffAxisLabel, slopeNumBins, slopeLowBound, slopeHighBound, slopeSubDir) );
343 
344  ATH_MSG_DEBUG( "Registering " << interceptDataTitle );
345  ATH_CHECK( bookHistCollection(m_interceptColl, interceptDataName, interceptDataTitle, "",
346  "", interceptAxisLabel, interceptNumBins, interceptLowBound, interceptHighBound,
347  interceptSubDir) );
348 
349  ATH_CHECK( bookHistCollection(m_chi2Coll, chi2DataName, chi2DataTitle, "", "",
350  chi2AxisLabel, chi2NumBins, chi2LowBound, chi2HighBound, chi2SubDir) );
351 
352  ATH_CHECK( bookHistCollection(m_deadNewColl, deadDataName, deadDataTitle, newCatName, newCatTitle,
353  deadAxisLabel, deadNumBins, deadLowBound, deadHighBound, deadSubDir) );
354 
355  ATH_CHECK( bookHistCollection(m_fitResColl, fitResDataName, fitResDataTitle, "", "",
356  fitResAxisLabel, fitResNumBins, fitResLowBound, fitResHighBound, fitResSubDir) );
357 
358  }
359  return StatusCode::SUCCESS;
360 
361 }
362 
363 /*StatusCode CscCalibMonToolSlope::fillHistograms()
364  {
365  StatusCode sc = StatusCode::SUCCESS;
366 
367  if (m_debuglevel)
368  m_log << MSG::DEBUG << "CscCalibMonToolSlope :: in fillHistograms()" << endmsg;
369 
370  return sc;
371  }*/
372 
373 //--handleParameter: Processes a vector of parameter values by filling the appropriate histograms
375 {
376  ATH_MSG_DEBUG( "CscCalibMonToolSlope : in handleParameter()" );
377 
378  //The whole point of this funciton is to pass the correct histograms and setup info
379  //to CsccalibMonToolBase::procParameter. To organize this, we store the setup info into
380  //these structs:
381  ProcSetupInfo simpleSet;
382 
383  //--setup for this parameter
384  std::string parName = parVals->parName();
385  /*if(parName == "peakt")
386  {
387  m_log << MSG::INFO << "Evaluating peaking times" << endmsg;
388  simpleSet.dbName = parVals->parName();
389  simpleSet.badHist = m_h_numBad;
390  simpleSet.badBin = m_peaktBadBin;
391  simpleSet.maxDiff = m_peaktMaxDiff;
392  simpleSet.overDiff = m_h_peaktCompareOverview;
393  simpleSet.overChi2 = m_h_chi2Overview;
394  simpleSet.chi2BadBin = m_chi2BadBin;
395  simpleSet.doChi2 = false;
396  simpleSet.vals = &m_peaktNewColl->data;
397  simpleSet.errors = &m_peaktNewColl->errors;
398  simpleSet.oldVals = &m_peaktOldColl->data;
399  simpleSet.diffs = &m_peaktDiffColl->data;
400  simpleSet.missingBadBin = m_missingBadBin;
401  simpleSet.missingChans = m_h_slopeMissingChans;
402  simpleSet.expectedChannels = m_expectedHashIdsPrec;
403  }
404  */
405  if(parName == "pslope")
406  {
407  ATH_MSG_INFO( "Evaluating slopes" );
408  simpleSet.dbName = parVals->parName();
409  simpleSet.badHist = m_h_numBad;
410  simpleSet.badBin = m_slopeBadBin;
411  simpleSet.maxDiff = m_slopeMaxDiff;
413  simpleSet.overChi2 = m_h_chi2Overview;
414  simpleSet.chi2BadBin = m_chi2BadBin;
415  simpleSet.chi2Max = m_chi2Max;
416  simpleSet.doChi2 = true;
417  simpleSet.vals = &m_slopeNewColl->data;
418  simpleSet.errors = &m_slopeNewColl->errors;
419  simpleSet.oldVals = &m_slopeOldColl->data;
420  simpleSet.diffs = &m_slopeDiffColl->data;
421  simpleSet.chi2s = &m_chi2Coll->data;
422  simpleSet.missingBadBin = m_missingBadBin;
425  }
426  else if (parName == "pinter")
427  {
428  ATH_MSG_INFO( "Evaluating intercepts" );
429  simpleSet.expectedVal = 0;
430  simpleSet.badHist = m_h_numBad;
431  simpleSet.badBin = m_interceptBadBin;
432  simpleSet.maxDiff = m_interceptMax;
433  simpleSet.overDiff = m_h_interceptOverview;
434  simpleSet.overChi2 = m_h_chi2Overview;
435  simpleSet.doChi2 = false;
436  simpleSet.vals = &m_interceptColl->data;
437  simpleSet.errors = &m_interceptColl->errors;
438  simpleSet.oldVals = nullptr ;
439  simpleSet.diffs = nullptr ;
440  simpleSet.missingBadBin = m_missingBadBin;
443  }
444  else
445  {
446  ATH_MSG_INFO( "CscCalibMonToolSlope : Did not recognize parameter name "
447  << parName << ". This is usually ok." );
448  return StatusCode::FAILURE;
449  }
450 
451  //Process parameter by filling histograms in simpleSet and allIdsSet structures
452  ATH_CHECK( procParameter(parVals,&simpleSet) );
453 
454 
455  if(parName == "peakt")
456  {
457  ATH_MSG_INFO( "Generating peaking time histograms" );
458 
462  }
463  if(parName == "pslope")
464  {
465 
466  ATH_MSG_INFO( "Generating slope histograms" );
467 
468  if(m_doNeighborRatios){
471  }
472 
477  }
478  if(parName == "pinter")
479  {
480  ATH_MSG_INFO( "Generating intercept histograms" );
482  }
483  return StatusCode::SUCCESS;
484 }
485 
486 //--retrieveHistos() will retrieve the slope amplitude histograms for the channels
487 //requested by the user in m_detailedHashIds.
489 {
490  ATH_MSG_DEBUG( "CscCalibMonToolSlope : in retrieveHistos()" );
491 
492  ATH_MSG_DEBUG( "Do all detailed is: " << m_doAllDetailed );
493 
494 
495 
496  IdContext chanContext = m_idHelperSvc->cscIdHelper().channel_context();
497 
498  //Get the slopeReport, checking for pointer errors along the way
499  const CscCalibReportContainer* repCont;
500  if (!evtStore()->retrieve(repCont, m_histKey).isSuccess())
501  {
502  ATH_MSG_ERROR( " Cannot retrieve object from storegate with key "
503  << m_histKey << " aborting retrieving hists " );
504  return StatusCode::RECOVERABLE;
505  }
506  if(repCont->size() != 1)
507  {
508  ATH_MSG_ERROR( "Container with key " << m_histKey
509  << " does not have a size of one. Do not know how to proceed, so aborting"
510  << " retrieving calibration histograms." );
511  return StatusCode::RECOVERABLE;
512  }
513 
514  const CscCalibReportSlope * slopeReport =
515  dynamic_cast<const CscCalibReportSlope *>(repCont->front());
516  if(!slopeReport)
517  {
518  ATH_MSG_ERROR( "No report stored in the container with key " << m_histKey
519  << ". Aborting retrieving histograms." );
520  return StatusCode::RECOVERABLE;
521  }
522  if(slopeReport->getLabel() != "calGraphs")
523  {
524  ATH_MSG_ERROR( "Incorect object retrieved from container with key " << m_histKey
525  << ". Aborting hist retrieval" );
526  return StatusCode::RECOVERABLE;
527  }
528 
529  //ampProfs
530  const std::map <int,TProfile*> * ampProfs = slopeReport->getAmpProfs();
531  if(!ampProfs)
532  {
533  ATH_MSG_ERROR( "There are no amplitude profiles in the slope report! Can't find dead chans." );
534  return StatusCode::RECOVERABLE;
535  }
536 
537  if(m_histAttenLevels){
538  for(const auto & [attenuationVal, pProfile] : *ampProfs){
539 
540  const float atten = attenuationVal * 0.5f;
541  const std::string attenStr = std::to_string(atten);
542 
543  HistCollection * ampColl = new HistCollection(m_maxHashId +1, m_maxHashId +1);
544  ampColl->ignoreY = true;
545 
546  //put into ampColls to make for easy deleting later
547  m_ampColls.push_back(ampColl);
548 
549 
550  std::string dataName = "amp_atten" + attenStr;
551  std::string dataTitle = "ADC response at attenuation " + attenStr + " db" ;
552  std::string axisLabel = "ADC";
553  unsigned int numBins = 300;
554  float lowBound = 0;
555  float highBound = 3000;
556  std::string subDir = "AmpAtten" + attenStr;
557 
558  bookHistCollection(ampColl, dataName, dataTitle, "", "", axisLabel, numBins, lowBound, highBound, subDir).ignore();
559  for(unsigned int stripHash = 0; stripHash < m_maxHashId; stripHash++){
560  ampColl->data[stripHash] = pProfile->GetBinContent(stripHash +1);
561  }
562 
563  ATH_CHECK( copyDataToHists(ampColl) );
564  }
565  }
566 
567 
568  const std::vector<float> * fitResVec = slopeReport->getFitResults();
569  m_fitResColl->data = *fitResVec;
571 
572  //Generate fractional deviation histograms
573  ATH_MSG_DEBUG( "About to generate fractional deviation graphs" );
574  if(!makeFracGraphs(*slopeReport).isSuccess())
575  ATH_MSG_WARNING( "Failed to generate fractional deviation graphs. Continuing anyway.." );
576 
577 
578  ATH_MSG_DEBUG( "About to find dead channels" );
579  //Determine dead channels
580  //sc = findDeadChannels(*slopeReport);
581  //if(!sc.isSuccess())
582  // m_log << MSG::WARNING << "Failure while finding dead channels" << endmsg;
583 
584 
585  //Put extra info for those channels indicated in m_detailedHashIds
586  ATH_MSG_DEBUG( "Picking detailed graphs to output to root file" );
588  {
589  const DataVector<TGraphErrors> * calGraphs
590  = slopeReport->getCalGraphs();
591  if(!calGraphs)
592  {
593  ATH_MSG_ERROR( "No calGraph stored inside object with key " << m_histKey
594  << ". Aborting hist retrieval." );
595  return StatusCode::RECOVERABLE;
596  }
597  else
598  ATH_MSG_INFO( "Got calGraphs" );
599 
600  const DataVector<TH1I> * bitHists = slopeReport->getBitHists();
601  if(!bitHists)
602  ATH_MSG_INFO( "No bit histogram vector found from calibration. "
603  << " Won't be in monitoring output file. " );
604  else
605  ATH_MSG_INFO( "Got bitHists" );
606 
607 
608  //These are the channels we will get detailed forr.
609  for(unsigned int idItr = 0; idItr < m_maxHashId; idItr++)
610  {
611  ATH_MSG_ERROR("Calgraph Address: " << (*calGraphs)[idItr]);
612  if(m_expectedHashIdsPrec.count(idItr) && (m_detailedHashIds[idItr] || (m_doAllDetailed) ) )
613  {
614  ATH_MSG_ERROR("Doing detailed plots of hash " << idItr);
615 
616  Identifier chanId;
617  m_idHelperSvc->cscIdHelper().get_id(IdentifierHash(idItr), chanId, &chanContext);
618  int stationSize = m_idHelperSvc->cscIdHelper().stationName(chanId);
619  int stationEta = m_idHelperSvc->cscIdHelper().stationEta(chanId);
620  int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(chanId);
621  int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(chanId);
622  int measuresPhi = m_idHelperSvc->cscIdHelper().measuresPhi(chanId);
623  int strip = m_idHelperSvc->cscIdHelper().strip(chanId);
624  int sector = getSector(stationPhi, stationSize);
625 
626  std::string geoPath = getGeoPath(stationEta, sector, wireLayer, measuresPhi);
627  std::string calGraphPath = getFullPath(geoPath, "CalGraphs","");
628  std::string fracPath = getFullPath(geoPath,"FracProf","");
629  std::string bitHistPath = getFullPath(geoPath, "BitHists", "");
630 
631  //Record calgraph
632  TGraphErrors * sourceGraph =
633  const_cast<TGraphErrors*>((*calGraphs)[idItr]);
634  if(!sourceGraph)
635  {
636  ATH_MSG_ERROR( "The requested calgraph for hash "
637  << idItr << " doesn't exist in CscCalibReport object!" );
638  }
639  else {
640  std::stringstream name;
641  name << "calfit"
642  << "_EC" << getEndCap(stationEta)
643  << "_sector_" << sector
644  << "_layer_" << wireLayer
645  << "_" << (measuresPhi ? "trans" : "prec")
646  << "_strip_"
647  << std::setfill ('0') << std::setw (measuresPhi ? 2 : 3)
648  << strip;
649 
650  sourceGraph->SetName(name.str().c_str());
651  ATH_MSG_DEBUG( "CalGraph axis title: " << sourceGraph->GetXaxis()->GetTitle() );
652 
653  ATH_CHECK( regGraph(sourceGraph, calGraphPath, run, ATTRIB_MANAGED) );
654  }
655 
656  //record fracDev graph
657  TProfile * sourceProf = m_fracProfs[idItr];
658  if(!sourceProf)
659  {
660  ATH_MSG_ERROR( "There is no fractional profile available for hash "
661  << idItr << ". Quitting retrieveHistos()." );
662  }
663  else{
664  std::stringstream fracName;
665  fracName << "frac_"
666  << "_EC" << getEndCap(stationEta)
667  << "_sector_" << sector
668  << "_layer_" << wireLayer
669  << "_" << (measuresPhi ? "trans" : "prec")
670  << "_strip_"
671  << std::setfill ('0') << std::setw (measuresPhi ? 2 : 3)
672  << strip;
673 
674  sourceProf->SetName(fracName.str().c_str());
675 
676  ATH_CHECK( regHist(sourceProf, fracPath, run, ATTRIB_MANAGED) );
677  }
678 
679  //Bit map histograms
680  //copy source histogram into new histogram, and store
681  if(bitHists)
682  {
683  TH1I * bitHist = const_cast<TH1I*>((*bitHists)[idItr]);
684  if(!bitHist)
685  {
686  ATH_MSG_ERROR( "There is no bit histogram with hashId "
687  << idItr << " Quiting out of detailed histogram loop." );
688  }
689  else {
690 
691  std::stringstream name2;
692  name2 << "h_bitMap"
693  << "_EC" << getEndCap(stationEta)
694  << "_sector_" << sector
695  << "_layer_" << wireLayer
696  << "_" << (measuresPhi ? "trans" : "prec")
697  << "_strip_"
698  << std::setfill ('0') << std::setw (measuresPhi ? 2 : 3)
699  << strip;
700  // TH1I * newHist2 = (TH1I*)bitHist->Clone(name2.str().c_str());
701  bitHist->SetName(name2.str().c_str());
702  bitHist->SetFillColor((m_detailedHashIds[idItr] ? m_histColAlert : m_histCol));
703 
704  //ATH_CHECK( regHist(newHist2, chanPath, run, ATTRIB_MANAGED) );
705  ATH_CHECK( regHist(bitHist, bitHistPath, run, ATTRIB_MANAGED) );
706  }
707  }//end if bithists*/
708 
709  }//end if (m_detailedHashIds)
710  else
711  ATH_MSG_ERROR("Skipping hash " << idItr << " " << m_expectedHashIdsPrec.count(idItr) << " " << m_doAllDetailed);
712  }//end idItr loop
713  }//if numBad > 0
714  return StatusCode::SUCCESS;
715 }// end retrieveHistos
716 
717 //Generate fractional Deviation graphs
719 {
720  ATH_MSG_DEBUG( "CscCalibMonToolSlope : in makeFracGraphs()" );
721  const DataVector<TGraphErrors> * calGraphs = slopeReport.getCalGraphs();
722  if(!calGraphs)
723  {
724  ATH_MSG_ERROR( "No calGraphs in slopeReport. Not going to make fractional deviation"
725  << " plots." );
726  return StatusCode::RECOVERABLE;
727  }
728 
729  //Loop through all channels in geometry:
730  const std::vector <Identifier> & ids = m_idHelperSvc->cscIdHelper().idVector();
731  for(const auto & thisChamberId:ids)
732  {
733  ATH_MSG_VERBOSE( "in Chamber loop " );
734  unsigned int stationSize = m_idHelperSvc->cscIdHelper().stationName(thisChamberId); //51 = large, 50 = small
735  unsigned int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(thisChamberId);
736  int stationEta = m_idHelperSvc->cscIdHelper().stationEta(thisChamberId);
737  unsigned int sector = getSector(stationPhi,stationSize);
738 
739  std::vector <Identifier> stripVect;
740  m_idHelperSvc->cscIdHelper().idChannels(thisChamberId,stripVect);
741  for(const auto & thisStrip : stripVect)
742  {
743  ATH_MSG_VERBOSE( "in strip loop " );
744  IdentifierHash stripHash;
745  m_idHelperSvc->cscIdHelper().get_channel_hash(thisStrip,stripHash);
746  if(!m_expectedHashIdsPrec.count((int)stripHash)){
747  ATH_MSG_VERBOSE( "Skipping hash" << (int)stripHash );
748  continue;
749  }
750  ATH_MSG_VERBOSE( "strip hash " << stripHash );
751 
752  const TGraphErrors * graph = (*calGraphs)[stripHash];
753  if(!graph)
754  {
755  ATH_MSG_VERBOSE( "SKipping graph" );
756  continue;
757  }
758 
759  TF1 * func = graph->GetFunction("simpleFunc");
760  if(!func){
761  ATH_MSG_DEBUG( "Could not retrieve function, skipping this graph" );
762  continue;
763  }
764 
765  ATH_MSG_VERBOSE( "Address is " << graph );
766  ATH_MSG_VERBOSE( "name is "<< graph->GetName() );
767  ATH_MSG_VERBOSE( "Getting n " );
768 
769  int nPoints = graph->GetN();
770  ATH_MSG_VERBOSE( "Got n " );
771  //Get identification information
772  //Note, we don't ask for measuresPhi because there should be no
773  //TGraphs with Y anyways.
774  ATH_MSG_VERBOSE( "getting id info " );
775  unsigned int layer = m_idHelperSvc->cscIdHelper().wireLayer(thisStrip);
776  unsigned int strip = m_idHelperSvc->cscIdHelper().strip(thisStrip);
777  ATH_MSG_VERBOSE( "Got strip and layer" );
778  //initialize fractional deviation profile
779  ATH_MSG_VERBOSE( "initializing profile " );
780 
781  std::stringstream nameStream;
782  nameStream.setf(std::ios::right,std::ios::adjustfield);
783  nameStream << "dev_"
784  << "X" //orientation
785  << "_eta_" << stationEta
786  << "_sector_" << std::setw (2) << std::setfill ('0') << sector
787  << "_layer_" << layer
788  << "_strip_" << strip;
789  std::stringstream titleStream;
790  titleStream << "Fractional Deviation of Measured ADC From Fit ADC for Precision Direction"
791  << ", Sector " << sector
792  << ", Eta " << stationEta
793  << ", Layer " << layer
794  << ", Strip " << strip;
795  TProfile * fracProf
796  = new TProfile(nameStream.str().c_str(), titleStream.str().c_str(), nPoints,
797  1, nPoints +1);
798  fracProf->GetXaxis()->SetTitle("Pulser Attenuator Settings in dB (not auscaled axis) ");
799  fracProf->GetYaxis()->SetTitle("ADC response");
800 
801  ATH_MSG_VERBOSE( "getting parameters " );
802  float intercept = func->GetParameter(0);
803  float slope = func->GetParameter(1);
804  ATH_MSG_VERBOSE( "got them " );
805 
806  //Loop through points in graph, and compare the adc value and charge
807  //to that expected from the fit parameters from the TF1 object
808  double adc, db, calcAdc;
809  bool isBad = false;
810  for(int itr = 0; itr < nPoints; itr++)
811  {
812  ATH_MSG_VERBOSE( "in point loop on point " << itr );
813 
814  //Find Fractional Deviation
815  graph->GetPoint(itr,db,adc);
816  calcAdc = intercept + slope*std::pow(10,db/-20);
817  double frac = (adc - calcAdc)/( calcAdc - intercept);
818 
819  //Test to see if this is a bad result
820  ATH_MSG_VERBOSE( "bad result test " );
821  if(frac > m_fracDevMax)
822  {
823  m_h_numBad->Fill(m_fracBadBin);
824  isBad = true;
825  }
826 
827  //test for nan, and put into fracProf
828  if (frac==frac)
829  {
830  ATH_MSG_VERBOSE( "filling fracProf " );
831  fracProf->Fill(itr +1, frac);
832  }
833 
834  //Label bin with db amount
835  ATH_MSG_VERBOSE( "labeling bin " );
836  std::stringstream binLabel;
837  binLabel << db;
838  fracProf->GetXaxis()->SetBinLabel(itr+1, binLabel.str().c_str());
839  }
840  ATH_MSG_VERBOSE( "storing fracProf " );
841  //Store fraction graph for later
842  if(stripHash > m_maxHashId)
843  {
844  ATH_MSG_ERROR( "Tried to assign fracProf with stripHash " << stripHash
845  << " when max stripHash is " << m_maxHashId );
846  return StatusCode::RECOVERABLE;
847  }
848 
849  m_fracProfs[stripHash] = fracProf;
850  //Record if this was a bad channel
851  if(isBad && ((int)m_numBad <= m_maxDetailedChannels) )
852  {
853  if(!m_detailedHashIds[stripHash])
854  {
855  m_numBad++;
856  m_detailedHashIds[stripHash] = true;
857  }
858  }
859 
860  }//end loop over strips
861  }//end loop over chambers
862  ATH_MSG_DEBUG( "Finished generating frac graphs" );
863 
864  return StatusCode::SUCCESS;
865 }//end makeFracGraphs
866 
868 {//This function has grown a bit unwieldly, and duplicates info in sets and arrays. Can this be merged?
869 
871  const CscCondDbData* readCdo{*readHandle};
872 
873  //****Find Dead channels
874  IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
875 
876  std::set <int> newDead, newUndead;
877 
878  const std::set <int> * pulsedChambers = slopeReport.getPulsedChambers();
879  if(!pulsedChambers)
880  {
881  ATH_MSG_ERROR( "No pulsed chambers stored in slopeReport! Skipping dead channel collecting!" );
882  return StatusCode::RECOVERABLE;
883  }
884 
885  const std::map <int,TProfile*> * ampProfs = slopeReport.getAmpProfs();
886  if(!ampProfs)
887  {
888  ATH_MSG_ERROR( "There are no amplitude profiles in the slope report! Can't find dead chans." );
889  return StatusCode::RECOVERABLE;
890  }
891 
892  std::map <int,TProfile*>::const_iterator profItr = ampProfs->begin();
893 
894  int pulserLevel = profItr->first;
895  ATH_MSG_INFO( "Looking for dead channels. Lowest attenuation level is "
896  << pulserLevel );
897  ATH_MSG_INFO( "Dead channel cutoff is: "<< m_deadADCCutoff );
898 
899  if(pulserLevel < m_deadPulserLevelCutoff)
900  {//Pulser level is low enough (pulse voltage is high enough) to test for dead channels
901 
902  const TProfile * ampProf = profItr->second;
903  if(!ampProf)
904  {
905  ATH_MSG_ERROR( "There is no profile for this attenuation level! Skipping dead channel finding!" );
906  return StatusCode::RECOVERABLE;
907  }
908 
909  ATH_MSG_DEBUG( "There were " << pulsedChambers->size()
910  << " chambers pulsed." );
911 
912  //Prepare dead channel content
913  std::vector<float> & currentDeadVals = m_deadNewColl->data;
914  std::vector<float> & diffDeadVals = m_deadDiffColl->data;
915 
916  setArray(currentDeadVals,0,m_maxHashId+1);
917  setArray(diffDeadVals,0,m_maxHashId+1);
918 
919  //Loop through each channel in TProfile (bin = hash + 1), and check value to see
920  //if its dead
921  float adc, ped;
922  bool wasDead, isDead;
923  int statusWord;
924  for(unsigned int hashItr = 0; hashItr <= m_maxHashId ; hashItr++)
925  {
926  Identifier id;
927  m_idHelperSvc->cscIdHelper().get_id(hashItr,id, &channelContext);
928  int chamberLayer = m_idHelperSvc->cscIdHelper().chamberLayer(id);
929  IdentifierHash chamberHash;
930  m_idHelperSvc->cscIdHelper().get_module_hash(id, chamberHash);
931 
932  if(chamberLayer == 2 && pulsedChambers->count((int)chamberHash))
933  {//This is a good chamber layer and it is a pulsed chamber
934 
935  ATH_CHECK(readCdo->readChannelStatus(hashItr, statusWord));
936  ATH_CHECK(readCdo->readChannelPed (hashItr, ped ));
937  wasDead = statusWord & 0x1;
938 
939  adc = ampProf->GetBinContent( hashItr + 1 );
940  isDead = ( (adc-ped) < m_deadADCCutoff);
941 
942  if(isDead && !wasDead)
943  {
944  ATH_MSG_INFO( "NEW DEAD CHANNEL! Hash: " << hashItr << " ped: " << ped << " adc " << adc << " diff: " << adc-ped );
945  newDead.insert(hashItr);
947  diffDeadVals[hashItr] = 1;
948  m_detailedHashIds[hashItr] = true;
949  }
950  if(!isDead && wasDead)
951  {
952  ATH_MSG_INFO( "PREVIOUSLY DEAD CHANNEL NOW LIVE! Hash: " << hashItr );
953  newUndead.insert(hashItr);
955  diffDeadVals[hashItr] = -1;
956  m_detailedHashIds[hashItr] = true;
957  }
958 
959  if(isDead)
960  {
961  currentDeadVals[hashItr] = 1;
963  }
964  else
966 
967  }//end if chamberLayer
968 
969  }//End for(hashItr)
970 
971  //***Generate histograms
972  ATH_MSG_INFO( "Generating dead histograms" );
974 
975  //ATH_CHECK( copyDataToHists(m_deadDiffColl) );
976  ATH_MSG_INFO( "Finished generating dead histograms" );
977 
978  //***Fill COOL input file if there are new dead channels******
979  if(newDead.size() || newUndead.size())
980  {
981  ATH_MSG_INFO( "There are " << newDead.size()
982  << " newly dead channels and " << newUndead.size()
983  << " newly live channels" );
984  std::ofstream out("deadInfo.cal");
985  out <<"00-00 " << newDead.size() + newUndead.size() << " dead_stat END_HEADER\n";
986 
987  for(const auto & thisDeadChannel:newDead)
988  {
989  Identifier id;
990  m_idHelperSvc->cscIdHelper().get_id(thisDeadChannel,id, &channelContext);
991  IdentifierHash chamHash;
992  m_idHelperSvc->cscIdHelper().get_module_hash(id, chamHash);
993  out << thisDeadChannel << " " << (int)chamHash << " "
994  << m_idHelperSvc->cscIdHelper().show_to_string(id, &channelContext) << " 1\n";
995  }
996 
997  for(const auto undeadChannel : newUndead)
998  {
999  Identifier id;
1000  m_idHelperSvc->cscIdHelper().get_id(undeadChannel,id, &channelContext);
1001  IdentifierHash chamHash;
1002  m_idHelperSvc->cscIdHelper().get_module_hash(id, chamHash);
1003  out << undeadChannel << " " << (int)chamHash << " "
1004  << m_idHelperSvc->cscIdHelper().show_to_string(id, &channelContext)
1005  << "0\n";
1006  }
1007  out.close();
1008  }//end if newDead.size()
1009 
1010  }//end if(pulserLevel < cutoff)
1011  else
1012  {
1013  ATH_MSG_ERROR( "Lowest pulser level isn't low enough to count as a dead channel test. Skipping." );
1014  return StatusCode::RECOVERABLE;
1015  }
1016 
1017 
1018  return StatusCode::SUCCESS;
1019 }
1020 
1021 //I changed the array to a vector. At some point I should replace code like this to make more sense for vector
1022 std::vector<float> & CscCalibMonToolSlope::setArray(std::vector<float> & array, const float &value, const int &numEntries)
1023 {
1024  for(int i = 0 ; i < numEntries; i++)
1025  array[i] = value;
1026  return array;
1027 }
1028 
1029 void CscCalibMonToolSlope::genNeighborRatios(const std::vector<float> & source, std::vector<float> & ratios) const{
1030  size_t nEntries = source.size();
1031  if(nEntries != ratios.size()){
1032  ATH_MSG_ERROR( " in genNeighborRatios, source (" << nEntries << ") and ratio (" << ratios.size()
1033  << ") vectors have different numbers of entries!" );
1034  return;
1035  }
1036 
1037  //loop through every channel, taking the ratio between it and the next
1038  size_t nloops = nEntries -1; //Can't do this to the last channel
1039  for(size_t cnt=0; cnt < nloops; cnt++){
1040  ratios[cnt] = source[cnt]/source[cnt+1];
1041  }
1042 }
1043 
CscCalibMonToolBase::m_expectedChamberLayer
unsigned int m_expectedChamberLayer
Definition: CscCalibMonToolBase.h:116
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
CscCalibMonToolSlope::makeFracGraphs
StatusCode makeFracGraphs(const CscCalibReportSlope &slopeReport)
Make fractional deviation plots between the gain plot points and the fit.
Definition: CscCalibMonToolSlope.cxx:718
CscCalibMonToolBase::ProcSetupInfo::overChi2
TH1F * overChi2
Definition: CscCalibMonToolBase.h:191
CscCalibMonToolSlope::m_slopeBadBin
int m_slopeBadBin
Bin corresponding to each category in m_h_numbad.
Definition: CscCalibMonToolSlope.h:93
CscCalibMonToolSlope::m_interceptBadBin
int m_interceptBadBin
Definition: CscCalibMonToolSlope.h:93
CscCalibMonToolSlope::m_fracDevMax
float m_fracDevMax
Definition: CscCalibMonToolSlope.h:90
python.TIDAMonTool.monGroup
def monGroup(analysis_chain)
Definition: TIDAMonTool.py:295
CscCalibMonToolBase::getSector
virtual int getSector(int stationPhi, int stationSize)
Produces a sector number from the phi and size of a station.
Definition: CscCalibMonToolBase.cxx:1072
CscCalibResultCollection::parName
std::string parName() const
the identify of this collection
Definition: CscCalibResultCollection.cxx:11
CscCalibMonToolBase
The CscCalibMonToolBase class.
Definition: CscCalibMonToolBase.h:56
Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:129
ChangeHistoRange.lowBound
lowBound
Definition: ChangeHistoRange.py:29
CscCalibMonToolBase::m_histCol
int m_histCol
Hist colors.
Definition: CscCalibMonToolBase.h:154
CscCalibMonToolBase::bookHistograms
virtual StatusCode bookHistograms()
Standard function for a ManagedMonitorToolBase.
Definition: CscCalibMonToolBase.cxx:650
SiliconTech::strip
@ strip
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:126
CscCalibMonToolBase::ProcSetupInfo::chi2Max
float chi2Max
Definition: CscCalibMonToolBase.h:194
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
CscCalibMonToolBase::ProcSetupInfo::expectedVal
float expectedVal
Definition: CscCalibMonToolBase.h:194
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CscCalibMonToolSlope::m_deadNewColl
HistCollection * m_deadNewColl
Definition: CscCalibMonToolSlope.h:116
CscCalibMonToolSlope::genNeighborRatios
void genNeighborRatios(const std::vector< float > &source, std::vector< float > &ratios) const
Generated next neighbor channel ratios of the slopes.
Definition: CscCalibMonToolSlope.cxx:1029
CscCalibMonToolSlope::m_chi2BadBin
int m_chi2BadBin
Definition: CscCalibMonToolSlope.h:93
TH1I
Definition: rootspy.cxx:332
CscCalibReportBase::getLabel
std::string getLabel() const
Definition: CscCalibReportBase.cxx:23
CscCalibMonToolSlope::finalize
StatusCode finalize()
Delete slope sepcific values.
Definition: CscCalibMonToolSlope.cxx:49
ChangeHistoRange.highBound
highBound
Definition: ChangeHistoRange.py:30
CscCalibMonToolBase::HistCollection::data
std::vector< float > data
Definition: CscCalibMonToolBase.h:231
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CscCalibMonToolSlope::m_h_slopeCompareOverview
TH1F * m_h_slopeCompareOverview
Histograms that simply histogram all entries for a value.
Definition: CscCalibMonToolSlope.h:101
CscCalibMonToolSlope::m_fracProfs
std::vector< TProfile * > m_fracProfs
Holds fractional deviation TProfiles.
Definition: CscCalibMonToolSlope.h:109
CscCalibMonToolBase::bookHistCollection
virtual StatusCode bookHistCollection(HistCollection *histCollection, std::string dataTypeName, std::string dataTypeTitle, std::string categoryName, std::string categoryTitle, std::string axisLabel, int numBins, float lowBound, float highBound, std::string parDir="", uint16_t toSkip=0)
Initializes the histograms in a histCollection and books them.
Definition: CscCalibMonToolBase.cxx:139
CscCalibMonToolBase::m_readKey
SG::ReadCondHandleKey< CscCondDbData > m_readKey
Access to COOL database.
Definition: CscCalibMonToolBase.h:171
CscCalibMonToolBase::getGeoPath
std::string getGeoPath(int eta=-9999, int sector=-9999, int wireLayer=-9999, int measuresPhi=-9999, int channel=-9999)
getGeoPath creates a directory structure for a histogram based upon where it is in the CSC geometry.
Definition: CscCalibMonToolBase.cxx:1097
CaloCondBlobAlgs_fillNoiseFromASCII.db
db
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:43
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
CscCalibMonToolSlope::m_peaktMaxDiff
float m_peaktMaxDiff
Definition: CscCalibMonToolSlope.h:90
CscCalibMonToolBase::m_generic_path_csccalibmonitoring
std::string m_generic_path_csccalibmonitoring
Path of histograms.
Definition: CscCalibMonToolBase.h:157
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
CscCalibMonToolBase::m_expectedHashIdsPrec
std::set< int > m_expectedHashIdsPrec
Definition: CscCalibMonToolBase.h:133
CscCalibReportContainer.h
CscCalibMonToolSlope::m_newDeadBin
int m_newDeadBin
Definition: CscCalibMonToolSlope.h:96
athena.value
value
Definition: athena.py:122
CscCalibMonToolBase::ProcSetupInfo::chi2s
std::vector< float > * chi2s
Definition: CscCalibMonToolBase.h:199
CscCalibMonToolBase::m_maxDetailedChannels
int m_maxDetailedChannels
To keep track of channels that should have more data printed to root file.
Definition: CscCalibMonToolBase.h:128
CscCalibReportContainer
Definition: CscCalibReportContainer.h:25
ManagedMonitorToolBase::regGraph
virtual StatusCode regGraph(TGraph *g, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
Registers a TGraph to be included in the output stream using logical parameters that describe the gra...
Definition: ManagedMonitorToolBase.cxx:1693
CscCalibMonToolBase::HistCollection::errors
std::vector< float > errors
Definition: CscCalibMonToolBase.h:232
CscCalibMonToolBase::getFullPath
std::string getFullPath(const std::string &geoPath, const std::string &histTypeDir, const std::string &parTypeDir)
Geo path creates a directory structure for a histogram based upon its geoPath, the hist type dir (spe...
Definition: CscCalibMonToolBase.cxx:1184
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
CscCalibMonToolSlope::m_histKey
std::string m_histKey
Storegate key for pedestal amplitude histograms.
Definition: CscCalibMonToolSlope.h:125
CscCalibMonToolBase::ProcSetupInfo::badBin
int badBin
Definition: CscCalibMonToolBase.h:193
CscCalibReportSlope::getBitHists
const DataVector< TH1I > * getBitHists() const
Retrive bit histogram vector.
Definition: CscCalibReportSlope.cxx:53
CscCalibMonToolSlope::m_slopeNewColl
HistCollection * m_slopeNewColl
HistCollections.
Definition: CscCalibMonToolSlope.h:112
CscCalibMonToolBase::ProcSetupInfo::overDiff
TH1F * overDiff
Definition: CscCalibMonToolBase.h:191
CscCalibMonToolBase::m_detailedHashIds
bool * m_detailedHashIds
Definition: CscCalibMonToolBase.h:129
CscCalibMonToolBase::ProcSetupInfo::oldVals
std::vector< float > * oldVals
Definition: CscCalibMonToolBase.h:199
CscCalibMonToolBase::procParameter
virtual StatusCode procParameter(const CscCalibResultCollection *parVals, ProcSetupInfo *simpleSet)
Processors a parameter type.
Definition: CscCalibMonToolBase.cxx:770
CscCalibMonToolSlope::m_deadBadBin
int m_deadBadBin
Definition: CscCalibMonToolSlope.h:94
SCT_CalibAlgs::nbins
@ nbins
Definition: SCT_CalibNumbers.h:10
CscCalibMonToolBase::ProcSetupInfo::expectedChannels
std::set< int > expectedChannels
Definition: CscCalibMonToolBase.h:195
CscCalibReportSlope::getPulsedChambers
const std::set< int > * getPulsedChambers() const
getPulsedChambers - Contains the chambers that were pulsed.
Definition: CscCalibReportSlope.cxx:101
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
CscCalibMonToolSlope::postProc
virtual StatusCode postProc()
postProc retrieves the plots fit to produce the gain
Definition: CscCalibMonToolSlope.cxx:488
ManagedMonitorToolBase::MonGroup
A container of information describing a monitoring object.
Definition: ManagedMonitorToolBase.h:138
CscCalibMonToolSlope::m_doNeighborRatios
bool m_doNeighborRatios
Do neighbor ratios.
Definition: CscCalibMonToolSlope.h:84
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CscCalibMonToolBase::ProcSetupInfo::vals
std::vector< float > * vals
Definition: CscCalibMonToolBase.h:199
lumiFormat.i
int i
Definition: lumiFormat.py:92
CscCalibMonToolBase::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: CscCalibMonToolBase.h:168
python.TrigEgammaMonitorHelper.TProfile
def TProfile(*args, **kwargs)
Definition: TrigEgammaMonitorHelper.py:81
CscCalibMonToolSlope::CscCalibMonToolSlope
CscCalibMonToolSlope(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: CscCalibMonToolSlope.cxx:24
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
CscCalibMonToolBase::ProcSetupInfo::missingChans
TH1F * missingChans
Definition: CscCalibMonToolBase.h:192
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CscCalibMonToolSlope::m_totalDeadBin
int m_totalDeadBin
Definition: CscCalibMonToolSlope.h:96
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
checkxAOD.frac
frac
Definition: Tools/PyUtils/bin/checkxAOD.py:256
CscCalibMonToolBase::m_doAllDetailed
bool m_doAllDetailed
Definition: CscCalibMonToolBase.h:123
CscCalibMonToolBase::ProcSetupInfo::doChi2
bool doChi2
Definition: CscCalibMonToolBase.h:196
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
CscCalibMonToolBase::m_histColAlert
int m_histColAlert
Definition: CscCalibMonToolBase.h:154
CscCalibMonToolSlope::m_deadDiffColl
HistCollection * m_deadDiffColl
Definition: CscCalibMonToolSlope.h:116
covarianceTool.title
title
Definition: covarianceTool.py:542
CscCalibMonToolSlope::m_h_deadOverview
TH1F * m_h_deadOverview
Overview of dead channels and changes.
Definition: CscCalibMonToolSlope.h:106
DataVector::front
const T * front() const
Access the first element in the collection as an rvalue.
CscCalibMonToolSlope::m_deadPulserLevelCutoff
int m_deadPulserLevelCutoff
Dead channel finding user defined parameters.
Definition: CscCalibMonToolSlope.h:131
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CscCalibMonToolSlope::m_fitResColl
HistCollection * m_fitResColl
Definition: CscCalibMonToolSlope.h:120
CscCalibMonToolBase::ProcSetupInfo::dbName
std::string dbName
Definition: CscCalibMonToolBase.h:197
beamspotnt.parName
list parName
Definition: bin/beamspotnt.py:1287
CscCalibMonToolSlope::m_interceptMax
float m_interceptMax
Definition: CscCalibMonToolSlope.h:90
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CscCalibMonToolSlope.h
CscCalibMonToolBase::HistCollection
Contains an array with data on a per-channel basis, as well as various histograms that give different...
Definition: CscCalibMonToolBase.h:205
CscCalibMonToolSlope::m_interceptColl
HistCollection * m_interceptColl
Definition: CscCalibMonToolSlope.h:114
run
Definition: run.py:1
ManagedMonitorToolBase::ATTRIB_MANAGED
@ ATTRIB_MANAGED
Definition: ManagedMonitorToolBase.h:131
CscCalibMonToolSlope::m_subDir
std::string m_subDir
Name of subdirectory under EXPERT or SHIFT that the histograms will be stored.
Definition: CscCalibMonToolSlope.h:128
CscCalibMonToolBase::HistCollection::ignoreY
bool ignoreY
Definition: CscCalibMonToolBase.h:230
CscCalibReportSlope.h
CscCalibMonToolSlope::m_peaktDiffColl
HistCollection * m_peaktDiffColl
Definition: CscCalibMonToolSlope.h:113
DataVector< TGraphErrors >
CscCalibReportSlope::getFitResults
const std::vector< float > * getFitResults() const
getFitReturns - Contains slope fit results.
Definition: CscCalibReportSlope.cxx:106
CscCalibReportSlope
Definition: CscCalibReportSlope.h:28
CscCalibMonToolSlope::m_chi2Coll
HistCollection * m_chi2Coll
Definition: CscCalibMonToolSlope.h:115
CscCalibMonToolBase::ProcSetupInfo::badHist
TH1I * badHist
Definition: CscCalibMonToolBase.h:190
CscCalibMonToolSlope::bookHistograms
StatusCode bookHistograms()
Books all histograms not retrieved driectly from CscCalcSlope.
Definition: CscCalibMonToolSlope.cxx:83
CscCalibMonToolSlope::m_peaktBadBin
int m_peaktBadBin
Definition: CscCalibMonToolSlope.h:93
lumiFormat.array
array
Definition: lumiFormat.py:98
CscCalibMonToolSlope::m_h_chi2Overview
TH1F * m_h_chi2Overview
Definition: CscCalibMonToolSlope.h:101
CscCalibMonToolBase::initialize
virtual StatusCode initialize()
initializes services, tools, etc.
Definition: CscCalibMonToolBase.cxx:61
CscCalibMonToolSlope::m_h_slopeMissingChans
TH1F * m_h_slopeMissingChans
Definition: CscCalibMonToolSlope.h:102
CscCalibMonToolSlope::m_slopeDiffColl
HistCollection * m_slopeDiffColl
Definition: CscCalibMonToolSlope.h:112
CscCalibMonToolSlope::m_slopeOldColl
HistCollection * m_slopeOldColl
Definition: CscCalibMonToolSlope.h:112
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
CscCalibMonToolSlope::m_deadADCCutoff
int m_deadADCCutoff
Definition: CscCalibMonToolSlope.h:131
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
CscCalibMonToolSlope::m_histAttenLevels
bool m_histAttenLevels
Histogram all values for all histograms.
Definition: CscCalibMonToolSlope.h:87
CscCalibMonToolSlope::m_totalLiveBin
int m_totalLiveBin
Definition: CscCalibMonToolSlope.h:96
CscCalibMonToolBase::ProcSetupInfo::diffs
std::vector< float > * diffs
Definition: CscCalibMonToolBase.h:199
CscCalibMonToolSlope::findDeadChannels
StatusCode findDeadChannels(const CscCalibReportSlope &slopeReport)
Look for dead channels.
Definition: CscCalibMonToolSlope.cxx:867
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
TProfile
Definition: rootspy.cxx:515
CscCalibMonToolBase::ProcSetupInfo::missingBadBin
int missingBadBin
Definition: CscCalibMonToolBase.h:193
CscCalibMonToolSlope::setArray
std::vector< float > & setArray(std::vector< float > &array, const float &value, const int &numEntries)
Definition: CscCalibMonToolSlope.cxx:1022
CscCalibMonToolBase::ProcSetupInfo::errors
std::vector< float > * errors
Definition: CscCalibMonToolBase.h:199
Example_ReadSampleNoise.ped
ped
Definition: Example_ReadSampleNoise.py:45
CscCalibReportSlope::getAmpProfs
const std::map< int, TProfile * > * getAmpProfs() const
getAmpProfs - get the map of ampProfs stored.
Definition: CscCalibReportSlope.cxx:86
CscCalibMonToolBase::copyDataToHists
virtual StatusCode copyDataToHists(HistCollection *histCollection)
Fills the histograms in the histCollection based on the data in the std::vector in the HistCollection...
Definition: CscCalibMonToolBase.cxx:889
CscCalibMonToolBase::ProcSetupInfo
Definition: CscCalibMonToolBase.h:180
CscCalibMonToolSlope::m_h_numBad
TH1I * m_h_numBad
Stores number of channels that are bad in several categories.
Definition: CscCalibMonToolSlope.h:98
CscCalibMonToolSlope::m_peaktOldColl
HistCollection * m_peaktOldColl
Definition: CscCalibMonToolSlope.h:113
CscCalibMonToolSlope::m_missingBadBin
int m_missingBadBin
Definition: CscCalibMonToolSlope.h:94
CscCalibMonToolSlope::m_h_interceptOverview
TH1F * m_h_interceptOverview
Definition: CscCalibMonToolSlope.h:101
CscCalibMonToolSlope::m_chi2Max
float m_chi2Max
Definition: CscCalibMonToolSlope.h:90
TProfile::Fill
int Fill(double, double)
Definition: rootspy.cxx:523
CscCalibMonToolBase::ProcSetupInfo::chi2BadBin
int chi2BadBin
Definition: CscCalibMonToolBase.h:193
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
CscCalibResultCollection
Definition: CscCalibResultCollection.h:24
trigbs_pickEvents.cnt
cnt
Definition: trigbs_pickEvents.py:71
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CscCalibMonToolBase::m_maxHashId
unsigned int m_maxHashId
Definition: CscCalibMonToolBase.h:113
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CscCalibMonToolSlope::m_ampColls
DataVector< HistCollection > m_ampColls
Definition: CscCalibMonToolSlope.h:122
CscCalibMonToolBase::ProcSetupInfo::maxDiff
float maxDiff
Definition: CscCalibMonToolBase.h:194
CscCalibMonToolSlope::handleParameter
virtual StatusCode handleParameter(const CscCalibResultCollection *parVals)
handleParameter sets things up for the base class procParameter.
Definition: CscCalibMonToolSlope.cxx:374
CscCalibMonToolBase::getEndCap
std::string getEndCap(int eta)
Gets the letter endcap (A or C) for a given eta index (1,-1)
Definition: CscCalibMonToolBase.cxx:1084
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
CscCalibMonToolSlope::m_fracBadBin
int m_fracBadBin
Definition: CscCalibMonToolSlope.h:93
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:127
CscCalibMonToolBase::m_calibResultKey
std::string m_calibResultKey
Calibration result storegate key.
Definition: CscCalibMonToolBase.h:166
IdentifierHash
Definition: IdentifierHash.h:38
CscCalibMonToolBase::finalize
virtual StatusCode finalize()
deletes private members
Definition: CscCalibMonToolBase.cxx:130
CscCalibMonToolSlope::m_slopeMaxDiff
float m_slopeMaxDiff
Maximum deviation from expected values allowed before m_h_numBad is incremented.
Definition: CscCalibMonToolSlope.h:90
dqBeamSpot.nEntries
int nEntries
Definition: dqBeamSpot.py:73
IdContext
class IdContext
Definition: IdContext.h:34
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
ManagedMonitorToolBase::regHist
virtual StatusCode regHist(TH1 *h, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical ...
Definition: ManagedMonitorToolBase.cxx:1454
CscCalibMonToolSlope::m_slopeRatioColl
HistCollection * m_slopeRatioColl
Definition: CscCalibMonToolSlope.h:117
CscCalibMonToolSlope::initialize
StatusCode initialize()
Initialize slope sepcific values.
Definition: CscCalibMonToolSlope.cxx:66
CscCalibMonToolSlope::m_newLiveBin
int m_newLiveBin
Definition: CscCalibMonToolSlope.h:96
CscCondDbData
Definition: CscCondDbData.h:24
TProfile::GetBinContent
double GetBinContent(int) const
Definition: rootspy.cxx:527
ManagedMonitorToolBase::newRunFlag
bool newRunFlag() const
Definition: ManagedMonitorToolBase.h:854
CscCalibMonToolBase::m_onlyExpectPrecisionHashIds
bool m_onlyExpectPrecisionHashIds
Hash Ids one would expect to be in calibration data.
Definition: CscCalibMonToolBase.h:132
CscCalibMonToolBase::m_numBad
unsigned int m_numBad
Definition: CscCalibMonToolBase.h:115
CscCalibMonToolSlope::m_peaktNewColl
HistCollection * m_peaktNewColl
Definition: CscCalibMonToolSlope.h:113
CscCalibReportSlope::getCalGraphs
const DataVector< TGraphErrors > * getCalGraphs() const
Retrieve pedestal amplitude histogram vector.
Definition: CscCalibReportSlope.cxx:68