1 #ifndef ALIPHOSPULSEGENERATOR_H
2 #define ALIPHOSPULSEGENERATOR_H
3 /* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
6 class AliPHOSPulseGenerator
12 AliPHOSPulseGenerator();
17 ~AliPHOSPulseGenerator();
20 * Contruct a pulsegenrator object an initializes all necessary parameters
21 * @param a Amplitude in ADC levels (0 -1023)
22 * @param t0 Timedelay in nanoseconds of signal relative the first sample. This value should be between 0 and Ts
23 * where Ts is the sample interval
25 AliPHOSPulseGenerator(double a, double t0, const int N, const double t, const double f);
28 * Adds a baseline offset to the signal
29 * @param baselineLevel The basline level to add
30 * @param *samples The sample array for which to add te basline offset
32 void AddBaseline(double baselineLevel, double *samples);
35 * Adds pretrigger samples to the sample array and returns
36 * a new array containing the pretrigger samples concatenatet
37 * in front of the samples given by "samples"
38 * @param The baseline value of the pretrigger samples
39 * @param The sample array for which to add the pretrigger samples
41 double *AddPretriggerSamples(double baslineLevel, double *samples);
44 * Adds Gaussian white noise to the sample array given by *dataPtr.
45 * @param dataPtr array of samples
46 * @param sigma the noise amplitude in entities of ADC levels
48 void AddNoise(double *dataPtr, double *sigma);
51 * Adds correlated Gaussian noise with cutof frequency "cutoff"
52 * @param dataPtr array of values
53 * @param sigma noise amplitude in entities of ADC levels
54 * @param -30DB cutoff frequency of the noise in entities of sampling frequency
56 void AddNoise(double *dataPtr, double *sigma, double cutoff);
59 * Returns the generated pulse with the parameters given in the constructor
64 * Returns a Pulse with new amplidude and t0
65 * @param a new amplidude, overriding the one given in the constructor
67 double *GetPulse(double a, double t0);
70 * Emulates the ADC. Rounds down to nearest Integerevalue all entries given by
73 void Quantisize(double *dataPtr);
75 /** sets the timedelay. Take as argument the timedelay in
76 * nanoseconds and sets in i entities of sample intervals
80 void SetAmplitude(double a);
81 void SetDT(double fs);
82 void SetTZero(double t0);
84 void MakePulse(double *dtaPtr);
85 void MakePulse(double *dtaPtr, double ampl);