AliPhysics  251aa1e (251aa1e)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MakeRealistic.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  // --- pT weight ---------------------------------------------------
27  // Unity in all centralities and pT
28  // TH2D* cPt = new TH2D("cPt", "cPt", 1, 0, 100, 1, 0, 5);
29  // cPt->SetBinContent(1,1,1);
30  // weights->SetPtWeight(cPt);
31 
32  // --- Abundance weights -------------------------------------------
33  // We do not add any!
34 
35  // --- Strangeness weights -----------------------------------------
36  // We add simple constant weights
37  Short_t pids[] = { 321, // K^+/-
38  310, // K^0_S
39  3122, // Lambda
40  3212, // Sigma0
41  3322, // Xi0,
42  0 };
43  Double_t factors[] = { 3,
44  1.5,
45  1.5,
46  1.5,
47  3,
48  0 };
49  Short_t* pid = pids;
50  Double_t* fac = factors;
51  while (*pid) {
52  Short_t p = *pid;
53  Double_t f = *fac;
54  TH1D* h = new TH1D(Form("w%d", p), Form("PID %d weight", p), 1, 0, 100);
55  h->SetBinContent(1,f);
56  weights->AddStrangenessWeight(p, h);
57  pid++;
58  fac++;
59  }
60 
61  new TBrowser;
62 
63  // --- Write to file -----------------------------------------------
64  TFile* outW = TFile::Open("realistic.root", "RECREATE");
65  weights->Write();
66  outW->Write();
67  weights->Draw();
68  weights->Print();
69 }
70 /* @} */
71 //
72 // EOF
73 //
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:18
short Short_t
Definition: External.C:23