|
| 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. More...
|
|
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. More...
|
|
virtual double | adcCountToFemtoCoulomb (const float adcCounts, const float slope) const override final |
| given one CSC ADC sample value, convert that to charge in femtoCoulomb More...
|
|
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 More...
|
|
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. More...
|
|
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. More...
|
|
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 More...
|
|
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 More...
|
|
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 More...
|
|
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 More...
|
|
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 More...
|
|
virtual int | stripStatusBit (uint32_t stripHashId) const override final |
| return status bit More...
|
|
virtual bool | stripT0phase (uint32_t stripHashId) const override final |
| return T0phase related to 5 ASM. More...
|
|
virtual double | stripT0base (uint32_t stripHashId) const override final |
| return T0base related to 5 ASM. More...
|
|
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 More...
|
|
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. More...
|
|
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.
370 int numberOfSamplings = samples.size();
372 if (numberOfSamplings==0)
return false;
376 int i = numberOfSamplings/2-1;
377 charge = 0.5*(samples[
i]+samples[
i+1]);
380 if (std::abs(samples[
i]+samples[
i+1])>0.0001) asym = (samples[
i+1]-samples[
i])/(samples[
i]+samples[
i+1]);
389 time = 76 + 47.85*asym + 6.629*asym*asym;
390 if ( samplingPhase == 1 )
time -= 25;
395 float max = -4096000;
398 if ( numberOfSamplings >10) {
400 max = samples[maxIndex];
403 for (
int i=0;
i<numberOfSamplings;
i++) {
404 if ( numberOfSamplings >10 && (i<2 || i>6) )
continue;
405 if (samples[
i] >
max) {
419 int midIndex = maxIndex;
421 a = samples[maxIndex];
422 b = samples[maxIndex+1];
423 c = samples[maxIndex+2];
425 }
else if (maxIndex == numberOfSamplings-1) {
426 a = samples[maxIndex-2];
427 b = samples[maxIndex-1];
428 c = samples[maxIndex];
431 a = samples[maxIndex-1];
432 b = samples[maxIndex];
433 c = samples[maxIndex+1];
438 double aa = 0.5*(
c+
a-2*
b);
439 double bb = 0.5*(
c-
a);
446 time *= samplingTime;
447 if ( samplingPhase == 1 )
time -= 25;
451 if (maxIndex ==0 || maxIndex ==1)
453 else if (maxIndex ==2 || maxIndex ==3)
460 double timeOffset = -0.5*bb/
aa;
464 if ( ( maxIndex == 0 && timeOffset < -2.0 )
465 || ( maxIndex == 3 && timeOffset > 2.0) ) {
467 time *= samplingTime;
468 if ( samplingPhase == 1 )
time -= 25;
472 if (maxIndex ==0 || maxIndex ==1)
474 else if (maxIndex ==2 || maxIndex ==3)
483 charge =
aa*timeOffset*timeOffset + bb*timeOffset +
b;
496 time *= samplingTime;
497 if ( samplingPhase == 1 )
time -= 25;