16#ifndef ALICEO2_TPC_SAMPAProcessing_H_
17#define ALICEO2_TPC_SAMPAProcessing_H_
46 return sampaProcessing;
78 template <DigitzationMode MODE>
79 float makeSignal(
float ADCcounts,
const int sector,
const int globalPadInSector,
const float commonMode,
float& pedestal,
float& noise,
float tot = 0);
87 void getShapedSignal(
float ADCsignal,
float driftTime, std::vector<float>& signalArray)
const;
148 const CalPad* mPedestalMap;
149 const CalPad* mPedestalMapCRU;
150 const CalPad* mZeroSuppression;
151 math_utils::RandomRing<> mRandomNoiseRing;
160 return nElectrons * conversion;
163template <DigitzationMode MODE>
165 float& pedestal,
float& noise,
float tot)
170 const float signal = ADCcounts;
172 const float fullSignal = signal - commonMode + noise + pedestal + (tot > 0 ? 80 : 0);
180 const float signalSubtractPedestal =
getADCSaturation(signal) - pedestalCRU;
182 if (signalSubtractPedestal < zeroSuppression) {
185 return signalSubtractPedestal;
191 const float signalNoCM = signal + noise + pedestal + (tot > 0 ? 80 : 0);
192 const float signalSubtractPedestal =
getADCSaturation(signalNoCM) - pedestalCRU;
194 if (signalSubtractPedestal < zeroSuppression) {
197 return signalSubtractPedestal;
201 const float signalSubtractPedestal =
getADCSaturation(fullSignal) - pedestalCRU;
202 return signalSubtractPedestal;
220 if (signal > adcSaturation - 1) {
221 return adcSaturation - 1;
230 const auto cond = (tmp0 > 0);
232 if constexpr (std::is_floating_point_v<T>) {
240 const auto tmp2 = tmp * tmp;
241 return 55.f * ADC * std::exp(-4.f * tmp) * tmp2 * tmp2;
251 const float zSign = (
s == 0) ? 1 : -1;
266 return static_cast<float>(timeBin) * mEleParam->
ZbinWidth;
276 return mRandomNoiseRing.getNextValue() * mNoiseMap->
getValue(
sector, globalPadInSector);
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual sector
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
Definition of the parameter class for the detector.
Definition of the parameter class for the detector electronics.
Definition of the parameter class for the detector gas.
const T getValue(const int sec, const int globalPadInSector) const
void setRandomRingPositions(TRandom &rng)
Move the random ring to a new position drawn from rng.
float getZeroSuppression(const int sector, const int globalPadInSector) const
Get the zero suppression threshold for a given channel.
float getNoise(const int sector, const int globalPadInSector)
void getShapedSignal(float ADCsignal, float driftTime, std::vector< float > &signalArray) const
T getADCvalue(T nElectrons) const
static SAMPAProcessing & instance()
float getTimeBinTime(float time) const
float getTimeFromBin(TimeBin timeBin) const
float makeSignal(float ADCcounts, const int sector, const int globalPadInSector, const float commonMode, float &pedestal, float &noise, float tot=0)
float getZfromTimeBin(float timeBin, Side s) const
void updateParameters(float vdrift=0)
Update the OCDB parameters cached in the class. To be called once per event.
float getPedestalCRU(const int sector, const int globalPadInSector) const
TimeBin getTimeBin(float zPos) const
~SAMPAProcessing()=default
Destructor.
float getADCSaturation(const float signal) const
T getGamma4(T time, T startTime, T ADC) const
TimeBin getTimeBinFromTime(float time) const
float getPedestal(const int sector, const int globalPadInSector) const
@ ZeroSuppressionCMCorr
Apply noise, pedestal and saturation and then from that subtract the pedestal and apply zero suppress...
@ ZeroSuppression
Apply noise, pedestal, common mode and saturation and then from that subtract the pedestal and apply ...
@ PropagateADC
Just propagate the bare ADC value.
@ FullMode
Apply noise, pedestal and saturation.
@ SubtractPedestal
Apply noise, pedestal and saturation and then from that subtract the pedestal.
@ NoSaturation
Apply only noise and pedestal.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
float TPClength
Length of the TPC [cm].
float ADCdynamicRange
Dynamic range of the ADC [mV].
float ADCsaturation
ADC saturation [ADC counts].
float ZbinWidth
Width of a z bin [us].
float PeakingTime
Peaking time of the SAMPA [us].
float ElectronCharge
Electron charge [C].
float ChipGain
Gain of the SAMPA [mV/fC] - may be either 20 or 30.