3 // Generation of kinematics tree which can be then used as an extrenal
5 // According to: $ALICE_ROOT/test/genkine/gen/fastGen.C
7 // By I. Hrivnacova, IPN Orsay
9 #if !defined(__CINT__) || defined(__MAKECINT__)
10 #include <Riostream.h>
12 #include <TStopwatch.h>
15 #include <TDatabasePDG.h>
16 #include <TParticle.h>
19 #include "AliGenerator.h"
21 #include "AliRunLoader.h"
24 #include "AliHeader.h"
25 #include "PYTHIA6/AliGenPythia.h"
26 #include "PYTHIA6/AliPythia.h"
29 void gen(Int_t nev = 1, char* filename = "galice.root")
32 // gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT");
33 gSystem->Load("liblhapdf.so"); // Parton density functions
34 gSystem->Load("libEGPythia6.so"); // TGenerator interface
35 gSystem->Load("libpythia6.so"); // Pythia
36 gSystem->Load("libAliPythia6.so"); // ALICE specific implementations
38 AliPDG::AddParticlesToPdgDataBase();
39 TDatabasePDG::Instance();
42 AliRunLoader* rl = AliRunLoader::Open("galice.root","FASTRUN","recreate");
44 rl->SetCompressionLevel(2);
45 rl->SetNumberOfEventsPerFile(nev);
46 rl->LoadKinematics("RECREATE");
48 gAlice->SetRunLoader(rl);
52 AliStack* stack = rl->Stack();
55 AliHeader* header = rl->GetHeader();
57 // Create and Initialize Generator
58 gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/ppbench/genPPbenchConfig.C");
59 AliGenerator* gener = genPPbenchConfig();
64 // Forbid some decays. Do it after gener->Init(0, because
65 // the initialization of the generator includes reading of the decay table.
74 for (Int_t iev = 0; iev < nev; iev++) {
76 cout <<"Event number "<< iev << endl;
80 rl->SetEventNumber(iev);
86 stack->ConnectTree(rl->TreeK());
88 cout << "Number of particles " << stack->GetNprimary() << endl;
91 header->SetNprimary(stack->GetNprimary());
92 header->SetNtrack(stack->GetNtrack());
96 header->SetStack(stack);
98 rl->WriteKinematics("OVERWRITE");
108 rl->WriteHeader("OVERWRITE");