Hi,
I have some issue in extracting the values of a RooRealVar which is used as a fitting variable.
Here is my code,
TFile *file = new TFile("data.root");
TTree *tree =(TTree*)file->Get("h1");
RooRealVar mbc("mbc","mbc",5.2,5.29);
Float_t s_mbc;
tree->SetBranchAddress("mbc",&s_mbc);
for(int j=0;j<tree->GetEntries();j++){
RooDataSet *data = new RooDataSet("data","data",RooArgSet(mbc));
for(int i=0;i<tree->GetEntries();i++){
tree->GetEntry(i);
mbc.setVal(s_mbc);
if(i == j) continue;
data->add(RooArgSet(mbc));
}
I have used a gaussian + Argus model to fit the data. And I want to extract the mbc value for each iteration. To do so, I have called
mbc.getVal();
But it seems, it is showing a single value for any iteration.
Any suggestion will help.