17     const IInterface* 
parent) : 
 
   19   m_h_pedMissingChannels(nullptr),
 
   27   m_onlTHoldBreachBadBin(8),
 
   29   m_pedNewColl(nullptr),
 
   30   m_pedOldColl(nullptr),
 
   31   m_pedDiffColl(nullptr),        
 
   32   m_noiseNewColl(nullptr),
 
   33   m_noiseOldColl(nullptr),
 
   34   m_noiseDiffColl(nullptr),
 
   36   m_rmsNewColl(nullptr),
 
   37   m_rmsOldColl(nullptr),
 
   38   m_rmsDiffColl(nullptr),
 
   39   m_f001NewColl(nullptr),
 
   40   m_f001OldColl(nullptr),
 
   41   m_f001DiffColl(nullptr),
 
   42   m_onlTHoldBreachColl(nullptr),
 
   43   m_nEntriesColl(nullptr),
 
   44   m_tholdDiffColl(nullptr),
 
   45   m_maxBitCorrColl(nullptr),
 
   46   m_h2_rmsVnoiseEta(nullptr),
 
   47   m_h2_rmsVnoisePhi(nullptr)
 
  127     int highbound,lowbound,
nbins;
 
  130     name = 
"h_csc_calib_numSignificant";
 
  131     title = 
"Number of significant results.";
 
  133     yaxis = 
"Num channels with bad value.";
 
  136     m_h_numBad = 
new TH1I(
name.c_str(),
title.c_str(),highbound-lowbound+1,lowbound,highbound+1);
 
  137     m_h_numBad->GetYaxis()->SetTitle(yaxis.c_str());     
 
  138     m_h_numBad->GetXaxis()->SetTitle(xaxis.c_str());
 
  139     std::stringstream pedBinTitle; pedBinTitle << 
"#Delta ped > " << 
m_pedMaxDiff;
 
  141     std::stringstream noiseBinTitle; noiseBinTitle << 
"#Delta noise > "<< 
m_noiseMaxDiff;
 
  143     std::stringstream rmsBinTitle; rmsBinTitle << 
"#Delta RMS > " << 
m_rmsMaxDiff;
 
  145     std::stringstream f001BinTitle; f001BinTitle << 
"#Delta F001 > " << 
m_f001MaxDiff;
 
  147     std::stringstream statisticsBinTitle; statisticsBinTitle << 
"N Entries < " << 
m_minAmpHistEntries;
 
  149     std::stringstream chiBinTitle; chiBinTitle << 
"#frac{#chi^{2}}{ndf} > " << 
m_chi2Max;
 
  157     name = 
"h_csc_calib_pedMissingChannels";
 
  158     title = 
"Channels Missing Data From Pedestal Run.";
 
  159     xaxis = 
"Channel (Hash ID)";
 
  160     yaxis = 
"Number of Parameter Types Missing";
 
  171     std::string pedDataName      = 
"ped";
 
  172     std::string pedDataTitle     = 
"Pedestals";
 
  173     std::string pedSubDir        = 
"Ped";
 
  175     std::string noiseDataName    = 
"noise";
 
  176     std::string noiseDataTitle   = 
"Noise (ped sigma)";
 
  177     std::string noiseSubDir      = 
"Noise";
 
  179     std::string chi2DataName     = 
"chi2";
 
  180     std::string chi2DataTitle    = 
"Chi^2/ndf for Pedestal Gaussian Fit";
 
  181     std::string chi2SubDir       = 
"Chi2";
 
  183     std::string rmsDataName      = 
"rms";
 
  184     std::string rmsDataTitle     = 
"RMS from gaussian distribution";
 
  185     std::string rmsSubDir        = 
"RMS";
 
  187     std::string f001DataName      = 
"f001";
 
  188     std::string f001DataTitle     = 
"F001";
 
  189     std::string f001SubDir        = 
"F001";
 
  191     std::string onlTHoldBreachDataName = 
"onlTHoldBreach";
 
  192     std::string onlTHoldBreachDataTitle = 
"Online Threshold Breaches";
 
  193     std::string onlTHoldBreachSubDir = 
"OnlTHoldBreaches";
 
  195     std::string nEntriesDataName = 
"nEntries";
 
  196     std::string nEntriesDataTitle = 
"Number of Entries from Pedestal Amplitude Hist";
 
  197     std::string nEntriesSubDir    = 
"NumEntries";
 
  199     std::string maxBitCorrDataName = 
"maxBitCorr";
 
  200     std::string maxBitCorrDataTitle = 
"Maximimum Bit Correlation";
 
  201     std::string maxBitCorrSubDir = 
"MaxBitCorr";
 
  205     std::string newCatName       = 
"new";
 
  206     std::string newCatTitle      = 
"New";
 
  208     std::string oldCatName       = 
"old";
 
  209     std::string oldCatTitle      = 
"COOL";
 
  211     std::string diffCatName      = 
"diff";
 
  212     std::string diffCatTitle     = 
"Change of ";
 
  215     std::string pedAxisLabel = 
"Pedestal Mean (ADC counts)";
 
  216     std::string pedDiffAxisLabel = 
"Pedestal Difference (ADC counts)";
 
  218     float pedLowBound = 1900;
 
  219     float pedHighBound = 2200;
 
  221     std::string noiseAxisLabel = 
"Pedestal Noise (ADC counts)";
 
  222     std::string noiseDiffAxisLabel = 
"Noise Difference (ADC counts)";
 
  223     int noiseNumBins = 300;
 
  224     float noiseLowBound = 0;
 
  225     float noiseHighBound = 30;
 
  227     std::string chi2AxisLabel = 
"Chi^2/ndf";
 
  228     int chi2NumBins = 500;
 
  229     float chi2LowBound = 0;
 
  230     float chi2HighBound = 500;
 
  232     std::string rmsAxisLabel = 
"RMS (ADC Counts)";
 
  233     std::string rmsDiffAxisLabel = 
"RMS Difference (ADC Counts)";
 
  234     int rmsNumBins = 300;
 
  235     float rmsLowBound =0;
 
  236     float rmsHighBound = 30;
 
  238     std::string f001AxisLabel = 
"F001 (ADC)";
 
  239     std::string f001DiffAxisLabel = 
"F001 Difference (ADC)";
 
  240     int f001NumBins = 350;
 
  241     float f001LowBound =1950;
 
  242     float f001HighBound = 2300;
 
  244     std::string nEntriesAxisLabel = 
"Number of Entries";
 
  245     int nEntriesNumBins = 20;
 
  246     float nEntriesLowBound = 0; 
 
  247     float nEntriesHighBound = 10000;
 
  250     std::string maxBitCorrAxisLabel = 
"Correlation";
 
  251     int maxBitCorrNumBins = 300;
 
  252     float maxBitCorrLowBound = -3;
 
  253     float maxBitCorrHighBound = 3;
 
  291                                   pedAxisLabel, pedNumBins, pedLowBound, pedHighBound, pedSubDir) );
 
  295                                   pedAxisLabel, pedNumBins, pedLowBound, pedHighBound, pedSubDir) );
 
  299                                   pedDiffAxisLabel, 100, -2, 2, pedSubDir) );
 
  303                                   newCatTitle, noiseAxisLabel, noiseNumBins, noiseLowBound, noiseHighBound, noiseSubDir) );
 
  307                                   oldCatTitle, noiseAxisLabel, 100, -2, 2, noiseSubDir) );
 
  311                                   diffCatTitle, noiseDiffAxisLabel, noiseNumBins, -1*noiseHighBound, noiseHighBound,noiseSubDir) );
 
  315                                   newCatTitle, rmsAxisLabel, rmsNumBins, rmsLowBound, rmsHighBound, rmsSubDir) );
 
  319                                   oldCatTitle, rmsAxisLabel, rmsNumBins, rmsLowBound, rmsHighBound, rmsSubDir) );
 
  323                                   diffCatTitle, rmsDiffAxisLabel, rmsNumBins, -1*rmsHighBound, rmsHighBound,rmsSubDir) );
 
  327                                   newCatTitle, f001AxisLabel, f001NumBins, f001LowBound, f001HighBound, f001SubDir) );
 
  331                                   oldCatTitle, f001AxisLabel, 100, -2, 2, f001SubDir) );
 
  335                                   diffCatTitle, f001DiffAxisLabel, 60, -30, 30, f001SubDir) );
 
  339                                   "" , 
"Number of Online THold Breachs", 100, 0, 1000, onlTHoldBreachSubDir) );
 
  343                                   "", nEntriesAxisLabel, nEntriesNumBins, nEntriesLowBound, nEntriesHighBound, nEntriesSubDir, nEntriesHistMask) );
 
  346                                   chi2AxisLabel, chi2NumBins, chi2LowBound, chi2HighBound, chi2SubDir) );
 
  352                                     "", 
"", maxBitCorrAxisLabel, maxBitCorrNumBins, maxBitCorrLowBound, 
 
  353                                     maxBitCorrHighBound, maxBitCorrSubDir) );
 
  357   return StatusCode::SUCCESS;
 
  381     return StatusCode::FAILURE;
 
  392     ProcParameterInput.
doChi2 = 
true;
 
  408     ProcParameterInput.
doChi2 = 
false;
 
  423     ProcParameterInput.
doChi2 = 
false;
 
  438     ProcParameterInput.
doChi2 = 
false;
 
  445   else if (
parName == 
"OnlTHoldBreaches"){
 
  455     ProcParameterInput.
doChi2 = 
false;
 
  464     ATH_MSG_INFO( 
"CscCalibMonToolPed : Did not recognize parameter name "  
  465                   << 
parName << 
". This is usually ok."  );
 
  466     return StatusCode::SUCCESS;
 
  475     ATH_MSG_FATAL( 
"CscCalibMonToolPed : Failed to process parameter "  
  477     return StatusCode::FAILURE;
 
  505   if(
parName == 
"OnlTHoldBreaches"){
 
  508   return StatusCode::SUCCESS;
 
  512   for(
unsigned int chanItr = 0 ; chanItr <= 
m_maxHashId; chanItr++) {
 
  513     tholdColl->
data[chanItr] = pedColl->
data[chanItr] + multiplier*noiseColl->
data[chanItr];
 
  532     m_h2_rmsVnoiseEta = 
new TH2I(
"rmsVsigma_eta", 
"RMS versus sigma for #eta strips", 100, 0, 30, 100, 0,30) ;
 
  537     m_h2_rmsVnoisePhi = 
new TH2I(
"rmsVsigma_phi", 
"RMS versus sigma for #phi strips", 100, 0, 30, 100, 0,30) ;
 
  547       return StatusCode::FAILURE;
 
  551     for(
unsigned int hashId = 0; hashId < 
nEntries; hashId++){
 
  555       int measuresPhi = 
m_idHelperSvc->cscIdHelper().measuresPhi(chanId);
 
  575                        << 
m_histKey <<  
" aborting retrieving hists "  );
 
  576       return StatusCode::RECOVERABLE;
 
  579     if(repCont->
size() != 1)
 
  582                        << 
" does not have a size of one. Do not know how to proceed, so aborting" 
  583                        << 
" retrieving calibration histograms."  );
 
  584       return StatusCode::RECOVERABLE;
 
  589     if(pedReport->
getLabel() != 
"pedAmps")
 
  592                        << 
" Aborting hist retrieval."  );
 
  593       return StatusCode::RECOVERABLE;
 
  599                        << 
" Won't be in monitoring output file"  );
 
  603       ATH_MSG_INFO( 
"No bit histogram vector found from calibration. " 
  604                     << 
" Won't be in monitoring output file. "  );
 
  614     for(
unsigned int idItr = 0; idItr <= 
m_maxHashId; idItr++)
 
  619                          << 
" is being retrieved."  );
 
  624         int stationSize = 
m_idHelperSvc->cscIdHelper().stationName(chanId);
 
  627         int wireLayer = 
m_idHelperSvc->cscIdHelper().wireLayer(chanId);
 
  628         int measuresPhi = 
m_idHelperSvc->cscIdHelper().measuresPhi(chanId);
 
  634         std::string pedAmpPath = 
getFullPath(geoPath, 
"PedAmpHists", 
"");
 
  635         std::string sampPath = 
getFullPath(geoPath, 
"SampHists",
"");
 
  636         std::string bitHistPath = 
getFullPath(geoPath, 
"BitHists", 
"");
 
  637         std::string bitCorrelationPath(
"");
 
  639           bitCorrelationPath = 
getFullPath(geoPath, 
"BitCorrelations", 
"");
 
  641         ATH_MSG_DEBUG( 
"Hash Id: " << idItr << 
". Booking channel histograms in paths : " << pedAmpPath << 
" and " << bitHistPath   );
 
  648           sourceHist = 
const_cast<TH1I*
>((*pedAmpHists)[idItr]);
 
  651             ATH_MSG_ERROR( 
"There is no pedestal amplitude histogram with hashId " 
  653             return StatusCode::RECOVERABLE;
 
  656           double nEntries = sourceHist->GetEntries();
 
  661                            << 
" but maximum m_nEntriesColl.data.size() == " 
  663             return StatusCode::RECOVERABLE;
 
  675             std::stringstream 
name;
 
  678               << 
"_sector_" << sector 
 
  679               << 
"_layer_" << wireLayer
 
  680               << 
"_" << (measuresPhi ? 
"trans" : 
"prec")
 
  682               << std::setfill (
'0') <<  std::setw (measuresPhi ? 2 : 3) 
 
  687             sourceHist->SetName(
name.str().c_str());
 
  696           size_t hNum = histVect->
size();
 
  697           for(
size_t hCnt = 0; hCnt < hNum; hCnt++) {
 
  698             sourceHist = 
const_cast<TH1I*
>((*histVect)[hCnt]);
 
  699             std::stringstream 
name;
 
  702               << 
"_sector_" << sector 
 
  703               << 
"_layer_" << wireLayer
 
  704               << 
"_" << (measuresPhi ? 
"trans" : 
"prec")
 
  706               << std::setfill (
'0') <<  std::setw (measuresPhi ? 2 : 3) 
 
  710             sourceHist->SetName(
name.str().c_str());
 
  720           sourceHist = 
const_cast<TH1I*
>((*bitHists)[idItr]);
 
  724                            << idItr << 
" Quiting out of detailed histogram loop."  );
 
  725             return StatusCode::RECOVERABLE;
 
  728           std::stringstream name2;
 
  731             << 
"_sector_" << sector 
 
  732             << 
"_layer_" << wireLayer
 
  733             << 
"_" << (measuresPhi ? 
"trans" : 
"prec")
 
  735             << std::setfill (
'0') <<  std::setw (measuresPhi ? 2 : 3) 
 
  737           sourceHist->SetName(name2.str().c_str());
 
  745           TH2F* 
hist = 
const_cast<TH2F*
>((*bitCorrelations)[idItr]);
 
  750           size_t nx = 
hist->GetXaxis()->GetNbins();
 
  751           size_t ny = 
hist->GetYaxis()->GetNbins();
 
  752           size_t x_cut = nx -1; 
 
  753           size_t y_cut = ny -1; 
 
  754           for(
size_t xi = 1; xi < x_cut; xi++){
 
  755             for(
size_t yi = 1; yi < y_cut; yi++){
 
  758               float val = 
hist->GetBinContent(xi,yi);
 
  770     ATH_MSG_DEBUG( 
"No channels flagged for debug info retrieval" );
 
  780   return StatusCode::SUCCESS;    
 
  788   report << 
"Num channels with Delta Ped > " << 
m_pedMaxDiff << 
" : " << numBadPed << std::endl ;
 
  791   report << 
"Num channels with Delta RMS > " << 
m_rmsMaxDiff << 
" : " << numBadRms << std::endl ;
 
  794   report << 
"Num channels with Delta f001 > " << 
m_f001MaxDiff << 
" : " << numBadF001 << std::endl ;
 
  797   report << 
"Num channels with Delta sigma > " << 
m_noiseMaxDiff << 
" : " << numBadNoise << std::endl ;
 
  801     << 
": " << numBadNEntries <<std::endl ;
 
  805     << 
": " << numBreachEntries <<std::endl ;
 
  807   if(!(numBadPed >100 || numBadRms > 100 || numBadNEntries>0|| numBreachEntries > 0)){
 
  809     allGoodFile << 
"All tests past.";
 
  815   reportFile << 
"\n\n";
 
  816   reportFile << 
report.str();