I have a simple question. I’m using root inside CMSSW " CMSSW_9_4_10". “root version is 6.10/09”
I was using variable bin size for long time without errors in my macro. Now I get error that the new histogram name not defined.
The steps I’m doing:
int n = 10;
Double_t xbins[11]={5,7,10,20,30,40,50,80,90,100,150}; //n=10
TFile *f0 = TFile::Open("All_data.root")
TH1F * h1 = (TH1F*)f0->Get("ZplusM_Pt_DEN_Barrel");
h1->Rebin(n,"histoMudenBarrelnew",xbins); //Rebining
histoMudenBarrelnew->Draw()
I got this error:
**error:** **use of undeclared identifier 'histoMudenBarrelnew'**
histoMudenBarrelnew->Draw();
Error in <ACLiC>: Dictionary generation failed!
When I tried the same steps interactively in root without macro, it works fine but not inside my macro.
I have another question: I defined TGraphAsymmErrors from 2 rebind histograms but when I use this graph later I get error the is not defined (although I included the header file in the beginning of my macro #include “TGraphAsymmErrors.h”),
Can it be that you define the “Trg_Pt2Er_data_Barrel” inside of a {...} block but then you try to access it outside if this block?
BTW. When you post “source code” or “output” here, do remember to enclose them into two lines which contain just three characters ``` (see how your post has been edited above).