Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::TreeUtils Namespace Reference

Functions

template<class DataType , class Tuple >
Long64_t FillNtupleFromStream (std::istream &inputStream, Tuple &tuple, char delimiter, bool strictMode)
 Function to fill tuples (TNtuple/TNtupleD) from a simple ASCII data file.
 
template Long64_t FillNtupleFromStream< Double_t, TNtupleD > (std::istream &, TNtupleD &, char, bool)
 
template Long64_t FillNtupleFromStream< Float_t, TNtuple > (std::istream &, TNtuple &, char, bool)
 
bool NextCharacterIsEOL (std::istream &input)
 Either '\r' | '\n' or eof of some problem.
 
void SkipComment (std::istream &input)
 Skips everything from '#' to (including) '\r' or '\n'.
 
void SkipEmptyLines (std::istream &input)
 Skips empty lines (newline-characters), ws-lines (consisting only of whitespace characters + newline-characters).
 
void SkipWSCharacters (std::istream &input)
 Skip whitespace characters, but not newline-characters we support ('\r' or '\n').
 

Function Documentation

◆ FillNtupleFromStream()

template<class DataType , class Tuple >
Long64_t ROOT::TreeUtils::FillNtupleFromStream ( std::istream &  inputStream,
Tuple &  tuple,
char  delimiter,
bool  strictMode 
)

Function to fill tuples (TNtuple/TNtupleD) from a simple ASCII data file.

With auto and decltype - we can get rid of DataType parameter :) (or with a simple typedef inside ntuple class). An input file consists of non-empty lines (separated by newline-characters), possibly empty lines, and comments (treated as empty lines). Each non-empty line should contain N numbers - entry for a tuple. Non-strict mode lets you to have newline-characters inside a tuple's row (as it worked in ROOT prior to v5.3xxx).

Definition at line 80 of file TreeUtils.cxx.

◆ FillNtupleFromStream< Double_t, TNtupleD >()

template Long64_t ROOT::TreeUtils::FillNtupleFromStream< Double_t, TNtupleD > ( std::istream &  ,
TNtupleD ,
char  ,
bool   
)

◆ FillNtupleFromStream< Float_t, TNtuple >()

template Long64_t ROOT::TreeUtils::FillNtupleFromStream< Float_t, TNtuple > ( std::istream &  ,
TNtuple ,
char  ,
bool   
)

◆ NextCharacterIsEOL()

bool ROOT::TreeUtils::NextCharacterIsEOL ( std::istream &  input)

Either '\r' | '\n' or eof of some problem.

Definition at line 298 of file TreeUtils.cxx.

◆ SkipComment()

void ROOT::TreeUtils::SkipComment ( std::istream &  input)

Skips everything from '#' to (including) '\r' or '\n'.

Definition at line 240 of file TreeUtils.cxx.

◆ SkipEmptyLines()

void ROOT::TreeUtils::SkipEmptyLines ( std::istream &  input)

Skips empty lines (newline-characters), ws-lines (consisting only of whitespace characters + newline-characters).

Definition at line 259 of file TreeUtils.cxx.

◆ SkipWSCharacters()

void ROOT::TreeUtils::SkipWSCharacters ( std::istream &  input)

Skip whitespace characters, but not newline-characters we support ('\r' or '\n').

Definition at line 280 of file TreeUtils.cxx.