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