2 #include "StarHijing.h"
5 #include "StarCallf77.h"
6 #include "StarGenerator/EVENT/StarGenAAEvent.h"
7 #include "StarGenerator/EVENT/StarGenParticle.h"
9 #include "StarGenerator/UTIL/StarRandom.h"
16 #include "TGenericTable.h"
20 TGenericTable *regtable(
const Char_t *type,
const Char_t *name,
void *address )
23 table->
Adopt( 1, address );
24 _maker -> AddData( table,
".const" );
38 StarHijing::StarHijing(
const Char_t *name ) :
StarGenerator(name)
44 regtable(
"HiParnt_t",
"hiparnt", (
void *)address_of_hiparnt() );
45 regtable(
"HiMain1_t",
"himain1", (
void *)address_of_himain1() );
47 regtable(
"Ludat3_t",
"ludat3", (
void *)address_of_hiparnt() );
56 mParticleCode[ 10551 ] = 551;
57 mParticleCode[ 20443 ] = 10443;
58 mParticleCode[ 30443 ] = 20443;
59 mParticleCode[ 30553 ] = 20553;
60 mParticleCode[ 4232 ] = 4332;
61 mParticleCode[ 4332 ] = 4232;
68 if ( jetid == 551 )
return 0;
69 if ( jetid == 10443 )
return 0;
72 if ( jetid==311 || jetid==-311 )
74 if ( rndm() > 0.5 )
return 130;
78 int id = mParticleCode[jetid];
94 return Lucomp( jetsetid );
105 for ( Int_t i=0; i<2; i++ ){
106 mNumberOfSpectatorProtons[i]=0;
107 mNumberOfSpectatorNeutrons[i]=0;
115 #define STABLE(x) ludat3().mdcy( Lucomp( x ), 1 ) = 0
156 cout <<
"StarHijing: Only CMS / FIXT frame supported for now. Kill me now." << endl;
164 map<TString,Int_t> A, Z; map<TString,string> type;
165 A[
"p"] =1; Z[
"p"] =1; type[
"p"] =
"P ";
166 A[
"n"] =1; Z[
"n"] =0; type[
"n"] =
"N ";
167 A[
"d"] =2; Z[
"d"] =1; type[
"d"] =
"A ";
168 A[
"He3"]=3; Z[
"He3"]=2; type[
"He3"]=
"A ";
171 A[
"Au"]=197; Z[
"Au"]=79; type[
"Au"]=
"A ";
172 A[
"Cu"]=63; Z[
"Cu"]=29; type[
"Cu"]=
"A ";
173 A[
"U"] =238; Z[
"U"]=92; type[
"U"] =
"A ";
174 A[
"Al"]=27; Z[
"Al"]=13; type[
"Al"]=
"A ";
176 A[
"proton"] =1; Z[
"proton"] =1; type[
"proton"] =
"P ";
177 A[
"neutron"] =1; Z[
"neutron"] =0; type[
"neutron"] =
"N ";
178 A[
"deuteron"] =2; Z[
"deuteron"] =1; type[
"deuteron"] =
"A ";
180 A[
"Zr96"]= 96; Z[
"Zr96"]=40; type[
"Zr96"]=
"A ";
181 A[
"Ru96"]= 96; Z[
"Ru96"]=44; type[
"Ru96"]=
"A ";
185 string frame =
mFrame.Data();
186 if(frame ==
"FIXT") frame=
"LAB";
188 float roots = TMath::Abs(
mRootS );
189 Hijset( roots, frame, type[
mBlue], type[
mYell], A[mBlue], Z[mBlue], A[mYell], Z[mYell] );
191 mNumberOfBeamProtons[0]=Z[
mBlue];
192 mNumberOfBeamProtons[1]=Z[
mYell];
193 mNumberOfBeamNeutrons[0]=A[
mBlue]-mNumberOfBeamProtons[0];
194 mNumberOfBeamNeutrons[1]=A[
mYell]-mNumberOfBeamProtons[1];
208 return StMaker::Init();
215 void hijing_(
const char *frame,
float &bmin,
float &bmax,
int sframe );
229 cout <<
"-----------------> Generate() <--------------------" << endl;
235 string frame =
"CMS ";
240 cout <<
mFrame.Data() <<
" " << frame.data() << endl;
245 hijing_( frame.c_str(), bmin, bmax, frame.size() );
252 for ( Int_t i=0; i<2; i++ ){
253 mNumberOfSpectatorProtons[i]=0;
254 mNumberOfSpectatorNeutrons[i]=0;
260 mNumberOfParticles =
himain1().natt;
263 for ( Int_t idx=1; idx<=mNumberOfParticles; idx++ )
267 Int_t
id = (
pdgid(jsid) );
281 Double_t M = Ulmass(jsid);
287 particles[idx] =
mEvent -> AddParticle( stat,
id, m1, m2, d1, d2, px, py, pz, E, M, vx, vy, vz, vt );
289 current = particles[m1];
301 if ( code == 0 || code == 1 )
303 if (
id == 2212 ) mNumberOfSpectatorProtons[0]++;
304 if (
id == 2112 ) mNumberOfSpectatorNeutrons[0]++;
307 if ( code == 10 || code == 11 )
309 if (
id == 2212 ) mNumberOfSpectatorProtons[1]++;
310 if (
id == 2112 ) mNumberOfSpectatorNeutrons[1]++;
330 event -> process = -999;
331 event -> subprocess = -999;
334 event -> xParton1 = -999;
335 event -> xParton2 = -999;
336 event -> xPdf1 = -999;
337 event -> xPdf2 = -999;
338 event -> Q2fac = -999;
339 event -> Q2ren = -999;
340 event -> valence1 = 0;
341 event -> valence2 = 0;
342 event -> sHat = -999;
343 event -> tHat = -999;
344 event -> uHat = -999;
345 event -> ptHat = -999;
346 event -> thetaHat = -999;
347 event -> phiHat = -999;
355 event -> numberOfBinary =
himain1().n0;
356 event -> numberOfParticipantNeutrons[0] = mNumberOfBeamNeutrons[0] - mNumberOfSpectatorNeutrons[0];
357 event -> numberOfParticipantNeutrons[1] = mNumberOfBeamNeutrons[1] - mNumberOfSpectatorNeutrons[1];
358 event -> numberOfParticipantProtons[0] = mNumberOfBeamProtons[0] - mNumberOfSpectatorProtons[0];
359 event -> numberOfParticipantProtons[1] = mNumberOfBeamProtons[1] - mNumberOfSpectatorProtons[1];
360 event -> numberRejected = -999;
361 event -> numberWounded[0] =
himain1().nwounded_blue;
362 event -> numberWounded[1] =
himain1().nwounded_yell;
363 event -> numberOfJets =
himain1().jatt;
365 event -> weight = 1.0;
Double_t mRootS
CMS energy or incident beam momentum for fixed target collisions.
static StarRandom & Instance()
Obtain the single instance of the random number generator.
TString mYell
Name of the yellow beam particle (-z)
void FillAA(StarGenEvent *event)
(Optional) Method to fill a AA event
Event record tailored to heavy ion collisions.
Yet another particle class.
ABC for defining event generator interfaces.
StarGenEvent * mEvent
Generated event.
Double_t mImpactMin
Minimum impact parameter in a HI collision.
Int_t LuComp(Int_t jetsetid)
HiMain2_t & himain2()
Returns a refernece to the hijing main2 block.
Double_t mImpactMax
Maximum impact parameter in a HI collision.
Double_t mDirect
Direction (+1 = W, -1 = E) of the beam in fixted target mode.
Double_t flat() const
Return a random number uniformly distributed between 0 and 1.
HiParnt_t & hiparnt()
Returns a reference to the hijing parameters.
HiMain1_t & himain1()
Returns a reference to the hijing main1 block.
Interface to the HIJING event generator.
Base class for event records.
void SetLastDaughter(Int_t last)
Set the last daughter particle in the array of particles.
Int_t GetLastDaughter()
Get the last daughter particle.
void SetFirstDaughter(Int_t first)
Set the first daughter particle in the array of particles.
Int_t pdgid(const Int_t &code)
TString mFrame
Frame of the collision, i.e. CMS, FIXT, 3MOM, 4MOM, 5MOM.
TString mBlue
Name of the blue beam particle (+z)
Int_t GetFirstDaughter()
Get the first daughter particle.
virtual void Adopt(Int_t n, void *array)
float & vatt(int i, int j)
float & patt(int i, int j)