20 gSystem->AddIncludePath(
"-I${ALICE_ROOT}/include -I${ALICE_PHYSICS}/include");
21 gROOT->LoadMacro(
"AliAODTracklet.C+g");
22 gROOT->LoadMacro(
"AliTrackletWeights.C+g");
26 TFile* ptFile = TFile::Open(
"../tracklets/REWEIGHTpt.root",
"READ");
28 Double_t c1Bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80 };
29 TH2D* cPt =
new TH2D(
"cPt",
"cPt", 9, c1Bins,
31 for (
Int_t i = 1; i <= cPt->GetNbinsX(); i++) {
33 histName.Form(
"ptWeight_c%d_%d",
34 Int_t(cPt->GetXaxis()->GetBinLowEdge(i)),
35 Int_t(cPt->GetXaxis()->GetBinUpEdge(i)));
36 TH1* hist =
static_cast<TH1*
>(ptFile->Get(histName));
38 Warning(
"MakeWeight",
"pt histogram %s not found", histName);
41 for (
Int_t j = 1; j <= cPt->GetNbinsY(); j++) {
42 cPt->SetBinContent(i, j, hist->GetBinContent(j));
43 cPt->SetBinError (i, j, hist->GetBinError (j));
48 TFile* pidFile = TFile::Open(
"../tracklets/REWEIGHTpid.root",
"READ");
49 Double_t c2Bins[] = { 0, 2.5, 5, 7.5, 10, 20, 30,
50 40, 50, 60, 70, 80, 90, 100 };
51 Short_t pids[] = { 211, 321, 2212 };
52 for (
Int_t i = 0; i < 3; i++) {
55 histName.Form(
"pidWeight_%s", (pdg == 211 ?
"pi" :
58 TH1* hist =
static_cast<TH1*
>(pidFile->Get(histName));
60 Warning(
"MakeWeight",
"pid histogram %s not found", histName.Data());
63 TH1D* out =
new TH1D(Form(
"w%d", pdg), Form(
"PID %d weight", pdg),
65 for (
Int_t j = 1; j <= out->GetNbinsX(); j++) {
66 out->SetBinContent(j, hist->GetBinContent(j));
67 out->SetBinError (j, hist->GetBinError (j));
72 TFile* strFile = TFile::Open(
"../tracklets/REWEIGHTstr.root",
"READ");
73 Short_t strs[] = { 211, 321, 2212, 310, 3122, 3212, 3322 };
74 for (
Int_t i = 0; i < 7; i++) {
77 histName.Form(
"strWeight_%s", (pdg == 211 ?
"pi" :
83 pdg == 3322 ?
"xi" :
""));
84 TH1* hist =
static_cast<TH1*
>(strFile->Get(histName));
86 Warning(
"MakeWeight",
"strangeness histogram %s not found",
90 TH1D* out =
new TH1D(Form(
"w%d", pdg), Form(
"Strangeness %d weight", pdg),
92 for (
Int_t j = 1; j <= out->GetNbinsX(); j++) {
93 out->SetBinContent(j, hist->GetBinContent(j));
94 out->SetBinError (j, hist->GetBinError (j));
104 TFile* outW = TFile::Open(
"weights.root",
"RECREATE");
Bool_t AddAbundanceWeight(Short_t pdg, const TH1D *h, UShort_t mode=0)
Bool_t AddStrangenessWeight(Short_t pdg, const TH1D *h, UShort_t mode=0)
void Print(Option_t *option="") const
void Draw(Option_t *option="")
Bool_t SetPtWeight(const TH2D *h, UShort_t mode=0)