AliPhysics  a4b41ad (a4b41ad)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MakeStrange.C
Go to the documentation of this file.
1 
17 void
19 {
20  gSystem->AddIncludePath("-I${ALICE_ROOT}/include -I${ALICE_PHYSICS}/include");
21  gROOT->LoadMacro("AliAODTracklet.C+g");
22  gROOT->LoadMacro("AliTrackletWeights.C+g");
23 
25 
26  Double_t c2Bins[] = { 0, 2.5, 5, 7.5, 10, 20, 30,
27  40, 50, 60, 70, 80, 90, 100 };
28 
29  TFile* pidFile = TFile::Open("../tracklets/REWEIGHTpid.root","READ");
30  Double_t c2Bins[] = { 0, 2.5, 5, 7.5, 10, 20, 30,
31  40, 50, 60, 70, 80, 90, 100 };
32  Short_t pids[] = { 321 };
33  for (Int_t i = 0; i < 1; i++) {
34  TString histName;
35  Short_t pdg = pids[i];
36  histName.Form("pidWeight_%s", (pdg == 211 ? "pi" :
37  pdg == 321 ? "ka" :
38  "pr"));
39  TH1* hist = static_cast<TH1*>(pidFile->Get(histName));
40  if (!hist) {
41  Warning("MakeWeight", "pid histogram %s not found", histName.Data());
42  continue;
43  }
44  TH1D* out = new TH1D(Form("w%d", pdg), Form("PID %d weight", pdg),
45  13, c2Bins);
46  for (Int_t j = 1; j <= out->GetNbinsX(); j++) {
47  out->SetBinContent(j, hist->GetBinContent(j));
48  out->SetBinError (j, hist->GetBinError (j));
49  }
50  weights->AddAbundanceWeight(pdg, out);
51  }
52 
53  TFile* strFile = TFile::Open("../tracklets/REWEIGHTstr.root","READ");
54  Short_t strs[] = { 321, 310, 3122, 3212, 3322 };
55  for (Int_t i = 0; i < 5; i++) {
56  TString histName;
57  Short_t pdg = strs[i];
58  histName.Form("strWeight_%s", (pdg == 211 ? "pi" :
59  pdg == 321 ? "ka" :
60  pdg == 2212 ? "pr" :
61  pdg == 310 ? "k0" :
62  pdg == 3122 ? "la" :
63  pdg == 3212 ? "si" :
64  pdg == 3322 ? "xi" : ""));
65  TH1* hist = static_cast<TH1*>(strFile->Get(histName));
66  if (!hist) {
67  Warning("MakeWeight", "strangeness histogram %s not found",
68  histName.Data());
69  continue;
70  }
71  TH1D* out = new TH1D(Form("w%d", pdg), Form("Strangeness %d weight", pdg),
72  13, c2Bins);
73  for (Int_t j = 1; j <= out->GetNbinsX(); j++) {
74  out->SetBinContent(j, hist->GetBinContent(j));
75  out->SetBinError (j, hist->GetBinError (j));
76  }
77  weights->AddStrangenessWeight(pdg, out);
78  }
79 
80 
81 
82 
83  new TBrowser;
84 
85  TFile* outW = TFile::Open("str.root", "RECREATE");
86  weights->Write();
87  outW->Write();
88  weights->Draw();
89  weights->Print();
90 }
91 /* @} */
92 //
93 // EOF
94 //
Int_t pdg
void MakeStrange()
Definition: MakeStrange.C:18
double Double_t
Definition: External.C:58
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)
TSystem * gSystem
void Print(Option_t *option="") const
void Draw(Option_t *option="")
int Int_t
Definition: External.C:63
Definition: External.C:212
short Short_t
Definition: External.C:23
Definition: External.C:196