\HeaderA{root.call}{Create class CallTreeSet accessing ROOT detection call file}{root.call}
\keyword{manip}{root.call}
\begin{Description}\relax
Create class CallTreeSet accessing ROOT detection call file.
\end{Description}
\begin{Usage}
\begin{verbatim}
root.call(xps.scheme, rootfile = character(0), treetype = character(0), treenames = "*")
\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{treetype}] tree type.
\item[\code{treenames}] 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{CallTreeSet}{CallTreeSet}} will be created, serving as R wrapper to the 
existing \code{\LinkA{ROOT}{ROOT}} detection call file \code{rootfile}.

Parameter \code{treetype} must be supplied to identify the ROOT trees for slots \code{data}
and \code{detcall}. Valid tree types are listed in \code{\LinkA{validTreetype}{validTreetype}}.

To get the names of all trees with their extensions \code{treetype}, which are stored in
\code{rootfile}, you can call function \code{\LinkA{getTreeNames}{getTreeNames}} first.

If the \code{\LinkA{CallTreeSet}{CallTreeSet}} should only handle a subset of the trees stored in 
\code{rootfile}, the tree names must be supplied as vector \code{treenames}.
\end{Details}
\begin{Value}
A \code{CallTreeSet} object.
\end{Value}
\begin{Author}\relax
Christian Stratowa
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{root.data}{root.data}}, \code{\LinkA{root.expr}{root.expr}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## first, load ROOT scheme file and ROOT data file
scheme.test3 <- root.scheme(paste(.path.package("xps"),"schemes/SchemeTest3.root",sep="/"))
data.test3 <- root.data(scheme.test3, paste(.path.package("xps"),"rootdata/DataTest3_cel.root",sep="/"))

## MAS5 detection call
detcall.mas5 <- mas5.call(data.test3,"tmp_Test3CallAll",tmpdir="",verbose=FALSE)

## use subset of trees
sub.call <- root.call(scheme.test3, "tmp_Test3CallAll.root", "dc5", c("TestA2", "TestB1"))
\end{ExampleCode}
\end{Examples}

