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