1 void runGlauberMC(Bool_t doPartProd=0,Int_t option=0,Int_t N=250000)
4 gSystem->Load("libVMC");
5 gSystem->Load("libPhysics");
6 gSystem->Load("libTree");
7 gSystem->Load("libPWGGlauber");
9 //set the random seed from current time
11 Int_t seed = time.GetSec();
12 gRandom->SetSeed(seed);
14 Int_t nevents = N; // number of events to simulate
15 // supported systems are e.g. "p", "d", "Si", "Au", "Pb", "U"
18 Double_t signn=64; // inelastic nucleon nucleon cross section
19 //const char *fname="GlauberMC_PbPb_ntuple.root"; // name output file
21 // run the code to produce an ntuple:
22 // AliGlauberMC::runAndSaveNucleons(10000,"Pb","Pb",72);
24 // AliGlauberMC::RunAndSaveNtuple(nevents,sysA,sysB,signn,mind);
27 const char *fname="glau_pbpb_ntuple.root";
29 AliGlauberMC mcg(sysA,sysB,signn);
30 mcg.SetMinDistance(mind);
34 mcg.SetDoFluc(0.55,78.5*0.92,0.82,kTRUE);
36 mcg.SetDoFluc(1.01,72.5*0.92,0.74,kTRUE);
37 mcg.SetDoPartProduction(doPartProd);
40 mcg.SetdNdEtaType(AliGlauberMC::kNBDSV);
41 mcg.GetdNdEtaParam()[0] = 2.49; //npp
42 mcg.GetdNdEtaParam()[1] = 1.7; //ratioSgm2Mu
43 mcg.GetdNdEtaParam()[2] = 0.13; //xhard
48 TNtuple *nt = mcg.GetNtuple();
49 TFile out(fname,"recreate",fname,9);
51 printf("total cross section with a nucleon-nucleon cross section %.4f is %.4f\n\n",signn,mcg.GetTotXSect());