AliPhysics  5364b50 (5364b50)
MakeK0S.C
Go to the documentation of this file.
1 
23 void
25 {
26  gSystem->AddIncludePath("-I${ALICE_ROOT}/include -I${ALICE_PHYSICS}/include");
27  gROOT->LoadMacro("AliAODTracklet.C+g");
28  gROOT->LoadMacro("AliTrackletWeights.C+g");
29 
31 
32  Double_t c2Bins[] = { 0, 2.5, 5, 7.5, 10, 20, 30,
33  40, 50, 60, 70, 80, 90, 100 };
34 
35  TFile* strFile = TFile::Open("../tracklets/REWEIGHTstr.root","READ");
36  Short_t strs[] = { 310 };
37  for (Int_t i = 0; i < 1; i++) {
38  TString histName;
39  Short_t pdg = strs[i];
40  histName.Form("strWeight_%s", (pdg == 211 ? "pi" :
41  pdg == 321 ? "ka" :
42  pdg == 2212 ? "pr" :
43  pdg == 310 ? "k0" :
44  pdg == 3122 ? "la" :
45  pdg == 3212 ? "si" :
46  pdg == 3322 ? "xi" : ""));
47  TH1* hist = static_cast<TH1*>(strFile->Get(histName));
48  if (!hist) {
49  Warning("MakeWeight", "strangeness histogram %s not found",
50  histName.Data());
51  continue;
52  }
53  TH1D* out = new TH1D(Form("w%d", pdg), Form("Strangeness %d weight", pdg),
54  13, c2Bins);
55  for (Int_t j = 1; j <= out->GetNbinsX(); j++) {
56  out->SetBinContent(j, hist->GetBinContent(j));
57  out->SetBinError (j, hist->GetBinError (j));
58  }
59  weights->AddStrangenessWeight(pdg, out);
60  }
61 
62 
63 
64 
65  new TBrowser;
66 
67  TFile* outW = TFile::Open("k0s.root", "RECREATE");
68  weights->Write();
69  outW->Write();
70  weights->Draw();
71  weights->Print();
72 }
73 /* @} */
74 //
75 // EOF
76 //
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
short Short_t
Definition: External.C:23
Definition: External.C:196