Home | News | Documentation | Download

Difference ROOT5.34 & ROOT6.04.16

I’ve used working script at ROOT5.34
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++)

/// 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’
/home/evd/MyROOT/ADCread/fitADC.C:70:31: error: use of undeclared identifier 'h1’
What is the differnce between two versions?

Try with: TH1F *h1; hf->GetObject("h1", h1);

ROOT 6.04.16 installed at VirtualBox with opeSUSE13.1, also ROOT5.34
ROOT5.34 installed at several computers with KUBUNTU

Thank you Pepe Le Pew, it works.

Please help me. With this code, I can run it perfectly in root 5, but I can’t run it in root 6.prob_vac.C (14.0 KB)

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):

root [0] .L probmu2et2k_vac.C++

Sorry, I am using root 6. I try to modify this code in root 6, but I can’t run it.

You can start with this: probmu2et2k_vac.C (2.9 KB)

thank you very much!!!

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)

// ...
// ...
h2->Draw("HIST SAME");
// ...
h3->Draw("HIST SAME");
// ...
h4->Draw("HIST SAME");
// ...
h5->Draw("HIST SAME");
// ...
h6->Draw("HIST SAME");
// ...

Thank for your help.

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 can’t run this code in root 6 plot_eventrate_app.C (6.7 KB) but It can run in root 5. What errors?

This screen dump shows you define several time “leg0” that’s invalid C++.
and titleStyle is undeclared…

you should see these errors with root5 also running with AClic:

root [0] .x plot_eventrate_app.C++