roll back of previous commit
[u/mrichter/AliRoot.git] / AD / AliADDigitizer.h
CommitLineData
5e319bd5 1#ifndef ALIADDigitizer_H
2#define ALIADDigitizer_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6///_________________________________________________________________________
7///
8/// Class for making Digits in AD
9///_________________________________________________________________________
10
11
12// --- Standard library ---
13
14// --- AliRoot header files ---
15
16#include "AliDigitizer.h"
aa8120bb 17#include "AliADConst.h"
5e319bd5 18
19class TClonesArray;
aa8120bb 20class TF1;
5e319bd5 21class AliDigitizationInput;
22class AliCDBManager;
23class AliCDBStorage;
aa8120bb 24class AliADCalibData;
25class AliAD;
5e319bd5 26
27class AliADDigitizer: public AliDigitizer {
28
29public:
aa8120bb 30 enum DigiTask_t {
31 kHits2Digits,
32 kHits2SDigits
33 };
34
35 AliADDigitizer() ; // default constructor
36 AliADDigitizer(AliAD *AD, DigiTask_t task); // constructor
37 AliADDigitizer(AliDigitizationInput* digInput); // constructor
38 virtual ~AliADDigitizer() ; // destructor
39
40 virtual Bool_t Init();
41 virtual void Digitize(Option_t* option=0);
42
43 void DigitizeHits();
44 void DigitizeSDigits();
45 void WriteDigits(AliLoader *loader);
46 void WriteSDigits(AliLoader *loader);
47 void ReadSDigits();
48
49 void AddDigit(Int_t pmnumber, Float_t time, Float_t width, Bool_t integrator, Short_t *chargeADC, Int_t *labels);
50 void AddSDigit(Int_t pmnumber, Int_t nbins, Float_t *charges, Int_t *labels);
51 TClonesArray* DigitsArray();
52 TClonesArray* SDigitsArray();
53 void ResetDigits();
54
55 AliADCalibData *GetCalibData() const;
5e319bd5 56
aa8120bb 57 TF1* GetSignalShape() const { return fSignalShape; }
58 TF1* GetPMResponse() const { return fPMResponse; }
59 TF1* GetSinglePhESpectrum() const { return fSinglePhESpectrum; }
60 double SignalShape(double *x, double *par);
61 double PMResponse(double *x, double *par);
62 double SinglePhESpectrum(double *x, double *par);
63
64 protected:
5e319bd5 65
aa8120bb 66 AliADCalibData *fCalibData; //! calibration data
5e319bd5 67
aa8120bb 68 private:
69
70 AliADDigitizer(const AliADDigitizer& /*digitizer*/);
71
72 AliADDigitizer& operator = (const AliADDigitizer& /*digitizer*/);
73
74 Int_t fNdigits; //! Number of digits
75 TClonesArray *fDigits; //! List of digits
76
77 TF1* fSignalShape; // function which describes the PMT signal shape
78 TF1* fPMResponse; // function which describes the PM time response
79 TF1* fSinglePhESpectrum; // function which describes the single ph.e. PM response
80
81 Float_t fAdc[16][kNClocks]; //! Container for ADC samples
82 Float_t fLeadingTime[16]; //! Leading time container
83 Float_t fTimeWidth[16]; //! Time width container
84 Float_t fAdcPedestal[16][2]; //! Pedestals, one per integrator
85 Float_t fAdcSigma[16][2]; //! Sigma of pedestals
86 Float_t fPmGain[16]; //! PMT gains
87 Int_t fNBins[16]; //! Number of bins in fTime container
88 Int_t fNBinsLT[16]; //! Number of bins in fTime container (match window only)
89 Float_t fBinSize[16]; //! Bin size in fTime container
90 Float_t fHptdcOffset[16]; //! HPTDC time offsets channel by channel
91 Float_t fClockOffset[16]; //! Clock offsets channel by channel
5e319bd5 92
aa8120bb 93 Float_t *fTime[16]; //! Main container used in digitization
94 Int_t fLabels[16][3]; //! Container for MC labels
95 Bool_t fEvenOrOdd; //! Choise of integrator in central ADC sample
5e319bd5 96
aa8120bb 97 DigiTask_t fTask; //! The task (to be) executed by the digitizer
98 AliAD *fAD; //! Pointer to AliDetector object
5e319bd5 99 ClassDef(AliADDigitizer,1) // digitizer for AD
100
101};
102
103#endif // AliADDigitizer_H