1 void extrapolateXSection()
3 TFile* file2 = TFile::Open("crosssectionEx_10TeV.root", "RECREATE");
8 for (Int_t fileId = 0; fileId < 2; fileId++)
12 TFile* file = TFile::Open("out_phojet.root");
15 TFile* file = TFile::Open("out_pythia.root");
17 TH1* xSection2 = dynamic_cast<TH1*> (gFile->Get("fMult"));
21 xSection2->Scale(1.0 / xSection2->Integral());
22 //TH1* xSection15 = dynamic_cast<TH1*> (gFile->Get("xSection15"));
24 //TH1F* xSection15Ex = new TH1F("xSection15Ex", ";Npart", 1001, -0.5, 1000.5);
27 Float_t lowLimit[] = { 150, 175, 200 };
36 xSection2->Draw((fileId == 0) ? "" : "SAME");
38 for (Int_t i=0; i<3; i++)
40 func[i] = new TF1("func", "[0]*exp([1]*x)", 0, 1000);
41 func[i]->SetParameters(1, -1e-4);
43 xSection2->Fit(func[i], "0", "", lowLimit[i], 250);
44 func[i]->SetRange(lowLimit[i], 500);
45 func[i]->SetLineColor(i+1);
46 func[i]->Draw("SAME");
50 base->GetXaxis()->SetRangeUser(0, 500);
51 base->GetYaxis()->SetRangeUser(func[2]->Eval(500), xSection2->GetMaximum());
53 for (Int_t j=0; j<3; j++)
56 TH1F* xSection2Ex = new TH1F(Form("xSection2Ex_%d_%d", fileId, j), ";Npart", 1001, -0.5, 1000.5);
58 for (Int_t i=1; i<=1000; ++i)
62 xSection2Ex->SetBinContent(i, xSection2->GetBinContent(i));
63 xSection2Ex->SetBinError(i, xSection2->GetBinError(i));
66 xSection2Ex->SetBinContent(i, func[j]->Eval(i));