]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDdigitizer.h
Latest version of zero suppressed raw data by Ken and Mateusz
[u/mrichter/AliRoot.git] / TRD / AliTRDdigitizer.h
1 #ifndef ALITRDDIGITIZER_H
2 #define ALITRDDIGITIZER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 ////////////////////////////////////////////////////////////////////////////
9 //                                                                        //
10 //  Produces digits from the hits information                             //
11 //                                                                        //
12 ////////////////////////////////////////////////////////////////////////////
13
14 #include "AliDigitizer.h"
15
16 class TFile;
17 class TF1;
18
19 class AliRunDigitizer;
20 class AliRunLoader;
21
22 class AliTRD;
23 class AliTRDdigitsManager;
24 class AliTRDgeometry;
25 class AliTRDfeeParam;
26
27 class AliTRDdigitizer : public AliDigitizer {
28
29  public:
30
31   AliTRDdigitizer();
32   AliTRDdigitizer(const Text_t *name, const Text_t *title);
33   AliTRDdigitizer(AliRunDigitizer *manager, const Text_t *name, const Text_t *title);
34   AliTRDdigitizer(AliRunDigitizer *manager);
35   AliTRDdigitizer(const AliTRDdigitizer &d);
36   virtual         ~AliTRDdigitizer();
37   AliTRDdigitizer &operator=(const AliTRDdigitizer &d);
38
39   virtual void     Copy(TObject &d) const;
40   virtual Bool_t   InitDetector();
41           void     InitOutput(Int_t iEvent);
42   virtual void     Exec(Option_t *option = 0);  
43   virtual Bool_t   Open(const Char_t *file, Int_t nEvent = 0);
44   virtual Bool_t   Open(AliRunLoader *runLoader, Int_t nEvent = 0);
45   virtual Bool_t   MakeBranch(TTree *tree) const;
46   virtual Bool_t   MakeDigits();
47
48   virtual void     AddSDigitsManager(AliTRDdigitsManager *manager);
49   virtual void     DeleteSDigitsManager();
50   virtual Bool_t   ConvertSDigits();
51   virtual Bool_t   MergeSDigits();
52   virtual Bool_t   SDigits2Digits();
53   virtual Bool_t   WriteDigits() const;
54
55   virtual void     SetCompress(Int_t c = 1)             { fCompress        = c;   }
56   virtual void     SetSDigits(Int_t v = 1)              { fSDigits         = v;   }
57   virtual void     SetSDigitsScale(Float_t s)           { fSDigitsScale    = s;   }
58   virtual void     SetEvent(Int_t v = 0)                { fEvent           = v;   }
59   virtual void     SetManager(AliTRDdigitsManager *man) { fDigitsManager   = man; }
60   virtual void     SetGeometry(AliTRDgeometry *geo)     { fGeo             = geo; }
61   virtual void     SetMergeSignalOnly(Bool_t m = kTRUE) { fMergeSignalOnly = m;   }
62
63           Bool_t   GetCompress() const                  { return fCompress;       }
64           Bool_t   GetSDigits() const                   { return fSDigits;        }
65           Float_t  GetSDigitsScale() const              { return fSDigitsScale;   }
66           Float_t  GetDiffusionT(Float_t vdrift);
67           Float_t  GetDiffusionL(Float_t vdrift);
68           Float_t  GetLorentzFactor(Float_t vdrift);
69
70   virtual Double_t TimeStruct(Float_t vdrift, Double_t time, Double_t z);
71   virtual Int_t    Diffusion(Float_t vdrift, Double_t absdriftlength
72                            , Double_t &lRow, Double_t &lCol, Double_t &lTime);
73   virtual Int_t    ExB(Float_t vdrift, Double_t driftlength, Double_t &lRow);
74
75   AliTRDdigitsManager *Digits() const                   { return fDigitsManager;  }
76   
77  protected:
78
79           void     SampleTimeStruct(Float_t vdrift);
80           void     RecalcDiffusion(Float_t vdrift);
81
82   AliRunLoader        *fRunLoader;          //! Local pointer
83   AliTRDdigitsManager *fDigitsManager;      //! Manager for the output digits
84   AliTRDdigitsManager *fSDigitsManager;     //! Manager for the summed input s-digits
85   TList               *fSDigitsManagerList; //! List of managers of input s-digits
86   AliTRD              *fTRD;                //! TRD detector class
87   AliTRDgeometry      *fGeo;                //! TRD geometry
88   AliTRDfeeParam      *fFee;                //  Fee Parameters
89
90           Int_t    fEvent;                  //! Event number
91           Int_t   *fMasks;                  //! Masks for the merging
92           Bool_t   fCompress;               //  Switch to keep only compressed data in memory
93           Bool_t   fSDigits;                //  Switch for the summable digits
94           Float_t  fSDigitsScale;           //  Scale factor for the summable digits 
95           Bool_t   fMergeSignalOnly;        //  Merge only detectors that contain a signal
96   
97           Float_t  fDiffLastVdrift;         //  The structures are valid for fLastVdrift (caching)
98           Float_t  fDiffusionT;             //  Transverse drift coefficient
99           Float_t  fDiffusionL;             //  Longitudinal drift coefficient
100           Float_t  fOmegaTau;               //  Tangens of the Lorentz angle
101           Float_t  fLorentzFactor;          //  Factor due to Lorentz force
102
103           Float_t  fTimeLastVdrift;         //  The structures are valid for fLastVdrift (caching)
104           Float_t *fTimeStruct1;            //! Time Structure of Drift Cells
105           Float_t *fTimeStruct2;            //! Time Structure of Drift Cells
106           Float_t  fVDlo;                   //  Lower drift velocity, for interpolation
107           Float_t  fVDhi;                   //  Higher drift velocity, for interpolation
108   
109  private:
110     
111   virtual Bool_t   Init();
112
113   ClassDef(AliTRDdigitizer,14)              //  Produces TRD-Digits
114
115 };
116
117 #endif