1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
19 // Wrapper for ISAJET generator.
20 // It is using ISAJET to comunicate with fortarn code
26 #include <Riostream.h>
28 //#include "TSystem.h"
29 //#include "TUnixSystem.h"
30 #include <TParticle.h>
33 #include "AliIsajetRndm.h"
34 #include "AliGenIsajet.h"
39 ClassImp(AliGenIsajet)
41 AliGenIsajet::AliGenIsajet() :
48 //____________________________________________________________________________
49 AliGenIsajet::AliGenIsajet(Int_t npart)
55 fIsajet = new TIsajet();
56 AliIsajetRndm::SetIsajetRandom(GetRandom());
60 //____________________________________________________________________________
61 AliGenIsajet::~AliGenIsajet()
64 // Standard destructor
66 if (fIsajet) delete fIsajet;
69 //____________________________________________________________________________
70 void AliGenIsajet::Init()
73 // Generator initialisation method
75 cout<<"isajet4"<<endl;
76 fIsajet->SetECM(2000);
77 cout<<"isajet5"<<endl;
78 fIsajet->SetJobtype("MINBIAS");
79 cout<<"isajet6"<<endl;
80 fIsajet->SetIDIN(0,1);
81 cout<<"isajet7"<<endl;
82 fIsajet->SetIDIN(1,1);
83 cout<<"isajet8"<<endl;
84 fIsajet->Initialise();
85 cout<<"isajet9"<<endl;
88 //____________________________________________________________________________
89 void AliGenIsajet::Generate()
92 Float_t polar[3] = {0,0,0};
93 Float_t origin[3]= {0,0,0};
94 Float_t origin0[3]= {0,0,0};
95 Float_t p[4], random[6];
102 static TClonesArray *particles;
103 //cout<<"generate"<<endl;
104 if(!particles) particles=new TClonesArray("TParticle",10000);
105 const Float_t kconv=0.001/2.999792458e8;
109 origin[0] = fVertex[0];
110 origin[1] = fVertex[1];
111 origin[2] = fVertex[2];
112 //cout<<"generate1"<<endl;
116 //cout<<"generate2"<<endl;
117 fIsajet->GenerateEvent();
118 //cout<<"generate3"<<endl;
120 fIsajet->ImportParticles(particles,"All");
121 //cout<<"generate4"<<endl;
122 Int_t np = particles->GetEntriesFast()-1;
123 //cout<<"generate51"<<endl;
124 if (np == 0 ) continue;
127 Int_t * newPos = new Int_t[np];
128 //cout<<"generate52"<<endl;
130 for (Int_t i = 0; i<np; i++) *(newPos+i)=-1;
131 //cout<<"generate5"<<endl;
132 for (Int_t i = 0; i<np; i++)
134 TParticle * iparticle = (TParticle *) particles->At(i);
135 //cout<<"generate6"<<endl;
136 imo = iparticle->GetFirstMother();
137 kf = iparticle->GetPdgCode();
138 ks = iparticle->GetStatusCode();
140 KinematicSelection(iparticle,0))
143 p[0]=iparticle->Px();
144 p[1]=iparticle->Py();
145 p[2]=iparticle->Pz();
146 p[3]=iparticle->Energy();
147 Float_t tof = kconv*iparticle->T();
148 Int_t iparent = (imo > -1) ? newPos[imo] : -1;
149 Int_t trackIt = (ks == 1) && fTrackIt;
150 PushTrack(trackIt, iparent, kf,
151 p[0], p[1], p[2], p[3],
152 origin[0], origin[1], origin[2],
154 polar[0], polar[1], polar[2],
155 kPPrimary, nt,1.,ks);
159 }// end of for: particle loop
160 if (newPos) delete[] newPos;
164 if (jev >= fNpart || fNpart == -1) {
165 fKineBias=Float_t(fNpart)/Float_t(fTrials);
170 SetHighWaterMark(nt);
173 //____________________________________________________________________________