]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDdigitsManager.h
added method to check the whoole filter mask, not just one bit
[u/mrichter/AliRoot.git] / TRD / AliTRDdigitsManager.h
1 #ifndef ALITRDDIGITSMANAGER_H
2 #define ALITRDDIGITSMANAGER_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 /* $Id$ */
8
9 /////////////////////////////////////////////////////////////
10 //  Manages the TRD digits                                 //
11 /////////////////////////////////////////////////////////////
12
13 #include <TObject.h>
14
15 class TFile;
16 class TTree;
17 class TBranch;  
18 class AliTRDdigit;
19 class AliTRDSignalIndex;
20 class AliTRDarrayADC;  
21 class AliTRDarraySignal; 
22 class AliTRDarrayDictionary;
23 class AliTRDdigitsParam;
24
25 class AliTRDdigitsManager : public TObject {
26
27  public:
28
29   enum { kNDict = 3 };
30
31   AliTRDdigitsManager(Bool_t rawRec = kFALSE);  //if true digitsmanager uses only one entry in the TObjectArrays
32   AliTRDdigitsManager(const AliTRDdigitsManager &m);
33   virtual ~AliTRDdigitsManager();
34   AliTRDdigitsManager &operator=(const AliTRDdigitsManager &m);
35
36   virtual void                Copy(TObject &m) const;
37
38   virtual void                CreateArrays();
39   virtual void                ResetArrays();
40   virtual void                ResetArrays(Int_t det);
41   void                        ClearArrays(Int_t det);
42   virtual Bool_t              BuildIndexes(Int_t det);
43
44   virtual Bool_t              MakeBranch(TTree * const tree);
45   virtual Bool_t              ReadDigits(TTree * consttree);
46   virtual Bool_t              WriteDigits();
47
48   virtual void                SetEvent(Int_t evt)             { fEvent           = evt;  };
49   virtual void                SetSDigits(Int_t v = 1)         { fHasSDigits      = v;    };
50   virtual void                SetUseDictionaries(Bool_t kval) { fUseDictionaries = kval; };
51
52   virtual Bool_t              UsesDictionaries() const        { return fUseDictionaries; };
53   virtual Bool_t              HasSDigits() const              { return fHasSDigits;      };
54   static  Int_t               NDict()                         { return fgkNDict;         }; 
55
56   virtual TObjArray          *GetDigits() const               { return fDigits;          };  
57   virtual TObjArray          *GetDictionary(Int_t i) const    { return fDict[i];         }; 
58
59   AliTRDdigit                *GetDigit(Int_t row, Int_t col, Int_t time, Int_t det) const;
60   Int_t                       GetTrack(Int_t track, Int_t row, Int_t col, Int_t time, Int_t det) const;
61   
62   AliTRDarrayADC             *GetDigits(Int_t det)  const;
63   AliTRDarraySignal          *GetSDigits(Int_t det) const;    
64   AliTRDarrayDictionary      *GetDictionary(Int_t det, Int_t i) const;  
65   AliTRDdigitsParam          *GetDigitsParam() const          { return fDigitsParam;     };
66   AliTRDSignalIndex          *GetIndexes(Int_t det);
67   TObjArray                  *GetIndexes() const              { return fSignalIndexes;   };
68
69   void                        RemoveDigits(Int_t det);
70   void                        RemoveDictionaries(Int_t det);
71   void                        RemoveIndexes(Int_t det);
72   void                        ClearIndexes(Int_t det);
73   
74   Int_t                       GetTrack(Int_t track, AliTRDdigit * const digit) const;
75   Short_t                     GetDigitAmp(Int_t row, Int_t col, Int_t time, Int_t det) const;
76   UChar_t                     GetPadStatus(Int_t row, Int_t col, Int_t time, Int_t det) const;
77
78   Bool_t                      LoadArrayDigits();
79   Bool_t                      LoadArrayDict();
80   Bool_t                      LoadDigitsParam();
81   Bool_t                      StoreArrayDigits();
82   Bool_t                      StoreArrayDict();
83   Bool_t                      StoreDigitsParam();
84
85  protected:
86   
87   static const Int_t  fgkNDict;            //  Number of track dictionary arrays
88   Int_t               fEvent;              //  Event number
89   TTree              *fTree;               //! Tree for the digits arrays
90   TObjArray          *fDigits;             //  Digits data array               
91   TObjArray          *fDict[kNDict];       //  Track dictionary data array   
92   Bool_t              fHasSDigits;         //  Switch for the summable digits
93   TObjArray          *fSignalIndexes;      //  Provides access to the active pads and tbins
94   Bool_t              fUseDictionaries;    //  Use dictionaries or not (case of real data)
95   Int_t               fDets;               //  No of Detectors
96   Bool_t              fRawRec;             //  Reconstruct from raw files? If its kTRUE then the TObjArrays have only one entry.
97   AliTRDdigitsParam  *fDigitsParam;        //  Parameters of the digits
98
99   ClassDef(AliTRDdigitsManager,8)          //  Manages the TRD digits
100
101 };
102 #endif