]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG0/highMultiplicity/extrapolateXSection.C
Deleting array of overlaps
[u/mrichter/AliRoot.git] / PWG0 / highMultiplicity / extrapolateXSection.C
1 void extrapolateXSection()
2 {
3   TFile* file = TFile::Open("crosssection.root");
4   TH1* xSection2 = dynamic_cast<TH1*> (gFile->Get("xSection2"));
5   TH1* xSection15 = dynamic_cast<TH1*> (gFile->Get("xSection15"));
6
7   gROOT->cd();
8
9   TH1F* xSection2Ex = new TH1F("xSection2Ex", ";Npart", 1001, -0.5, 1000.5);
10   TH1F* xSection15Ex = new TH1F("xSection15Ex", ";Npart", 1001, -0.5, 1000.5);
11
12   new TCanvas;
13   xSection2->Draw();
14   xSection2->Fit("expo", "", "", 200, 250);
15   gPad->SetLogy();
16
17   for (Int_t i=1; i<=1000; ++i)
18   {
19     if (i < 250)
20     {
21       xSection2Ex->SetBinContent(i, xSection2->GetBinContent(i));
22       xSection2Ex->SetBinError(i, xSection2->GetBinError(i));
23     }
24     else
25       xSection2Ex->SetBinContent(i, xSection2->GetFunction("expo")->Eval(i));
26   }
27
28   new TCanvas;
29   xSection2Ex->Draw();
30   xSection2->SetLineColor(2);
31   xSection2->Draw("SAME");
32   gPad->SetLogy();
33
34   new TCanvas;
35   xSection15->Draw();
36   xSection15->Fit("expo", "", "", 145, 250);
37   gPad->SetLogy();
38
39   for (Int_t i=1; i<=1000; ++i)
40   {
41     if (i < 145)
42     {
43       xSection15Ex->SetBinContent(i,xSection15->GetBinContent(i));
44       xSection15Ex->SetBinError(i, xSection15->GetBinError(i));
45     }
46     else
47       xSection15Ex->SetBinContent(i, xSection15->GetFunction("expo")->Eval(i));
48   }
49
50   new TCanvas;
51   xSection15Ex->Draw();
52   xSection15->SetLineColor(2);
53   xSection15->Draw("SAME");
54   gPad->SetLogy();
55
56   TFile* file2 = TFile::Open("crosssectionEx.root", "RECREATE");
57
58   xSection2Ex->Write();
59   xSection15Ex->Write();
60
61   file2->Close();
62 }
63
64
65