1 #ifndef ALIHLTPHOSPULSEGENERATOR_H
2 #define ALIHLTPHOSPULSEGENERATOR_H
3 /* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
9 class AliHLTPHOSPulseGenerator
12 AliHLTPHOSPulseGenerator();
13 virtual ~AliHLTPHOSPulseGenerator();
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
23 AliHLTPHOSPulseGenerator(double a, double t0, const int N , const double tau, const double fs);
25 AliHLTPHOSPulseGenerator(const AliHLTPHOSPulseGenerator & );
28 AliHLTPHOSPulseGenerator & operator = (const AliHLTPHOSPulseGenerator &)
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
38 void AddBaseline(double baselineLevel = 0, double *samples = 0);
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
45 void AddNoise(double *dataPtr, double *sigma);
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
53 void AddNoise(double *dataPtr, double *sigma, double cutoff);
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
63 double *AddPretriggerSamples(double baselineLevel = 0, double *samples = 0);
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.
71 double *GetPulse(double a = 1, double t0 = 0);
75 * Emulates the ADC. Rounds down to nearest Integerevalue all entries given by
78 void Quantisize(double *dataPtr) const;
80 void SetAmplitude(double a = 1);
81 void SetDT(double fs = 10);
82 void SetTZero(double t0 = 0);
83 void SetSampleFreq(int fs);
84 void MakePulse(double *dtaPtr, int N);
85 void MakePulse(double *dtaPtr);
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]
96 ClassDef(AliHLTPHOSPulseGenerator,1)