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 AliGenIsajet::AliGenIsajet(const AliGenIsajet & Isajet)
68 //____________________________________________________________________________
69 AliGenIsajet::~AliGenIsajet()
72 // Standard destructor
74 if (fIsajet) delete fIsajet;
77 //____________________________________________________________________________
78 void AliGenIsajet::Init()
81 // Generator initialisation method
83 cout<<"isajet4"<<endl;
84 fIsajet->SetECM(2000);
85 cout<<"isajet5"<<endl;
86 fIsajet->SetJobtype("MINBIAS");
87 cout<<"isajet6"<<endl;
88 fIsajet->SetIDIN(0,1);
89 cout<<"isajet7"<<endl;
90 fIsajet->SetIDIN(1,1);
91 cout<<"isajet8"<<endl;
92 fIsajet->Initialise();
93 cout<<"isajet9"<<endl;
96 //____________________________________________________________________________
97 void AliGenIsajet::Generate()
100 Float_t polar[3] = {0,0,0};
101 Float_t origin[3]= {0,0,0};
102 Float_t origin0[3]= {0,0,0};
103 Float_t p[4], random[6];
104 Int_t j, kf, ks, imo;
110 static TClonesArray *particles;
111 //cout<<"generate"<<endl;
112 if(!particles) particles=new TClonesArray("TParticle",10000);
113 const Float_t kconv=0.001/2.999792458e8;
117 origin[0] = fVertex[0];
118 origin[1] = fVertex[1];
119 origin[2] = fVertex[2];
120 //cout<<"generate1"<<endl;
124 //cout<<"generate2"<<endl;
125 fIsajet->GenerateEvent();
126 //cout<<"generate3"<<endl;
128 fIsajet->ImportParticles(particles,"All");
129 //cout<<"generate4"<<endl;
130 Int_t np = particles->GetEntriesFast()-1;
131 //cout<<"generate51"<<endl;
132 if (np == 0 ) continue;
135 Int_t * newPos = new Int_t[np];
136 //cout<<"generate52"<<endl;
138 for (Int_t i = 0; i<np; i++) *(newPos+i)=-1;
139 //cout<<"generate5"<<endl;
140 for (Int_t i = 0; i<np; i++)
142 TParticle * iparticle = (TParticle *) particles->At(i);
143 //cout<<"generate6"<<endl;
144 imo = iparticle->GetFirstMother();
145 kf = iparticle->GetPdgCode();
146 ks = iparticle->GetStatusCode();
148 KinematicSelection(iparticle,0))
151 p[0]=iparticle->Px();
152 p[1]=iparticle->Py();
153 p[2]=iparticle->Pz();
154 p[3]=iparticle->Energy();
155 Float_t tof = kconv*iparticle->T();
156 Int_t iparent = (imo > -1) ? newPos[imo] : -1;
157 Int_t trackIt = (ks == 1) && fTrackIt;
158 PushTrack(trackIt, iparent, kf,
159 p[0], p[1], p[2], p[3],
160 origin[0], origin[1], origin[2],
162 polar[0], polar[1], polar[2],
163 kPPrimary, nt,1.,ks);
167 }// end of for: particle loop
168 if (newPos) delete[] newPos;
172 if (jev >= fNpart || fNpart == -1) {
173 fKineBias=Float_t(fNpart)/Float_t(fTrials);
178 SetHighWaterMark(nt);
180 AliGenIsajet& AliGenIsajet::operator=(const AliGenIsajet& rhs)
182 // Assignment operator
187 //____________________________________________________________________________
188 //____________________________________________________________________________