+TH1* GetSystematicUncertainty(TH1* corr)
+{
+ Int_t energy = 900;
+ Int_t ueHist = 0;
+
+ systError = (TH1*) corr->Clone("systError");
+ systError->Reset();
+
+ Float_t constantUnc = 0;
+
+ // particle composition
+ constantUnc += 0.8 ** 2;
+
+ // tpc efficiency
+ if (energy == 900 && gLeadingpTMin < 1.0)
+ constantUnc += 1.0 ** 2;
+ else if (energy == 900 && gLeadingpTMin < 1.5)
+ constantUnc += 0.5 ** 2;
+ if (energy == 7000 && gLeadingpTMin < 1.0)
+ constantUnc += 1.0 ** 2;
+ else if (energy == 7000 && gLeadingpTMin < 1.5)
+ constantUnc += 0.6 ** 2;
+
+ // track cuts
+ if (energy == 900 && gLeadingpTMin < 1.0)
+ constantUnc += 2.5 ** 2;
+ else if (energy == 900 && gLeadingpTMin < 1.5)
+ constantUnc += 2.0 ** 2;
+ if (energy == 7000)
+ constantUnc += 3.0 ** 2;
+
+ // difference corrected with pythia and phojet
+ if (energy == 900 && gLeadingpTMin < 1.0)
+ constantUnc += 0.6 ** 2;
+ else if (energy == 900 && gLeadingpTMin < 1.5)
+ constantUnc += 0.8 ** 2;
+
+ for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
+ systError->SetBinContent(bin, constantUnc);
+
+ // mis id bias
+ if (ueHist == 0 || ueHist == 2)
+ systError->Fill(0.75, 4.0 ** 2);
+ if (ueHist == 1)
+ systError->Fill(0.75, 5.0 ** 2);
+
+ if (energy == 900)
+ {
+ if (gLeadingpTMin < 1.0)
+ systError->Fill(1.25, 1.0 ** 2);
+ else if (gLeadingpTMin < 1.5)
+ systError->Fill(1.25, 2.0 ** 2);
+ }
+
+ // non-closure in MC
+ if (energy == 900)
+ for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
+ systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 1.0 ** 2);
+
+ if (energy == 7000)
+ systError->Fill(0.75, 2.0 ** 2);
+
+ // vertex efficiency
+ systError->Fill(0.75, 1.0 ** 2);
+
+ // strangeness
+ for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
+ {
+ if (energy == 900)
+ systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 0.5 ** 2);
+ if (energy == 7000 && systError->GetXaxis()->GetBinCenter(bin) < 1.5)
+ systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 2.0 ** 2);
+ else if (energy == 7000)
+ systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 1.0 ** 2);
+ }
+
+ systError->SetFillColor(kGray);
+ systError->SetFillStyle(1001);
+ systError->SetMarkerStyle(0);
+ systError->SetLineColor(0);
+
+ for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
+ systError->SetBinContent(bin, TMath::Sqrt(systError->GetBinContent(bin)));
+
+ return systError;
+}
+