]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDsegmentArray.h
Re-structured digitizer
[u/mrichter/AliRoot.git] / TRD / AliTRDsegmentArray.h
1 #ifndef ALITRDSEGMENTARRAY_H
2 #define ALITRDSEGMENTARRAY_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 #include "AliTRDsegmentArrayBase.h"
9
10 ////////////////////////////////////////////////////////////////////////////
11 //                                                                        //
12 //  Array for TRD detector segments containing digits                     //
13 //                                                                        //
14 ////////////////////////////////////////////////////////////////////////////
15
16 #include <TNamed.h>
17
18 class TTree;
19 class TBranch;
20 class TObjArray;
21
22 class AliTRDarrayI;
23 class AliTRDdataArray;
24 class AliTRDsegmentID;
25
26 class AliTRDsegmentArray : public TNamed {
27
28  public:
29
30   AliTRDsegmentArray();
31   AliTRDsegmentArray(const char *classname, Int_t n);
32   AliTRDsegmentArray(AliTRDsegmentArray &a);
33   virtual ~AliTRDsegmentArray();
34   AliTRDsegmentArray &operator=(const AliTRDsegmentArray &a);
35
36   const   AliTRDsegmentID *At(Int_t i) const; 
37   const   AliTRDsegmentID *operator[](Int_t i) const; 
38
39           Bool_t           AddSegment(AliTRDsegmentID *segment);
40           AliTRDsegmentID *AddSegment(Int_t index);  
41   virtual AliTRDsegmentID *NewSegment(); 
42   virtual AliTRDsegmentID *LoadSegment(Int_t index);
43   virtual AliTRDsegmentID *LoadEntry(Int_t index); 
44   virtual void             StoreSegment(Int_t index);
45           void             ClearSegment(Int_t index);
46  
47   virtual void             Copy(TObject &a) const;
48   virtual Bool_t           ConnectTree(const char *treeName);
49   virtual void             Delete();
50   virtual void             Delete(const char *) { Delete(); };
51
52           Bool_t           MakeArray(Int_t n);    
53   virtual void             MakeTree(char *file = 0);           
54           Bool_t           MakeDictionary(Int_t size);
55
56           Bool_t           SetClass(const char *classname);
57  
58           TClass          *GetClass() const { return fClass; };
59           TTree           *GetTree() const  { return fTree;  };   
60
61   virtual Bool_t           LoadArray(const Char_t *branchname, TTree *tree = 0);
62   virtual Bool_t           StoreArray(const Char_t *branchname, TTree *tree = 0);
63
64   virtual AliTRDdataArray *GetDataArray(Int_t det) const;
65   virtual AliTRDdataArray *GetDataArray(Int_t sec, Int_t cha, Int_t pla) const;
66
67  protected:
68
69   TObjArray    *fSegment;            //! Pointer to an array of pointers to a segment
70   AliTRDarrayI *fTreeIndex;          //! Pointers(index) table
71   Int_t         fNSegment;           //  Number of segments 
72   TTree        *fTree;               //! Tree with segment objects
73   TBranch      *fBranch;             //! Branchaddress
74   TClass       *fClass;              //! Class type of included objects 
75
76   ClassDef(AliTRDsegmentArray,2)     //  TRD detector segment array 
77
78 };
79
80 #endif