Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOTR.C
Go to the documentation of this file.
1//script to test Modules
2#include<TRInterface.h>
3
5{
6 return cos(x);
7}
8
9void ROOTR()
10{
12 r.SetVerbose(kFALSE);
13 r.LoadModule("Gpad");
14 r.LoadModule("Hist");
15 r.LoadModule("Rint");
16
17 r<<"x<-seq(0,2*pi,by=.1)";
18 r<<"c1<-new(TCanvas,'c1','dlnorm')";
19 r<<"u <-new(TGraph,length(x),x,dlnorm(x))" ;//TGraph(int,double*,double*)
20 r<<"u$Draw()";
21
22 r<<"c2<-new(TCanvas,'c2','DiLog from TMath')";
23 r<<"o<- new(TF1,'dilog','TMath::DiLog(x)',0,2*pi)";
24 r<<"o$Draw()";
25//
26 r<<"c3<-new(TCanvas,'c3','Custom')";
27 r<<"i <- new(TF1,'f2','[0]*myFunc([1]*x)',0,2*pi)";
28 r<<"i$SetRange(0,2*pi)";
29 r<<"i$SetParameter(0,4)";
30 r<<"i$SetParameter(1,pi/2)";
31 r<<"print(i$Eval(0))";
32 r<<"print(i$Eval(c(0,pi)))";
33 r<<"i$Draw('')";
34
35// r<<"gApp<-new(TRint,'ROOTR')";
36// r<<"gApp$ProcessLine('cout<<\"Calling cout from TRint\"<<endl;')";
37
38}
void ROOTR()
Definition ROOTR.C:9
Double_t myFunc(Double_t x)
Definition ROOTR.C:4
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
ROOT R was implemented using the R Project library and the modules Rcpp and RInside
static TRInterface & Instance()
static method to get an TRInterface instance reference
Double_t x[n]
Definition legend1.C:17