]>
Commit | Line | Data |
---|---|---|
431a9211 | 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 | AliPHOSPulseGenerator(const AliPHOSPulseGenerator & pulse); | |
22 | virtual ~AliPHOSPulseGenerator(); | |
23 | ||
24 | void AddBaseline(Double_t baselineLevel); | |
2111ab30 | 25 | void AddNoise (Double_t sigma); |
431a9211 | 26 | void AddNoise (Double_t *sigma, Double_t cutoff); |
27 | void AddPretriggerSamples(Int_t nPresamples); | |
28 | void GetSamples(Int_t *adcHG, Int_t *adcLG) const; | |
29 | Bool_t MakeSamples(); | |
30 | void Digitize(); | |
31 | Bool_t GetDigitize() {return fDigitize;} | |
32 | void SetDigitise (Bool_t flag) {fDigitize = flag;} | |
2111ab30 | 33 | void SetAmplitude(Double_t a) {fAmplitude = a ; Reset();} |
34 | void SetTZero (Double_t t0) {fTZero = t0 ; Reset();} | |
35 | void Reset(); | |
431a9211 | 36 | |
37 | // Raw Read Out | |
38 | Double_t GetRawFormatCapa() const { return fgCapa ; } | |
39 | static Double_t GetRawFormatHighCharge() { return fgHighCharge ; } | |
40 | static Double_t GetRawFormatHighGain() { return fgHighGain ; } | |
41 | static Double_t GetRawFormatHighLowGainFactor() { return fgHighLowGainFactor ; } | |
42 | static Double_t GetRawFormatLowCharge() { return ( fgHighCharge * fgHighLowGainFactor ) ; } | |
43 | static Double_t GetRawFormatLowGain() { return ( fgHighGain / fgHighLowGainFactor ) ; } | |
44 | Int_t GetRawFormatOrder() const { return fgOrder ; } | |
45 | static Int_t GetRawFormatTimeBins() { return fkTimeBins ; } | |
ff857cdc | 46 | static Double_t GetRawFormatTimeMax() { return fgTimeTrigger*fkTimeBins ; } |
431a9211 | 47 | Double_t GetRawFormatTimePeak() const { return fgTimePeak ; } |
48 | Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; } | |
49 | static Double_t RawResponseFunctionMax(Double_t charge, Double_t gain) ; | |
50 | static Double_t RawResponseFunction (Double_t *x, Double_t *par) ; | |
7ceef380 | 51 | static Double_t GeV2ADC(); |
431a9211 | 52 | |
53 | virtual void Print(Option_t*) const; | |
54 | virtual void Draw (Option_t*); | |
55 | ||
56 | AliPHOSPulseGenerator& operator = (const AliPHOSPulseGenerator &) { | |
57 | Fatal("operator =", "not implemented") ; | |
58 | return *this; | |
59 | } | |
60 | ||
61 | private: | |
62 | static Double_t fgCapa ; // capacitor of the preamplifier | |
63 | static Double_t fgHighCharge ; // high charge (to convert energy to charge) | |
64 | static Double_t fgHighGain ; // high gain | |
65 | static Double_t fgHighLowGainFactor ; // high to low gain factor | |
66 | static Int_t fgOrder ; // order of the gamma function | |
30546505 | 67 | |
68 | // static const Int_t fkTimeBins = 64 ; // number of sampling bins | |
69 | static const Int_t fkTimeBins = 1008 ; // number of sampling bins | |
70 | ||
431a9211 | 71 | static Double_t fgTimeMax ; // maximum sampled time |
72 | static Double_t fgTimePeak ; // peaking time | |
73 | static Double_t fgTimeTrigger ; // time of the trigger for the RO signal | |
74 | ||
75 | private: | |
76 | Double_t fAmplitude; // signal amplitude in GeV | |
77 | Double_t fTZero; // signal start time in ns | |
78 | Double_t *fDataHG; // samples array for high gain | |
79 | Double_t *fDataLG; // samples array for low gain | |
80 | Bool_t fDigitize; // true is samples should be rounded to integers | |
81 | ||
82 | ClassDef(AliPHOSPulseGenerator,1) | |
83 | ||
84 | }; | |
85 | ||
86 | #endif | |
87 |