AliPhysics  f05a842 (f05a842)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MakeRealistic.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  // --- pT weight ---------------------------------------------------
11  // Unity in all centralities and pT
12  // TH2D* cPt = new TH2D("cPt", "cPt", 1, 0, 100, 1, 0, 5);
13  // cPt->SetBinContent(1,1,1);
14  // weights->SetPtWeight(cPt);
15 
16  // --- Abundance weights -------------------------------------------
17  // We do not add any!
18 
19  // --- Strangeness weights -----------------------------------------
20  // We add simple constant weights
21  Short_t pids[] = { 321, // K^+/-
22  310, // K^0_S
23  3122, // Lambda
24  3212, // Sigma0
25  3322, // Xi0,
26  0 };
27  Double_t factors[] = { 3,
28  1.5,
29  1.5,
30  1.5,
31  3,
32  0 };
33  Short_t* pid = pids;
34  Double_t* fac = factors;
35  while (*pid) {
36  Short_t p = *pid;
37  Double_t f = *fac;
38  TH1D* h = new TH1D(Form("w%d", p), Form("PID %d weight", p), 1, 0, 100);
39  h->SetBinContent(1,f);
40  weights->AddStrangenessWeight(p, h);
41  pid++;
42  fac++;
43  }
44 
45  new TBrowser;
46 
47  // --- Write to file -----------------------------------------------
48  TFile* outW = TFile::Open("realistic.root", "RECREATE");
49  weights->Write();
50  outW->Write();
51  weights->Draw();
52  weights->Print();
53 }
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="")
Definition: External.C:212
void MakeRealistic()
Definition: MakeRealistic.C:2
short Short_t
Definition: External.C:23