]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDdigitsManager.h
changes in AliTRDdigitsManager
[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 AliTRDReconstructor;
24
25 class AliTRDdigitsManager : public TObject {
26
27  public:
28
29   enum { kNDict = 3 };
30
31   AliTRDdigitsManager(const AliTRDReconstructor *const rec = 0x0);  //if rec is given, we are reading raw data, so the TObjArrays may (and will) contain only one entry
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   virtual Bool_t              BuildIndexes(Int_t det);
42
43   virtual Bool_t              MakeBranch(TTree *tree);
44   virtual Bool_t              ReadDigits(TTree *tree);
45   virtual Bool_t              WriteDigits();
46
47   virtual void                SetEvent(Int_t evt)             { fEvent           = evt;  };
48   virtual void                SetSDigits(Int_t v = 1)         { fHasSDigits      = v;    };
49   virtual void                SetUseDictionaries(Bool_t kval) { fUseDictionaries = kval; };
50
51   virtual Bool_t              UsesDictionaries() const        { return fUseDictionaries; };
52   virtual Bool_t              HasSDigits() const              { return fHasSDigits;      };
53   static  Int_t               NDict()                         { return fgkNDict;         }; 
54
55   virtual TObjArray          *GetDigits() const               { return fDigits;          };  
56   virtual TObjArray          *GetDictionary(Int_t i) const    { return fDict[i];         }; 
57
58   AliTRDdigit                *GetDigit(Int_t row, Int_t col, Int_t time, Int_t det) const;
59   Int_t                       GetTrack(Int_t track, Int_t row, Int_t col, Int_t time, Int_t det) const;
60   
61   AliTRDarrayADC             *GetDigits(Int_t det)  const;
62   AliTRDarraySignal          *GetSDigits(Int_t det) const;    
63   AliTRDarrayDictionary      *GetDictionary(Int_t det, Int_t i) const;  
64   
65   AliTRDSignalIndex          *GetIndexes(Int_t det);
66   TObjArray                  *GetIndexes()                    { return fSignalIndexes;   };
67
68   void                        RemoveDigits(Int_t det);
69   void                        RemoveDictionaries(Int_t det);
70   void                        RemoveIndexes(Int_t det);
71   void                        ClearIndexes(Int_t det);
72   
73   Int_t                       GetTrack(Int_t track, AliTRDdigit *digit) const;
74   Short_t                     GetDigitAmp(Int_t row, Int_t col, Int_t time, Int_t det) const;
75   UChar_t                     GetPadStatus(Int_t row, Int_t col, Int_t time, Int_t det) const;
76
77   Bool_t                      LoadArray(TObjArray *object, const Char_t *branchname, TTree *tree=0);  
78   Bool_t                      LoadArrayDict(TObjArray *object, const Char_t *branchname, TTree *tree=0);  
79   Bool_t                      StoreArray(TObjArray *array1, const Char_t *branchname, TTree *tree=0); 
80   Bool_t                      StoreArrayDict(TObjArray *array3, const Char_t *branchname, TTree *tree=0); 
81   
82  protected:
83   
84   static const Int_t  fgkNDict;            //  Number of track dictionary arrays
85   Int_t               fEvent;              //  Event number
86   TTree              *fTree;               //! Tree for the digits arrays
87   TObjArray          *fDigits;             //  Digits data array               
88   TObjArray          *fDict[kNDict];       //  Track dictionary data array   
89   Bool_t              fHasSDigits;         //  Switch for the summable digits
90   TObjArray          *fSignalIndexes;      //  Provides access to the active pads and tbins
91   Bool_t              fUseDictionaries;    //  Use dictionaries or not (case of real data)
92   TTree              *fTreeD;              //  Tree with detector objects
93   TBranch            *fBranch;             //  Branchaddress
94   Int_t               fDets;               //  No of Detectors
95   Bool_t              fRawRec;             //  Reconstruct from raw data. If its kTRUE then the TObjArrays have only one entry.
96                                            //  If kFALSE then they have (AliTRDgeometry::Ndet()) entries (default).
97
98   ClassDef(AliTRDdigitsManager,7)          //  Manages the TRD digits
99
100 };
101 #endif