AliPhysics  32b88a8 (32b88a8)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MakeK0S.C
Go to the documentation of this file.
1 void
3 {
4  gSystem->AddIncludePath("-I${ALICE_ROOT}/include -I${ALICE_PHYSICS}/include");
5  gROOT->LoadMacro("AliAODTracklet.C+g");
6  gROOT->LoadMacro("AliTrackletWeights.C+g");
7 
9 
10  Double_t c2Bins[] = { 0, 2.5, 5, 7.5, 10, 20, 30,
11  40, 50, 60, 70, 80, 90, 100 };
12 
13  TFile* strFile = TFile::Open("../tracklets/REWEIGHTstr.root","READ");
14  Short_t strs[] = { 310 };
15  for (Int_t i = 0; i < 1; i++) {
16  TString histName;
17  Short_t pdg = strs[i];
18  histName.Form("strWeight_%s", (pdg == 211 ? "pi" :
19  pdg == 321 ? "ka" :
20  pdg == 2212 ? "pr" :
21  pdg == 310 ? "k0" :
22  pdg == 3122 ? "la" :
23  pdg == 3212 ? "si" :
24  pdg == 3322 ? "xi" : ""));
25  TH1* hist = static_cast<TH1*>(strFile->Get(histName));
26  if (!hist) {
27  Warning("MakeWeight", "strangeness histogram %s not found",
28  histName.Data());
29  continue;
30  }
31  TH1D* out = new TH1D(Form("w%d", pdg), Form("Strangeness %d weight", pdg),
32  13, c2Bins);
33  for (Int_t j = 1; j <= out->GetNbinsX(); j++) {
34  out->SetBinContent(j, hist->GetBinContent(j));
35  out->SetBinError (j, hist->GetBinError (j));
36  }
37  weights->AddStrangenessWeight(pdg, out);
38  }
39 
40 
41 
42 
43  new TBrowser;
44 
45  TFile* outW = TFile::Open("k0s.root", "RECREATE");
46  weights->Write();
47  outW->Write();
48  weights->Draw();
49  weights->Print();
50 }
Int_t pdg
double Double_t
Definition: External.C:58
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
void MakeK0S()
Definition: MakeK0S.C:2
short Short_t
Definition: External.C:23
Definition: External.C:196