ROOT  6.06/09
Reference Guide
TNtuple.h
Go to the documentation of this file.
1 // @(#)root/tree:$Id$
2 // Author: Rene Brun 06/04/96
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 #ifndef ROOT_TNtuple
13 #define ROOT_TNtuple
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TNtuple //
19 // //
20 // A simple tree with branches of floats. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #ifndef ROOT_TTree
25 #include "TTree.h"
26 #endif
27 
28 class TBrowser;
29 
30 class TNtuple : public TTree {
31 
32 protected:
33  Int_t fNvar; // Number of columns
34  Float_t *fArgs; //! [fNvar] Array of variables
35 
36  virtual Int_t Fill();
37 
38 private:
39  TNtuple(const TNtuple&); // not implemented
40  TNtuple& operator=(const TNtuple&); // not implmeneted
41 
42 public:
43  TNtuple();
44  TNtuple(const char *name,const char *title, const char *varlist, Int_t bufsize=32000);
45  virtual ~TNtuple();
46 
47  virtual void Browse(TBrowser *b);
48  virtual TTree *CloneTree(Long64_t nentries = -1, Option_t* option = "");
49  virtual Int_t Fill(const Float_t *x);
50  Int_t Fill(Int_t x0) { return Fill((Float_t)x0); }
51  Int_t Fill(Double_t x0) { return Fill((Float_t)x0); }
52  virtual Int_t Fill(Float_t x0, Float_t x1=0, Float_t x2=0, Float_t x3=0,
53  Float_t x4=0, Float_t x5=0, Float_t x6=0, Float_t x7=0,
54  Float_t x8=0, Float_t x9=0, Float_t x10=0,
55  Float_t x11=0, Float_t x12=0, Float_t x13=0,
56  Float_t x14=0);
57  virtual Int_t GetNvar() const { return fNvar; }
58  Float_t *GetArgs() const { return fArgs; }
59  virtual Long64_t ReadStream(std::istream& inputStream, const char *branchDescriptor="", char delimiter = ' ');
60  virtual void ResetBranchAddress(TBranch *);
61  void ResetBranchAddresses();
62 
63  ClassDef(TNtuple,2); //A simple tree with branches of floats.
64 };
65 
66 #endif
virtual Long64_t ReadStream(std::istream &inputStream, const char *branchDescriptor="", char delimiter= ' ')
Read from filename as many columns as variables in the ntuple the function returns the number of rows...
Definition: TNtuple.cxx:218
long long Long64_t
Definition: RtypesCore.h:69
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
int Int_t
Definition: RtypesCore.h:41
TNtuple & operator=(const TNtuple &)
static const double x2[5]
ClassDef(TNtuple, 2)
Double_t x[n]
Definition: legend1.C:17
static const double x4[22]
Float_t * GetArgs() const
Definition: TNtuple.h:58
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
Int_t fNvar
Definition: TNtuple.h:33
virtual TTree * CloneTree(Long64_t nentries=-1, Option_t *option="")
Create a clone of this tree and copy nentries.
Definition: TNtuple.cxx:117
A simple TTree restricted to a list of float variables only.
Definition: TNtuple.h:30
virtual void ResetBranchAddress(TBranch *)
Reset the branch addresses to the internal fArgs array.
Definition: TNtuple.cxx:131
virtual void Browse(TBrowser *b)
Browse content of the ntuple.
Definition: TNtuple.cxx:156
void ResetBranchAddresses()
Reset the branch addresses to the internal fArgs array.
Definition: TNtuple.cxx:145
static const double x1[5]
Int_t Fill(Double_t x0)
Definition: TNtuple.h:51
double Double_t
Definition: RtypesCore.h:55
int nentries
Definition: THbookFile.cxx:89
virtual Int_t Fill()
[fNvar] Array of variables
Definition: TNtuple.cxx:167
Int_t Fill(Int_t x0)
Definition: TNtuple.h:50
Float_t * fArgs
Definition: TNtuple.h:34
#define name(a, b)
Definition: linkTestLib0.cpp:5
A TTree object has a header with a name and a title.
Definition: TTree.h:94
virtual Int_t GetNvar() const
Definition: TNtuple.h:57
A TTree is a list of TBranches.
Definition: TBranch.h:58
virtual ~TNtuple()
Default destructor for an Ntuple.
Definition: TNtuple.cxx:101
static const double x3[11]