Line data Source code
1 : #ifndef ALIPHOSPULSEGENERATOR_H
2 : #define ALIPHOSPULSEGENERATOR_H
3 : /* Copyright(c) 2007, ALICE Experiment at CERN, All rights reserved. *
4 : * See cxx source for full Copyright notice */
5 :
6 : /* $Id$ */
7 :
8 : // The class which simulates the pulse shape from the PHOS FEE shaper,
9 : // make sampled amplitudes, digitize them.
10 : // The shape is described by the function RawResponseFunction
11 : // The input parameters for the shape function (time and aplitude) are passed
12 : // to the class via constructor.
13 : // Other parameters related to the shaper are hard-coded in this class
14 :
15 : #include <Rtypes.h>
16 :
17 : class AliPHOSPulseGenerator : public TObject
18 : {
19 : public:
20 : AliPHOSPulseGenerator(Double_t a=0, Double_t t0=0);
21 : virtual ~AliPHOSPulseGenerator();
22 :
23 : void AddBaseline(Double_t baselineLevel);
24 : void AddNoise (Double_t sigma);
25 : void AddNoise (Double_t *sigma, Double_t cutoff);
26 : void AddPretriggerSamples(Int_t nPresamples);
27 : void GetSamples(Int_t *adcHG, Int_t *adcLG) const;
28 : Bool_t MakeSamples();
29 : void Digitize();
30 0 : Bool_t GetDigitize() {return fDigitize;}
31 0 : void SetDigitise (Bool_t flag) {fDigitize = flag;}
32 464 : void SetAmplitude(Double_t a) {fAmplitude = a ; Reset();}
33 464 : void SetTZero (Double_t t0) {fTZero = t0 ; Reset();}
34 216 : void SetHG2LGRatio(Double_t r=16.){fHG2LGratio = r ;}
35 8 : void SetTimeStep(Double_t step=100.e-9){fgTimeTrigger=step ;}
36 : void Reset();
37 :
38 : // Raw Read Out
39 0 : Int_t GetRawFormatOrder() const { return fgOrder ; }
40 140860 : static Int_t GetRawFormatTimeBins() { return fkTimeBins ; }
41 130012 : static Double_t GetRawFormatTimeMax() { return fgTimeTrigger*fkTimeBins ; }
42 0 : Double_t GetRawFormatTimePeak() const { return fgTimePeak ; }
43 0 : Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; }
44 : static Double_t RawResponseFunction (Double_t *x, Double_t *par) ;
45 :
46 : virtual void Print(Option_t*) const;
47 : virtual void Draw (Option_t* opt = "all");
48 :
49 : private:
50 : AliPHOSPulseGenerator(const AliPHOSPulseGenerator & pulse);
51 : AliPHOSPulseGenerator& operator = (const AliPHOSPulseGenerator &) {return *this;}
52 :
53 : private:
54 : static Int_t fgOrder ; // order of the gamma function
55 :
56 : static const Int_t fkTimeBins = 100 ; // number of sampling bins
57 :
58 : static Double_t fgTimeMax ; // maximum sampled time
59 : static Double_t fgTimePeak ; // peaking time
60 : static Double_t fgTimeTrigger ; // time of the trigger for the RO signal
61 :
62 : private:
63 : Double_t fAmplitude; // signal amplitude in GeV
64 : Double_t fTZero; // signal start time in ns
65 : Double_t fHG2LGratio ; // HG/LG ratio for given channel
66 : Double_t *fDataHG; // samples array for high gain
67 : Double_t *fDataLG; // samples array for low gain
68 : Bool_t fDigitize; // true is samples should be rounded to integers
69 :
70 22 : ClassDef(AliPHOSPulseGenerator,1)
71 :
72 : };
73 :
74 : #endif
75 :
|