Flushing the buffer for debug purposes (R. Preghenella)
[u/mrichter/AliRoot.git] / FASTSIM / plotDiscreteWeight.C
... / ...
CommitLineData
1plotDiscreteWeight(Int_t len=5)
2{
3 AliQuenchingWeights afq;
4 afq.InitMult();
5 afq.PlotDiscreteWeights();
6}
7
8plotDiscreteWeightMacro(Int_t len=5)
9{
10 AliQuenchingWeights afq;
11 afq.InitMult();
12
13 TCanvas *c = new TCanvas("cdisc","Discrete Weight for Multiple Scattering",0,0,500,400);
14 TH2F *hframe = new TH2F("hdisc","",2,0,1.1,2,0,1);
15 hframe->SetStats(0);
16 hframe->SetXTitle("#hat{q} [GeV^{2}/fm]");
17 hframe->SetYTitle("Probability #Delta E = 0 , p_{0}");
18 hframe->Draw();
19
20 TGraph *gq=new TGraph(20);
21 Int_t i=0;
22 for(Double_t q=0.1;q<=1.05;q+=0.05){
23 Double_t disc,cont;
24 afq.CalcMult(1,1.0, q, len, cont, disc);
25 //cout << " " << q << " " << disc << endl;
26 gq->SetPoint(i,q,disc);i++;
27 }
28 gq->SetMarkerStyle(20);
29 gq->Draw("pl");
30
31 TGraph *gg=new TGraph(20);
32 Int_t i=0;
33 for(Double_t q=0.05;q<=1.05;q+=0.05){
34 Double_t disc,cont;
35 afq.CalcMult(2,1.0, q, 5., cont, disc);
36 //cout << " " << q << " " << disc << endl;
37 gg->SetPoint(i,q,disc);i++;
38 }
39 gg->SetMarkerStyle(24);
40 gg->Draw("pl");
41
42 TLegend *l1a = new TLegend(0.5,0.6,.95,0.8);
43 l1a->SetFillStyle(0);
44 l1a->SetBorderSize(0);
45 Char_t label[100];
46 sprintf(label,"L = %d fm",len);
47 l1a->AddEntry(gq,label,"");
48 l1a->AddEntry(gq,"quark","pl");
49 l1a->AddEntry(gg,"gluon","pl");
50 l1a->Draw();
51
52 c->Update();
53
54}