# How can i fitting sub-ranges

hi, rooters!
i try to draw the sub ranges so, i’m reference to Fitting Multiple Sub Ranges section from Users-Guide5.12 finally, i can made a some result. but i didn’t understand a method. and i want to use single Sub-Range.
I have a two question.
first, what is the meanning of “Double_t par[9]”,"GetParmeters(&par[0]…(&par[6]); and how can i define suitable parameters to my program.
second, How can i get the value of peak between 65 and 90(please see the attached file and script.)

----script------

``````Float_t dt;
Float_t qa, qg;
Float_t wa, wg;
UShort_t ca, cg;
``````

TH1F *hnvox[6];
hnvox[0] = new TH1F(“hnvox1”, “Gamma Energy for g detector 1”, 125, 50, 100);
hnvox[1] = new TH1F(“hnvox2”, “Gamma Energy for g detector 2”, 125, 50, 100);
hnvox[2] = new TH1F(“hnvox3”, “Gamma Energy for g detector 3”, 125, 50, 100);
hnvox[3] = new TH1F(“hnvox4”, “Gamma Energy for g detector 4”, 125, 50, 100);
hnvox[4] = new TH1F(“hnvox5”, “Gamma Energy for g detector 5”, 125, 50, 100);
hnvox[5] = new TH1F(“hnvox6”, “Gamma Energy for g detector 6”, 125, 50, 100);

//read all entries and fill the histograms
Int_t nentries = (Int_t)tree->GetEntries();
for (Int_t i=0;i<nentries;i++)
{
tree->GetEntry(i);
if (cg<6){
switch (cg) {
case 0:
hnvox[0]->Fill(qg);
break;
case 1:
hnvox[1]->Fill(qg);
break;
case 2:
hnvox[2]->Fill(qg);
break;
case 3:
hnvox[3]->Fill(qg);
break;
case 4:
hnvox[4]->Fill(qg);
break;
case 5:
hnvox[5]->Fill(qg);
break;
}
}

}
double par[9];
TCanvas *c4 = new TCanvas(“c4”, “c4”, 1150, 850);

TF1 *g1 = new TF1(“g1”,“gaus”,65,90);
TF1 *g2 = new TF1(“g2”,“gaus”,65,90);
TF1 *g3 = new TF1(“g3”,“gaus”,65,90);
TF1 *total = new TF1(“total”,“gaus(0)+gaus(3)+gaus(6)”,65,90);

c4->Divide(2,3);
c4->SetFillColor(18);
c4->cd(1);

g1->SetFillColor(kBlue);
g2->SetLineColor(kRed);
g3->SetLineColor(kGreen);
total->SetLineColor(2);
hnvox[0]->Fit(g1,“R”);
hnvox[0]->Fit(g2,“R+”);
hnvox[0]->Fit(g3,“R+”);
g1->GetParameters(&par[0]);
g2->GetParameters(&par[3]);
g3->GetParameters(&par[6]);
total->SetParameters(par);
hnvox[0]->Fit(total,“R+”);
hnvox[0]->Draw();

hnvox[0]->SetFillColor(9);