// -*- C++ -*- // $Id$ // creates histogram of generated rho0 kinematical data // writes a text file "rho0.txt" which should be identical to ../../test/rho0.txt void testsl() { gSystem->Load("libStarLight"); gSystem->Load("libAliStarLight"); TStarLight* sl = new TStarLight("starlight generator", "title", ""); #if 1 sl->SetParameter("BEAM_1_Z = 1 #Z of projectile"); sl->SetParameter("BEAM_1_A = 1 #A of projectile"); sl->SetParameter("BEAM_2_Z = 82 #Z of target"); sl->SetParameter("BEAM_2_A = 208 #A of target"); sl->SetParameter("BEAM_1_GAMMA = 4264.4 #Gamma of the colliding ions"); sl->SetParameter("BEAM_2_GAMMA = 1682.4 #Gamma of the colliding ions"); #else sl->SetParameter("BEAM_1_Z = 82 #Z of projectile"); sl->SetParameter("BEAM_1_A = 208 #A of projectile"); sl->SetParameter("BEAM_2_Z = 82 #Z of target"); sl->SetParameter("BEAM_2_A = 208 #A of target"); sl->SetParameter("BEAM_2_GAMMA = 1470 #Gamma of the colliding ions"); sl->SetParameter("BEAM_1_GAMMA = 1470 #Gamma of the colliding ions"); #endif sl->SetParameter("W_MAX = 15 #Max value of w"); sl->SetParameter("W_MIN = -1 #Min value of w"); sl->SetParameter("W_N_BINS = 40 #Bins i w"); sl->SetParameter("RAP_MAX = 8. #max y"); sl->SetParameter("RAP_N_BINS = 80 #Bins i y"); sl->SetParameter("CUT_PT = 0 #Cut in pT? 0 = (no, 1 = yes)"); sl->SetParameter("PT_MIN = 1.0 #Minimum pT in GeV"); sl->SetParameter("PT_MAX = 3.0 #Maximum pT in GeV"); sl->SetParameter("CUT_ETA = 0 #Cut in pseudorapidity? (0 = no, 1 = yes)"); sl->SetParameter("ETA_MIN = -10 #Minimum pseudorapidity"); sl->SetParameter("ETA_MAX = 10 #Maximum pseudorapidity"); 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 )"); sl->SetParameter("PROD_PID = 913 #Channel of interest (not relevant for photonuclear processes)"); sl->SetParameter("RND_SEED = 34533 #Random number seed"); sl->SetParameter("BREAKUP_MODE = 5 #Controls the nuclear breakup"); sl->SetParameter("INTERFERENCE = 0 #Interference (0 = off, 1 = on)"); sl->SetParameter("IF_STRENGTH = 1. #% of intefernce (0.0 - 0.1)"); sl->SetParameter("COHERENT = 1 #Coherent=1,Incoherent=0"); sl->SetParameter("INCO_FACTOR = 1. #percentage of incoherence"); sl->SetParameter("INT_PT_MAX = 0.24 #Maximum pt considered, when interference is turned on"); sl->SetParameter("INT_PT_N_BINS = 120 #Number of pt bins when interference is turned on"); sl->InitStarLight(); sl->PrintInputs(std::cout); TClonesArray tca("TParticle", 100); TLorentzVector v[2], vSum; TH1* hM = new TH1D("hM", "STARLIGHT;M#(){#pi^{+}#pi^{-}}", 80, 0., 2.); TH1* hPt = new TH1D("hPt", "STARLIGHT;P_{T}#(){#pi^{+}#pi^{-}}", 80, 0., 2.); TH1* hY = new TH1D("hY", "STARLIGHT;Y#(){#pi^{+}#pi^{-}}", 100,-10., 10.); std::ofstream ofs("rho0.txt"); TParticle *p; for (Int_t counter(0); counter<20000;) { sl->GenerateEvent(); sl->BoostEvent(); sl->ImportParticles(&tca, "ALL"); Bool_t genOK = kTRUE; TLorentzVector vSum; for (Int_t i=0; iMomentum(v[i]); vSum += v[i]; // genOK = TMath::Abs(v[i].Rapidity()) <= 1.5; } tca.Clear(); if (!genOK) continue; Printf("counter, %d", counter, genOK); ++counter; vSum = v[0] + v[1]; ofs << std::fixed << std::setprecision(4) << vSum.M() << " " << vSum.Perp() << " " << vSum.Rapidity() << " " << v[0].Eta() << " " << v[0].Px() << " " << v[0].Py() << " " << v[0].Pz() << " " << v[1].Eta() << " " << v[1].Px() << " " << v[1].Py() << " " << v[1].Pz() << std::endl; hM->Fill(vSum.M()); hPt->Fill(vSum.Perp()); hY->Fill(vSum.Rapidity()); } TFile::Open("sl.root", "RECREATE"); sl->Write(); gFile->Write(); hM->Draw(); c1->SaveAs("SL.pdf("); hPt->Draw(); c1->SaveAs("SL.pdf"); hY->Draw(); c1->SaveAs("SL.pdf)"); }