]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSPulseGenerator.h
The AliHLTPHOSPeakfinder class was made as a derived class of a HLT component
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSPulseGenerator.h
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                          */
5
6 class AliPHOSPulseGenerator
7 {
8  public:
9   /**
10    * Default constructor
11    **/
12   AliPHOSPulseGenerator();
13   
14   /**
15    * Destructor
16    **/
17   ~AliPHOSPulseGenerator();
18
19   /**
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
24    **/
25   AliPHOSPulseGenerator(double a, double t0, const int N, const double t, const double f);
26
27   /**
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
31    **/
32   void AddBaseline(double baselineLevel, double *samples);
33
34   /**
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
40    **/
41   double *AddPretriggerSamples(double baslineLevel, double *samples);
42
43   /**
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  
47    **/
48   void AddNoise(double *dataPtr, double *sigma);
49
50   /**
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
55    **/
56   void AddNoise(double *dataPtr, double *sigma, double cutoff);
57
58   /**
59    * Returns the generated pulse with the parameters given in the constructor
60    **/
61   double *GetPulse();
62
63   /**
64    * Returns a Pulse with new amplidude and t0
65    * @param a new amplidude, overriding the one given in the constructor
66    **/
67   double *GetPulse(double a, double t0);
68
69   /**
70    * Emulates the ADC. Rounds down to nearest Integerevalue all entries given by
71    * dataPtr
72    **/
73   void Quantisize(double *dataPtr);
74
75   /** sets the timedelay. Take as argument the timedelay in
76    * nanoseconds and sets in i entities of sample intervals
77    *   
78    **/
79  
80   void SetAmplitude(double a);
81   void SetDT(double fs);
82   void SetTZero(double t0);
83 private:
84   void MakePulse(double *dtaPtr);
85   void MakePulse(double *dtaPtr, double ampl);  
86   double  fAmplitude;
87   int     fNSamples;
88   double  fTau;
89   double  fSampleFreq;
90   double  fTZero;
91   double *fDataPtr;
92   double  fDT;
93   double *fEvent;
94 };
95
96 #endif
97