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