Logo ROOT   6.19/01
Reference Guide
TChainElement.cxx
Go to the documentation of this file.
1 // @(#)root/tree:$Id$
2 // Author: Rene Brun 11/02/97
3 
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 
12 /** \class TChainElement
13 \ingroup tree
14 
15 A TChainElement describes a component of a TChain.
16 */
17 
18 #include "TChainElement.h"
19 #include "TBuffer.h"
20 #include "TTree.h"
21 #include "Riostream.h"
22 #include "TROOT.h"
23 
25 
26 ////////////////////////////////////////////////////////////////////////////////
27 /// Default constructor for a chain element.
28 
29 TChainElement::TChainElement() : TNamed(),fBaddress(0),fBaddressType(0),
30  fBaddressIsPtr(kFALSE), fBranchPtr(0), fLoadResult(0)
31 {
32  fNPackets = 0;
33  fPackets = 0;
34  fEntries = 0;
35  fPacketSize = 100;
36  fStatus = -1;
38 }
39 
40 ////////////////////////////////////////////////////////////////////////////////
41 /// Create a chain element.
42 
43 TChainElement::TChainElement(const char *name, const char *title)
44  :TNamed(name,title),fBaddress(0),fBaddressType(0),
45  fBaddressIsPtr(kFALSE), fBranchPtr(0), fLoadResult(0)
46 {
47  fNPackets = 0;
48  fPackets = 0;
49  fEntries = 0;
50  fPacketSize = 100;
51  fStatus = -1;
53 }
54 
55 ////////////////////////////////////////////////////////////////////////////////
56 /// Default destructor for a chain element.
57 
59 {
60  delete [] fPackets;
61 }
62 
63 ////////////////////////////////////////////////////////////////////////////////
64 /// Initialize the packet descriptor string.
65 
67 {
69  delete [] fPackets;
70  fPackets = new char[fNPackets+1];
71  for (Int_t i=0;i<fNPackets;i++) fPackets[i] = ' ';
72  fPackets[fNPackets] = 0;
73 
74 }
75 
76 ////////////////////////////////////////////////////////////////////////////////
77 /// List files in the chain.
78 
80 {
82  std::cout << GetTitle() << "tree:" << GetName() << " entries=";
84  std::cout << "<not calculated>";
85  else
86  std::cout << fEntries;
87  std::cout << '\n';
88 }
89 
90 ////////////////////////////////////////////////////////////////////////////////
91 /// Set number of entries per packet for parallel root.
92 
94 {
95  fPacketSize = size;
96 }
97 
98 ////////////////////////////////////////////////////////////////////////////////
99 /// Set/Reset the looked-up bit
100 
102 {
103  if (y)
105  else
107 }
108 
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
const char Option_t
Definition: RtypesCore.h:62
Int_t fNPackets
Number of packets.
Definition: TChainElement.h:37
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:28
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:694
virtual void SetPacketSize(Int_t size=100)
Set number of entries per packet for parallel root.
char * fPackets
! Packet descriptor string
Definition: TChainElement.h:44
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
virtual ~TChainElement()
Default destructor for a chain element.
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
Definition: TROOT.cxx:2851
Long64_t fEntries
Number of entries in the tree of this chain element.
Definition: TChainElement.h:36
const Bool_t kFALSE
Definition: RtypesCore.h:88
virtual void CreatePackets()
Initialize the packet descriptor string.
#define ClassImp(name)
Definition: Rtypes.h:365
Double_t y[n]
Definition: legend1.C:17
Int_t fPacketSize
Number of events in one packet for parallel root.
Definition: TChainElement.h:38
void ResetBit(UInt_t f)
Definition: TObject.h:171
Int_t fStatus
branch status when used as a branch
Definition: TChainElement.h:39
TChainElement()
Default constructor for a chain element.
static constexpr Long64_t kMaxEntries
Definition: TTree.h:217
char name[80]
Definition: TGX11.cxx:109
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual void ls(Option_t *option="") const
List files in the chain.