]>
Commit | Line | Data |
---|---|---|
cd906859 | 1 | #ifndef ALIHLTPHOSPULSEGENERATOR_H |
2 | #define ALIHLTPHOSPULSEGENERATOR_H | |
228cb536 | 3 | /* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. * |
4 | * See cxx source for full Copyright notice */ | |
29d9ed72 | 5 | |
cd906859 | 6 | #include <Rtypes.h> |
228cb536 | 7 | |
d504c864 | 8 | |
cd906859 | 9 | class AliHLTPHOSPulseGenerator |
228cb536 | 10 | { |
11 | public: | |
cd906859 | 12 | AliHLTPHOSPulseGenerator(); |
13 | virtual ~AliHLTPHOSPulseGenerator(); | |
005850ed | 14 | |
15 | /** | |
16 | * Contruct a pulsegenrator object an initializes all necessary parameters | |
17 | * @param a Amplitude in ADC levels (0 -1023) | |
18 | * @param t0 Timedelay in nanoseconds of signal relative the first sample. This value should be between 0 and Ts | |
19 | * @param N the number of samples | |
20 | * @param tau Rise time of the semi Gaussian signal | |
21 | * @param fs samling rate | |
22 | **/ | |
d504c864 | 23 | AliHLTPHOSPulseGenerator(double a, double t0, const int N , const double tau, const double fs); |
005850ed | 24 | |
cd906859 | 25 | AliHLTPHOSPulseGenerator(const AliHLTPHOSPulseGenerator & ); |
005850ed | 26 | |
27 | ||
28 | AliHLTPHOSPulseGenerator & operator = (const AliHLTPHOSPulseGenerator &) | |
cd906859 | 29 | { |
30 | return *this; | |
31 | } | |
005850ed | 32 | |
33 | /** | |
34 | * Adds a baseline offset to the signal | |
35 | * @param baselineLevel The basline level to add | |
36 | * @param *samples The sample array for which to add te basline offset | |
37 | **/ | |
d504c864 | 38 | void AddBaseline(double baselineLevel = 0, double *samples = 0); |
005850ed | 39 | |
40 | /** | |
41 | * Adds Gaussian white noise to the sample array given by *dataPtr. | |
42 | * @param dataPtr array of samples | |
43 | * @param sigma the noise amplitude in entities of ADC levels | |
44 | **/ | |
228cb536 | 45 | void AddNoise(double *dataPtr, double *sigma); |
005850ed | 46 | |
47 | /** | |
48 | * Adds correlated Gaussian noise with cutof frequency "cutoff" | |
49 | * @param dataPtr array of values | |
50 | * @param sigma noise amplitude in entities of ADC levels | |
51 | * @param cutoff -30DB cutoff frequency of the noise in entities of sampling frequency | |
52 | **/ | |
d504c864 | 53 | void AddNoise(double *dataPtr, double *sigma, double cutoff); |
005850ed | 54 | |
55 | ||
56 | /** | |
57 | * Adds pretrigger samples to the sample array and returns | |
58 | * a new array containing the pretrigger samples concatenatet | |
59 | * in front of the samples given by "samples" | |
60 | * @param baselineLevel The baseline value of the pretrigger samples | |
61 | * @param samples The sample array for which to add the pretrigger samples | |
62 | **/ | |
9be2600f | 63 | double *AddPretriggerSamples(double baselineLevel = 0, double *samples = 0); |
005850ed | 64 | |
65 | ||
66 | /** | |
67 | * Returns a Pulse with new amplidude and t0 | |
68 | * @param a new amplidude, overriding the one given in the constructor | |
69 | * @param t0 start time of the pulse relative to the sampling clock. | |
70 | **/ | |
d504c864 | 71 | double *GetPulse(double a = 1, double t0 = 0); |
005850ed | 72 | |
73 | ||
74 | /** | |
75 | * Emulates the ADC. Rounds down to nearest Integerevalue all entries given by | |
76 | * dataPtr | |
77 | **/ | |
78 | void Quantisize(double *dataPtr) const; | |
79 | ||
d504c864 | 80 | void SetAmplitude(double a = 1); |
81 | void SetDT(double fs = 10); | |
82 | void SetTZero(double t0 = 0); | |
005850ed | 83 | void SetSampleFreq(int fs); |
84 | void MakePulse(double *dtaPtr, int N); | |
85 | void MakePulse(double *dtaPtr); | |
cd906859 | 86 | |
87 | private: | |
d504c864 | 88 | double fAmplitude; /**<The amplitude in entities of ADC counts of the genrated pulse*/ |
89 | int fNSamples; /**<The number of samples of the genrated pulse*/ | |
90 | double fTau; /**<The risetime in entities of us of the generated pulse*/ | |
91 | double fSampleFreq; /**<The sampling frequency in MHz*/ | |
92 | double fTZero; /**<t0 of the genrated pulse in entities of nanoseconds*/ | |
93 | double *fDataPtr; //[1000] /**<pointer to array holding the genrated pulse*/ | |
94 | double fDT; /**<1/fSampleFreq*/ | |
95 | // double *fEvent; //[1000] | |
29d9ed72 | 96 | ClassDef(AliHLTPHOSPulseGenerator,1) |
228cb536 | 97 | }; |
98 | ||
99 | #endif | |
100 |