25 gSystem->AddIncludePath(
"-I${ALICE_ROOT}/include -I${ALICE_PHYSICS}/include");
26 gROOT->LoadMacro(
"AliAODTracklet.C+g");
27 gROOT->LoadMacro(
"AliTrackletWeights.C+g");
31 TFile* ptFile = TFile::Open(
"../tracklets/REWEIGHTpt.root",
"READ");
33 Double_t c1Bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80 };
34 TH2D* cPt =
new TH2D(
"cPt",
"cPt", 9, c1Bins,
36 for (
Int_t i = 1; i <= cPt->GetNbinsX(); i++) {
38 histName.Form(
"ptWeight_c%d_%d",
39 Int_t(cPt->GetXaxis()->GetBinLowEdge(i)),
40 Int_t(cPt->GetXaxis()->GetBinUpEdge(i)));
41 TH1* hist =
static_cast<TH1*
>(ptFile->Get(histName));
43 Warning(
"MakeWeight",
"pt histogram %s not found", histName);
46 for (
Int_t j = 1; j <= cPt->GetNbinsY(); j++) {
47 cPt->SetBinContent(i, j, hist->GetBinContent(j));
48 cPt->SetBinError (i, j, hist->GetBinError (j));
53 TFile* pidFile = TFile::Open(
"../tracklets/REWEIGHTpid.root",
"READ");
54 Double_t c2Bins[] = { 0, 2.5, 5, 7.5, 10, 20, 30,
55 40, 50, 60, 70, 80, 90, 100 };
56 Short_t pids[] = { 211, 321, 2212 };
57 for (
Int_t i = 0; i < 3; i++) {
60 histName.Form(
"pidWeight_%s", (pdg == 211 ?
"pi" :
63 TH1* hist =
static_cast<TH1*
>(pidFile->Get(histName));
65 Warning(
"MakeWeight",
"pid histogram %s not found", histName.Data());
68 TH1D* out =
new TH1D(Form(
"w%d", pdg), Form(
"PID %d weight", pdg),
70 for (
Int_t j = 1; j <= out->GetNbinsX(); j++) {
71 out->SetBinContent(j, hist->GetBinContent(j));
72 out->SetBinError (j, hist->GetBinError (j));
77 TFile* strFile = TFile::Open(
"../tracklets/REWEIGHTstr.root",
"READ");
78 Short_t strs[] = { 211, 321, 2212, 310, 3122, 3112, 3222, 3312 };
79 for (
Int_t i = 0; i < 8; i++) {
82 histName.Form(
"strWeight_%s", (pdg == 211 ?
"pi" :
91 pdg == 3322 ?
"xi" :
""));
92 TH1* hist =
static_cast<TH1*
>(strFile->Get(histName));
94 Warning(
"MakeWeight",
"strangeness histogram %s not found",
98 TH1D* out =
new TH1D(Form(
"w%d", pdg), Form(
"Strangeness %d weight", pdg),
100 for (
Int_t j = 1; j <= out->GetNbinsX(); j++) {
101 out->SetBinContent(j, hist->GetBinContent(j));
102 out->SetBinError (j, hist->GetBinError (j));
112 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)