]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STARLIGHT/starlight/TStarLight/testsl.C
.so cleanup: removed from gSystem->Load()
[u/mrichter/AliRoot.git] / STARLIGHT / starlight / TStarLight / testsl.C
CommitLineData
da32329d
AM
1// -*- C++ -*-
2// $Id$
3
a2de4243 4// creates histogram of generated rho0 kinematical data
5// writes a text file "rho0.txt" which should be identical to ../../test/rho0.txt
6
da32329d 7void testsl() {
da32329d 8 gSystem->Load("libStarLight");
4070f709 9 gSystem->Load("libAliStarLight");
da32329d
AM
10
11 TStarLight* sl = new TStarLight("starlight generator", "title", "");
12
be31281a 13#if 1
a2de4243 14 sl->SetParameter("BEAM_1_Z = 1 #Z of projectile");
15 sl->SetParameter("BEAM_1_A = 1 #A of projectile");
da32329d
AM
16 sl->SetParameter("BEAM_2_Z = 82 #Z of target");
17 sl->SetParameter("BEAM_2_A = 208 #A of target");
a2de4243 18 sl->SetParameter("BEAM_1_GAMMA = 4264.4 #Gamma of the colliding ions");
19 sl->SetParameter("BEAM_2_GAMMA = 1682.4 #Gamma of the colliding ions");
be31281a 20#else
21 sl->SetParameter("BEAM_1_Z = 82 #Z of projectile");
22 sl->SetParameter("BEAM_1_A = 208 #A of projectile");
23 sl->SetParameter("BEAM_2_Z = 82 #Z of target");
24 sl->SetParameter("BEAM_2_A = 208 #A of target");
25 sl->SetParameter("BEAM_2_GAMMA = 1470 #Gamma of the colliding ions");
26 sl->SetParameter("BEAM_1_GAMMA = 1470 #Gamma of the colliding ions");
27#endif
45d54d9a 28 sl->SetParameter("W_MAX = 15 #Max value of w");
29 sl->SetParameter("W_MIN = -1 #Min value of w");
da32329d
AM
30 sl->SetParameter("W_N_BINS = 40 #Bins i w");
31 sl->SetParameter("RAP_MAX = 8. #max y");
32 sl->SetParameter("RAP_N_BINS = 80 #Bins i y");
33 sl->SetParameter("CUT_PT = 0 #Cut in pT? 0 = (no, 1 = yes)");
34 sl->SetParameter("PT_MIN = 1.0 #Minimum pT in GeV");
35 sl->SetParameter("PT_MAX = 3.0 #Maximum pT in GeV");
36 sl->SetParameter("CUT_ETA = 0 #Cut in pseudorapidity? (0 = no, 1 = yes)");
37 sl->SetParameter("ETA_MIN = -10 #Minimum pseudorapidity");
38 sl->SetParameter("ETA_MAX = 10 #Maximum pseudorapidity");
be31281a 39 sl->SetParameter("PROD_MODE = 4 #gg or gP switch (1 = 2-photon, 2 = coherent vector meson (narrow), 3 = coherent vector meson (wide), # 4 = incoherent vector meson, 5 = A+A DPMJet single, 6 = A+A DPMJet double, 7 = p+A DPMJet single, 8 = p+A Pythia single )");
7b8392f4 40 sl->SetParameter("PROD_PID = 913 #Channel of interest (not relevant for photonuclear processes)");
da32329d 41 sl->SetParameter("RND_SEED = 34533 #Random number seed");
da32329d
AM
42 sl->SetParameter("BREAKUP_MODE = 5 #Controls the nuclear breakup");
43 sl->SetParameter("INTERFERENCE = 0 #Interference (0 = off, 1 = on)");
44 sl->SetParameter("IF_STRENGTH = 1. #% of intefernce (0.0 - 0.1)");
45 sl->SetParameter("COHERENT = 1 #Coherent=1,Incoherent=0");
46 sl->SetParameter("INCO_FACTOR = 1. #percentage of incoherence");
da32329d
AM
47 sl->SetParameter("INT_PT_MAX = 0.24 #Maximum pt considered, when interference is turned on");
48 sl->SetParameter("INT_PT_N_BINS = 120 #Number of pt bins when interference is turned on");
49
50 sl->InitStarLight();
51 sl->PrintInputs(std::cout);
be31281a 52 TClonesArray tca("TParticle", 100);
da32329d 53
a2de4243 54 TLorentzVector v[2], vSum;
7b8392f4 55 TH1* hM = new TH1D("hM", "STARLIGHT;M#(){#pi^{+}#pi^{-}}", 80, 0., 2.);
56 TH1* hPt = new TH1D("hPt", "STARLIGHT;P_{T}#(){#pi^{+}#pi^{-}}", 80, 0., 2.);
57 TH1* hY = new TH1D("hY", "STARLIGHT;Y#(){#pi^{+}#pi^{-}}", 100,-10., 10.);
a2de4243 58
59 std::ofstream ofs("rho0.txt");
60 TParticle *p;
7b8392f4 61 for (Int_t counter(0); counter<20000;) {
da32329d 62 sl->GenerateEvent();
a2de4243 63 sl->BoostEvent();
da32329d 64 sl->ImportParticles(&tca, "ALL");
7b8392f4 65 Bool_t genOK = kTRUE;
66 TLorentzVector vSum;
67 for (Int_t i=0; i<tca.GetEntries() && genOK; ++i) {
a2de4243 68 p = (TParticle*)tca.At(i);
69 p->Momentum(v[i]);
7b8392f4 70 vSum += v[i];
71// genOK = TMath::Abs(v[i].Rapidity()) <= 1.5;
a2de4243 72 }
0e1bd874 73 tca.Clear();
7b8392f4 74 if (!genOK) continue;
75 Printf("counter, %d", counter, genOK);
a2de4243 76 ++counter;
77 vSum = v[0] + v[1];
78 ofs << std::fixed << std::setprecision(4)
79 << vSum.M() << " " << vSum.Perp() << " " << vSum.Rapidity() << " "
80 << v[0].Eta() << " " << v[0].Px() << " " << v[0].Py() << " " << v[0].Pz() << " "
81 << v[1].Eta() << " " << v[1].Px() << " " << v[1].Py() << " " << v[1].Pz()
82 << std::endl;
83 hM->Fill(vSum.M());
84 hPt->Fill(vSum.Perp());
85 hY->Fill(vSum.Rapidity());
da32329d 86 }
a2de4243 87 TFile::Open("sl.root", "RECREATE");
88 sl->Write();
89 gFile->Write();
90
91 hM->Draw();
92 c1->SaveAs("SL.pdf(");
93 hPt->Draw();
94 c1->SaveAs("SL.pdf");
95 hY->Draw();
96 c1->SaveAs("SL.pdf)");
da32329d 97}