]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSPulseGenerator.h
hopefully the last refinements for correct type conversion in calibration
[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();}
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) ;
51
52 virtual void Print(Option_t*) const;
53 virtual void Draw (Option_t*);
54
55 AliPHOSPulseGenerator& operator = (const AliPHOSPulseGenerator &) {
56 Fatal("operator =", "not implemented") ;
57 return *this;
58 }
59
60private:
61 static Double_t fgCapa ; // capacitor of the preamplifier
62 static Double_t fgHighCharge ; // high charge (to convert energy to charge)
63 static Double_t fgHighGain ; // high gain
64 static Double_t fgHighLowGainFactor ; // high to low gain factor
65 static Int_t fgOrder ; // order of the gamma function
30546505 66
67 // static const Int_t fkTimeBins = 64 ; // number of sampling bins
68 static const Int_t fkTimeBins = 1008 ; // number of sampling bins
69
431a9211 70 static Double_t fgTimeMax ; // maximum sampled time
71 static Double_t fgTimePeak ; // peaking time
72 static Double_t fgTimeTrigger ; // time of the trigger for the RO signal
73
74private:
75 Double_t fAmplitude; // signal amplitude in GeV
76 Double_t fTZero; // signal start time in ns
77 Double_t *fDataHG; // samples array for high gain
78 Double_t *fDataLG; // samples array for low gain
79 Bool_t fDigitize; // true is samples should be rounded to integers
80
81 ClassDef(AliPHOSPulseGenerator,1)
82
83};
84
85#endif
86