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