Added README to PHOS/macros/Trigger/OCDB, explaining the content.
[u/mrichter/AliRoot.git] / PHOS / AliPHOSPulseGenerator.h
CommitLineData
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
17class AliPHOSPulseGenerator : public TObject
18{
19public:
20 AliPHOSPulseGenerator(Double_t a=0, Double_t t0=0);
431a9211 21 virtual ~AliPHOSPulseGenerator();
22
23 void AddBaseline(Double_t baselineLevel);
2111ab30 24 void AddNoise (Double_t sigma);
431a9211 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 Bool_t GetDigitize() {return fDigitize;}
31 void SetDigitise (Bool_t flag) {fDigitize = flag;}
2111ab30 32 void SetAmplitude(Double_t a) {fAmplitude = a ; Reset();}
33 void SetTZero (Double_t t0) {fTZero = t0 ; Reset();}
b28a9811 34 void SetHG2LGRatio(Double_t r=16.){fHG2LGratio = r ;}
6f47f50d 35 void SetTimeStep(Double_t step=100.e-9){fgTimeTrigger=step ;}
2111ab30 36 void Reset();
431a9211 37
38 // Raw Read Out
431a9211 39 Int_t GetRawFormatOrder() const { return fgOrder ; }
40 static Int_t GetRawFormatTimeBins() { return fkTimeBins ; }
ff857cdc 41 static Double_t GetRawFormatTimeMax() { return fgTimeTrigger*fkTimeBins ; }
431a9211 42 Double_t GetRawFormatTimePeak() const { return fgTimePeak ; }
43 Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; }
431a9211 44 static Double_t RawResponseFunction (Double_t *x, Double_t *par) ;
45
46 virtual void Print(Option_t*) const;
565550c6 47 virtual void Draw (Option_t* opt = "all");
431a9211 48
f4971b47 49private:
e8969f2e 50 AliPHOSPulseGenerator(const AliPHOSPulseGenerator & pulse);
f4971b47 51 AliPHOSPulseGenerator& operator = (const AliPHOSPulseGenerator &) {return *this;}
431a9211 52
53private:
431a9211 54 static Int_t fgOrder ; // order of the gamma function
30546505 55
ae0e2716 56 static const Int_t fkTimeBins = 100 ; // number of sampling bins
30546505 57
431a9211 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
62private:
63 Double_t fAmplitude; // signal amplitude in GeV
64 Double_t fTZero; // signal start time in ns
b28a9811 65 Double_t fHG2LGratio ; // HG/LG ratio for given channel
431a9211 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 ClassDef(AliPHOSPulseGenerator,1)
71
72};
73
74#endif
75