4 #ifndef ALIHLTPHOSPULSEGENERATOR_H
5 #define ALIHLTPHOSPULSEGENERATOR_H
6 /* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
7 * See cxx source for full Copyright notice */
12 class AliHLTPHOSPulseGenerator
15 AliHLTPHOSPulseGenerator();
16 virtual ~AliHLTPHOSPulseGenerator();
19 * Contruct a pulsegenrator object an initializes all necessary parameters
20 * @param a Amplitude in ADC levels (0 -1023)
21 * @param t0 Timedelay in nanoseconds of signal relative the first sample. This value should be between 0 and Ts
22 * @param N the number of samples
23 * @param tau Rise time of the semi Gaussian signal
24 * @param fs samling rate
26 AliHLTPHOSPulseGenerator(double a, double t0, const int N , const double tau, const double fs);
28 AliHLTPHOSPulseGenerator(const AliHLTPHOSPulseGenerator & );
31 AliHLTPHOSPulseGenerator & operator = (const AliHLTPHOSPulseGenerator &)
37 * Adds a baseline offset to the signal
38 * @param baselineLevel The basline level to add
39 * @param *samples The sample array for which to add te basline offset
41 void AddBaseline(double baselineLevel = 0, double *samples = 0);
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 cutoff -30DB cutoff frequency of the noise in entities of sampling frequency
56 void AddNoise(double *dataPtr, double *sigma, double cutoff);
60 * Adds pretrigger samples to the sample array and returns
61 * a new array containing the pretrigger samples concatenatet
62 * in front of the samples given by "samples"
63 * @param baselineLevel The baseline value of the pretrigger samples
64 * @param samples The sample array for which to add the pretrigger samples
66 double *AddPretriggerSamples(double baselineLevel = 0, double *samples = 0);
70 * Returns a Pulse with new amplidude and t0
71 * @param a new amplidude, overriding the one given in the constructor
72 * @param t0 start time of the pulse relative to the sampling clock.
74 double *GetPulse(double a = 1, double t0 = 0);
78 * Emulates the ADC. Rounds down to nearest Integerevalue all entries given by
81 void Quantisize(double *dataPtr) const;
83 void SetAmplitude(double a = 1);
84 void SetDT(double fs = 10);
85 void SetTZero(double t0 = 0);
86 void SetSampleFreq(int fs);
87 void MakePulse(double *dtaPtr, int N);
88 void MakePulse(double *dtaPtr);
91 double fAmplitude; /**<The amplitude in entities of ADC counts of the genrated pulse*/
92 int fNSamples; /**<The number of samples of the genrated pulse*/
93 double fTau; /**<The risetime in entities of us of the generated pulse*/
94 double fSampleFreq; /**<The sampling frequency in MHz*/
95 double fTZero; /**<t0 of the genrated pulse in entities of nanoseconds*/
96 double *fDataPtr; //[1000] /**<pointer to array holding the genrated pulse*/
97 double fDT; /**<1/fSampleFreq*/
98 // double *fEvent; //[1000]
99 ClassDef(AliHLTPHOSPulseGenerator,1)