Logo ROOT  
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 "TTree.h"
20 #include "TROOT.h"
21 #include <iostream>
22 
24 
25 ////////////////////////////////////////////////////////////////////////////////
26 /// Default constructor for a chain element.
27 
28 TChainElement::TChainElement() : TNamed(),fBaddress(0),fBaddressType(0),
29  fBaddressIsPtr(kFALSE), fDecomposedObj(kFALSE), fCheckedType(kFALSE), fBranchPtr(0), fLoadResult(0)
30 {
31  fNPackets = 0;
32  fPackets = 0;
33  fEntries = 0;
34  fPacketSize = 100;
35  fStatus = -1;
37 }
38 
39 ////////////////////////////////////////////////////////////////////////////////
40 /// Create a chain element.
41 
42 TChainElement::TChainElement(const char *name, const char *title)
43  :TNamed(name,title),fBaddress(0),fBaddressType(0),
44  fBaddressIsPtr(kFALSE), fDecomposedObj(kFALSE), fCheckedType(kFALSE), fBranchPtr(0), fLoadResult(0)
45 {
46  fNPackets = 0;
47  fPackets = 0;
48  fEntries = 0;
49  fPacketSize = 100;
50  fStatus = -1;
52 }
53 
54 ////////////////////////////////////////////////////////////////////////////////
55 /// Default destructor for a chain element.
56 
58 {
59  delete [] fPackets;
60 }
61 
62 ////////////////////////////////////////////////////////////////////////////////
63 /// Initialize the packet descriptor string.
64 
66 {
68  delete [] fPackets;
69  fPackets = new char[fNPackets+1];
70  for (Int_t i=0;i<fNPackets;i++) fPackets[i] = ' ';
71  fPackets[fNPackets] = 0;
72 
73 }
74 
75 ////////////////////////////////////////////////////////////////////////////////
76 /// List files in the chain.
77 
79 {
81  std::cout << GetTitle() << "tree:" << GetName() << " entries=";
83  std::cout << "<not calculated>";
84  else
85  std::cout << fEntries;
86  std::cout << '\n';
87 }
88 
89 ////////////////////////////////////////////////////////////////////////////////
90 /// Set number of entries per packet for parallel root.
91 
93 {
94  fPacketSize = size;
95 }
96 
97 ////////////////////////////////////////////////////////////////////////////////
98 /// Set/Reset the looked-up bit
99 
101 {
102  if (y)
104  else
106 }
107 
TChainElement::fPacketSize
Int_t fPacketSize
Number of events in one packet for parallel root.
Definition: TChainElement.h:38
TChainElement::fStatus
Int_t fStatus
branch status when used as a branch
Definition: TChainElement.h:39
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:54
Int_t
int Int_t
Definition: RtypesCore.h:45
TChainElement::fEntries
Long64_t fEntries
Number of entries in the tree of this chain element.
Definition: TChainElement.h:36
TChainElement::TChainElement
TChainElement()
Default constructor for a chain element.
Definition: TChainElement.cxx:28
TChainElement::kHasBeenLookedUp
@ kHasBeenLookedUp
Definition: TChainElement.h:32
TTree.h
bool
TChainElement
Definition: TChainElement.h:28
TROOT.h
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TObject::ResetBit
void ResetBit(UInt_t f)
Definition: TObject.h:171
TObject::SetBit
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:696
TChainElement::fPackets
char * fPackets
! Packet descriptor string
Definition: TChainElement.h:46
TNamed
Definition: TNamed.h:29
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
y
Double_t y[n]
Definition: legend1.C:17
TChainElement::SetPacketSize
virtual void SetPacketSize(Int_t size=100)
Set number of entries per packet for parallel root.
Definition: TChainElement.cxx:92
TROOT::IndentLevel
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
Definition: TROOT.cxx:2798
TChainElement::CreatePackets
virtual void CreatePackets()
Initialize the packet descriptor string.
Definition: TChainElement.cxx:65
TChainElement::fNPackets
Int_t fNPackets
Number of packets.
Definition: TChainElement.h:37
TChainElement::ls
virtual void ls(Option_t *option="") const
List files in the chain.
Definition: TChainElement.cxx:78
name
char name[80]
Definition: TGX11.cxx:110
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:53
TChainElement::SetLookedUp
virtual void SetLookedUp(Bool_t y=kTRUE)
Set/Reset the looked-up bit.
Definition: TChainElement.cxx:100
TTree::kMaxEntries
static constexpr Long64_t kMaxEntries
Definition: TTree.h:225
TChainElement::~TChainElement
virtual ~TChainElement()
Default destructor for a chain element.
Definition: TChainElement.cxx:57
TChainElement.h
int