ATLAS Offline Software
CscCalcSlope.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 "CscCalcSlope.h"
6 
7 #include "MuonRDO/CscRawData.h"
11 #include "GaudiKernel/Chrono.h"
16 #include "BipolarFit.h"
17 
18 #include "TH1I.h"
19 #include "TF1.h"
20 #include "TGraphErrors.h"
21 #include "TFile.h"
22 #include "TProfile.h"
23 
24 #include <iostream>
25 #include <fstream>
26 #include <bitset>
27 #include <inttypes.h>
28 
29 namespace MuonCalib {
30 
31  CscCalcSlope::CscCalcSlope(const std::string& name, ISvcLocator* pSvcLocator) :
32  AthAlgorithm(name,pSvcLocator),
33  m_storeGate(nullptr),
34  m_cscCalibTool(nullptr),
35  m_chronoSvc(nullptr),
36  m_outputFileName("output.cal"),
37  m_dumpAllHists(false),
38  m_maxStripHash(0),
39  m_lastPulserLevel(-999),
40  m_fracProfs(nullptr),
41  m_fracGraphs(nullptr),
42  m_bitHists(nullptr),
43  m_fitReturns(nullptr),
44  m_resGraph(nullptr),
45  m_calGraphs(nullptr),
46  m_currentAmpProf(nullptr),
47  m_ampProfs(nullptr),
48  m_pulsedChambers(nullptr),
49  m_eventCnt(0),
50  m_slopes(nullptr),
51  m_intercepts(nullptr),
52  m_peds(nullptr),
53  m_noises(nullptr),
54  m_peakTimeProf(nullptr),
55  m_peakTimes(nullptr),
56  m_numBits(12)
57  {
58  declareProperty("OutputFile", m_outputFileName = "");
59  declareProperty("IgnoreDatabaseError",m_ignoreDatabaseError = false); //Set to true to ignore database errors
60  declareProperty("TitlePrefix",m_titlePrefix = ""); //Prefix appended to title of histograms and graphs
61  declareProperty("TitlePostfix",m_titlePostfix = ""); //Postfix appended to title of histograms and graphs
62 
63  //test parameters
64  declareProperty("DoBipolarFit", m_doBipolarFit = true);
65  declareProperty("DoCrossTalkFix",m_doCrossTalkFix = true);
66 
67  declareProperty("GetPedFromFile",m_pedFile = false);
68  declareProperty("PedFileName",m_pedFileName = "");
69 
70  declareProperty("ExpectedChamberLayer", m_expectedChamberLayer = 2);
71 
72  declareProperty("DoLinPlot" , m_doLinPlot = false);
73  declareProperty("CalibFitFunction" , m_calFitFunc = "[0] + [1]*10^(x/-20)");
74  declareProperty("MinDeltaAdc",m_minDeltaAdc = 10, "Minimum change in ADC a calgraph needs to drop for a fit lower bound to be set");
75 
76  /*
77  ADC = mC(db) = m*C_max*10^(db/20) + intercept // C_max = maximum charge
78 
79  we divide by c_max later to get m (the function as in m_calFitFunc has
80  [1] = max ADC, so we divide max charge to get
81 
82  since attenuation is negative
83 
84  db = -20 log(ADC+intercept/mC_max)
85 
86  db = -20 log(ADC - intercept / mC_max)
87 
88  (-20 since V^2 gives power disipation)
89 
90  */
91 
92  declareProperty("FindPeakTime", m_findPeakTime = true);
93  declareProperty("DoBitHists", m_doBitHists = true);
94 
95  declareProperty("CalOutputVersion", m_calOutputVersion="03-00");
96 
97  m_crossTalkFix = new double[24];
98  m_crossTalkFix[0] = 1.0322840930;
99  m_crossTalkFix[1] = 1.0422690324;
100  m_crossTalkFix[2] = 1.0235384586;
101  m_crossTalkFix[3] = 1.0183445962;
102  m_crossTalkFix[4] = 1.0151409212;
103  m_crossTalkFix[5] = 1.0152511102;
104  m_crossTalkFix[6] = 1.0103618910;
105  m_crossTalkFix[7] = 1.0113985580;
106  m_crossTalkFix[8] = 1.0040464232;
107  m_crossTalkFix[9] = 1.0049431193;
108  m_crossTalkFix[10] = 0.9997829589;
109  m_crossTalkFix[11] = 1.0003994005;
110  m_crossTalkFix[12] = 0.9826108255;
111  m_crossTalkFix[13] = 0.9850002836;
112  m_crossTalkFix[14] = 0.9831852065;
113  m_crossTalkFix[15] = 0.9826508145;
114  m_crossTalkFix[16] = 0.9804885017;
115  m_crossTalkFix[17] = 0.9811262196;
116  m_crossTalkFix[18] = 0.9784119832;
117  m_crossTalkFix[19] = 0.9777689757;
118  m_crossTalkFix[20] = 0.9704773978;
119  m_crossTalkFix[21] = 0.9738781078;
120  m_crossTalkFix[22] = 0.9710430303;
121  m_crossTalkFix[23] = 0.9743144079;
122  }
123 
125  {
126  ATH_MSG_INFO("CscCalcSlope::initialize() called");
127 
128  //*******Register services and tools *********/
129  // Store Gate active store
130  ATH_CHECK(serviceLocator()->service("StoreGateSvc", m_storeGate));
131 
132  ATH_CHECK(m_idHelperSvc.retrieve());
133 
134  ATH_CHECK(service("ChronoStatSvc",m_chronoSvc));
135 
136  IToolSvc* toolSvc=nullptr;
137  ATH_CHECK(service("ToolSvc",toolSvc));
138 
139  ATH_CHECK(toolSvc->retrieveTool("CscCalibTool",m_cscCalibTool));
140 
141  ATH_CHECK(m_cscRdoDecoderTool.retrieve());
142 
143  ATH_MSG_INFO("Finished initializing services. ");
144  //*****Initialize internal variables and histograms*******/
145  m_ampProfs = new std::map<int, TProfile* >();
146  //Setup lookup table for pulser levels
147  m_dbLevels.resize(64);
148  for(unsigned int pulserLevel=0; pulserLevel < 64; pulserLevel++)
149  m_dbLevels[pulserLevel] = pulserLevel*.5;
150 
151  IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
152 
154  //Loop through ids to find out what hash range we're working on, and to
155  //initialize histograms.
156  const std::vector<Identifier> & ids = m_idHelperSvc->cscIdHelper().idVector();
157 
158 
159  m_maxStripHash = 0;
160  for(const auto & thisChamberId:ids)
161  {
162  std::vector<Identifier> stripVect;
163  m_idHelperSvc->cscIdHelper().idChannels(thisChamberId,stripVect);
164 
165 
166 
167  for(const auto & thisStripId:stripVect)
168  {
169  IdentifierHash stripHash;
170  m_idHelperSvc->cscIdHelper().get_channel_hash(thisStripId,stripHash);
171 
172  if(m_maxStripHash < (unsigned int)stripHash)
173  m_maxStripHash = (unsigned int)stripHash;
174 
175  if(m_bitHists)
176  {
177  Identifier id;
178  m_idHelperSvc->cscIdHelper().get_id((IdentifierHash)stripHash,id,&channelContext);
179  int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(id);
180  char orientation = (m_idHelperSvc->cscIdHelper().measuresPhi(id) ? 'Y':'X');
181 
182  int stationName = m_idHelperSvc->cscIdHelper().stationName(id);
183  int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(id);
184  int stationEta = m_idHelperSvc->cscIdHelper().stationEta(id);
185 
186  int stripNumber = m_idHelperSvc->cscIdHelper().strip(id);
187 
188  char bitName[200], titleSeed[500];
189  //Bit histogram (for looking for stuck-bits)
190  sprintf(bitName, "bitHist%d",(int)stripHash);
191  sprintf(titleSeed, "Bit histogram for eta %d, sector %d, layer %d%c strip %d",
192  stationEta,(2*stationPhi+50 - stationName),wireLayer,orientation,stripNumber);
193  std::string title = m_titlePrefix + titleSeed + m_titlePostfix;
194  TH1I* hist = new TH1I(bitName, title.c_str(), m_numBits, 0, m_numBits); //12 bits
195  hist->GetXaxis()->SetTitle("Bit");
196  hist->GetYaxis()->SetTitle("Counts");
198  }
199  }
200  }//end chamber loop
201 
202  m_fitReturns = new std::vector<float>;
203  m_fitReturns->resize(m_maxStripHash+1,0);
204 
206  for(unsigned int chanItr =0; chanItr <= m_maxStripHash; chanItr++)
207  {
208  m_calGraphs->push_back(nullptr);
209  }
210 
211 
212  if(m_pedFile)
213  {
214  ATH_MSG_INFO("Opening pedestal file");
215  std::ifstream in(m_pedFileName.c_str());
216  int stripHash;
217  double ped,noise;//,pedError,noiseError;
218  std::string buff;
219  in >> buff >> buff >> buff >> buff >> buff ;// skip header
220  m_peds = new float[m_maxStripHash+1];
221  m_noises = new float[m_maxStripHash+1];
222 
223  while(!in.eof())
224  {
225  in >> stripHash >> buff >> buff >> ped >> noise;
226  ATH_MSG_INFO(stripHash << "\t" << ped << "\t" << noise);
227  if( stripHash < 0 || (unsigned int) stripHash > m_maxStripHash ) {
228  //cppcheck-suppress shiftNegative
229  ATH_MSG_FATAL("The hash "<< (int) stripHash << " is out of range for the Ped-Vector - Crashing!");
230  return StatusCode::FAILURE;
231  }
232  m_peds[stripHash] = ped;
233  m_noises[stripHash] = noise;
234  }
235  }
236  else
237  {
239  }
240 
241  ATH_MSG_INFO("Counted " << m_maxStripHash +1 << " strips.");
242 
243  m_slopes = new CscCalibResultCollection("pslope");
244  m_intercepts = new CscCalibResultCollection("pinter");
245 
246  if(m_findPeakTime)
247  {
248  m_peakTimeProf = new TProfile("PeakTimes","Peaking Time for each channel",m_maxStripHash+1,
249  0,m_maxStripHash+1);
250  m_peakTimes = new CscCalibResultCollection("peakt");
251  }
252 
253  m_pulsedChambers = new std::set<int>;
254 
255 
256  ATH_MSG_DEBUG("End initialize");
257  return StatusCode::SUCCESS;
258  }//end initialize
259 
260  //Execute loops through all strips and fills histograms
262  {
263  ATH_MSG_INFO("Begin execute");
264  //collectEventInfo collects infomation about each event by filling ampHistCollection and peaktHist.
266 
267  if(!sc.isSuccess())
268  {
269  ATH_MSG_WARNING("There was an error collecting information from the RDO this event.");
270  return sc;
271  }
272  ATH_MSG_INFO("End execute");
273  return StatusCode::SUCCESS;
274  } //end execute()
275 
277  {
278  ATH_MSG_INFO("In finalize()");
279 
280  StatusCode sc;
281 
282  bool thereIsAFatal=false;
283 
284  //calculateParameters() finds means and fits gain curves from the data in
287  if(sc.isFailure())
288  {
289  ATH_MSG_WARNING("Calculation of parameters failed!");
290  }
291  ATH_MSG_DEBUG("Finished calculating parameters");
292 
293  //writeCalibrationFile() writes the calculated parameters into a calibration fie.
295  if(!sc.isSuccess())
296  {
297  ATH_MSG_FATAL("Failed to write parameters to disk!");
298  thereIsAFatal = true; //Not quiting yet to ensure memory is properly deleted
299  }
300 
301  sc = storeGateRecord();
302  if(sc.isFailure())
303  {
304  ATH_MSG_FATAL("Failed to record parameters in StoreGate ");
305  thereIsAFatal = true;
306  }
307 
308  delete m_peakTimeProf;
309 
310  delete [] m_crossTalkFix;
311  ATH_MSG_DEBUG("Finished finalize()");
312 
313  if(thereIsAFatal)
314  return StatusCode::FAILURE;
315 
316  return StatusCode::SUCCESS;
317  }//end finalize()
318 
319 
320  //Collect event info is run every event, gathering amplitutdes and peakting times.
322  {
323  MsgStream mLog( msgSvc(), name() );
324 
325  // apparently not used since code is exited automatically if there is an error
326  // bool thereIsAnError = false;
327 
328  Chrono chrono(m_chronoSvc,"collectEventInfo");
329  ATH_MSG_DEBUG("Collecting event info for event " << m_eventCnt);
330  //Below might need to be changed depending on how we get data
331  const CscRawDataContainer* fullRDO;
332  StatusCode sc_read = m_storeGate->retrieve(fullRDO, "CSCRDO");
333  if (sc_read != StatusCode::SUCCESS)
334  {
335  ATH_MSG_FATAL("Could not find event");
336  return StatusCode::FAILURE;
337  }
338 
340  const CscCondDbData* readCdo{*readHandle};
341 
342  //Loop over RODs (data from 2 chambers), each of which is in
343  //a single CscRawaData collection
344 
345 
346  for(const auto rod:*fullRDO)
347  {
348  if(not rod->empty())
349  {
350 
351  uint16_t pulsedWireLayer = rod->calLayer();
352 
353  int pulserLevel = rod->calAmplitude();
354  ATH_MSG_VERBOSE("Pulser level is " << pulserLevel);
355  if( pulserLevel != m_lastPulserLevel)
356  {
357  ATH_MSG_INFO("New pulser level found. (" << pulserLevel <<").");
358 
359  std::map<int,TProfile*>::iterator alreadyExistingProfile = m_ampProfs->find(pulserLevel);
360 
361  if(alreadyExistingProfile == m_ampProfs->end())
362  {//No previous profile for this amplitude exists
363 
364  ATH_MSG_DEBUG(" creating new amplitude profile");
365  std::stringstream name, title;
366  name << "ampProf_" << pulserLevel;
367  title << m_titlePrefix << "Amplitudes For Pulser Level " << pulserLevel << m_titlePostfix;
368  m_currentAmpProf = new TProfile(name.str().c_str(), title.str().c_str(),
370  m_currentAmpProf->GetXaxis()->SetTitle("Channel (Hash Id)");
371  m_currentAmpProf->GetYaxis()->SetTitle("Amplitude (ADC value)");
372  ATH_MSG_DEBUG("Adding new amplitude profile");
373  m_ampProfs->insert(std::pair<int, TProfile*>( pulserLevel, m_currentAmpProf));
374  }
375  else
376  {
377  ATH_MSG_DEBUG(" using existing amplitude profile");
378  m_currentAmpProf = alreadyExistingProfile->second;
379  }
380 
381  m_lastPulserLevel = pulserLevel;
382  }
383 
384  unsigned int samplingPhase = rod->samplingPhase();
385  uint8_t samplingPeriod = rod->rate(); //sampling period in ns
386 
387 
388  //Loop over strips in rod
389 
390 
391  for(const auto cluster: *rod)
392  {
393  //Note: For a pulser or ped run, the "cluster"
394  //is the size of an entire layer
395  int numStrips = cluster->width();
396  int samplesPerStrip = (cluster->samples()).size()/numStrips;
397 
398  IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
399 
400  for(int stripItr = 0; stripItr <numStrips; stripItr++)
401  {
402  Identifier stripId =m_cscRdoDecoderTool->channelIdentifier(cluster, &m_idHelperSvc->cscIdHelper(), stripItr);
403  IdentifierHash cscChannelHashId;
404  m_idHelperSvc->cscIdHelper().get_channel_hash(stripId, cscChannelHashId);
405  int stripHash = cscChannelHashId;
406  ATH_MSG_VERBOSE("The eta of this strip is: " << m_idHelperSvc->cscIdHelper().stationEta(stripId));
407 
408  int chamberLayer = m_idHelperSvc->cscIdHelper().chamberLayer(stripId);
409  if(chamberLayer != m_expectedChamberLayer)
410  {
411  ATH_MSG_FATAL("Cluster includes strip in chamber layer "
412  << chamberLayer << ". Only " << m_expectedChamberLayer
413  << " is valid.");
414  return StatusCode::FAILURE;
415  }
416 
417  int currentWireLayer = m_idHelperSvc->cscIdHelper().wireLayer(stripId) - 1;
418  if( currentWireLayer < 0 || currentWireLayer > 3)
419  {
420  ATH_MSG_FATAL("Problem in getting wire layer! - Current value is "
421  << m_idHelperSvc->cscIdHelper().wireLayer(stripId) << " while only values between 1-4 are allowed.");
422  return StatusCode::FAILURE;
423  }
424  bool isThisLayerPulsed = (pulsedWireLayer >> currentWireLayer)&0x1;
425  if(isThisLayerPulsed)
426  {
427 
428  std::vector<uint16_t> samples;
429  cluster->samples(stripItr,samplesPerStrip,samples); //Retrieve samples for a single strip
430 
431  float ped = 0;
432  float noise = 0;
433  if(m_pedFile)
434  {
435  ped = m_peds[stripHash];
436  noise = m_noises[stripHash];
437  }
438  else{
439 
440  if(!readCdo->readChannelPed(stripHash, ped).isSuccess()){
441  ped = 2054;
442  if (m_ignoreDatabaseError) ATH_MSG_WARNING("Failed at getting pedestal from COOL for hash " << stripHash);
443  else ATH_MSG_ERROR("Failed at getting pedestal from COOL for hash " << stripHash);
445  return StatusCode::RECOVERABLE;
446  ATH_MSG_WARNING("Setting to " << ped);
447  }
448  else
449  ATH_MSG_VERBOSE("Got pedestal of " << ped);
450  if(!readCdo->readChannelNoise(stripHash, noise).isSuccess())
451  {
452  noise = .001;
453  if (m_ignoreDatabaseError) ATH_MSG_WARNING("Failed at getting noise from COOL for hash " << stripHash);
454  else ATH_MSG_ERROR("Failed at getting noise from COOL for hash " << stripHash);
456  return StatusCode::FAILURE;
457  ATH_MSG_WARNING("Setting to " << noise);
458  }
459 
460  }
461 
462  double peakAmp{}, peakTime{};
463  int success{};
464  if(!m_doBipolarFit)
465  {
466  //Need to convert vector from ints to floats to pass to findCharge
467  std::vector<float> floatSamples;
468  for(const auto & thisSample:samples){
469 
470  floatSamples.push_back(thisSample-ped);
471  if(m_bitHists){
472  if(!fillBitHist((*m_bitHists)[stripHash],thisSample)){
473  ATH_MSG_WARNING("Failed recording bits for strip " << stripHash);
474  }
475 
476  }
477  }
478 
479  success = m_cscCalibTool->findCharge((float)samplingPeriod, samplingPhase,floatSamples,peakAmp,peakTime);
480 
481  }
482  else
483  {
484  //Need to convert vector from ints to doubles to pass to bipolar fit
485  double adcSamples[4];
486  for(int i = 0; i < 4; i++) adcSamples[i] = samples[i] -ped;
487  double fitResult[3],fitErrors[3], chi2;
488  double width = samplingPeriod == 50 ? 7.2:14.4; //check if 50 or 25ns period
489 
490  m_bipolarFit.Fit(adcSamples,noise,ped,width,fitResult,fitErrors,&chi2);
491  success = true;
492  peakAmp = fitResult[0];
493  peakTime = fitResult[1] - (samplingPhase ? 25 : 0);
494  }//end if m_doBipolarFit
495 
496 
497  if(success)
498  {
499  m_currentAmpProf->Fill(stripHash,peakAmp);
500  //((*m_ampHists)[stripHash])->Fill(peakAmp);
501 
502  if(m_findPeakTime)
503  m_peakTimeProf->Fill(stripHash,peakTime);
504  }
505  else
506  {
507  ATH_MSG_WARNING("Failed at fitting pulse shape. Debug info: ");
508  ATH_MSG_WARNING("stripHash " << stripHash);
509  ATH_MSG_WARNING("strip in chamber " << stripItr);
510  ATH_MSG_WARNING(" and detailed id " << m_idHelperSvc->cscIdHelper().show_to_string(stripId,&channelContext));
511  ATH_MSG_WARNING("Pulsed layer " << pulsedWireLayer<< ", Samples: " << samples[0] <<", " << samples[1] << ", " << samples[2] << ", " << samples[3]);
512  }
513  }//end if (islayerPulsedand and is precision layer)
514  }//end strip loop
515 
516  }//end cluster loop
517  }//end if rod >1
518  }//end rod loop
519 
520 
521  ATH_MSG_DEBUG("end collectEventInfo()");
522  m_eventCnt++;
523 
524  // at this part of the code thereIsAnError is always false - if true it would exit earlier
525  // if(thereIsAnError)
526  // return StatusCode::RECOVERABLE;
527 
528  return StatusCode::SUCCESS;
529  }// end collectEventInfo()
530 
531 
532  //Calculate parameters is called during finalize, and calculates the parameter values from the
533  //data taken by collectEventData()
535  {
536  Chrono chrono(m_chronoSvc,"calculateParameters");
537  StatusCode sc;
538  ATH_MSG_INFO("Calculating calibration constants.");
539 
540  if(!m_ampProfs){
541  ATH_MSG_FATAL("m_ampProfs empty!");
542  return StatusCode::FAILURE;
543  }
544  unsigned int numCalibPoints = m_ampProfs->size();
545  ATH_MSG_INFO("There are " << numCalibPoints << " pulser levels to evaluate.");
546 
547  IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
548 
549  float chargeMax = 530.88; //in fC
550 
551  int crossTalkCnt = 0;
552 
553  for(unsigned int stripHash = 0 ;stripHash <= m_maxStripHash; stripHash++)
554  {
555 
556  if(true)//stripHash < 50 || stripHash%1000 == 0)
557  {
558  ATH_MSG_INFO("Analyzing strip with hash " << stripHash << " out of " << m_maxStripHash);
559  }
560 
561  //**Now tackle slope calculation
562 
563 
564  Identifier id;
565  m_idHelperSvc->cscIdHelper().get_id((IdentifierHash)stripHash,id,&channelContext);
566  int chamberLayer = m_idHelperSvc->cscIdHelper().chamberLayer(id);
567  char orientation = (m_idHelperSvc->cscIdHelper().measuresPhi(id) ? 'Y':'X');
568 
569  int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(id);
570 
571 
572  int stationName = m_idHelperSvc->cscIdHelper().stationName(id);
573  int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(id);
574  int stationEta = m_idHelperSvc->cscIdHelper().stationEta(id);
575  int stripNumber = m_idHelperSvc->cscIdHelper().strip(id);
576 
577  IdentifierHash chamHash;
578  m_idHelperSvc->cscIdHelper().get_module_hash(id,chamHash);
579 
580  if(chamberLayer != m_expectedChamberLayer)
581  continue;
582 
583  if(m_findPeakTime)
584  {
585  if(m_peakTimeProf->GetBinEntries(stripHash+1)) //See if any peaking times were recorded for strip
586  {
587  float peakt = m_peakTimeProf->GetBinContent(stripHash+1);
588  float peaktError = m_peakTimeProf->GetBinError(stripHash+1);
589  CscCalibResult * peaktResult = new CscCalibResult(stripHash,peakt, peaktError);
590  m_peakTimes->push_back(peaktResult);
591  }
592  }//end if(m_findPeakTime)
593 
594  //Don't find slope for this strip if it is a transverse strip
595  if(orientation != 'X')
596  continue;
597 
598  //For removing plateau's from fit
599  bool foundMin(false);
600  double fitMinX = 0;
601  double fitMaxX = 0;
602  double lastVal = -1;
603  double lastDrop=0;
604  double thisDrop=0;
605 
606 
607  TGraphErrors * calGraph = new TGraphErrors(numCalibPoints); //calGraph will be what the gain will be found on
608  char calName[20],titleSeed[500];
609  sprintf(calName, "calGraph%u",stripHash);
610  sprintf(titleSeed, "Calgraph for eta %d, sector %d, layer %d%c, strip %d",stationEta,(2*stationPhi+50 - stationName),wireLayer,orientation, stripNumber);
611  calGraph->SetName(calName);
612  std::string title = m_titlePrefix + titleSeed + m_titlePostfix;
613  calGraph->SetTitle(title.c_str());
614  calGraph->GetYaxis()->SetTitle("ADC counts");
615  calGraph->GetXaxis()->SetTitle("Attenuation (-db)");
616 
617  ATH_MSG_DEBUG(" Generating " << title);
618 
619  bool isGoodStrip = false;
620 
621  //Loop over all attenuation levels, filling the calGraph with the amplitudes
622  //for this strip
623  ATH_MSG_DEBUG("Number of ampProfs " << m_ampProfs->size());
624  int calPointItr = 0;
625  for(const auto & [pulserLevel, pAmplitudeProfile] : *m_ampProfs)
626  {
627  if(!pAmplitudeProfile){
628  ATH_MSG_FATAL("Failed at accessing ampProf!");
629  return StatusCode::FAILURE;
630  }
631  ATH_MSG_DEBUG("\tLooking for data for pulser level "
632  << pulserLevel);
633 
634  if(pAmplitudeProfile->GetBinEntries(stripHash+1))
635  {
636 
637  ATH_MSG_VERBOSE("\nHave data for strip " << stripHash);
638 
639  isGoodStrip = true;
640 
641 
642  float adcValue = pAmplitudeProfile->GetBinContent(stripHash+1);
643  float adcError = pAmplitudeProfile->GetBinError(stripHash+1);
644  if(m_doCrossTalkFix)
645  {
646  ATH_MSG_VERBOSE("\tCrosstalk fix " << m_crossTalkFix[crossTalkCnt]);
647  adcValue /= m_crossTalkFix[crossTalkCnt];
648  adcError /= m_crossTalkFix[crossTalkCnt];
649  }
650  if(adcError != adcError)
651  adcError = 0.01;
652 
653  float db = m_dbLevels[pulserLevel];
654 
655 
656  float attenValue =0;
657  if(m_doLinPlot)
658  attenValue = 300*std::pow(10,db/20);
659  else
660  attenValue = db;
661 
662  ATH_MSG_DEBUG("\tStoring at db of " << db << " with attenValue " << attenValue << " from pulser level of " << pulserLevel << " and adcValue " << adcValue);
663 
664 
665 
666  //See if the last two drops were far down enough
667  if(!foundMin){
668  thisDrop = lastVal - adcValue;
669  ATH_MSG_DEBUG("\tFinding fit min:"
670  << "\tlastVal = " << lastVal
671  << ";lastDrop " << lastDrop << "; thisDrop " << thisDrop);
672  if(thisDrop > m_minDeltaAdc && lastDrop > m_minDeltaAdc){
673  ATH_MSG_DEBUG("Found fitMin!");
674  foundMin = true;
675  fitMinX = attenValue;
676  }
677  else{
678  //Not enough deltaADC, store this iterations values for the next loop
679  lastDrop = thisDrop;
680  lastVal = adcValue;
681  }
682  }
683 
684  //Use highest attenuation level as fitMaxX
685  if(attenValue > fitMaxX)
686  fitMaxX = attenValue;
687 
688  calGraph->SetPoint(calPointItr,attenValue,adcValue);
689  calGraph->SetPointError(calPointItr,0.01,adcError);
690  calPointItr++;
691  }//done if(entries >0)
692 
693  }//Done ampProfItr loop
694 
695  if(!foundMin && isGoodStrip){
696  ATH_MSG_WARNING("Failed to find minium for " << title);
697  }
698 
699  //***Do a simple fit to calGraph***
700  //Here we only fit the linear part of the plot. m_fitCutoff can be set by user.
701  if(isGoodStrip)
702  {
703  ATH_MSG_INFO("we have a good stripHash at " << stripHash);
704 
705  m_pulsedChambers->insert(chamHash); //Programer note: Only gets filled on x-axis. Probably OK.
706 
707  float slope, slopeError, intercept, interceptError, chiSquared;
708  int ndf;
709  int fitRet=0;
710 
711  //Setup our gain fit function
712  TF1 myFunc("myFunction", m_calFitFunc.c_str(), fitMinX, fitMaxX);
713  myFunc.SetLineColor(kRed);
714  if(m_doLinPlot)
715  {
716  myFunc.SetParameters(0,5);
717  slope = myFunc.GetParameter(1);
718  slopeError = myFunc.GetParError(1);
719  intercept = myFunc.GetParameter(0);
720  interceptError = myFunc.GetParError(0);
721  chiSquared = myFunc.GetChisquare();
722  ndf = myFunc.GetNDF();
723  }
724  else
725  {
726  myFunc.SetParameters(0.1,2000);
727 
728  fitRet = calGraph->Fit(&myFunc,"RV");
729 
730  slope = myFunc.GetParameter(1)/chargeMax;
731  slopeError = myFunc.GetParError(1);
732  intercept = myFunc.GetParameter(0);
733  interceptError = myFunc.GetParError(0);
734  chiSquared = myFunc.GetChisquare();
735  ndf = myFunc.GetNDF();
736  }
737 
738  float invertedSlope;
739  if(std::abs(slope) < 0.00001 || slope == -999) //watch out for slope==0
740  {
741  ATH_MSG_WARNING("Slope invalid ");
742  continue;
743  }
744 
745  invertedSlope = 1/slope;
746 
747  ATH_MSG_ERROR("Inserting calgraph in for hash " << stripHash);
748  (*m_calGraphs)[stripHash] = calGraph;
749 
750  ATH_MSG_DEBUG("StripHash: " << stripHash << "; slope: " <<slope
751  << "; intercept: " << intercept
752  << "; chi^2/ndf: " << chiSquared << "/" << ndf);
753  CscCalibResult * slopeResult = new CscCalibResult(stripHash,invertedSlope,slopeError,chiSquared,ndf);
754  CscCalibResult * interceptResult = new CscCalibResult(stripHash, intercept, interceptError, chiSquared, ndf);
755 
756  m_slopes->push_back(slopeResult);
757  m_intercepts->push_back(interceptResult);
758  (*m_fitReturns)[stripHash] = fitRet;
759 
760  }//end if(isGoodStrip)
761 
762 
763  if(crossTalkCnt == 23)
764  crossTalkCnt = 0;
765  else
766  crossTalkCnt++;
767  ATH_MSG_DEBUG("Looping over next strip...");
768  }//end loop over strips
769  ATH_MSG_INFO("Completed calculating parameters for each strip");
770  return StatusCode::SUCCESS;
771  }//End calculateParameters()
772 
773  //writeCalibrationFile() dumps the parameters to disk
775  {
776  Chrono chrono(m_chronoSvc,"writeCalibrationFile");
777  if(m_calOutputVersion == "00-00"){
778  ATH_MSG_INFO("Printing output file version 00-00");
779  return calOutput0();
780  }
781  else if(m_calOutputVersion == "03-00") {
782  ATH_MSG_INFO("Printing output file version 03-00");
783  return calOutput3();
784  }
785  else{
786  ATH_MSG_INFO("Don't know how to write calibration file version " << m_calOutputVersion);
787  return StatusCode::RECOVERABLE;
788  }
789  }
790 
792  //***Take conditions data held in summary histograms and print to the calibration file***//
793  ATH_MSG_INFO("Parameters calculated, preparing to outputing to file: " << m_outputFileName);
794  std::ofstream out;
795  out.open(m_outputFileName.c_str());
796  if(!out.is_open())
797  {
798  ATH_MSG_FATAL("Can't open file " << m_outputFileName.c_str() << "for writing");
799  return StatusCode::FAILURE;
800  }
801  //Start by writing file version number (mainly for COOL program to read)
802  out << "00-00 ";
803  //Number of strips we have info for:
804  out << m_slopes->size() << " ";
805  //print out header
806  out << "pslope ";
807  if(m_findPeakTime) out << "peakt ";
808  out << "END_HEADER\n";
809  //Now we loop over each strip's parameters and print them out
810  ATH_MSG_DEBUG("Begining loop over all " << m_maxStripHash << " hash ids.");
811 
812  //form is:
813  //hashID chamber LayerOrientationStrip parametervalue parametervalue
818  if(m_findPeakTime)
819  {
820  peaktItr = m_peakTimes->begin();
821  peaktEnd = m_peakTimes->end();
822  }
823  for(; slopeItr != slopeEnd; ++slopeItr)
824  {
825  if(m_findPeakTime && (peaktItr == peaktEnd) )
826  {
827  ATH_MSG_FATAL("Peaktimes out of sync with slopes. Quiting write.");
828 
829  return StatusCode::FAILURE;
830  }
831 
832  //Output hashId
833  out << (*slopeItr)->hashId();
834 
835  //get id for next few outputs
836  Identifier id;
837  IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
838  m_idHelperSvc->cscIdHelper().get_id((*slopeItr)->hashId(),id, &channelContext);
839 
840  //output chamber #
841  IdentifierHash chamberHash;
842  Identifier chamberId = m_idHelperSvc->cscIdHelper().elementID(id);
843  if(!m_idHelperSvc->cscIdHelper().valid(chamberId))
844  {
845  ATH_MSG_FATAL(chamberId.getString() << " is not a valid id!");
846  ATH_MSG_FATAL("identifier is: " << m_idHelperSvc->cscIdHelper().show_to_string(chamberId));
847  return StatusCode::FAILURE;
848  }
849 
850  m_idHelperSvc->cscIdHelper().get_module_hash(id,chamberHash);
851  out <<" " << chamberHash;
852 
853  //output strip details
854  out << " " << m_idHelperSvc->cscIdHelper().show_to_string(id) << " ";
855 
856  //output parameter values
857  out << " " << (*slopeItr)->value();
858  if(m_findPeakTime) out << " " << (*peaktItr)->value();
859  out << "\n" ; //to improve readability
860  } //end loop over hash Ids
861 
862  out.close(); //done writing
863 
864  return StatusCode::SUCCESS;
865  }//end calOutput0
866 
868  {
869  ATH_MSG_INFO("Recording csc calibration report.");
870 
871  StatusCode sc = StatusCode::SUCCESS;
872 
873  bool thereIsAnError = false;
874 
875  std::string histKey = "cscSlopeCalibReport";
876  ATH_MSG_DEBUG("Recording calibration graphs to TDS with key " << histKey);
877 
878  CscCalibReportSlope * report = new CscCalibReportSlope("calGraphs");
879 
880  report->setCalGraphs(m_calGraphs);
881  report->setAmpProfs(m_ampProfs);
882  report->setPulsedChambers(m_pulsedChambers);
883  report->setBitHists(m_bitHists);
884  report->setFitResults(m_fitReturns);
885 
886  CscCalibReportContainer * repCont = new CscCalibReportContainer(histKey);
887  repCont->push_back(report);
888 
889  sc = m_storeGate->record(repCont, histKey);
890  if(sc.isFailure())
891  {
892  ATH_MSG_ERROR("Failed to record CscCalibReportSlope to storegate");
893  thereIsAnError = true;
894  //Since storegate isn't taking ownership, we'll delete it:
895  delete repCont;
896  }
897 
898  CscCalibResultContainer * calibResults
899  = new CscCalibResultContainer("CscCalibResultSlope");
900  calibResults->push_back(m_slopes);
901  calibResults->push_back(m_intercepts);
902  if(m_findPeakTime)
903  calibResults->push_back(m_peakTimes);
904  sc = m_storeGate->record(calibResults,"CscCalibResultSlope");
905  if(sc.isFailure())
906  {
907  ATH_MSG_ERROR("Failed to record results to storegate");
908  thereIsAnError = true;
909  //Since storegate isn't taking ownership, we'll delete it
910  delete calibResults;
911  }
912 
913  if(thereIsAnError)
914  return StatusCode::RECOVERABLE;
915 
916  return StatusCode::SUCCESS;
917  }
918 
919 
920 
922  std::ofstream out;
923  out.open(m_outputFileName.c_str());
924  if(!out.is_open())
925  {
926  ATH_MSG_ERROR("Can't open file " << m_outputFileName.c_str());
927  return StatusCode::RECOVERABLE;
928  }
929  out << "03-00 <END_HEADER>";
930 
932  out << "\n<END_FILE>";
933  out.close();
934 
935  ATH_MSG_INFO("Successfully opened file " << m_outputFileName);
936 
937  return StatusCode::SUCCESS;
938  }
939 
940 
942  ATH_MSG_INFO("Printing out parameter " << results.parName());
943 
945  const CscCondDbData* readCdo{*readHandle};
946 
947  out << "\n";
948  out << "<NEW_PAR> " << results.parName() << "\n";
949  std::string idString;
950 
953  for(; resItr != resEnd; ++resItr){
954  unsigned int hashId = (*resItr)->hashId();
955  double value = (*resItr)->value();
956  std::string idString;
957 
958  readCdo->indexToStringId(&m_idHelperSvc->cscIdHelper(), hashId, "CHANNEL", idString).ignore();
959 
960  out << idString << " " << value << "\n";
961  }
962 
963  out << "<END_PAR>" ;
964  }
965 }//end namespace MuonCalib
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
StoreGateSvc::record
StatusCode record(T *p2BRegistered, const TKEY &key)
Record an object with a key.
MuonCalib::CscCalcSlope::storeGateRecord
StatusCode storeGateRecord()
Definition: CscCalcSlope.cxx:867
covarianceTool.ndf
ndf
Definition: covarianceTool.py:678
ICSC_RDO_Decoder.h
get_hdefs.buff
buff
Definition: get_hdefs.py:64
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
MuonCalib::CscCalcSlope::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: CscCalcSlope.h:83
MuonCalib::CscCalcSlope::m_chronoSvc
IChronoStatSvc * m_chronoSvc
Definition: CscCalcSlope.h:84
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
MuonCalib::CscCalcSlope::m_outputFileName
std::string m_outputFileName
Parameters input through joboptions.
Definition: CscCalcSlope.h:88
MuonCalib::CscCalcSlope::CscCalcSlope
CscCalcSlope(const std::string &name, ISvcLocator *pSvcLocator)
Definition: CscCalcSlope.cxx:31
MuonCalib::CscCalcSlope::execute
StatusCode execute(void)
Definition: CscCalcSlope.cxx:261
MuonCalib::CscCalcSlope::calculateParameters
StatusCode calculateParameters()
Finalize functions.
Definition: CscCalcSlope.cxx:534
MuonCalib::CscCalcSlope::fillBitHist
StatusCode fillBitHist(TH1I *bitHist, const uint16_t &val)
Definition: CscCalcSlope.h:150
MuonCalib::CscCalcSlope::m_pulsedChambers
std::set< int > * m_pulsedChambers
Definition: CscCalcSlope.h:111
MuonCalib::CscCalcSlope::m_dbLevels
std::vector< float > m_dbLevels
Definition: CscCalcSlope.h:124
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
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
MuonCalib::CscCalcSlope::calOutput0
StatusCode calOutput0()
Definition: CscCalcSlope.cxx:791
CscCalibResult
Definition: CscCalibResult.h:19
MuonCalib::CscCalcSlope::outputParameter3
void outputParameter3(const CscCalibResultCollection &results, std::ofstream &out)
Definition: CscCalcSlope.cxx:941
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
CaloCondBlobAlgs_fillNoiseFromASCII.db
db
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:43
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
MuonCalib::CscCalcSlope::m_cscCalibTool
ICscCalibTool * m_cscCalibTool
Definition: CscCalcSlope.h:81
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
MuonCalib::CscCalcSlope::writeCalibrationFile
StatusCode writeCalibrationFile()
Definition: CscCalcSlope.cxx:774
checkTP.report
report
Definition: checkTP.py:127
CscCalibReportContainer.h
MuonCalib::CscCalcSlope::m_expectedChamberLayer
int m_expectedChamberLayer
Definition: CscCalcSlope.h:131
MuonCalib::CscCalcSlope::m_findPeakTime
bool m_findPeakTime
Definition: CscCalcSlope.h:136
MuonCalib::CscCalcSlope::m_peakTimes
CscCalibResultCollection * m_peakTimes
Definition: CscCalcSlope.h:138
athena.value
value
Definition: athena.py:122
CscCalibReportContainer
Definition: CscCalibReportContainer.h:25
ICscCalibTool.h
MuonCalib::CscCalcSlope::m_intercepts
CscCalibResultCollection * m_intercepts
Definition: CscCalcSlope.h:116
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MuonCalib::CscCalcSlope::m_fitReturns
std::vector< float > * m_fitReturns
Definition: CscCalcSlope.h:105
MuonCalib::CscCalcSlope::m_lastPulserLevel
int m_lastPulserLevel
Definition: CscCalcSlope.h:100
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
MuonCalib::CscCalcSlope::m_peds
float * m_peds
Definition: CscCalcSlope.h:126
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
MuonCalib::CscCalcSlope::m_bipolarFit
BipolarFit m_bipolarFit
Definition: CscCalcSlope.h:120
MuonCalib::CscCalcSlope::m_calFitFunc
std::string m_calFitFunc
Definition: CscCalcSlope.h:133
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MuonCalib::CscCalcSlope::m_pedFileName
std::string m_pedFileName
Definition: CscCalcSlope.h:129
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:92
python.TrigEgammaMonitorHelper.TProfile
def TProfile(*args, **kwargs)
Definition: TrigEgammaMonitorHelper.py:81
MuonCalib::CscCalcSlope::m_slopes
CscCalibResultCollection * m_slopes
Definition: CscCalcSlope.h:116
MuonCalib::CscCalcSlope::m_doBipolarFit
bool m_doBipolarFit
Definition: CscCalcSlope.h:121
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
MuonCalib::CscCalcSlope::collectEventInfo
StatusCode collectEventInfo()
event loop functions
Definition: CscCalcSlope.cxx:321
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
MuonCalib::CscCalcSlope::m_bitHists
DataVector< TH1I > * m_bitHists
Definition: CscCalcSlope.h:104
01SubmitToGrid.samples
samples
Definition: 01SubmitToGrid.py:58
MuonCalib::CscCalcSlope::m_numBits
unsigned int m_numBits
Definition: CscCalcSlope.h:147
covarianceTool.title
title
Definition: covarianceTool.py:542
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
MuonCalib::CscCalcSlope::m_peakTimeProf
TProfile * m_peakTimeProf
Definition: CscCalcSlope.h:137
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalib::CscCalcSlope::m_calOutputVersion
std::string m_calOutputVersion
Definition: CscCalcSlope.h:89
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
BipolarFit.h
MuonCalib::CscCalcSlope::calOutput3
StatusCode calOutput3()
Definition: CscCalcSlope.cxx:921
MuonCalib::CscCalcSlope::m_noises
float * m_noises
Definition: CscCalcSlope.h:126
CscCalibReportSlope.h
RunTileMonitoring.rod
rod
Definition: RunTileMonitoring.py:134
DataVector< TH1I >
MuonCalib::CscCalcSlope::m_storeGate
StoreGateSvc * m_storeGate
Services and tools.
Definition: CscCalcSlope.h:80
MuonCalib::CscCalcSlope::m_doCrossTalkFix
bool m_doCrossTalkFix
Definition: CscCalcSlope.h:123
CscCalibReportSlope
Definition: CscCalibReportSlope.h:28
CscCalibResultContainer
Definition: CscCalibResultContainer.h:22
AthAlgorithm
Definition: AthAlgorithm.h:47
MuonCalib::CscCalcSlope::initialize
StatusCode initialize(void)
basic required functions
Definition: CscCalcSlope.cxx:124
CscRawDataCollection.h
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
MuonCalib::CscCalcSlope::m_titlePrefix
std::string m_titlePrefix
Definition: CscCalcSlope.h:97
CscCalibResultContainer.h
CscRawData.h
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
MuonCalib::CscCalcSlope::m_readKey
SG::ReadCondHandleKey< CscCondDbData > m_readKey
Definition: CscCalcSlope.h:85
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
python.ami.results
def results
Definition: ami.py:386
MuonCalib::CscCalcSlope::m_cscRdoDecoderTool
ToolHandle< Muon::ICSC_RDO_Decoder > m_cscRdoDecoderTool
Definition: CscCalcSlope.h:82
Example_ReadSampleNoise.ped
ped
Definition: Example_ReadSampleNoise.py:45
IDTPM::chiSquared
float chiSquared(const U &p)
Definition: TrackParametersHelper.h:136
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
ICscCalibTool::findCharge
virtual bool findCharge(const float samplingTime, const unsigned int samplingPhase, const std::vector< float > &samples, double &charge, double &time) const =0
Given sampling values for a CSC strip, find the corresponding charge by fitting the time samples.
Identifier::getString
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Definition: Identifier.cxx:25
CscCalcSlope.h
TProfile::Fill
int Fill(double, double)
Definition: rootspy.cxx:523
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
CscCalibResultCollection
Definition: CscCalibResultCollection.h:24
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MuonCalib::CscCalcSlope::m_doLinPlot
bool m_doLinPlot
Definition: CscCalcSlope.h:141
CscRawDataContainer
This container provides access to collections of CSC RDOs and a mechanism for recording them.
Definition: CscRawDataContainer.h:23
MuonCalib::CscCalcSlope::m_currentAmpProf
TProfile * m_currentAmpProf
Definition: CscCalcSlope.h:109
MuonCalib::CscCalcSlope::m_ignoreDatabaseError
bool m_ignoreDatabaseError
Definition: CscCalcSlope.h:94
MuonCalib::CscCalcSlope::m_minDeltaAdc
double m_minDeltaAdc
Definition: CscCalcSlope.h:91
MuonCalib::CscCalcSlope::finalize
StatusCode finalize(void)
Definition: CscCalcSlope.cxx:276
IdentifierHash
Definition: IdentifierHash.h:38
MuonCalib::CscCalcSlope::m_titlePostfix
std::string m_titlePostfix
Definition: CscCalcSlope.h:97
MuonCalib::CscCalcSlope::m_crossTalkFix
double * m_crossTalkFix
Definition: CscCalcSlope.h:122
BipolarFit::Fit
int Fit(double *x, const double ex, const double pedestal, const double predefinedwidth, double *result, double *errors, double *chi2)
Definition: BipolarFit.cxx:203
IdContext
class IdContext
Definition: IdContext.h:34
MuonCalib::CscCalcSlope::m_maxStripHash
unsigned int m_maxStripHash
Internally global variables.
Definition: CscCalcSlope.h:99
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
MuonCalib::CscCalcSlope::m_eventCnt
int m_eventCnt
coherent correction array has the corrections to the coherently pulsed channels to get the basic chan...
Definition: CscCalcSlope.h:114
MuonCalib::CscCalcSlope::m_calGraphs
DataVector< TGraphErrors > * m_calGraphs
Definition: CscCalcSlope.h:108
WriteCellNoiseToCool.noise
noise
Definition: WriteCellNoiseToCool.py:380
MuonCalib::CscCalcSlope::m_pedFile
bool m_pedFile
Definition: CscCalcSlope.h:128
MuonCalib::CscCalcSlope::m_doBitHists
bool m_doBitHists
Definition: CscCalcSlope.h:95
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
CscCondDbData
Definition: CscCondDbData.h:24
TProfile::GetBinContent
double GetBinContent(int) const
Definition: rootspy.cxx:527
MuonCalib::CscCalcSlope::m_ampProfs
std::map< int, TProfile * > * m_ampProfs
Definition: CscCalcSlope.h:110