Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TNtupleD.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_TNtupleD
13#define ROOT_TNtupleD
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TNtupleD //
19// //
20// A simple tree with branches of doubles. //
21// //
22//////////////////////////////////////////////////////////////////////////
23
24#include "TTree.h"
25
26class TBrowser;
27
28class TNtupleD : public TTree {
29
30protected:
31 Int_t fNvar; ///< Number of columns
32 Double_t *fArgs; ///<! [fNvar] Array of variables
33
34 Int_t Fill() override;
35
36private:
37 TNtupleD(const TNtupleD&) = delete;
38 TNtupleD& operator=(const TNtupleD&) = delete;
39
40public:
41 TNtupleD();
42 TNtupleD(const char *name,const char *title, const char *varlist, Int_t bufsize=32000);
43 ~TNtupleD() override;
44
45 void Browse(TBrowser *b) override;
46 virtual Int_t Fill(const Double_t *x);
47 virtual Int_t Fill(Double_t x0, Double_t x1, Double_t x2=0, Double_t x3=0,
48 Double_t x4=0, Double_t x5=0, Double_t x6=0, Double_t x7=0,
49 Double_t x8=0, Double_t x9=0, Double_t x10=0,
50 Double_t x11=0, Double_t x12=0, Double_t x13=0,
51 Double_t x14=0);
52 virtual Int_t GetNvar() const { return fNvar; }
53 Double_t *GetArgs() const { return fArgs; }
54 Long64_t ReadStream(std::istream& inputstream, const char *branchDescriptor="", char delimiter = ' ') override;
55 void ResetBranchAddress(TBranch *) override;
56 void ResetBranchAddresses() override;
57
58 ClassDefOverride(TNtupleD,1) //A simple tree with branches of floats.
59};
60
61#endif
#define b(i)
Definition RSha256.hxx:100
long long Long64_t
Definition RtypesCore.h:80
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
char name[80]
Definition TGX11.cxx:110
A TTree is a list of TBranches.
Definition TBranch.h:93
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
A simple TTree restricted to a list of double variables only.
Definition TNtupleD.h:28
virtual Int_t GetNvar() const
Definition TNtupleD.h:52
~TNtupleD() override
Default destructor for an Ntuple.
Definition TNtupleD.cxx:104
void Browse(TBrowser *b) override
Browse content.
Definition TNtupleD.cxx:139
Long64_t ReadStream(std::istream &inputstream, const char *branchDescriptor="", char delimiter=' ') override
Read from filename as many columns as variables in the ntuple the function returns the number of rows...
Definition TNtupleD.cxx:200
Double_t * GetArgs() const
Definition TNtupleD.h:53
void ResetBranchAddress(TBranch *) override
Reset the branch addresses to the internal fArgs array.
Definition TNtupleD.cxx:114
TNtupleD & operator=(const TNtupleD &)=delete
TNtupleD(const TNtupleD &)=delete
TNtupleD()
Default constructor for Ntuple.
Definition TNtupleD.cxx:45
void ResetBranchAddresses() override
Reset the branch addresses to the internal fArgs array.
Definition TNtupleD.cxx:128
Int_t Fill() override
Fill a Ntuple with current values in fArgs.
Definition TNtupleD.cxx:150
Int_t fNvar
Number of columns.
Definition TNtupleD.h:31
Double_t * fArgs
! [fNvar] Array of variables
Definition TNtupleD.h:32
A TTree represents a columnar dataset.
Definition TTree.h:79
Double_t x[n]
Definition legend1.C:17