ATLAS Offline Software
CscCalcPed.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 "CscCalcPed.h"
6 
7 #include "GaudiKernel/Chrono.h"
8 #include "MuonRDO/CscRawData.h"
14 
15 #include "TF1.h"
16 
17 #include <iostream>
18 #include <fstream>
19 #include <bitset>
20 #include <inttypes.h>
21 
22 namespace MuonCalib {
23 
24  CscCalcPed::CscCalcPed(const std::string& name, ISvcLocator* pSvcLocator) :
25  AthAlgorithm(name,pSvcLocator),
26  m_chronoSvc(nullptr),
27  m_maxStripHash(0),
28  m_numBits(12),
29  m_ampHists(nullptr),
30  m_sampHists(nullptr),
31  m_bitHists(nullptr),
32  m_bitProds(nullptr),
33  m_bitCorrelation(nullptr),
34  m_peds(nullptr),
35  m_noises(nullptr),
36  m_rmses(nullptr),
37  m_f001s(nullptr),
38  m_onlineTHoldBreaches(nullptr),
39  m_eventCnt(0),
40  m_crossTalkFix(nullptr)
41  {
42  declareProperty("OutputFile", m_outputFileName = "output.cal");
43  declareProperty("TitlePrefix",m_titlePrefix = ""); //Prefix appended to title of histograms and graphs
44  declareProperty("TitlePostfix",m_titlePostfix = ""); //Prefix appended to title of histograms and graphs
45  declareProperty("PedAmpHighBound", m_ampHistHighBound = 2600);
46  declareProperty("PedAmpLowBound", m_ampHistLowBound = 1800);
47  declareProperty("PedAmpNumBins", m_ampHistNumBins = 800);
48  declareProperty("ExpectedChamberLayer", m_expectedChamberLayer = 2);
49  declareProperty("ThresholdMultiplier", m_thresholdMultiplier = 3.1);
50  declareProperty("DoBitHists", m_doBitHists = false);
51  declareProperty("CalOutputVersion", m_calOutputVersion="03-00");
52  declareProperty("DoCorrelation", m_doCorrelation = false);
53 
54  declareProperty("DoSampHists", m_doSampleHists = false);
55  declareProperty("NumSamplesExpected", m_numSamplesExpected = 4);
56  declareProperty("DoF001", m_doF001 = true);
57 
58  declareProperty("OnlineCalibFile", m_onlineDbFile = "", "File with data currently stored in online configuration database");
59  declareProperty("CompareOnlineCalibFile",m_doOnlineDbFile = true, "Compare new to online data?");
60 
61 
62  //Can't do correlation without bitHists
63  if(!m_doBitHists){
64  m_doCorrelation = false;
65  }
66  }
67 
69  {
70  ATH_MSG_INFO("CscCalcPed::initialize() called");
71 
72  if(m_doOnlineDbFile && m_onlineDbFile ==""){
73  ATH_MSG_FATAL("Either specify an OnlineCalibFile or set CompareOnlineCalibFile to false");
74  return StatusCode::FAILURE;
75  }
76 
77  //*******Register services and tools *********/
79 
80  ATH_CHECK(m_idHelperSvc.retrieve());
81 
83 
84  ATH_CHECK(service("ChronoStatSvc",m_chronoSvc));
85 
86  ATH_CHECK(m_cscRdoDecoderTool.retrieve());
87 
88  IToolSvc* toolSvc=nullptr;
89  ATH_CHECK(service("ToolSvc",toolSvc));
90 
91  //Set to SG::VIEW_ELEMENTS, since we want root to do its own memory
92  //management.
96 
97  //Loop through ids to find out what hash range we're working on (in case we're using some
98  //unusual geometry)
99  const std::vector<Identifier> &ids = m_idHelperSvc->cscIdHelper().idVector();
100 
101 
102  m_maxStripHash = 0;
103 
104  for(const auto &thisChamberId: ids)
105  {
106  std::vector<Identifier> stripVect;
107  m_idHelperSvc->cscIdHelper().idChannels(thisChamberId,stripVect);
108 
109 
110 
111  for(const auto & thisStrip: stripVect)
112  {
113  IdentifierHash stripHash;
114  m_idHelperSvc->cscIdHelper().get_channel_hash(thisStrip,stripHash);
115  if((unsigned int)stripHash > m_maxStripHash)
116  m_maxStripHash = (int)stripHash;
117  }//End strip loop
118  }//end chamber loop
119 
120 
121  //Now creating ampHists. It wasn't done in last loop since there
122  //is no gaurantee that it will come out in strip order, and we assume
123  //later that m_ampHists's index = stripHash
124  ATH_MSG_DEBUG("Preparing ampHists. Only allowing those for " << " chamberLayer " << m_expectedChamberLayer);
125  for(unsigned int stripItr = 0 ; stripItr <=m_maxStripHash; stripItr++)
126  {
127 
128  IdentifierHash stripHash =stripItr;
129  Identifier stripId;
130  IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
131  m_idHelperSvc->cscIdHelper().get_id(stripHash, stripId, &channelContext);
132 
133  int chamLayer = m_idHelperSvc->cscIdHelper().chamberLayer(stripId);
134  if(chamLayer == m_expectedChamberLayer) //Only second chamber layer exists
135  {
136  int stationEta = m_idHelperSvc->cscIdHelper().stationEta(stripId);
137  int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(stripId);
138  int stripNumber = m_idHelperSvc->cscIdHelper().strip(stripId);
139  int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(stripId);
140  char orientation = m_idHelperSvc->cscIdHelper().measuresPhi(stripId) ? 'Y':'X';
141 
142 
143  char name[30],titleSeed[600];
144  TH1I* hist = nullptr;
145 
146  int stationName = m_idHelperSvc->cscIdHelper().stationName(stripId);
147  //Amplitude histogram
148  sprintf(name, "ampHist%u",stripItr);
149  sprintf(titleSeed, "Amplitude Histogram for eta %d, sector %d, layer %d%c, strip %d",
150  stationEta,(2*stationPhi+50 - stationName),wireLayer,orientation,stripNumber);
151  std::string title = m_titlePrefix + titleSeed + m_titlePostfix;
152 
155  hist->GetXaxis()->SetTitle("Amplitude (ADC value)");
156  hist->GetYaxis()->SetTitle("Counts");
158 
159  if(m_doSampleHists) {
161  for(int cnt = 0; cnt < m_numSamplesExpected ; cnt++) {
162  sprintf(name, "sampHist%u_%d",stripItr,cnt);
163  sprintf(titleSeed, "Amplitude Histogram for eta %d, sector %d, layer %d%c, strip %d, sample %d",
164  stationEta,(2*stationPhi+50 - stationName),wireLayer,orientation,stripNumber,cnt);
165 
168  tempVect->push_back(hist);
169 
170  }
171  m_sampHists->push_back(tempVect);
172  }
173 
174  if(m_bitHists)
175  {
176  //Bit histogram (for looking for stuck-bits)
177  sprintf(name, "bitHist%u",stripItr);
178  sprintf(titleSeed, "Bit histogram for eta %d, sector %d, layer %d%c strip %d",
179  stationEta,(2*stationPhi+50 - stationName),wireLayer,orientation,stripNumber);
180  title = m_titlePrefix + titleSeed + m_titlePostfix;
181  hist = new TH1I(name, title.c_str(), m_numBits, 0, m_numBits); //12 bits
182  hist->GetXaxis()->SetTitle("Bit");
183  hist->GetYaxis()->SetTitle("Counts");
185  if(m_doCorrelation) {
186  (*m_bitProds)[stripItr] = new TH2F(TString::Format("bitProds%d",stripItr),"Bit products", m_numBits,0,m_numBits, m_numBits, 0, m_numBits);
187 
188  }
189  }
190  }
191  else
192  {
193  m_ampHists->push_back(nullptr);
194  if(m_bitHists) m_bitHists->push_back(nullptr);
195  if(m_doSampleHists) m_sampHists->push_back(nullptr);
196  }
197  }//end strip loop
198 
199  //Setup result collections. These will be passed to storegate for any monitoring later
200  m_peds = new CscCalibResultCollection("ped");
201  m_noises = new CscCalibResultCollection("noise");
202  m_rmses = new CscCalibResultCollection("rms");
203  if(m_doF001){
204  ATH_MSG_DEBUG("Doing f001");
205  //For f001 values
206  m_f001s = new CscCalibResultCollection("f001");
207 
208  //Initializing for comparing new values to an online database file
209  if(m_doOnlineDbFile){
210 
211  //How many samples failed the online threshold test of f001 +2*RMS
212  //(f001 and RMS read from a file from online configuration db)
213  m_onlineTHoldBreaches = new CscCalibResultCollection("OnlTHoldBreaches");
214 
215 
216 
217  //Vector we use to count the online thresholds
219 
220  //Retrieve current online thresholds
222  std::ifstream ifile; ifile.open(m_onlineDbFile.c_str());
223  if(!ifile.is_open()){
224  ATH_MSG_FATAL("Failed to open online database file " << m_onlineDbFile);
225  return StatusCode::FAILURE;
226  }
227  std::string buf;
228  ifile >> buf; // skip 32 at start of file
229  unsigned int onlineId;
230  unsigned int hashId;
231  double rms;
232  double f001;
233 
234  if(!ifile){
235  ATH_MSG_FATAL("Problem with file after one word read in.");
236  return StatusCode::FAILURE;
237  }
238 
239 
240  ATH_MSG_DEBUG("Reading in online thresholds from file " << m_onlineDbFile);
241  ATH_MSG_DEBUG("First (junk) word: " << buf);
242  int chanCnt = 0;
243  while(ifile >> std::hex >> onlineId >> std::dec) {
244  chanCnt++;
245  onlineToOfflineHashId(onlineId,hashId);
246 
247  ifile >> buf >> buf >> buf >> buf >> rms >> buf >> f001;
248  double thold = f001 + 2*rms;
249  ATH_MSG_VERBOSE("onlid: " << std::hex << onlineId << std::dec << " hash: " << hashId << " rms: " << rms << " f001: " << f001 << " thold: " << thold);
250  m_onlineThresholds.at(hashId) = thold;
251  if(!ifile)
252  ATH_MSG_VERBOSE("input file is done, ready to close!");
253  else
254  ATH_MSG_VERBOSE("Input file still good!");
255 
256 
257  }
258  if(chanCnt != 30720){
259  ATH_MSG_FATAL("Did not retrieve expected 30720 channels from online database! Retrieved: " << chanCnt);
260  ATH_MSG_FATAL("Last onlineId read: " << std::hex << onlineId << std::dec);
261  return StatusCode::FAILURE;
262  }
263 
264  }//if m_doOnlineDBFile
265  }//db file
266 
267  ATH_MSG_INFO("highest strip hash id is " << m_maxStripHash);
268 
269  //If we're doing correlation plots, set up the product histogram array
270  if(m_doCorrelation){
273  }
274 
275 
276 
277 
278 
279  ATH_MSG_INFO("m_prods value: " << m_bitProds << "\ndoCorrelation" << m_doCorrelation);
280  return StatusCode::SUCCESS;
281  }
282 
283  //Execute loops through all strips and fills histograms
285  {
286  ATH_MSG_DEBUG("Begin execute");
287  //collectEventInfo collects infomation about each event by filling ampHistCollection and peaktHist.
289 
290  if(!sc.isSuccess())
291  {
292  ATH_MSG_ERROR("There was an error collecting information from the RDO this event.");
293  return StatusCode::RECOVERABLE;
294  }
295  ATH_MSG_DEBUG("End execute");
296  return StatusCode::SUCCESS;
297  } //end execute()
298 
300  if(m_eventCnt ==0)
301  {
302  ATH_MSG_FATAL("No events processed!");
303  return StatusCode::FAILURE;
304  }
305  else
306  ATH_MSG_INFO("In finalize() after analyzing " << m_eventCnt << " events ");
307 
308  StatusCode sc;
309 
310  ATH_MSG_INFO("not dump all hists!");
311 
312  //calculateParameters() finds means and fits gain curves from the data in
313  //m_ampHistCollection and/or m_peaktHist
315  if(!sc.isSuccess())
316  {
317  ATH_MSG_FATAL("Calculation of parameters failed!");
318  return StatusCode::FAILURE;
319  }
320  ATH_MSG_DEBUG("Finished calculating parameters");
321 
322 
323  //writeCalibrationFile() writes the calculated parameters into a calibration fie.
325  if(!sc.isSuccess())
326  {
327  ATH_MSG_FATAL("Calculation of parameters failed!");
328  return StatusCode::FAILURE;
329  }
330 
331  //Record report (ampHists) and results to storegate for future algorithms
332  //like COOL database storage or monitoring to collect
333  sc =storeGateRecord();
334  if (!sc.isSuccess())
335  {
336  ATH_MSG_FATAL("Failed recording data in storegate");
337  return StatusCode::FAILURE;
338  }
339 
340  ATH_MSG_INFO("Finished finalize");
341  return StatusCode::SUCCESS;
342  }//end finalize()
343 
344 
345  //Collect event info is run every event, gathering amplitutdes and peakting times.
347  {
348  //start the timer
349  Chrono chrono(m_chronoSvc,"collectEventInfo");
350 
351 
352  m_eventCnt++;
353  ATH_MSG_DEBUG("Collecting event info for event " << m_eventCnt);
354  //Below might need to be changed depending on how we get data
355  const CscRawDataContainer* rawDataContainer;
356  StatusCode sc_read = evtStore()->retrieve(rawDataContainer, "CSCRDO");
357  if (sc_read != StatusCode::SUCCESS)
358  {
359  ATH_MSG_FATAL("Could not find event");
360  return StatusCode::FAILURE;
361  }
362 
363  ATH_MSG_VERBOSE("Retrieved RDO from storegate ");
364 
365  if(rawDataContainer->size() == 0)
366  {
367  ATH_MSG_FATAL("no rods in RDO!");
368  return StatusCode::FAILURE;
369  }
370 
371  ATH_MSG_VERBOSE("There are " << rawDataContainer->size() << " rods in the RDO");
372 
373  IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
374 
375  //Loop over RODs (data from 2 chambers), each of which is in
376  //a single CscRawaData collection
377 
378  for(const auto rod : *rawDataContainer)
379  {
380  Chrono chronoRod(m_chronoSvc,"RodItr");
381  ATH_MSG_VERBOSE("Examining a ROD");
382 
383  ATH_MSG_VERBOSE("There are " << rod->size() << " clusters in the ROD");
384  if(rod->size() >0)
385  {
386  //Loop over strips in rod
387 
388 
389  for(const auto cluster: *rod)
390  {
391  Chrono chronoClus(m_chronoSvc,"ClusterItr");
392  int numStrips = cluster->width();
393  int samplesPerStrip = (cluster->samples()).size()/numStrips;
394 
395  ATH_MSG_VERBOSE("About to collect info from " << numStrips << " strips");
396  for(int stripItr = 0; stripItr <numStrips; stripItr++)
397  {
398 
399  Chrono chronoStrip(m_chronoSvc,"stripItr");
400  // WP Added
401  Identifier channelId =m_cscRdoDecoderTool->channelIdentifier(cluster, &m_idHelperSvc->cscIdHelper(), stripItr);
402  IdentifierHash cscChannelHashId;
403  m_idHelperSvc->cscIdHelper().get_channel_hash(channelId, cscChannelHashId);
404 
406  int stripHash = cscChannelHashId;
407 
408  Identifier stripId;
409  m_idHelperSvc->cscIdHelper().get_id(stripHash, stripId, &channelContext);
410 
411 
412  Chrono chronoAfterId(m_chronoSvc,"afterID1");
413 
414  if( m_idHelperSvc->cscIdHelper().chamberLayer(channelId) != m_expectedChamberLayer)
415  {
416  ATH_MSG_WARNING("Wrong chamber layer a hash ("
417  << stripHash << ") from the wrong multilayer has appeared in the data. Its string id is " << m_idHelperSvc->cscIdHelper().show_to_string(stripId)
418  << " " << m_idHelperSvc->cscIdHelper().show_to_string(channelId));
419 
420  ATH_MSG_INFO("WP added (1) "
421  << m_idHelperSvc->cscIdHelper().stationEta(stripId) << " " << m_idHelperSvc->cscIdHelper().measuresPhi(stripId) << " "
422  << stripHash << " " << cscChannelHashId);
423 
424  ATH_MSG_INFO("WP added (2) "
425  << m_idHelperSvc->cscIdHelper().stationEta(stripId) << " " << m_idHelperSvc->cscIdHelper().measuresPhi(stripId) << " "
426  << stripId << " " << channelId);
427 
428  stripId = m_idHelperSvc->cscIdHelper().channelID(
429  m_idHelperSvc->cscIdHelper().stationName(stripId),
430  m_idHelperSvc->cscIdHelper().stationEta(stripId),
431  m_idHelperSvc->cscIdHelper().stationPhi(stripId),
432  2,
433  m_idHelperSvc->cscIdHelper().wireLayer(stripId),
434  m_idHelperSvc->cscIdHelper().measuresPhi(stripId),
435  m_idHelperSvc->cscIdHelper().strip(stripId)
436  );
437  IdentifierHash newHash;
438  m_idHelperSvc->cscIdHelper().get_channel_hash(stripId, newHash );
439  stripHash = newHash;
440  ATH_MSG_DEBUG("New hash " << stripHash);
441  }
442  else{
443  if(m_idHelperSvc->cscIdHelper().measuresPhi(stripId))
444  ATH_MSG_VERBOSE(" good id Measures Phi");
445  else
446  ATH_MSG_VERBOSE(" good id is eta");
447  }
448 
449  Chrono chronoAfterId2(m_chronoSvc,"afterID2");
450 
451  //Get samples. Each shows amplitude of pulse at different
452  //time slice.
453  std::vector<uint16_t> samples;
454  cluster->samples(stripItr,samplesPerStrip,samples);
455 
456  //Test for threshold breach...
457  size_t sampCnt = 0;
458 
459 
460  for(const auto & thisSample: samples)
461  {
462  (*m_ampHists)[stripHash]->Fill(thisSample);
463  if(m_doSampleHists)
464  (*((*m_sampHists)[stripHash]))[sampCnt]->Fill(thisSample);
465  if(m_bitHists && sampCnt==1)
466  {
467  TH2F* prodHist = nullptr;
468  if(m_bitProds)
469  prodHist = (*m_bitProds)[stripHash];
470  if(!fillBitHist((*m_bitHists)[stripHash],thisSample, prodHist).isSuccess())
471  ATH_MSG_WARNING("Failed recording bits for strip " << stripHash);
472  }//end if(m_bitHists)
473 
474  if(m_doOnlineDbFile){//m_doF001){
475  //test if any samples are obvoe the online threshold
476  if (thisSample > m_onlineThresholds[stripHash] ){
477  m_onlineThresholdFailureCount[stripHash]++;
478  ATH_MSG_VERBOSE("StripHash: " << stripHash <<
479  " has online threshold breach. Sample: " << thisSample << " Thold: "
480  << m_onlineThresholds[stripHash]);
481  }
482  }
483  sampCnt++;
484  }//end Sample loop
485  }//end strip loop
486  }//end cluster loop
487  }
488  else
489  ATH_MSG_DEBUG("There is an empty rod (CscRawDataContainer).");
490  }//end rod loop
491  ATH_MSG_DEBUG("end collectEventInfo()");
492  return StatusCode::SUCCESS;
493  }// end collectEventInfo()
494 
495 
496  //Calculate parameters is called during finalize,
497  //calculates the parameter values.
499  {
500  Chrono chrono(m_chronoSvc,"calculateParameters");
501 
502 
503  //**********Calculate all the parameters from data collected during execute*****************//
504 
505  for(unsigned int stripHash = 0 ;stripHash <= m_maxStripHash; stripHash++)
506  {
507  if(stripHash < 50 || stripHash%1000 == 0)
508  {
509  ATH_MSG_INFO("Analyzing strip with hash " << stripHash << " out of " << m_maxStripHash);
510  ATH_MSG_VERBOSE((float)clock()/((float)CLOCKS_PER_SEC) << " is the time");
511  }
512 
513  TH1I * ampHist = (*m_ampHists)[stripHash];
514  if(ampHist)
515  {
516  ATH_MSG_VERBOSE("Have data for strip hash " << stripHash);
517  if(ampHist->GetEntries() >0) //If strip wasn't tested, it won't have entries
518  {
519  //Following Schernau's work
520  float histMean = ampHist->GetMean();
521  float histRMS = ampHist->GetRMS();
522  float histRMSError = ampHist->GetRMSError();
523 
524  float lowbound = histMean - 3*histRMS;
525  float highbound = histMean + 3*histRMS;
526  ATH_MSG_VERBOSE("About to fit...");
527 
528  int result = ampHist->Fit("gaus","QL","",lowbound,highbound);
529  ATH_MSG_VERBOSE("Result is " << result);
530  TF1 * fittedFunction = ampHist->GetFunction("gaus");
531  double meanError = fittedFunction->GetParError(1);
532  double sigma = fittedFunction->GetParameter(2);
533  double sigmaError = fittedFunction->GetParError(2);
534  double chi2 = fittedFunction->GetChisquare();
535  int ndf = fittedFunction->GetNDF();
536 
537  m_peds->push_back(new CscCalibResult(stripHash,histMean,meanError,chi2,ndf));
538  m_noises->push_back(new CscCalibResult(stripHash,sigma,sigmaError,chi2,ndf));
539  m_rmses->push_back(new CscCalibResult(stripHash,histRMS,histRMSError,0,0));
540 
541 
542 
543  //Integrated threshold (f001) calculation
544  if(m_doF001){
545  int num = (int)ampHist->GetEntries();
546  int thr = ampHist->GetNbinsX() + 1; // start at overflow bin
547  double maxSum = 0.001*num; // 99.90 of pedestals under thr
548  //double maxSum = 0.0001*num; // 99.99 of pedestals under thr
549 
550  double sum = 0;
551  do{
552  sum += ampHist->GetBinContent(thr);
553  thr--;
554  } while ((thr>0)&&(sum<maxSum));
555 
556  //double threshold = ampHist->GetXaxis()->GetBinLowEdge(thr) +2; //For some reason +2 here matches Michael Schernau's +1
557  double threshold = ampHist->GetXaxis()->GetBinLowEdge(thr) +1; //For some reason +2 here matches Michael Schernau's +1
558  m_f001s->push_back(new CscCalibResult(stripHash,threshold,0,0,0));
559 
560  if(m_doOnlineDbFile){
562  }
563  }
564  }
565  }
566  else
567  ATH_MSG_VERBOSE("Don't have data for strip hash " << stripHash);
568  }//end loop over strips
569 
570 
571  //don't need it anymore, clear ram taken by m_failure tests
572  ATH_MSG_DEBUG("Clearing m_onlineThresholdFailureCount");
574 
575 
576  ATH_MSG_INFO("Completed calculating parameters.");
577 
578  return StatusCode::SUCCESS;
579  }//End calculateParameters()
580 
581  //writeCalibrationFile() dumps the parameters to disk
583  {
584  Chrono chrono(m_chronoSvc,"writeFile");
585  //***Take conditions data held in summary histograms and print to the calibration file***//
586  ATH_MSG_INFO("Parameters calculated, preparing to output to file: " << m_outputFileName << " Types 1 and " << m_calOutputVersion);
587 
588  ATH_CHECK( calOutput1() );
589 
590  if(m_calOutputVersion == "00-00"){
591  return calOutput0();
592  }
593  else if(m_calOutputVersion == "03-00") {
594  return calOutput3();
595  }
596  else{
597  ATH_MSG_WARNING("Don't know how to write calibration file version " << m_calOutputVersion);
598  return StatusCode::RECOVERABLE;
599  }
600  // this part of the code cannot be reached since one of the if statements before already exits the code
601  // return StatusCode::SUCCESS;
602  }
603 
605 
606  std::ofstream out;
607  out.open(m_outputFileName.c_str());
608  if(!out.is_open())
609  {
610  ATH_MSG_ERROR("Can't open file " << m_outputFileName.c_str());
611  return StatusCode::RECOVERABLE;
612  }
613 
614  out << "00-00 ";
615  out << m_peds->size() << " ";
616  out << "ped ";
617  out << "noise ";
618  out << "rms ";
619  out << "END_HEADER\n";
620 
621  ATH_MSG_DEBUG("Begining loop over all " << m_peds->size() << " channels data was collected for.");
622 
623  //form is:hashID chamber LayerOrientationStrip parametervalue parametervalue
628  for(;pedItr!= pedEnd;++pedItr,++noiseItr, ++rmsItr)//,tholdItr++)
629  {
630  int hashId = (*pedItr)->hashId();
631  double ped = (*pedItr)->value();
632  double noise = (*noiseItr)->value();
633  double rms = (*rmsItr)->value();
634 
635  ATH_MSG_DEBUG("we're on hash " << hashId << " with pedestal " << ped << "and noise " << noise);
636  Identifier id;
637  IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
638  m_idHelperSvc->cscIdHelper().get_id(hashId,id, &channelContext);
639 
640  Identifier chamberId = m_idHelperSvc->cscIdHelper().elementID(id);
641  if(!m_idHelperSvc->cscIdHelper().valid(chamberId))
642  {
643  ATH_MSG_WARNING(chamberId.getString() << " is not a valid id!");
644  ATH_MSG_WARNING("identifier is: " << m_idHelperSvc->cscIdHelper().show_to_string(chamberId));
645  }
646 
647  IdentifierHash chamberHash;
648  m_idHelperSvc->cscIdHelper().get_module_hash(id,chamberHash);
649 
650  //print out values.
651  out << hashId;
652  out <<" " << chamberHash;
653  out << " " << m_idHelperSvc->cscIdHelper().show_to_string(id) << " ";
654  out << " " << ped;
655  out << " " << noise;
656  out << " " << rms;
657  out << "\n" ;
658  } //end loop over hash Ids
659 
660  out.close(); //done writing
661  ATH_MSG_INFO("File written");
662  return StatusCode::SUCCESS;
663  }//end calOutput0
664 
665  //calOutput1 prints out calibration output file in format Michael Schernau's
666  //online software likes to read
668 
669  std::ofstream out;
670  std::string onlineFileName = m_outputFileName + "_online";
671 
672  out.open(onlineFileName.c_str());
673  if(!out.is_open())
674  {
675  ATH_MSG_ERROR("Can't open online file " << m_outputFileName.c_str());
676  return StatusCode::RECOVERABLE;
677  }
678 
679  out << "32\n";
680 
681  ATH_MSG_DEBUG("Begining loop over all " << m_peds->size() << " channels data was collected for.");
682 
684  const CscCondDbData* readCdo{*readHandle};
685 
686  //form is:hashID chamber LayerOrientationStrip parametervalue parametervalue
692  for(;pedItr!= pedEnd;++pedItr,++noiseItr, ++rmsItr, ++f001Itr)//,tholdItr++)
693  {
694  int hashId = (*pedItr)->hashId();
695  double ped = (*pedItr)->value();
696  double noise = (*noiseItr)->value();
697  //double rms = (*rmsItr)->value();
698  double f001 = (*f001Itr)->value();
699 
700  //double thold = (*tholdItr)->value();
701  std::string onlineHexId;
702 
703  //Online ids are same as "string ids" used internally in COOL db.
704  readCdo->indexToStringId(&m_idHelperSvc->cscIdHelper(), hashId, "CHANNEL", onlineHexId).ignore();
705 
706  ATH_MSG_DEBUG("we're on hash " << hashId << " with pedestal " << ped << "and noise " << noise);
707  Identifier id;
708  IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
709  m_idHelperSvc->cscIdHelper().get_id(hashId,id, &channelContext);
710 
711  Identifier chamberId = m_idHelperSvc->cscIdHelper().elementID(id);
712  if(!m_idHelperSvc->cscIdHelper().valid(chamberId))
713  {
714  ATH_MSG_WARNING(chamberId.getString() << " is not a valid id!");
715  ATH_MSG_WARNING("identifier is: " << m_idHelperSvc->cscIdHelper().show_to_string(chamberId));
716  }
717 
718  char orientationChar = (m_idHelperSvc->cscIdHelper().measuresPhi(id) ? 'Y':'X');
719 
720 
721  IdentifierHash chamberHash;
722  m_idHelperSvc->cscIdHelper().get_module_hash(id,chamberHash);
723 
724  //print out values.
725  out.setf(std::ios::right);//right aligned columns
726  out << std::setfill('0') << std::setw(8) << onlineHexId;
727  out <<" "
728  << std::setw(2) << chamberHash << orientationChar << (m_idHelperSvc->cscIdHelper().wireLayer(id)-1)
729  <<" "
730  << std::setw(3) << m_idHelperSvc->cscIdHelper().strip(id) -1 << " " ;
731  out.setf(std::ios::fixed);
732 
733 
734  out << " " << std::setprecision(3) << std::setw(8) << ped << " 0000.00";
735  out << " " << std::setprecision(3) << std::setw(8) << noise << " 0000.000";
736  out << " " << f001;
737  out << "\n" ;
738  } //end loop over hash Ids
739 
740  out.close(); //done writing
741  ATH_MSG_INFO("File written");
742  return StatusCode::SUCCESS;
743  }//end calOutput1
744 
745  //calOutput3 outputs version 03-00 calibration files, which are what the most recent version
746  //of CscCoolReadWrite takes for input
748  std::ofstream out;
749  out.open(m_outputFileName.c_str());
750  if(!out.is_open())
751  {
752  ATH_MSG_ERROR("Can't open output 3 type file " << m_outputFileName.c_str() << " for writing ");
753  return StatusCode::RECOVERABLE;
754  }
755  out << "03-00 <END_HEADER>";
756 
760  if(m_doF001)
762  out << "\n<END_FILE>";
763  out.close();
764 
765  return StatusCode::SUCCESS;
766  }
767 
768 
769  //Outputs a single parameter in version 03-00
771 
773  const CscCondDbData* readCdo{*readHandle};
774 
775  out << "\n";
776  out << "<NEW_PAR> " << results.parName() << "\n";
777  std::string idString;
778 
781  for(; resItr != resEnd; ++resItr){
782  unsigned int hashId = (*resItr)->hashId();
783  double value = (*resItr)->value();
784  std::string idString;
785 
786  readCdo->indexToStringId(&m_idHelperSvc->cscIdHelper(), hashId, "CHANNEL", idString).ignore();
787 
788  out << idString << " " << value << "\n";
789  }
790 
791  out << "<END_PAR>" ;
792  }
793 
794 
795 
796  //Record ampHist and calib results to storegate for monitoring and maybe other
797  //programs
799  {
800  StatusCode sc = StatusCode::SUCCESS;
801 
802  bool thereIsAnError = false;
803 
804  std::string histKey = "cscPedCalibReport";
805  ATH_MSG_DEBUG("Recording pedestal amplitude histograms to TDS with key " << histKey);
806 
807  //CscCalibReport has extraraneous monitoring information
808  CscCalibReportPed * report = new CscCalibReportPed("pedAmps");
809  report->setPedAmpHists(m_ampHists); //report now has ownership of the DataVector
810  report->setBitHists(m_bitHists); //report now has ownership of the DataVector
811  if(m_doSampleHists){
812  report->setSampHists(m_sampHists);
813  }
814  if(m_bitProds){
815  report->setBitCorrelation( makeBitCorrelation());
816  }
817 
818  CscCalibReportContainer * repCont = new CscCalibReportContainer(histKey);
819  repCont->push_back(report);
820 
821  sc = evtStore()->record(repCont, histKey);
822  if(!sc.isSuccess())
823  {
824  ATH_MSG_ERROR("Failed to record CscCalibReportPed to storegate");
825  thereIsAnError = true;
826  delete repCont;
827  }
828 
829 
830  //CscCalibResult contains the actual parameters that we recorded, mostly things that should be entered
831  //into cool
832  std::string key = "CscCalibResultPed";
833  ATH_MSG_DEBUG("Recording calibration results to TDS with key " << key);
834 
835  CscCalibResultContainer * calibResults
836  = new CscCalibResultContainer("CscCalibResultPed");
837  calibResults->push_back(m_peds);
838  calibResults->push_back(m_noises);
839  calibResults->push_back(m_rmses);
840  calibResults->push_back(m_f001s);
841  if(m_doOnlineDbFile)
842  calibResults->push_back(m_onlineTHoldBreaches);
843 
844  sc = evtStore()->record(calibResults,key);
845  if(!sc.isSuccess())
846  {
847  ATH_MSG_ERROR("Failed to record data to storegate");
848  thereIsAnError = true;
849  delete calibResults;
850  }
851 
852  if(thereIsAnError)
853  return StatusCode::RECOVERABLE;
854 
855  return StatusCode::SUCCESS;
856  }
857 
858  //Does bit correlation study. Likely will be dropped
860 
861  if(!m_bitProds || !m_bitHists)
862  return nullptr;
863 
865  correlations->resize(m_maxStripHash +1);
866 
867  for(unsigned int hashItr =0; hashItr <= m_maxStripHash; hashItr++) {
868  IdentifierHash stripHash =hashItr;
869  Identifier stripId;
870  IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
871  m_idHelperSvc->cscIdHelper().get_id(stripHash, stripId, &channelContext);
872 
873  int chamLayer = m_idHelperSvc->cscIdHelper().chamberLayer(stripId);
874  if(chamLayer == m_expectedChamberLayer) //Only second chamber layer exists
875  {
876  int stationName = m_idHelperSvc->cscIdHelper().stationName(stripId);
877  //int stationEta = m_idHelperSvc->cscIdHelper().stationEta(stripId);
878  int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(stripId);
879  int stripNumber = m_idHelperSvc->cscIdHelper().strip(stripId);
880  int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(stripId);
881  char orientation = m_idHelperSvc->cscIdHelper().measuresPhi(stripId) ? 'Y':'X';
882 
883  int sector = 2*stationPhi + 50 - stationName;
884 
885  std::stringstream name;
886  name << "h_bitCorr_sector_" << std::setfill('0') << std::setw(2) << sector <<
887  "_lay_" << wireLayer << orientation << "_strip_" << std::setw(3) << stripNumber;
888  std::stringstream title;
889  title << "h_bitCorr_sector_" << std::setfill('0') << std::setw(2) << sector <<
890  "_lay_" << wireLayer << orientation << "_strip_" << std::setw(3) << stripNumber;
891 
892  TH2F* correlationHist = new TH2F(
893  name.str().c_str(),
894  title.str().c_str(),
895  m_numBits, 0, m_numBits,
896  m_numBits, 0, m_numBits
897  );
898  (*correlations)[hashItr] = correlationHist;
899 
900  //each amphis is filled exaclty the number of times the bits are sampled,
901  //so its a good place to get n
902  double n = (*m_ampHists)[hashItr]->GetEntries();
903  TH1I * bitHist = (*m_bitHists)[hashItr];
904  TH2F * bitProds = (*m_bitProds)[hashItr];
905  for(unsigned int bit1 = 1; bit1 <=m_numBits; bit1++){
906  for(unsigned int bit2 = 1; bit2 <=bit1; bit2++){
907 
908  float xy = bitProds->GetBinContent(bit1,bit2);
909  float x = bitHist->GetBinContent(bit1);
910  float y = bitHist->GetBinContent(bit2);
911 
912  float r;
913  float denom = (n*x-x*x)*(n*y-y*y);
914  if(denom <= 0 )
915  r= 0;
916  else
917  r = (n*xy - x*y)/std::sqrt(denom);
918 
919  //Pearson r
920  correlationHist->SetBinContent(bit1,bit2,r);
921  if(bit1!=bit2)
922  correlationHist->SetBinContent(bit2,bit1,r);
923 
924 
925  }
926  }
927  }
928  }
929  return correlations;
930  }//end makeBitCorrelations
931 
932 
933  void CscCalcPed::onlineToOfflineHashId(const unsigned int & onlineId, unsigned int &hashId) const
934  {
935  int stationName = ((onlineId >> 16)&0x1) + 50;
936  int phi = ((onlineId >> 13)&0x7)+1;
937  int eta = ((((onlineId >> 12)&0x1) == 1) ? 1:-1);
938  int chamLay = ((onlineId>>11)&0x1) +1;
939  int wireLay = ((onlineId>>9)&0x3) +1;
940  int measuresPhi = ((onlineId >> 8)&0x1);
941  int strip;
942 
943  // Online and offline phi ids are flipped on A wheel
944  if( measuresPhi && eta == 1){
945  strip = 48 - ((onlineId)&0xff) ; //equivalent: 49 -( onlineId&0xff +1)
946  }
947  else {
948  strip = ((onlineId)&0xff) +1;
949  }
950 
951  Identifier chanId = m_idHelperSvc->cscIdHelper().channelID(stationName,eta,phi,chamLay,wireLay,measuresPhi,strip);
952 
953  IdentifierHash chanHash;
954  m_idHelperSvc->cscIdHelper().get_channel_hash(chanId, chanHash);
955 
956  hashId = (unsigned int)chanHash;
957 
958  }
959 
960  }//end namespace MuonCalib
MuonCalib::CscCalcPed::onlineToOfflineHashId
void onlineToOfflineHashId(const unsigned int &onlineId, unsigned int &hashId) const
Definition: CscCalcPed.cxx:933
covarianceTool.ndf
ndf
Definition: covarianceTool.py:678
TestSUSYToolsAlg.ifile
ifile
Definition: TestSUSYToolsAlg.py:92
beamspotman.r
def r
Definition: beamspotman.py:676
MuonCalib::CscCalcPed::m_chronoSvc
IChronoStatSvc * m_chronoSvc
Definition: CscCalcPed.h:84
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
MuonCalib::CscCalcPed::m_doSampleHists
bool m_doSampleHists
Definition: CscCalcPed.h:110
MuonCalib::CscCalcPed::CscCalcPed
CscCalcPed(const std::string &name, ISvcLocator *pSvcLocator)
Definition: CscCalcPed.cxx:24
get_generator_info.result
result
Definition: get_generator_info.py:21
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
MuonCalib::CscCalcPed::m_ampHists
DataVector< TH1I > * m_ampHists
Definition: CscCalcPed.h:116
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MuonCalib::CscCalcPed::m_eventCnt
int m_eventCnt
Definition: CscCalcPed.h:128
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
MuonCalib::CscCalcPed::m_cscRdoDecoderTool
ToolHandle< Muon::ICSC_RDO_Decoder > m_cscRdoDecoderTool
Definition: CscCalcPed.h:85
MuonCalib::CscCalcPed::m_doF001
bool m_doF001
Definition: CscCalcPed.h:114
TH1I
Definition: rootspy.cxx:332
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
TH2F
Definition: rootspy.cxx:420
MuonCalib::CscCalcPed::m_thresholdMultiplier
float m_thresholdMultiplier
Definition: CscCalcPed.h:97
CscCalibResult
Definition: CscCalibResult.h:19
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
CscRawDataContainer.h
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
plotmaker.hist
hist
Definition: plotmaker.py:148
StateLessPT_NewConfig.Format
Format
Definition: StateLessPT_NewConfig.py:146
MuonCalib::CscCalcPed::m_readKey
SG::ReadCondHandleKey< CscCondDbData > m_readKey
Definition: CscCalcPed.h:86
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
IdentifiableContainerMT::size
size_t size() const
Duplicate of fullSize for backwards compatability.
Definition: IdentifiableContainerMT.h:209
checkTP.report
report
Definition: checkTP.py:127
CscCalibReportContainer.h
MuonCalib::CscCalcPed::m_ampHistNumBins
unsigned int m_ampHistNumBins
Definition: CscCalcPed.h:105
MuonCalib::CscCalcPed::fillBitHist
StatusCode fillBitHist(TH1I *bitHist, const uint16_t &val, TH2F *bitProds)
Definition: CscCalcPed.h:139
MuonCalib::CscCalcPed::calculateParameters
StatusCode calculateParameters()
Finalize functions.
Definition: CscCalcPed.cxx:498
athena.value
value
Definition: athena.py:122
CscCalibReportContainer
Definition: CscCalibReportContainer.h:25
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MuonCalib::CscCalcPed::m_onlineThresholds
std::vector< int > m_onlineThresholds
Definition: CscCalcPed.h:121
MuonCalib::CscCalcPed::m_numBits
const unsigned int m_numBits
Definition: CscCalcPed.h:107
MuonCalib::CscCalcPed::m_bitProds
DataVector< TH2F > * m_bitProds
Definition: CscCalcPed.h:119
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
x
#define x
MuonCalib::CscCalcPed::collectEventInfo
StatusCode collectEventInfo()
event loop functions
Definition: CscCalcPed.cxx:346
MuonCalib::CscCalcPed::calOutput3
StatusCode calOutput3()
Definition: CscCalcPed.cxx:747
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
MuonCalib::CscCalcPed::m_outputFileName
std::string m_outputFileName
Parameters input through joboptions.
Definition: CscCalcPed.h:90
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
MuonCalib::CscCalcPed::execute
StatusCode execute(void)
Definition: CscCalcPed.cxx:284
MuonCalib::CscCalcPed::m_f001s
CscCalibResultCollection * m_f001s
Definition: CscCalcPed.h:126
MuonCalib::CscCalcPed::calOutput1
StatusCode calOutput1()
Definition: CscCalcPed.cxx:667
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
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
01SubmitToGrid.samples
samples
Definition: 01SubmitToGrid.py:58
covarianceTool.title
title
Definition: covarianceTool.py:542
CscCalcPed.h
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonCalib::CscCalcPed::m_ampHistLowBound
unsigned int m_ampHistLowBound
Definition: CscCalcPed.h:105
MuonCalib::CscCalcPed::m_titlePrefix
std::string m_titlePrefix
Definition: CscCalcPed.h:91
RunTileMonitoring.rod
rod
Definition: RunTileMonitoring.py:134
MuonCalib::CscCalcPed::m_doOnlineDbFile
bool m_doOnlineDbFile
Definition: CscCalcPed.h:134
MuonCalib::CscCalcPed::m_noises
CscCalibResultCollection * m_noises
Definition: CscCalcPed.h:124
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
DataVector< TH1I >
MuonCalib::CscCalcPed::initialize
StatusCode initialize(void)
basic required functions
Definition: CscCalcPed.cxx:68
TH2F::GetBinContent
double GetBinContent(int) const
Definition: rootspy.cxx:425
CscCalibResultContainer
Definition: CscCalibResultContainer.h:22
compute_lumi.denom
denom
Definition: compute_lumi.py:76
AthAlgorithm
Definition: AthAlgorithm.h:47
MuonCalib::CscCalcPed::m_onlineDbFile
std::string m_onlineDbFile
filename for file with online database information
Definition: CscCalcPed.h:100
TH2F::SetBinContent
void SetBinContent(int, double)
Definition: rootspy.cxx:426
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
CscRawDataCollection.h
MuonCalib::CscCalcPed::m_titlePostfix
std::string m_titlePostfix
Definition: CscCalcPed.h:91
MuonCalib::CscCalcPed::m_rmses
CscCalibResultCollection * m_rmses
Definition: CscCalcPed.h:125
DataVector::resize
void resize(size_type sz)
Resizes the collection to the specified number of elements.
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
MuonCalib::CscCalcPed::m_onlineTHoldBreaches
CscCalibResultCollection * m_onlineTHoldBreaches
Definition: CscCalcPed.h:127
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
CscCalibResultContainer.h
threshold
Definition: chainparser.cxx:74
CscRawData.h
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
python.ami.results
def results
Definition: ami.py:386
MuonCalib::CscCalcPed::m_maxStripHash
unsigned int m_maxStripHash
Internally global variables.
Definition: CscCalcPed.h:103
MuonCalib::CscCalcPed::finalize
StatusCode finalize(void)
Definition: CscCalcPed.cxx:299
MuonCalib::CscCalcPed::m_doCorrelation
bool m_doCorrelation
Definition: CscCalcPed.h:93
Example_ReadSampleNoise.ped
ped
Definition: Example_ReadSampleNoise.py:45
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
MuonCalib::CscCalcPed::m_sampHists
DataVector< DataVector< TH1I > > * m_sampHists
Definition: CscCalcPed.h:117
MuonCalib::CscCalcPed::writeCalibrationFile
StatusCode writeCalibrationFile()
Definition: CscCalcPed.cxx:582
Identifier::getString
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Definition: Identifier.cxx:25
y
#define y
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
CscRawDataContainer
This container provides access to collections of CSC RDOs and a mechanism for recording them.
Definition: CscRawDataContainer.h:23
beamspotnt.rms
rms
Definition: bin/beamspotnt.py:1266
MuonCalib::CscCalcPed::m_expectedChamberLayer
int m_expectedChamberLayer
Definition: CscCalcPed.h:98
MuonCalib::CscCalcPed::m_doBitHists
bool m_doBitHists
Definition: CscCalcPed.h:109
MuonCalib::CscCalcPed::m_ampHistHighBound
unsigned int m_ampHistHighBound
Definition: CscCalcPed.h:105
MuonCalib::CscCalcPed::calOutput0
StatusCode calOutput0()
Definition: CscCalcPed.cxx:604
TH1I::GetBinContent
double GetBinContent(int) const
Definition: rootspy.cxx:337
MuonCalib::CscCalcPed::outputParameter3
void outputParameter3(const CscCalibResultCollection &results, std::ofstream &out)
Definition: CscCalcPed.cxx:770
MuonCalib::CscCalcPed::makeBitCorrelation
DataVector< TH2F > * makeBitCorrelation()
Definition: CscCalcPed.cxx:859
MuonCalib::CscCalcPed::m_calOutputVersion
std::string m_calOutputVersion
Definition: CscCalcPed.h:92
IdentifierHash
Definition: IdentifierHash.h:38
MuonCalib::CscCalcPed::m_peds
CscCalibResultCollection * m_peds
Definition: CscCalcPed.h:123
MuonCalib::CscCalcPed::m_numSamplesExpected
int m_numSamplesExpected
Definition: CscCalcPed.h:112
CscCalibReportPed.h
CscCalibReportPed
Definition: CscCalibReportPed.h:25
IdContext
class IdContext
Definition: IdContext.h:34
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
MuonCalib::CscCalcPed::m_bitHists
DataVector< TH1I > * m_bitHists
Definition: CscCalcPed.h:118
MuonCalib::CscCalcPed::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Services and tools.
Definition: CscCalcPed.h:83
MuonCalib::CscCalcPed::storeGateRecord
StatusCode storeGateRecord()
Definition: CscCalcPed.cxx:798
WriteCellNoiseToCool.noise
noise
Definition: WriteCellNoiseToCool.py:380
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
CscCondDbData
Definition: CscCondDbData.h:24
MuonCalib::CscCalcPed::m_onlineThresholdFailureCount
std::vector< int > m_onlineThresholdFailureCount
Definition: CscCalcPed.h:122
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37