]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSPulseGenerator.h
Bugfix: lowercase b should be upper case B for component id: TPCClusterFinder32Bit
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSPulseGenerator.h
1 //-*- Mode: C++ -*-
2 // $Id$
3
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                          */
8
9 #include <Rtypes.h>
10
11
12 class AliHLTPHOSPulseGenerator
13 {
14  public:
15   AliHLTPHOSPulseGenerator();
16   virtual ~AliHLTPHOSPulseGenerator();
17
18   /**
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
25    **/
26   AliHLTPHOSPulseGenerator(double a, double t0, const int N , const double tau, const double fs);
27
28   AliHLTPHOSPulseGenerator(const AliHLTPHOSPulseGenerator & );
29
30
31   AliHLTPHOSPulseGenerator & operator = (const AliHLTPHOSPulseGenerator &)
32     {
33       return *this; 
34     }
35
36   /**
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
40    **/
41   void AddBaseline(double baselineLevel = 0, double *samples = 0);
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 cutoff -30DB cutoff frequency of the noise in entities of sampling frequency
55    **/
56   void AddNoise(double *dataPtr, double *sigma, double cutoff); 
57
58
59   /**
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
65    **/
66   double *AddPretriggerSamples(double baselineLevel = 0, double *samples = 0);
67
68
69   /**
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.
73    **/
74   double *GetPulse(double a = 1, double t0 = 0);
75
76
77   /**
78    * Emulates the ADC. Rounds down to nearest Integerevalue all entries given by
79    * dataPtr
80    **/
81   void Quantisize(double *dataPtr) const;
82
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);
89
90  private:
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)
100 };
101
102 #endif
103