|
| | 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 363 of file CscCalibTool.cxx.
364 {
365
368
369 int numberOfSamplings = samples.size();
370
371 if (numberOfSamplings==0) return false;
372
373
375 int i = numberOfSamplings/2-1;
376 charge = 0.5*(samples[
i]+samples[
i+1]);
377
378 double asym = 0.;
379 if (std::abs(samples[i]+samples[i+1])>0.0001) asym = (samples[
i+1]-samples[
i])/(samples[i]+samples[i+1]);
380
381
382
383
384
385
386
387
388 time = 76 + 47.85*asym + 6.629*asym*asym;
389 if ( samplingPhase == 1 )
time -= 25;
390 return true;
391 }
392
394 float max = -4096000;
395 int maxIndex = -1;
396
397 if ( numberOfSamplings >10) {
398 maxIndex = 2;
399 max = samples[maxIndex];
400 }
401
402 for (
int i=0;
i<numberOfSamplings;
i++) {
403 if ( numberOfSamplings >10 && (i<2 || i>6) ) continue;
404 if (samples[i] >
max) {
407 }
408 }
409
411
412
413
415
416 double a{},
b{},
c{};
417
418 int midIndex = maxIndex;
419 if (maxIndex == 0) {
420 a = samples[maxIndex];
421 b = samples[maxIndex+1];
422 c = samples[maxIndex+2];
423 midIndex +=1;
424 } else if (maxIndex == numberOfSamplings-1) {
425 a = samples[maxIndex-2];
426 b = samples[maxIndex-1];
427 c = samples[maxIndex];
428 midIndex -=1;
429 } else if (maxIndex > 0){
430 a = samples[maxIndex-1];
431 b = samples[maxIndex];
432 c = samples[maxIndex+1];
433 }
434
435
436
437 double aa = 0.5*(
c+
a-2*
b);
438 double bb = 0.5*(
c-
a);
439
440
443 if ( aa >= 0 ) {
445 time *= samplingTime;
446 if ( samplingPhase == 1 )
time -= 25;
447
449
450 if (maxIndex ==0 || maxIndex ==1)
452 else if (maxIndex ==2 || maxIndex ==3)
454
456 return false;
457 }
458
459 double timeOffset = -0.5*bb/
aa;
460
463 if ( ( maxIndex == 0 && timeOffset < -2.0 )
464 || ( maxIndex == 3 && timeOffset > 2.0) ) {
466 time *= samplingTime;
467 if ( samplingPhase == 1 )
time -= 25;
468
470
471 if (maxIndex ==0 || maxIndex ==1)
473 else if (maxIndex ==2 || maxIndex ==3)
475
477
478 return true;
479 }
480
482 charge =
aa*timeOffset*timeOffset + bb*timeOffset +
b;
484
495 time *= samplingTime;
496 if ( samplingPhase == 1 )
time -= 25;
497
498 return true;
499}
time(flags, cells_name, *args, **kw)