I thought this should be a really simple problem, but I just keep running into errors.
Please let me know if it is just a very silly mistake that I am overlooking…
//
// jj.c
//
//
// on 8/17/15.
//
//
#include “TFile.h”
#include “TGraph.h”
#include “TTree.h”
#include “TNtuple.h”
void jj(void){
double mass, Crosssection, Br, A;
TFile f ("f.root", "RECREATE");
TNTuple ntuple("ntuple","Cross section vs mass",mass : Crosssection : Br : A);
// const char data_file=“QStar.txt”;
ntuple.ReadFile(“QStar.txt”);
ntuple.write();
ntuple.draw("Crosssection:Mass")
}
Error: Can’t call TTree::TTree(“ntuple”,“Cross section vs mass”,“mass:Crosssection:Br:A”) in current scope jj.c:18:
Possible candidates are…
(in TTree)
/usr/local/Cellar/root/5.34.26/lib/root/libTree.so -1:-1 0 private: TTree TTree::TTree(const TTree& tt); //not implemented
/usr/local/Cellar/root/5.34.26/lib/root/libTree.so -1:-1 0 public: TTree TTree::TTree(void);
/usr/local/Cellar/root/5.34.26/lib/root/libTree.so -1:-1 0 public: TTree TTree::TTree(const char* name,const char* title,Int_t splitlevel=99);
*** Interpreter error recovered ***
root [19] .x jj.c
Error: Symbol mass:Crosssection:Br:A is not defined in current scope jj.c:18:
*** Interpreter error recovered ***
Also, I wonder what is the major difference between creating the object as a pointer and creating as just a TNTuple?(besides that the pointer reference the location of the information stored in the memory, and the object calls the object itself) is there a major advantage of doing it one way over the other?
Why should I ever use a ntuple if a tree can do all of what an ntuple can do?
Thanks.