1 #ifndef ALISEGARRAYBASE_H
2 #define ALISEGARRAYBASE_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
6 /* $Id: AliTRDsegmentArrayBase.h,v */
8 ////////////////////////////////////////////////
9 // Manager class generaol Alice segment
10 // segment is for example one pad row in TPC //
11 ////////////////////////////////////////////////
15 #include "TObjArray.h"
17 //#include "AliTRDsegmentID.h"
22 class AliTRDsegmentID;
25 class AliTRDsegmentArrayBase: public TNamed{
27 AliTRDsegmentArrayBase();
28 AliTRDsegmentArrayBase(Text_t *classname, Int_t n); //
29 Bool_t SetClass(Text_t *classname); //set class of stored object
30 ~AliTRDsegmentArrayBase();
31 inline const AliTRDsegmentID * At(Int_t i); //return pointer to segment with index i
32 inline const AliTRDsegmentID * operator[](Int_t i); //return pointer to segment with index i
34 Bool_t AddSegment(AliTRDsegmentID *segment); // add segment to array
35 AliTRDsegmentID * AddSegment(Int_t index); //create objet and set index
36 Bool_t MakeArray(Int_t n); //make array of pointers to Segments
37 void ClearSegment(Int_t index); //remove segment from active
38 virtual AliTRDsegmentID * NewSegment(); //dynamicaly create new segment
39 //input output functions
40 TTree * GetTree(){return fTree;} //return pointer to connected tree
42 virtual void MakeTree(); //Make tree with the name
43 virtual Bool_t ConnectTree(const char * treeName); //connect tree from current directory
44 virtual AliTRDsegmentID * LoadSegment(Int_t index);//load segment with index to the memory
45 virtual AliTRDsegmentID * LoadEntry(Int_t index); //load segment entry from position index in tree
46 virtual void StoreSegment(Int_t index);//write segmen persistent
47 Bool_t MakeDictionary(Int_t size);//create index table for tree
48 TClass * GetClass() {return fClass;}
50 TObjArray * fSegment; //!pointer to array of pointers to segment
51 AliTRDarrayI * fTreeIndex; //!pointers(index) table in tree
53 TTree * fTree; //!tree with segment objects
54 TBranch * fBranch; //!total branch
56 TClass * fClass; //!class type of included objects
57 ClassDef(AliTRDsegmentArrayBase,1)
62 const AliTRDsegmentID* AliTRDsegmentArrayBase::operator[](Int_t i)
65 //return segment with given index
67 if ( (i<0) || (i>=fNSegment)) return 0;
68 return (AliTRDsegmentID *)fSegment->At(i);
70 const AliTRDsegmentID* AliTRDsegmentArrayBase::At(Int_t i)
73 //return segment with given index
75 if ( (i<0) || (i>=fNSegment)) return 0;
76 return (AliTRDsegmentID *)((*fSegment)[i]);
79 #endif //ALISEGARRAY_H