AliPhysics  9b6b435 (9b6b435)
MakeRealistic.C
Go to the documentation of this file.
1 
22 void
24 {
25  gSystem->AddIncludePath("-I${ALICE_ROOT}/include -I${ALICE_PHYSICS}/include");
26  gROOT->LoadMacro("AliAODTracklet.C+g");
27  gROOT->LoadMacro("AliTrackletWeights.C+g");
28 
30 
31  // --- pT weight ---------------------------------------------------
32  // Unity in all centralities and pT
33  // TH2D* cPt = new TH2D("cPt", "cPt", 1, 0, 100, 1, 0, 5);
34  // cPt->SetBinContent(1,1,1);
35  // weights->SetPtWeight(cPt);
36 
37  // --- Abundance weights -------------------------------------------
38  // We do not add any!
39 
40  // --- Strangeness weights -----------------------------------------
41  // We add simple constant weights
42  Short_t pids[] = { 321, // K^+/-
43  310, // K^0_S
44  3122, // Lambda
45  3212, // Sigma0
46  3322, // Xi0,
47  0 };
48  Double_t factors[] = { 3,
49  1.5,
50  1.5,
51  1.5,
52  3,
53  0 };
54  Short_t* pid = pids;
55  Double_t* fac = factors;
56  while (*pid) {
57  Short_t p = *pid;
58  Double_t f = *fac;
59  TH1D* h = new TH1D(Form("w%d", p), Form("PID %d weight", p), 1, 0, 100);
60  h->SetBinContent(1,f);
61  weights->AddStrangenessWeight(p, h);
62  pid++;
63  fac++;
64  }
65 
66  new TBrowser;
67 
68  // --- Write to file -----------------------------------------------
69  TFile* outW = TFile::Open("realistic.root", "RECREATE");
70  weights->Write();
71  outW->Write();
72  weights->Draw();
73  weights->Print();
74 }
75 /* @} */
76 //
77 // EOF
78 //
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
short Short_t
Definition: External.C:23