I’ve used working script at ROOT5.34
but
I cann’t use it at ROOT6.04.16
The first lines of script are:
void fitADC(){
TFile *hf=new TFile("ADC.root");
Double_t par[9];
Int_t Nbins=h1->GetNbinsX();
Double_t xmin=h1->GetXaxis()->GetXmin();
Double_t xmax=h1->GetXaxis()->GetXmax();
Double_t binwid=(xmax-xmin)/Nbins;
cout<<" Nbins="<<Nbins<<" xmin="<<xmin<<" xmax="<<xmax<< endl;
TH1F *h1minbg = new TH1F("h1minbg","",Nbins,xmin,xmax);
for(Int_t i=210;i<400;i++)
{
h1minbg->SetBinContent(i+1,h1->GetBinContent(i+1)-exp(9.348-0.007638*i));
h1minbg->SetBinError(i+1,h1->GetBinError(i+1));
}
/// Histogram h1 with 1000 channels is in ADC.root
The output looks like:
.x ../MyROOT/ADCread/fitADC.C
In file included from input_line_9:1:
/home/evd/MyROOT/ADCread/fitADC.C:61:14: error: use of undeclared identifier 'h1'
Int_t Nbins=h1->GetNbinsX();
^
/home/evd/MyROOT/ADCread/fitADC.C:62:16: error: use of undeclared identifier 'h1'
Double_t xmin=h1->GetXaxis()->GetXmin();
^
/home/evd/MyROOT/ADCread/fitADC.C:63:16: error: use of undeclared identifier 'h1'
Double_t xmax=h1->GetXaxis()->GetXmax();
^
/home/evd/MyROOT/ADCread/fitADC.C:69:33: error: use of undeclared identifier 'h1'
h1minbg->SetBinContent(i+1,h1->GetBinContent(i+1)-exp(9.348-0.007638*i));
^
/home/evd/MyROOT/ADCread/fitADC.C:70:31: error: use of undeclared identifier 'h1'
h1minbg->SetBinError(i+1,h1->GetBinError(i+1));
^
Try to precompile your macro using ACLiC and fix all bugs and warnings reported by your compiler (in ROOT 5 and / or ROOT 6, there should be no big differences):
Please help me. How I can modify my code to adjust the root6.cc plot as same as the root5.cc plot. appearance_nu_mode_0.cc (5.5 KB) root5.pdf (14.8 KB) root6.pdf (18.2 KB)
Welll, it seems the parakeet “rule” is invalid for the function glbGetRuleRatePtr…
This is not a ROOT function. May be check the related documentation.
I am a bit puzzle because run.py is not a ROOT script. And you said it runs with ROOT 5 … that’s not possible, it is not a ROOT script.
Seems to me you are trying to generate a ROOT macro which you will execute after in ROOT ? why are you not directly writing a ROOT macro ?