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 */
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
17 class AliPHOSPulseGenerator : public TObject
20 AliPHOSPulseGenerator(Double_t a=0, Double_t t0=0);
21 AliPHOSPulseGenerator(const AliPHOSPulseGenerator & pulse);
22 virtual ~AliPHOSPulseGenerator();
24 void AddBaseline(Double_t baselineLevel);
25 void AddNoise (Double_t sigma);
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;
31 Bool_t GetDigitize() {return fDigitize;}
32 void SetDigitise (Bool_t flag) {fDigitize = flag;}
33 void SetAmplitude(Double_t a) {fAmplitude = a ; Reset();}
34 void SetTZero (Double_t t0) {fTZero = t0 ; Reset();}
35 void SetHG2LGRatio(Double_t r=16.){fHG2LGratio = r ;}
39 Int_t GetRawFormatOrder() const { return fgOrder ; }
40 static Int_t GetRawFormatTimeBins() { return fkTimeBins ; }
41 static Double_t GetRawFormatTimeMax() { return fgTimeTrigger*fkTimeBins ; }
42 Double_t GetRawFormatTimePeak() const { return fgTimePeak ; }
43 Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; }
44 static Double_t RawResponseFunction (Double_t *x, Double_t *par) ;
46 virtual void Print(Option_t*) const;
47 virtual void Draw (Option_t* opt = "all");
49 AliPHOSPulseGenerator& operator = (const AliPHOSPulseGenerator &) {
50 Fatal("operator =", "not implemented") ;
55 static Int_t fgOrder ; // order of the gamma function
57 static const Int_t fkTimeBins = 100 ; // number of sampling bins
59 static Double_t fgTimeMax ; // maximum sampled time
60 static Double_t fgTimePeak ; // peaking time
61 static Double_t fgTimeTrigger ; // time of the trigger for the RO signal
64 Double_t fAmplitude; // signal amplitude in GeV
65 Double_t fTZero; // signal start time in ns
66 Double_t fHG2LGratio ; // HG/LG ratio for given channel
67 Double_t *fDataHG; // samples array for high gain
68 Double_t *fDataLG; // samples array for low gain
69 Bool_t fDigitize; // true is samples should be rounded to integers
71 ClassDef(AliPHOSPulseGenerator,1)