Logo ROOT   6.08/07
Reference Guide
Go to the documentation of this file.
1 // @(#)root/tree:$Id$
2 // Author: Rene Brun 11/02/97
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 #ifndef ROOT_TChainElement
12 #define ROOT_TChainElement
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TChainElement //
18 // //
19 // Describes a component of a TChain. //
20 // //
21 //////////////////////////////////////////////////////////////////////////
24 #ifndef ROOT_TNamed
25 #include "TNamed.h"
26 #endif
28 class TBranch;
30 class TChainElement : public TNamed {
32  // TChainElement status bits
33  enum EStatusBits {
35  };
37 protected:
38  Long64_t fEntries; ///< Number of entries in the tree of this chain element
39  Int_t fNPackets; ///< Number of packets
40  Int_t fPacketSize; ///< Number of events in one packet for parallel root
41  Int_t fStatus; ///< branch status when used as a branch
42  void *fBaddress; ///<! branch address when used as a branch
43  TString fBaddressClassName; ///<! Name of the class pointed to by fBaddress
44  UInt_t fBaddressType; ///<! Type of the value pointed to by fBaddress
45  Bool_t fBaddressIsPtr; ///<! True if the address is a pointer to an address
46  char *fPackets; ///<! Packet descriptor string
47  TBranch **fBranchPtr; ///<! Address of user branch pointer (to updated upon loading a file)
48  Int_t fLoadResult; ///<! Return value of TChain::LoadTree(); 0 means success
50 public:
51  TChainElement();
52  TChainElement(const char *title, const char *filename);
53  virtual ~TChainElement();
54  virtual void CreatePackets();
55  virtual void *GetBaddress() const {return fBaddress;}
56  virtual const char *GetBaddressClassName() const { return fBaddressClassName; }
57  virtual Bool_t GetBaddressIsPtr() const { return fBaddressIsPtr; }
58  virtual UInt_t GetBaddressType() const { return fBaddressType; }
59  virtual TBranch **GetBranchPtr() const { return fBranchPtr; }
60  virtual Long64_t GetEntries() const {return fEntries;}
61  Int_t GetLoadResult() const { return fLoadResult; }
62  virtual char *GetPackets() const {return fPackets;}
63  virtual Int_t GetPacketSize() const {return fPacketSize;}
64  virtual Int_t GetStatus() const {return fStatus;}
66  virtual void ls(Option_t *option="") const;
67  virtual void SetBaddress(void *add) {fBaddress = add;}
68  virtual void SetBaddressClassName(const char* clname) { fBaddressClassName = clname; }
69  virtual void SetBaddressIsPtr(Bool_t isptr) { fBaddressIsPtr = isptr; }
70  virtual void SetBaddressType(UInt_t type) { fBaddressType = type; }
71  virtual void SetBranchPtr(TBranch **ptr) { fBranchPtr = ptr; }
72  void SetLoadResult(Int_t result) { fLoadResult = result; }
73  virtual void SetLookedUp(Bool_t y = kTRUE);
74  virtual void SetNumberEntries(Long64_t n) {fEntries=n;}
75  virtual void SetPacketSize(Int_t size = 100);
76  virtual void SetStatus(Int_t status) {fStatus = status;}
78  ClassDef(TChainElement,2); //A chain element
79 };
81 #endif
virtual void SetBaddressIsPtr(Bool_t isptr)
Definition: TChainElement.h:69
virtual UInt_t GetBaddressType() const
Definition: TChainElement.h:58
long long Long64_t
Definition: RtypesCore.h:69
Bool_t fBaddressIsPtr
! True if the address is a pointer to an address
Definition: TChainElement.h:45
const char Option_t
Definition: RtypesCore.h:62
UInt_t fBaddressType
! Type of the value pointed to by fBaddress
Definition: TChainElement.h:44
virtual Int_t GetStatus() const
Definition: TChainElement.h:64
virtual void * GetBaddress() const
Definition: TChainElement.h:55
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:157
#define BIT(n)
Definition: Rtypes.h:120
Int_t fNPackets
Number of packets.
Definition: TChainElement.h:39
void SetLoadResult(Int_t result)
Definition: TChainElement.h:72
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void SetLookedUp(Bool_t y=kTRUE)
Set/Reset the looked-up bit.
A TChainElement describes a component of a TChain.
Definition: TChainElement.h:30
TBranch ** fBranchPtr
! Address of user branch pointer (to updated upon loading a file)
Definition: TChainElement.h:47
virtual Bool_t HasBeenLookedUp()
Definition: TChainElement.h:65
virtual char * GetPackets() const
Definition: TChainElement.h:62
Int_t fLoadResult
! Return value of TChain::LoadTree(); 0 means success
Definition: TChainElement.h:48
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void SetBaddressClassName(const char *clname)
Definition: TChainElement.h:68
virtual void SetPacketSize(Int_t size=100)
Set number of entries per packet for parallel root.
char * fPackets
! Packet descriptor string
Definition: TChainElement.h:46
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual Long64_t GetEntries() const
Definition: TChainElement.h:60
virtual void SetBranchPtr(TBranch **ptr)
Definition: TChainElement.h:71
virtual ~TChainElement()
Default destructor for a chain element.
void * fBaddress
! branch address when used as a branch
Definition: TChainElement.h:42
virtual void SetStatus(Int_t status)
Definition: TChainElement.h:76
virtual Bool_t GetBaddressIsPtr() const
Definition: TChainElement.h:57
virtual TBranch ** GetBranchPtr() const
Definition: TChainElement.h:59
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void SetNumberEntries(Long64_t n)
Definition: TChainElement.h:74
Long64_t fEntries
Number of entries in the tree of this chain element.
Definition: TChainElement.h:38
virtual void CreatePackets()
Initialize the packet descriptor string.
Definition: TObject.h:55
int type
Definition: TGX11.cxx:120
Double_t y[n]
Definition: legend1.C:17
Int_t fPacketSize
Number of events in one packet for parallel root.
Definition: TChainElement.h:40
TString fBaddressClassName
! Name of the class pointed to by fBaddress
Definition: TChainElement.h:43
virtual void SetBaddressType(UInt_t type)
Definition: TChainElement.h:70
Int_t GetLoadResult() const
Definition: TChainElement.h:61
virtual void SetBaddress(void *add)
Definition: TChainElement.h:67
virtual Int_t GetPacketSize() const
Definition: TChainElement.h:63
virtual const char * GetBaddressClassName() const
Definition: TChainElement.h:56
double result[121]
Int_t fStatus
branch status when used as a branch
Definition: TChainElement.h:41
Default constructor for a chain element.
A TTree is a list of TBranches.
Definition: TBranch.h:58
const Bool_t kTRUE
Definition: Rtypes.h:91
const Int_t n
Definition: legend1.C:16
virtual void ls(Option_t *option="") const
List files in the chain.