|
| | CscCalibTool (const std::string &, const std::string &, const IInterface *) |
| virtual | ~CscCalibTool ()=default |
| virtual StatusCode | initialize () override final |
| virtual int | femtoCoulombToADCCount (uint32_t stripHashId, const double femtoCoulombs) const override final |
| | given a charge on the CSC strip, convert that to ADC counts this is needed in the digitization for example where it is the charges on the strips that are simulated first and converter to AOD samples in a subsequent step.
|
| virtual int | numberOfElectronsToADCCount (uint32_t stripHashId, const int numberOfElecEquiv) const override final |
| | Here the charge on the CSC strip is given in number of equivalent electrons; conversion to ADC counts.
|
| virtual double | adcCountToFemtoCoulomb (const float adcCounts, const float slope) const override final |
| | given one CSC ADC sample value, convert that to charge in femtoCoulomb
|
| virtual double | adcCountToFemtoCoulomb (uint32_t stripHashId, const float adcCounts) const override final |
| virtual double | adcCountToNumberOfElectrons (const float adcValue, const float slope) const override final |
| | given one CSC ADC sample value, convert that to charge in number of equivalent electrons
|
| virtual double | adcCountToNumberOfElectrons (uint32_t stripHashId, const float adcValue) const override final |
| virtual bool | adcToCharge (const std::vector< uint16_t > &samples, uint32_t stripHashId, std::vector< float > &charges) const override final |
| | Conversion of ADC value to charge - Here the charges is returned in numbers of equivalent electrons.
|
| virtual bool | findCharge (const float samplingTime, const unsigned int samplingPhase, const std::vector< float > &samples, double &charge, double &time) const override final |
| | Given sampling values for a CSC strip, find the corresponding charge by fitting the time samples.
|
| virtual double | stripNoise (uint32_t stripHashId, const bool convert=true) const override final |
| | return the noise(sigma) on the readout strip in ADC counts or Number of Electrons number of electrons by default: convert=true
|
| virtual double | stripRMS (uint32_t stripHashId, const bool convert=true) const override final |
| | return the RMS on the readout strip in ADC counts or Number of Electrons number of electrons by default: convert=true
|
| virtual double | stripF001 (uint32_t stripHashId, const bool convert=true) const override final |
| | return the F001 on the readout strip in ADC counts or Number of Electrons number of electrons by default: convert=true
|
| virtual double | stripPedestal (uint32_t stripHashId, const bool convert=true) const override final |
| | return the pedestal on the readout strip in ADC counts or Number of Electrons
|
| virtual bool | isGood (uint32_t stripHashId) const override final |
| | return the status of this strip, good channel, dead channel, noisy channel - it will return true for strip that working fine, false is returned for dead/noisy channels
|
| virtual int | stripStatusBit (uint32_t stripHashId) const override final |
| | return status bit
|
| virtual bool | stripT0phase (uint32_t stripHashId) const override final |
| | return T0phase related to 5 ASM.
|
| virtual double | stripT0base (uint32_t stripHashId) const override final |
| | return T0base related to 5 ASM.
|
| virtual double | func (const double x, const float slope) const override final |
| | these function used in the AOD <-> conversion; may not be needed once we integrate the calibration service
|
| virtual double | func_prime (const double x, const float slope) const override final |
| virtual double | signal (const double z) const override final |
| virtual double | signal_amplitude (const double driftTime, const double samplingTime) const override final |
| virtual double | getZ0 () const override final |
| | ROOT version of bipolar function.
|
| virtual double | getSamplingTime () const override final |
| virtual double | getTimeOffset () const override final |
| virtual double | getSignalWidth () const override final |
| virtual double | getNumberOfIntegration () const override final |
| virtual double | getNumberOfIntegration2 () const override final |
| virtual std::pair< double, double > | addBipfunc (const double driftTime0, const double stripCharge0, const double driftTime1, const double stripCharge1) const override final |
| virtual std::vector< float > | getSamplesFromBipolarFunc (const double driftTime0, const double stripCharge0) const override final |
| virtual double | getLatency () const override final |
Definition at line 36 of file CscCalibTool.h.
| bool CscCalibTool::findCharge |
( |
const float | samplingTime, |
|
|
const unsigned int | samplingPhase, |
|
|
const std::vector< float > & | samples, |
|
|
double & | charge, |
|
|
double & | time ) const |
|
finaloverridevirtual |
Given sampling values for a CSC strip, find the corresponding charge by fitting the time samples.
By default, a parabolic fit is done. The charge and the time are returned. The time is calculated with respect to the time of the first sample.
find the maximum
all the samples are zeros
now the parabolic interpolation
a==0: 3 points on a line, no parabola possible
a>0: convex parabola isn't useful for peak finding
if the time offset is out of range
successful interpolation
Find the peaking time: this is no longer assuming a 4-time sample system The peaking time is the time of the largest sample. This is corrected by the timeOffset interpolation, which should range from -0.5 to 0.5.
- Todo
- find out if a larger range can be used, such as +-1.0
Multiply by sampling time to convert to nanoseconds. Finally subtract 25ns if the sampling phase is 1.
Definition at line 364 of file CscCalibTool.cxx.
365 {
366
369
370 int numberOfSamplings = samples.size();
371
372 if (numberOfSamplings==0) return false;
373
374
376 int i = numberOfSamplings/2-1;
377 charge = 0.5*(samples[
i]+samples[
i+1]);
378
379 double asym = 0.;
380 if (std::abs(samples[i]+samples[i+1])>0.0001) asym = (samples[
i+1]-samples[
i])/(samples[i]+samples[i+1]);
381
382
383
384
385
386
387
388
389 time = 76 + 47.85*asym + 6.629*asym*asym;
390 if ( samplingPhase == 1 )
time -= 25;
391 return true;
392 }
393
395 float max = -4096000;
396 int maxIndex = -1;
397
398 if ( numberOfSamplings >10) {
399 maxIndex = 2;
400 max = samples[maxIndex];
401 }
402
403 for (
int i=0;
i<numberOfSamplings;
i++) {
404 if ( numberOfSamplings >10 && (i<2 || i>6) ) continue;
405 if (samples[i] >
max) {
408 }
409 }
410
412
413
414
416
418
419 int midIndex = maxIndex;
420 if (maxIndex == 0) {
421 a = samples[maxIndex];
422 b = samples[maxIndex+1];
423 c = samples[maxIndex+2];
424 midIndex +=1;
425 } else if (maxIndex == numberOfSamplings-1) {
426 a = samples[maxIndex-2];
427 b = samples[maxIndex-1];
428 c = samples[maxIndex];
429 midIndex -=1;
430 } else {
431 a = samples[maxIndex-1];
432 b = samples[maxIndex];
433 c = samples[maxIndex+1];
434 }
435
436
437
438 double aa = 0.5*(
c+
a-2*
b);
439 double bb = 0.5*(
c-
a);
440
441
444 if ( aa >= 0 ) {
446 time *= samplingTime;
447 if ( samplingPhase == 1 )
time -= 25;
448
450
451 if (maxIndex ==0 || maxIndex ==1)
453 else if (maxIndex ==2 || maxIndex ==3)
455
457 return false;
458 }
459
460 double timeOffset = -0.5*bb/
aa;
461
464 if ( ( maxIndex == 0 && timeOffset < -2.0 )
465 || ( maxIndex == 3 && timeOffset > 2.0) ) {
467 time *= samplingTime;
468 if ( samplingPhase == 1 )
time -= 25;
469
471
472 if (maxIndex ==0 || maxIndex ==1)
474 else if (maxIndex ==2 || maxIndex ==3)
476
478
479 return true;
480 }
481
483 charge =
aa*timeOffset*timeOffset + bb*timeOffset +
b;
485
496 time *= samplingTime;
497 if ( samplingPhase == 1 )
time -= 25;
498
499 return true;
500}
time(flags, cells_name, *args, **kw)