1 AliGenerator* CreateGenerator();
3 void fastGenPA(Int_t nev = 1, char* filename = "galice.root")
9 TFile* file = new TFile(filename, "recreate");
11 AliStack* stack = new AliStack(10000);
12 stack->MakeTree(0, filename);
15 AliHeader* header = new AliHeader();
17 TTree* treeE = new TTree("TE","Headers");
18 treeE->Branch("Header", "AliHeader", &header, 4000, 0);
21 // Create and Initialize Generator
22 AliGenerator *gener = CreateGenerator();
23 AliPythia* pyth = AliPythia::Instance();
26 gener->SetStack(stack);
33 for (iev = 0; iev < nev; iev++) {
35 printf("\n \n Event number %d \n \n", iev);
40 stack->BeginEvent(iev);
46 Int_t npart = stack->GetNprimary();
47 // printf("Analyse %d Particles\n", npart);
48 for (Int_t part=0; part<npart; part++) {
49 TParticle *MPart = stack->Particle(part);
50 Int_t mpart = MPart->GetPdgCode();
51 printf("Particle %d\n", mpart);
55 header->SetNprimary(stack->GetNprimary());
56 header->SetNtrack(stack->GetNtrack());
59 // stack->FinishEvent();
60 // header->SetStack(stack);
62 // (stack->TreeK())->Write(0,TObject::kOverwrite);
67 printf("Calling Finish Run \n");
71 treeE->Write(0,TObject::kOverwrite);
72 delete treeE; treeE = 0;
81 AliGenerator* CreateGenerator()
83 AliGenCocktail *gener = new AliGenCocktail();
84 gener->SetTrackingFlag(0);
85 AliGenHijing *hijing = new AliGenHijing(-1);
86 // centre of mass energy
87 hijing->SetEnergyCMS(TMath::Sqrt(82./208.) * 14000.);
88 // impact parameter range
89 hijing->SetImpactParameterRange(0., 6.);
91 hijing->SetReferenceFrame("CMS");
92 hijing->SetBoostLHC(1);
94 hijing->SetProjectile("P", 1, 1);
95 hijing->SetTarget ("A", 208, 82);
96 // tell hijing to keep the full parent child chain
97 hijing->KeepFullEvent();
98 // enable jet quenching
99 hijing->SetJetQuenching(4);
101 hijing->SetShadowing(1);
102 // Don't track spectators
103 hijing->SetSpectators(0);
104 // kinematic selection
105 hijing->SetSelectAll(0);
107 AliGenSlowNucleons* gray = new AliGenSlowNucleons(1);
108 AliSlowNucleonModel* model = new AliSlowNucleonModelExp();
109 gray->SetSlowNucleonModel(model);
113 gener->AddGenerator(hijing,"Hijing pPb", 1);
114 gener->AddGenerator(gray, "Gray Particles",1);