forked from ALICEHLT/AliRoot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAliSegmentArray.h
More file actions
89 lines (69 loc) · 3.04 KB
/
AliSegmentArray.h
File metadata and controls
89 lines (69 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#ifndef ALISEGMENTARRAY_H
#define ALISEGMENTARRAY_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
/// \class AliSegmentArray
///
/// Manager class general Alice segment
/// segment is for example one pad row in TPC
#include "TNamed.h"
#include "TError.h"
#include "TObjArray.h"
class TTree;
class TBranch;
class TFile;
class TArrayI;
class AliSegmentID;
class AliSegmentArray: public TNamed{
public:
AliSegmentArray();
AliSegmentArray(const char *classname, Int_t n); //
virtual ~AliSegmentArray();
Bool_t SetClass(const char *classname); //set class of stored object
const AliSegmentID * At(Int_t i); //return pointer to segment with index i
const AliSegmentID * operator[](Int_t i); //return pointer to segment with index i
Bool_t AddSegment(AliSegmentID *segment); // add segment to array
AliSegmentID * AddSegment(Int_t index); //create objet and set index
Bool_t MakeArray(Int_t n); //make array of pointers to Segments
void ClearSegment(Int_t index); //remove segment from active
virtual AliSegmentID * NewSegment(); //dynamicaly create new segment
//input output functions
TTree * GetTree(){return fTree;} //return pointer to connected tree
virtual void MakeTree(char *file=0); //Make tree with the name
virtual void MakeTree(TTree* tree); //Make tree with the name
virtual Bool_t ConnectTree(const char * treeName); //connect tree from current directory
virtual Bool_t ConnectTree(TTree* tree); //connect tree from current directory
virtual AliSegmentID * LoadSegment(Int_t index);//load segment with index to the memory
virtual AliSegmentID * LoadEntry(Int_t index); //load segment entry from position index in tree
virtual void StoreSegment(Int_t index);//write segmen persistent
Bool_t MakeDictionary(Int_t size);//create index table for tree
TClass * GetClass() {return fClass;}
protected:
AliSegmentArray(const AliSegmentArray &segment); //copy constructor
AliSegmentArray &operator = (const AliSegmentArray & segment); //assignment operator
TObjArray * fSegment; //!<! pointer to array of pointers to segment
TArrayI * fTreeIndex; //!<! pointers(index) table in tree
Int_t fNSegment; ///< number of alocated segments
TTree * fTree; //!<! tree with segment objects
Bool_t fTreeOwner;///< flag determing the ownership of the fTree
TBranch * fBranch; //!<! total branch
private:
TClass * fClass; //!<! class type of included objects
/// \cond CLASSIMP
ClassDef(AliSegmentArray,3)
/// \endcond
};
inline const AliSegmentID* AliSegmentArray::operator[](Int_t i)
{
/// return segment with given index
if ( (i<0) || (i>=fNSegment)) return 0;
return (AliSegmentID *)(fSegment->At(i));
}
inline const AliSegmentID* AliSegmentArray::At(Int_t i)
{
/// return segment with given index
if ( (i<0) || (i>=fNSegment)) return 0;
return (AliSegmentID *)(fSegment->At(i));
}
#endif //ALISEGMENTARRAY_H