\HeaderA{root.data}{Create class DataTreeSet accessing ROOT data file}{root.data}
\keyword{manip}{root.data}
\begin{Description}\relax
Create class DataTreeSet accessing ROOT data file.
\end{Description}
\begin{Usage}
\begin{verbatim}
root.data(xps.scheme, rootfile = character(0), celnames = "*")
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{xps.scheme}] A \code{\LinkA{SchemeTreeSet}{SchemeTreeSet}} containing the correct scheme for the ROOT data file.
\item[\code{rootfile}] name of ROOT data file, including full path.
\item[\code{celnames}] optional \code{character} vector of tree names to get only subset of trees.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
An S4 class \code{\LinkA{DataTreeSet}{DataTreeSet}} will be created, serving as R wrapper to the 
existing \code{\LinkA{ROOT}{ROOT}} data file \code{rootfile}.

If the \code{\LinkA{DataTreeSet}{DataTreeSet}} should only handle a subset of the trees stored in 
\code{rootfile}, the tree names must be supplied as vector \code{celnames}.

To get the names of all trees stored in \code{rootfile} you can call function 
\code{\LinkA{getTreeNames}{getTreeNames}} first.
\end{Details}
\begin{Value}
A \code{DataTreeSet} object.
\end{Value}
\begin{Note}\relax
Use \code{\LinkA{root.data}{root.data}} to access the ROOT data file from new R sessions 
to avoid creating a new \code{\LinkA{ROOT}{ROOT}} data file for every R session.
\end{Note}
\begin{Author}\relax
Christian Stratowa
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{import.data}{import.data}}, \code{\LinkA{DataTreeSet}{DataTreeSet}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## get scheme and import CEL-files from package
scheme.test3 <- root.scheme(paste(.path.package("xps"),"schemes/SchemeTest3.root",sep="/"))
data.test3 <- import.data(scheme.test3,"tmp_datatest3",celdir=paste(.path.package("xps"),"raw",sep="/"),verbose=FALSE)

## use subset of CEL-files
subdata.test3 <- root.data(scheme.test3,"tmp_datatest3_cel.root", celnames=c("TestA1.cel","TestB2.cel"))
\end{ExampleCode}
\end{Examples}

