Introduction of decalibration in the simulations with anchor runs and raw:// OCDB.
[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);
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();}
b28a9811 35 void SetHG2LGRatio(Double_t r=16.){fHG2LGratio = r ;}
6f47f50d 36 void SetTimeStep(Double_t step=100.e-9){fgTimeTrigger=step ;}
2111ab30 37 void Reset();
431a9211 38
39 // Raw Read Out
431a9211 40 Int_t GetRawFormatOrder() const { return fgOrder ; }
41 static Int_t GetRawFormatTimeBins() { return fkTimeBins ; }
ff857cdc 42 static Double_t GetRawFormatTimeMax() { return fgTimeTrigger*fkTimeBins ; }
431a9211 43 Double_t GetRawFormatTimePeak() const { return fgTimePeak ; }
44 Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; }
431a9211 45 static Double_t RawResponseFunction (Double_t *x, Double_t *par) ;
46
47 virtual void Print(Option_t*) const;
565550c6 48 virtual void Draw (Option_t* opt = "all");
431a9211 49
50 AliPHOSPulseGenerator& operator = (const AliPHOSPulseGenerator &) {
51 Fatal("operator =", "not implemented") ;
52 return *this;
53 }
54
55private:
431a9211 56 static Int_t fgOrder ; // order of the gamma function
30546505 57
ae0e2716 58 static const Int_t fkTimeBins = 100 ; // number of sampling bins
30546505 59
431a9211 60 static Double_t fgTimeMax ; // maximum sampled time
61 static Double_t fgTimePeak ; // peaking time
62 static Double_t fgTimeTrigger ; // time of the trigger for the RO signal
63
64private:
65 Double_t fAmplitude; // signal amplitude in GeV
66 Double_t fTZero; // signal start time in ns
b28a9811 67 Double_t fHG2LGratio ; // HG/LG ratio for given channel
431a9211 68 Double_t *fDataHG; // samples array for high gain
69 Double_t *fDataLG; // samples array for low gain
70 Bool_t fDigitize; // true is samples should be rounded to integers
71
72 ClassDef(AliPHOSPulseGenerator,1)
73
74};
75
76#endif
77