Missing #ifdef ZMQ added in AliEveEventManager.cxx
[u/mrichter/AliRoot.git] / TDPMjet / fastGenDPMjet.C
CommitLineData
89083db0 1AliGenerator* CreateGenerator();
2
7cbda79e 3void fastGenDPMjet(Int_t nev = 1, char* filename = "dpmjet.root")
89083db0 4{
5// Runloader
7cbda79e 6#if defined(__CINT__)
f4e87470 7 gSystem->Load("liblhapdf");
8 gSystem->Load("libpythia6");
4070f709 9 gSystem->Load("libdpmjet");
10 gSystem->Load("libTDPMjet");
7cbda79e 11#endif
12
13 AliPDG::AddParticlesToPdgDataBase();
89083db0 14
7cbda79e 15 AliRunLoader* rl = AliRunLoader::Open(filename,"FASTRUN","recreate");
f4e87470 16 AliPythiaRndm::SetPythiaRandom(new TRandom());
17
89083db0 18 rl->SetCompressionLevel(2);
19 rl->SetNumberOfEventsPerFile(nev);
20 rl->LoadKinematics("RECREATE");
21 rl->MakeTree("E");
22 gAlice->SetRunLoader(rl);
23
7cbda79e 24 // Create stack
89083db0 25 rl->MakeStack();
7cbda79e 26 AliStack* stack = rl->Stack();
89083db0 27
7cbda79e 28 // Header
89083db0 29 AliHeader* header = rl->GetHeader();
7cbda79e 30 //AliGenDPMjetEventHEader* dpmHeader;
31
32 // Create and Initialize Generator
33 AliGenDPMjet *gener = CreateGenerator();
34 //AliCollisionGeometry *coll = gener->CollisionGeometry();
89083db0 35 gener->Init();
36 gener->SetStack(stack);
37
7cbda79e 38 // Event Loop
89083db0 39 Int_t iev;
40
41 for (iev = 0; iev < nev; iev++) {
42
7cbda79e 43 if(iev%500==0) printf("\n Event number %d \n", iev);
89083db0 44
7cbda79e 45 // Initialize event
89083db0 46 header->Reset(0,iev);
47 rl->SetEventNumber(iev);
48 stack->Reset();
49 rl->MakeTree("K");
89083db0 50
7cbda79e 51 // Generate event
89083db0 52 gener->Generate();
89083db0 53
7cbda79e 54 Int_t npart = stack->GetNprimary();
55
56 // Finish event
89083db0 57 header->SetNprimary(stack->GetNprimary());
58 header->SetNtrack(stack->GetNtrack());
7cbda79e 59
89083db0 60// I/O
61//
62 stack->FinishEvent();
63 header->SetStack(stack);
64 rl->TreeE()->Fill();
65 rl->WriteKinematics("OVERWRITE");
66
67 } // event loop
7cbda79e 68
89083db0 69 gener->FinishRun();
7cbda79e 70
89083db0 71 rl->WriteHeader("OVERWRITE");
72 gener->Write();
73 rl->Write();
74
75}
76
77
78AliGenerator* CreateGenerator()
79{
7cbda79e 80 AliGenDPMjet *gener = new AliGenDPMjet(-1);
81
82 // p-A
83 /*Float_t pEnergy = 4000.;
84 gener->SetProjectile("P", 1, 1);
85 gener->SetTarget("A", 208, 82);
86 //
87 gener->SetEnergyCMS(TMath::Sqrt(82./208.) * 2* pEnergy);
88 gener->SetProjectileBeamEnergy(pEnergy); */
89
90 // A-p
91 Float_t pEnergy = 1577.;
92 gener->SetProjectile("A", 208, 82);
93 gener->SetTarget("P", 1, 1);
94 //
95 gener->SetEnergyCMS(TMath::Sqrt(208./82.) * 2* pEnergy);
96 gener->SetProjectileBeamEnergy(pEnergy);
97
98 // Pb-Pb
99 /* gener->SetProjectile("A", 208, 82);
100 gener->SetTarget("A", 208, 82);
101 gener->SetEnergyCMS(2760.);
102 //
103 gener->SetProcess(kDpmMb);
104 gener->SetImpactParameterRange(0., 100.);
105 //gener->SetFragmentProd(kTRUE);*/
106
107 gener->SetTrackingFlag(0);
108
109 return gener;
89083db0 110}
111
112
113
114
115
116
117
118
119
120
121
122