]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSPulseGenerator.h
moving all definitions to AliHLTPHOSDefinitions
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSPulseGenerator.h
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                          */
5
6 #include <Rtypes.h>
7
8
9 class AliHLTPHOSPulseGenerator
10 {
11  public:
12   AliHLTPHOSPulseGenerator();
13   virtual ~AliHLTPHOSPulseGenerator();
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    **/
23   AliHLTPHOSPulseGenerator(double a, double t0, const int N , const double tau, const double fs);
24
25   AliHLTPHOSPulseGenerator(const AliHLTPHOSPulseGenerator & );
26
27
28   AliHLTPHOSPulseGenerator & operator = (const AliHLTPHOSPulseGenerator &)
29     {
30       return *this; 
31     }
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    **/
38   void AddBaseline(double baselineLevel = 0, double *samples = 0);
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    **/
45   void AddNoise(double *dataPtr, double *sigma);
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    **/
53   void AddNoise(double *dataPtr, double *sigma, double cutoff); 
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    **/
63   double *AddPretriggerSamples(double baselineLevel = 0, double *samples = 0);
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    **/
71   double *GetPulse(double a = 1, double t0 = 0);
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
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);
86
87  private:
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)
97 };
98
99 #endif
100