Logo ROOT  
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 #include "TTree.h"
25 
26 class TBrowser;
27 
28 class TNtuple : public TTree {
29 
30 protected:
31  Int_t fNvar; ///< Number of columns
32  Float_t *fArgs; ///<! [fNvar] Array of variables
33 
34  virtual Int_t Fill();
35 
36 private:
37  TNtuple(const TNtuple&); // not implemented
38  TNtuple& operator=(const TNtuple&); // not implemented
39 
40 public:
41  TNtuple();
42  TNtuple(const char *name,const char *title, const char *varlist, Int_t bufsize=32000);
43  virtual ~TNtuple();
44 
45  virtual void Browse(TBrowser *b);
46  virtual TTree *CloneTree(Long64_t nentries = -1, Option_t* option = "");
47  virtual Int_t Fill(const Float_t *x);
48  Int_t Fill(Int_t x0) { return Fill((Float_t)x0); }
49  Int_t Fill(Double_t x0) { return Fill((Float_t)x0); }
50  virtual Int_t Fill(Float_t x0, Float_t x1=0, Float_t x2=0, Float_t x3=0,
51  Float_t x4=0, Float_t x5=0, Float_t x6=0, Float_t x7=0,
52  Float_t x8=0, Float_t x9=0, Float_t x10=0,
53  Float_t x11=0, Float_t x12=0, Float_t x13=0,
54  Float_t x14=0);
55  virtual Int_t GetNvar() const { return fNvar; }
56  Float_t *GetArgs() const { return fArgs; }
57  virtual Long64_t ReadStream(std::istream& inputStream, const char *branchDescriptor="", char delimiter = ' ');
58  virtual void ResetBranchAddress(TBranch *);
59  void ResetBranchAddresses();
60 
61  ClassDef(TNtuple,2); //A simple tree with branches of floats.
62 };
63 
64 #endif
TNtuple::operator=
TNtuple & operator=(const TNtuple &)
TBrowser
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
x4
static const double x4[22]
Definition: RooGaussKronrodIntegrator1D.cxx:437
Option_t
const char Option_t
Definition: RtypesCore.h:66
TNtuple
A simple TTree restricted to a list of float variables only.
Definition: TNtuple.h:28
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TTree
A TTree represents a columnar dataset.
Definition: TTree.h:79
Float_t
float Float_t
Definition: RtypesCore.h:57
Int_t
int Int_t
Definition: RtypesCore.h:45
x
Double_t x[n]
Definition: legend1.C:17
nentries
int nentries
Definition: THbookFile.cxx:91
TTree.h
TNtuple::~TNtuple
virtual ~TNtuple()
Default destructor for an Ntuple.
Definition: TNtuple.cxx:103
b
#define b(i)
Definition: RSha256.hxx:100
x1
static const double x1[5]
Definition: RooGaussKronrodIntegrator1D.cxx:346
TNtuple::TNtuple
TNtuple()
Default constructor for Ntuple.
Definition: TNtuple.cxx:46
TBranch
A TTree is a list of TBranches.
Definition: TBranch.h:89
TNtuple::GetArgs
Float_t * GetArgs() const
Definition: TNtuple.h:56
x3
static const double x3[11]
Definition: RooGaussKronrodIntegrator1D.cxx:392
TNtuple::fArgs
Float_t * fArgs
! [fNvar] Array of variables
Definition: TNtuple.h:32
TNtuple::Browse
virtual void Browse(TBrowser *b)
Browse content of the ntuple.
Definition: TNtuple.cxx:158
TNtuple::ReadStream
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:220
Double_t
double Double_t
Definition: RtypesCore.h:59
TNtuple::fNvar
Int_t fNvar
Number of columns.
Definition: TNtuple.h:31
TNtuple::CloneTree
virtual TTree * CloneTree(Long64_t nentries=-1, Option_t *option="")
Create a clone of this tree and copy nentries.
Definition: TNtuple.cxx:119
TNtuple::TNtuple
TNtuple(const TNtuple &)
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
TNtuple::ResetBranchAddress
virtual void ResetBranchAddress(TBranch *)
Reset the branch addresses to the internal fArgs array.
Definition: TNtuple.cxx:133
x2
static const double x2[5]
Definition: RooGaussKronrodIntegrator1D.cxx:364
TNtuple::GetNvar
virtual Int_t GetNvar() const
Definition: TNtuple.h:55
TNtuple::ResetBranchAddresses
void ResetBranchAddresses()
Reset the branch addresses to the internal fArgs array.
Definition: TNtuple.cxx:147
TNtuple::Fill
Int_t Fill(Double_t x0)
Definition: TNtuple.h:49
TNtuple::Fill
virtual Int_t Fill()
Fill a Ntuple with current values in fArgs.
Definition: TNtuple.cxx:169
TNtuple::Fill
Int_t Fill(Int_t x0)
Definition: TNtuple.h:48
int