--- /dev/null
+void plotContWeight()
+{
+ AliQuenchingWeights afq;
+ afq.InitMult();
+
+ afq.PlotContWeights(1,4);
+ afq.PlotContWeights(2,1.);
+}
+
--- /dev/null
+plotDiscreteWeight(Int_t len=5)
+{
+ AliQuenchingWeights afq;
+ afq.InitMult();
+ afq.PlotDiscreteWeights();
+}
+
+plotDiscreteWeightMacro(Int_t len=5)
+{
+ AliQuenchingWeights afq;
+ afq.InitMult();
+
+ TCanvas *c = new TCanvas("cdisc","Discrete Weight for Multiple Scattering",0,0,500,400);
+ TH2F *hframe = new TH2F("hdisc","",2,0,1.1,2,0,1);
+ hframe->SetStats(0);
+ hframe->SetXTitle("#hat{q} [GeV^{2}/fm]");
+ hframe->SetYTitle("Probability #Delta E = 0 , p_{0}");
+ hframe->Draw();
+
+ TGraph *gq=new TGraph(20);
+ Int_t i=0;
+ for(Double_t q=0.1;q<=1.05;q+=0.05){
+ Double_t disc,cont;
+ afq.CalcMult(1,1.0, q, len, cont, disc);
+ //cout << " " << q << " " << disc << endl;
+ gq->SetPoint(i,q,disc);i++;
+ }
+ gq->SetMarkerStyle(20);
+ gq->Draw("pl");
+
+ TGraph *gg=new TGraph(20);
+ Int_t i=0;
+ for(Double_t q=0.05;q<=1.05;q+=0.05){
+ Double_t disc,cont;
+ afq.CalcMult(2,1.0, q, 5., cont, disc);
+ //cout << " " << q << " " << disc << endl;
+ gg->SetPoint(i,q,disc);i++;
+ }
+ gg->SetMarkerStyle(24);
+ gg->Draw("pl");
+
+ TLegend *l1a = new TLegend(0.5,0.6,.95,0.8);
+ l1a->SetFillStyle(0);
+ l1a->SetBorderSize(0);
+ Char_t label[100];
+ sprintf(label,"L = %d fm",len);
+ l1a->AddEntry(gq,label,"");
+ l1a->AddEntry(gq,"quark","pl");
+ l1a->AddEntry(gg,"gluon","pl");
+ l1a->Draw();
+
+ c->Update();
+
+}
--- /dev/null
+void testAliGlauberQuenching() {
+
+ AliFastGlauber g;
+ g.Init(2);
+ g.SetCentralityClass(0.00,0.10); // centrality (fraction of geometrical cross section)
+
+ AliQuenchingWeights afq;
+ afq.InitMult();
+ afq.SetQTransport(1.);
+ afq.SetECMethod(0);
+ afq.SetLengthMax(8.);
+ afq.SampleEnergyLoss();
+
+ TCanvas *c = new TCanvas("cELD","Energy Loss Distribution",0,0,800,500);
+ c->Divide(2,1);
+
+ for(Int_t itype=1;itype<=2;itype++){
+ c->cd(itype);
+ gPad->SetLogy();
+ Char_t name[100];
+ Char_t hname[100];
+ if(itype==1){
+ sprintf(name,"Energy Loss Distribution - Quarks;E_{loss} (GeV);#");
+ sprintf(hname,"hQuarks");
+ } else {
+ sprintf(name,"Energy Loss Distribution - Gluons;E_{loss} (GeV);#");
+ sprintf(hname,"hGluons");
+ }
+
+ TH1F *h = new TH1F(hname,name,100,0,200);
+
+ for(Int_t i=0;i<10000;i++){
+ if(i % 100 == 0) cout << "." << flush;
+ Double_t ell;
+ g.GetLength(ell);
+ Double_t loss=afq.GetELossRandom(itype,ell);
+ h->Fill(loss);
+ }
+
+ h->SetStats(kTRUE);
+ if(itype==1){
+ h->SetLineColor(1);
+ h->DrawCopy();
+ }
+ else {
+ h->SetLineColor(2);
+ h->DrawCopy();
+ }
+ delete h;
+ }
+
+ c->Update();
+}
+
+// second example using ell distribution
+void testFastAliGlauberQuenching(Char_t *fname) {
+
+ TFile f(fname);
+ TH1F *hEll=(TH1F*)f.Get("hEll");
+ if(!hEll) return;
+
+ AliQuenchingWeights afq;
+ afq.InitMult();
+ afq.SetQTransport(1.);
+ afq.SetECMethod(0);
+ afq.SetLengthMax(5.);
+ afq.SampleEnergyLoss();
+
+ TCanvas *c = new TCanvas("cELD","Energy Loss Distribution",0,0,800,500);
+ c->Divide(2,1);
+
+ for(Int_t itype=1;itype<=2;itype++){
+ c->cd(itype);
+ gPad->SetLogy();
+ Char_t name[200];
+ if(itype==1)
+ sprintf(name,"Energy Loss Distribution - Quarks;E_{loss} (GeV);#");
+ else
+ sprintf(name,"Energy Loss Distribution - Gluons;E_{loss} (GeV);#");
+ Char_t hname[200];
+ if(itype==1)
+ sprintf(hname,"hQuarks");
+ else
+ sprintf(hname,"hGluons");
+
+ TH1F *h = afq.ComputeELossHisto(itype,1.,hEll);
+
+ h->SetStats(kTRUE);
+ if(itype==1){
+ h->SetLineColor(1);
+ h->DrawCopy();
+ }
+ else {
+ h->SetLineColor(2);
+ h->DrawCopy();
+ }
+ delete h;
+ }
+
+ c->Update();
+}
--- /dev/null
+testAliQuenching()
+{
+ AliQuenchingWeights afq;
+ afq.InitMult();
+ afq.SetQTransport(1.);
+ //afq.SetECMethod(0);
+ afq.SampleEnergyLoss();
+
+ Int_t lengths[6]={2,4,6,8,10,12};
+ TCanvas *c = new TCanvas("cELW","Energy Loss Weights",0,0,800,500);
+ c->Divide(3,2);
+ for(Int_t len=0;len<6;len++){
+ c->cd(len+1);
+ TH1F *h = new TH1F(*afq.GetHisto(2,lengths[len]));
+ if(h) h->DrawCopy();
+ }
+ c->Update();
+
+ afq.PlotDiscreteWeights(4);
+ afq.PlotAvgELoss(4);
+ afq.PlotAvgELossVsPt(1.,4);
+}
+
+