]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDdigitizer.h
Copy arrays in assignment instead of the pointer; avoid double delete.
[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 class AliTRDdataArrayF;
27 class AliTRDsegmentArray;
28
29 class AliTRDdigitizer : public AliDigitizer {
30
31  public:
32
33   AliTRDdigitizer();
34   AliTRDdigitizer(const Text_t *name, const Text_t *title);
35   AliTRDdigitizer(AliRunDigitizer *manager, const Text_t *name, const Text_t *title);
36   AliTRDdigitizer(AliRunDigitizer *manager);
37   AliTRDdigitizer(const AliTRDdigitizer &d);
38   virtual             ~AliTRDdigitizer();
39   AliTRDdigitizer     &operator=(const AliTRDdigitizer &d);
40
41   virtual void         Copy(TObject &d) const;
42           Bool_t       InitDetector();
43           void         InitOutput(Int_t iEvent);
44   virtual void         Exec(Option_t *option = 0);  
45
46   virtual Bool_t       Open(const Char_t *file, Int_t nEvent = 0);
47   virtual Bool_t       Open(AliRunLoader *runLoader, Int_t nEvent = 0);
48   virtual Bool_t       MakeBranch(TTree *tree) const;
49   virtual Bool_t       WriteDigits() const;
50
51   virtual void         AddSDigitsManager(AliTRDdigitsManager *manager);
52   virtual void         DeleteSDigitsManager();
53
54   virtual Bool_t       MakeDigits();
55
56           Bool_t       SortHits(Float_t **hits, Int_t *nhit);
57           Bool_t       ConvertHits(Int_t det, Float_t *hits, Int_t nhit, AliTRDdataArrayF *signals);
58           Bool_t       ConvertSignals(Int_t det, AliTRDdataArrayF *signals);
59
60           Bool_t       SDigits2Digits();
61           Bool_t       MergeSDigits();
62           Bool_t       ConvertSDigits();
63
64           Bool_t       Signal2ADC(Int_t det, AliTRDdataArrayF *signals);
65           Bool_t       Signal2SDigits(Int_t det, AliTRDdataArrayF *signals);
66           Bool_t       CopyDictionary(Int_t det);
67           void         CompressOutputArrays(Int_t det);
68
69           void         SetCompress(Int_t c = 1)             { fCompress        = c;   }
70           void         SetSDigits(Int_t v = 1)              { fSDigits         = v;   }
71           void         SetEvent(Int_t v = 0)                { fEvent           = v;   }
72           void         SetManager(AliTRDdigitsManager *man) { fDigitsManager   = man; }
73           void         SetGeometry(AliTRDgeometry *geo)     { fGeo             = geo; }
74           void         SetMergeSignalOnly(Bool_t m = kTRUE) { fMergeSignalOnly = m;   }
75
76   AliTRDdigitsManager *Digits() const                       { return fDigitsManager;  }
77
78           Bool_t       GetCompress() const                  { return fCompress;       }
79           Bool_t       GetSDigits() const                   { return fSDigits;        }
80           Float_t      GetDiffusionT(Float_t vdrift);
81           Float_t      GetDiffusionL(Float_t vdrift);
82           Float_t      GetLorentzFactor(Float_t vdrift);
83
84           Double_t     TimeStruct(Float_t vdrift, Double_t time, Double_t z);
85           Int_t        Diffusion(Float_t vdrift, Double_t absdriftlength
86                                , Double_t &lRow, Double_t &lCol, Double_t &lTime);
87           Int_t        ExB(Float_t vdrift, Double_t driftlength, Double_t &lRow);
88   
89  protected:
90
91   virtual Bool_t       Init();
92           void         SampleTimeStruct(Float_t vdrift);
93           void         RecalcDiffusion(Float_t vdrift);
94
95   AliRunLoader        *fRunLoader;          //! Local pointer
96   AliTRDdigitsManager *fDigitsManager;      //! Manager for the output digits
97   AliTRDdigitsManager *fSDigitsManager;     //! Manager for the summed input s-digits
98   TList               *fSDigitsManagerList; //! List of managers of input s-digits
99   AliTRD              *fTRD;                //! TRD detector class
100   AliTRDgeometry      *fGeo;                //! TRD geometry
101   AliTRDfeeParam      *fFee;                //  Fee Parameters
102
103           Int_t        fEvent;              //! Event number
104           Int_t       *fMasks;              //! Masks for the merging
105           Bool_t       fCompress;           //  Switch to keep only compressed data in memory
106           Bool_t       fSDigits;            //  Switch for the summable digits
107           Bool_t       fMergeSignalOnly;    //  Merge only detectors that contain a signal
108
109           Float_t      fDiffLastVdrift;     //  The structures are valid for fLastVdrift (caching)
110           Float_t      fDiffusionT;         //  Transverse drift coefficient
111           Float_t      fDiffusionL;         //  Longitudinal drift coefficient
112           Float_t      fOmegaTau;           //  Tangens of the Lorentz angle
113           Float_t      fLorentzFactor;      //  Factor due to Lorentz force
114
115           Float_t      fTimeLastVdrift;     //  The structures are valid for fLastVdrift (caching)
116           Float_t     *fTimeStruct1;        //! Time Structure of Drift Cells
117           Float_t     *fTimeStruct2;        //! Time Structure of Drift Cells
118           Float_t      fVDlo;               //  Lower drift velocity, for interpolation
119           Float_t      fVDhi;               //  Higher drift velocity, for interpolation
120
121   ClassDef(AliTRDdigitizer,16)              //  Produces TRD-Digits
122
123 };
124 #endif