]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Test routines and example for use of AliFastGlauber and AliQuenchingWeights
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Feb 2004 15:45:43 +0000 (15:45 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Feb 2004 15:45:43 +0000 (15:45 +0000)
(A. Dainese, K. Loizides, A. Morsch)

FASTSIM/plotContWeight.C [new file with mode: 0644]
FASTSIM/plotDiscreteWeight.C [new file with mode: 0644]
FASTSIM/testAliGlauberQuenching.C [new file with mode: 0644]
FASTSIM/testAliQuenching.C [new file with mode: 0644]

diff --git a/FASTSIM/plotContWeight.C b/FASTSIM/plotContWeight.C
new file mode 100644 (file)
index 0000000..0b3e4ca
--- /dev/null
@@ -0,0 +1,9 @@
+void plotContWeight()
+{
+  AliQuenchingWeights afq;
+  afq.InitMult();
+
+  afq.PlotContWeights(1,4);
+  afq.PlotContWeights(2,1.);
+}
+
diff --git a/FASTSIM/plotDiscreteWeight.C b/FASTSIM/plotDiscreteWeight.C
new file mode 100644 (file)
index 0000000..9a79de5
--- /dev/null
@@ -0,0 +1,54 @@
+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();
+
+}
diff --git a/FASTSIM/testAliGlauberQuenching.C b/FASTSIM/testAliGlauberQuenching.C
new file mode 100644 (file)
index 0000000..01e5647
--- /dev/null
@@ -0,0 +1,101 @@
+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();
+}
diff --git a/FASTSIM/testAliQuenching.C b/FASTSIM/testAliQuenching.C
new file mode 100644 (file)
index 0000000..daee853
--- /dev/null
@@ -0,0 +1,24 @@
+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);
+}
+
+