26#include <RtypesCore.h>
33#include <MessageTypes.h>
151 static Double_t
Response(Double_t* samplenr, Double_t* par);
170 Int_t
GetNoise(Double_t sigmaNoise);
186 template<
class Pulse>
189 for (
auto& sample : *pulse) {
287 template<
class precision>
292 if (sndtriggersample) *sndtriggersample = 0;
295 bool selftrigger =
false;
296 bool falling =
false;
297 bool multihit =
false;
302 for (
auto sampleIt = pulse->begin(); sampleIt < pulse->end() - 2; ++sampleIt) {
303 slopeFst = *(sampleIt + 1) - *sampleIt;
306 slopeSnd = *(sampleIt + 1) - *sampleIt;
307 if (slopeSnd < 0 && !selftrigger)
continue;
317 if (sndtriggersample) *sndtriggersample = sampleIt - pulse->begin();
319 if (slopeFst < 0 && slopeSnd < 0) falling =
true;
Class containing definitions and functions correlated to the dEdx behavior of the CbmTrd.
static Double_t GetChargeToMaxAdcCal()
Get the Charge To Max Adc Calibration value.
static Double_t GetClockCycle()
Get the Clock Cycle.
UInt_t GetPeakingSamplePos()
Get the Peaking Sample Pos.
bool GetUseBaselineAvg()
Get the Use Baseline Avg flag.
ClassDef(CbmTrdSpadic, 2)
eResponsePars
enum for response parameters
CbmTrdDigi::eTriggerType GetTriggerDecision(std::vector< precision > *pulse, UInt_t *sndtriggersample=nullptr)
Get the Trigger Decision Get the trigger decision for the spadic. Currently this is based on the & di...
void SetBaselineLvl(UInt_t value)
Set the Baseline Lvl value.
void SetMaxAdcToEnergyCal(Double_t value)
Set the Max Adc To Energy Cal value.
Float_t GetModuleThickness()
Get the Module Thickness value.
static constexpr UInt_t fgNrOfAdcSamples
Number of ADC samples.
Float_t GetMaxAdcToEnergyCal()
Get the Max Adc To Energy Cal value.
void SetModuleThickness(Double_t value)
Set the Module Thickness value.
Float_t fModuleThickness
Thickness of the module [cm] this spadic is mounted on. Should be setted during runtime from paramete...
Int_t fTriggerSlopeConditionFst
Slope trigger condition for a two stage differential triggger.
Double_t GetMipCalibration()
Get the MaxAdc to Mip Calibration value.
Float_t fMaxAdcToMipCal
Calibration for MIP to 7% of MaxAdc dynamic range. 0.65 = charge from PRF broad distribution on centr...
bool fDoUseBaselineAvg
Flag wether we have n standard presamples or the average baseline in a single presamples.
virtual ~CbmTrdSpadic()
Destroy the Cbm Trd Spadic object.
static constexpr UInt_t GetNrOfAdcSamples()
Get the Nr Of Adc Samples (Spadic default)
void SetDynamicRange(UInt_t value)
Set the Dynamic Range value.
Float_t GetAdcNoiseLevel()
Get the Adc Noise Level value.
Double_t GetAnalyticTimeshift(Double_t absolutetime)
Get the Analytic Timeshift value ns precision Calculate the timeshift within the spadic response base...
static constexpr UInt_t GetShapingOrder()
Get the Shaping Order.
UInt_t fDynamicRange
Dynamic range of the spadic The Spadic uses a 9-Bit ADC.
void SetClippingStart(Int_t value)
Set the Clipping Start value.
void SetNoiseLevel(Double_t value)
static const Double_t fgClockCycleLength
Clockcycle length of SPADIC v2.2.
UInt_t GetBaselineLvl()
Get the Baseline Lvl value.
static const Double_t fgChargeToMaxAdcCal
Calibration factor for input charges.
static std::shared_ptr< TF1 > GetResponseFunc()
Get a TF1 response function object.
std::vector< std::int16_t > GetAnalogResponsePulse(Double_t inputCharge, Double_t binTimeshift=0.0)
Get the Analog Response to a given input charge per adc time bin.
void SetSndTriggerSlopeCondition(Double_t value)
Set the Trigger Slope Condition value.
Float_t fMaxAdcToEnergyCal
Calibration value to calculate energy in keV based on the max adc value. Default = Simulation calibra...
void SetFstTriggerSlopeCondition(Double_t value)
Set the Trigger Slope Condition value.
static Float_t GetShapingTime()
Get the Shaping Time (Spadic default)
Int_t fClippingStart
Value where a analog and or digital clipping appears By default it is set to the dynamic range of Spa...
Int_t GetNoise(Double_t sigmaNoise)
Get a Noise value based on the width of the noise distribution in sigmas.
std::vector< Double_t > fvecResponsePars
Vector for the response parameters. Order based on eResponsePars. The given values here correspond to...
static const Double_t fgShapingTime
Spadic shaping time.
void ApplyClipping(Pulse *pulse)
Check the passed pulse for samples in clipping and reduce the value of those to fClippingStart.
void SetParameter(eResponsePars ipar, Double_t value)
CbmTrdSpadic & operator=(const CbmTrdSpadic &)
Assignment of CbmTrdSpadic objects (not implemented!)
static UInt_t GetNrChannels()
void SetUseBaselineAverage(bool value=true)
Set the Use Baseline Average flag.
Int_t GetClippingStart()
Get the Clipping Start value.
static constexpr UInt_t fgNrOfPresamples
Number of presamples in the ADC signal in front of the actual signal.
static Double_t Response(Double_t *samplenr, Double_t *par)
Response of the SPADIC v2.2 to an input charge, for a given timesample.
CbmTrdSpadic()
Construct a new CbmTrdSpadic object Default and standard c'tor for a CbmTrdSpadic object.
Int_t fTriggerSlopeConditionSnd
Slope trigger condition for a two stage differential triggger.
UInt_t GetDynamicRange()
Get the Dynamic Range value.
Double_t GetParameter(eResponsePars partype)
Get the Parameter value.
UInt_t fBaselineLvl
Baseline level of the current Spadic Used for MaxAdcToMip calibration and baseline placement in Analo...
static constexpr UInt_t GetNrOfPresamples()
Get the Nr Of Preamples.
Float_t MaxAdcToEnergyCal(Float_t maxadc)
Return energy [keV (MC input GeV)] for a given max adc value, based on max adc to energy calibration.
void SetMipCalibration(Double_t value)
Set the max adc to mip calibration value.
static constexpr UInt_t fgShapingOrder
Spadic Shaping order.
Float_t fNoiseLvl
Noise level for signal response simulation [gaus sigmas].
CbmTrdSpadic(const CbmTrdSpadic &)=delete
Copy construct a new CbmTrdSpadic object (not implemented!)
static Double_t MeanChargeCentrPadPRF()
Mean charge fraction on the central pad assuming a flat distrubtion all over the pad.
static Double_t MipDeDx()
Mip De Dx kev/cm for XeC02 8020 see https://cbm-wiki.gsi.de/foswiki/bin/view/TRD/ TrdParameterList.
static Double_t MipCaliTarget()
Target percentage of the dynamic range for the MIP energy deposition on the central pad.