]> git.uio.no Git - u/mrichter/AliRoot.git/blob - CONTAINERS/AliArrayBranch.h
Initialization of interaction rate
[u/mrichter/AliRoot.git] / CONTAINERS / AliArrayBranch.h
1 #ifndef ALIARRAYBRANCH_H
2 #define ALIARRAYBRANCH_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 //////////////////////////////////////////////////////////////////////////
9 //                                                                      //
10 // AliArrayBranch                                                        //
11 //                                                                      //
12 // A Branch for the case of an array of clone objects.                  //
13 //////////////////////////////////////////////////////////////////////////
14
15
16 #include "TBranch.h"
17 #include "TTree.h"
18 #include "TBranchObject.h"
19 class TClonesArray;
20 class AliObjectArray;
21  
22 class AliArraySubBranch : public TBranch {
23 public: 
24   AliArraySubBranch(){}
25   AliArraySubBranch(const char* name, void* address, const char* leaflist, Int_t basketsize = 32000, 
26     Int_t compress = -1):TBranch(name, address, leaflist, basketsize, compress){}
27   virtual ~AliArraySubBranch() {}
28   virtual Int_t  GetEntryExport(Long64_t entry, Int_t getall, TClonesArray* list, Int_t n) { return TBranch::GetEntryExport(entry, getall, list, n); }
29   virtual Int_t  GetEntryExport(Int_t entry, Int_t getall, AliObjectArray* list, Int_t n);
30   virtual void ReadBasketExport(TBuffer &b, TLeaf *leaf, AliObjectArray *list, Int_t n); 
31   ClassDef(AliArraySubBranch,1)  //Branch in case of an array of clone objects
32 };
33
34 class AliArrayBranch : public TBranch {
35
36 public:
37     AliArrayBranch();
38     AliArrayBranch(const Text_t *name, void *clonesaddress, TTree * tree, Int_t basketsize=32000,Int_t compress=-1);
39     virtual ~AliArrayBranch();
40
41     virtual void    Browse(TBrowser *b);
42     virtual Int_t   Fill();
43     virtual Int_t   GetEntry(Long64_t entry=0, Int_t getall = 0);
44     virtual Int_t   GetN() const {return fN;}
45     AliObjectArray    *GetList() const {return fList;}
46     virtual void    Print(Option_t *option="") const;
47     virtual void    Reset(Option_t *option="");
48     virtual void    SetAddress(void *add);
49     virtual void    SetBasketSize(Int_t buffsize);
50     virtual Bool_t          IsFolder() const {return kTRUE;}
51
52 protected:
53     AliObjectArray     *fList;           //Pointer to the clonesarray
54     Int_t            fRead;            //flag = 1 if clonesarray has been read
55     Int_t            fN;               //Number of elements in ClonesArray
56     Int_t            fNdataMax;        //Maximum value of fN
57     TString          fClassName;       //name of the class of the objets in the ClonesArray
58     TBranch          *fBranchCount;    //Branch with clones count
59
60 private: 
61     AliArrayBranch(const AliArrayBranch &);
62     AliArrayBranch & operator=(const AliArrayBranch &);
63     void Import(TLeaf * leaf, Int_t n);  //integer fill leef buffer 
64     ClassDef(AliArrayBranch,1)  //Branch in case of an array of clone objects
65 };
66
67
68 class AliObjectBranch: public TBranchObject{
69 public:
70   AliObjectBranch():TBranchObject(){;}
71   AliObjectBranch(const Text_t *name, const Text_t *classname, void *addobj, TTree * tree, 
72                   Int_t basketsize=32000, Int_t splitlevel = 0, Int_t compress=-1);
73   void SetAddress(void *add);
74   ClassDef(AliObjectBranch,1) 
75 };
76
77 class AliTree : public TTree {
78 public:
79   AliTree():TTree(){;}
80   AliTree(const char *name,const char *title, Int_t maxvirtualsize=0);
81   TBranch* AliBranch(const char *name, void *clonesaddress, Int_t bufsize =32000, 
82                      Int_t splitlevel=99,Int_t compres=1);
83   TBranch* AliBranch(const char *name, const char *classname, void *addobj, 
84                      Int_t bufsize=32000, Int_t splitlevel=99);
85   ClassDef(AliTree,1)  
86 };
87
88 #endif