Error in importing data

I have a one-dimensional histogram that i want to import. This is my line of code,

TFile *file1 = new TFile(“15-03.root”, “READ”);

TH1 *hist = (TH1F *)file1->Get(“tree_sig”);

RooRealVar mass(“mass_toptop”,“mass_toptop”, 8000,12000);

RooDataHist data(“data”,“dataset”, mass, hist);

But i get the following error,

[#0] ERROR:InputArguments – RooDataHist::ctor(data) ERROR: dimension of input histogram must match number of dimension variables
libc++abi: terminating with uncaught exception of type std::invalid_argument: RooDataHist::ctor(data) ERROR: dimension of input histogram must match number of dimension variables

Attached is the tree data that i want to import.

Tells you that tree_sig is not of the type you think it is (TH1F).You can check with rootls -l 15-03.root or:

TFile *file1 = TFile::Open("15-03.root");
file1->ls()

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.