// ------------------------------------------------------------------------- // ----- FairAsciiGenerator source file ----- // ----- Created 09/06/04 by V. Friese / D.Bertini ----- // ------------------------------------------------------------------------- #include "R3BAsciiIQMDGen.h" #include "FairPrimaryGenerator.h" #include "TDatabasePDG.h" #include "TVirtualMC.h" #include "TMath.h" #include #include "TRandom2.h" using std::cout; using std::endl; // ----- Default constructor ------------------------------------------ R3BAsciiIQMDGen::R3BAsciiIQMDGen() : fiqmd(NULL), fname("") { } //---------------------------------------------------------------------------- // ---------- Standard constructor --------------------------------------------- R3BAsciiIQMDGen::R3BAsciiIQMDGen(const char* filename) : fiqmd(NULL), fname(filename) { char c[518]; fiqmd=fopen(fname,"r"); if(fgets(c,200,fiqmd)){;} cout<SetSeed(eventID); phi_rplane = 2*TMath::Pi()*(tr2->Rndm()); crp = TMath::Cos(phi_rplane); srp = TMath::Sin(phi_rplane); //equal speed system used by IQMD //which is = NN CMS for symmetric system Ep=Ep/1000.; Ep=0.4; gammal = 1. + Ep/(amu); betal=TMath::Sqrt(1.-1./(gammal*gammal)); //CMS velocity beta=betal*ap*amu*gammal/(ap*amu*gammal+at*amu); gamma=1.0/(TMath::Sqrt(1-beta*beta)); //CMS rapidity Y=0.5*TMath::Log((1.+beta)/(1.-beta)); //the=TMath::ATanH(beta); if ( ap!=at ){ beta=betal*gammal/(gammal+1.); //CMS rapidity Y=0.5*TMath::Log((1.+beta)/(1.-beta)); //the=TMath::ATanH(beta); } //total number of particles totpart = at + ap + newpart; cout<<"evt# "<0.5){ innuc++; rmsx=rmsx+x[i]*x[i]; rmsy=rmsy+y[i]*y[i]; rmsz=rmsz+z[i]*z[i]; }//end on rms }//end on all particles //initialise event vectors sigx=rmsx/(1.0*innuc);//spread2 x sigy=rmsy/(1.0*innuc);//spread2 y sigz=rmsz/(1.0*innuc);//spread2 z //initialise cluster vectors for (j=0;j: Itype not specified in IQMD "<< imod[i]<<" taken as particle "<1&&nn[iclus[i]-1]==0)pdgID[iclus[i]-1]=0; }//end loop over all particles! for(k=0;k1){ x_c[k]=x_c[k]/(nn[k]*1.0); y_c[k]=y_c[k]/(nn[k]*1.0); z_c[k]=z_c[k]/(nn[k]*1.0); //construct pdg code number for cluster pdgID[k]=1000000000 +10000*nz[k] +10*nn[k]; //defining ion name_c[k]=Form("A%d_Z%d",nn[k],nz[k]); mass_c[k]=nn[k]*amu; } //pz_c[k]=-1.0*pz_c[k]; //cluster pt, E and Y pt_c = TMath::Sqrt(px_c[k]*px_c[k] + py_c[k]*py_c[k]); e_c = TMath::Sqrt(pt_c*pt_c + pz_c[k]*pz_c[k] + mass_c[k]*mass_c[k]); //gamma_c=1.+(e_c-mass_c[k])/mass_c[k]; //beta_c=TMath::Sqrt(1.-1./(gamma_c*gamma_c)); //the_c=TMath::ATanH(beta_c); Y_c = 0.5*TMath::Log((e_c+pz_c[k])/(e_c-pz_c[k])); //particle lab system rapidity Ylab_c=Y+Y_c; //particle E and pz in lab system et_c=TMath::Sqrt(pt_c*pt_c +mass_c[k]*mass_c[k]); //elab_c=gammal*(e_c-betal*pz_c[k]); //pzlab_c=gammal*(pz_c[k]-betal*e_c); elab_c=et_c*TMath::CosH(Ylab_c); pzlab_c=et_c*TMath::SinH(Ylab_c); //particle lab 4-vector p p4tot[0][k]=elab_c; p4tot[1][k]=px_c[k]; p4tot[2][k]=py_c[k]; p4tot[3][k]=pzlab_c; // evx=x_c[k]; // evy=y_c[k]; // evz=z_c[k]; cout<<"px= "<AddTrack(pdgID[k],p4tot[1][k],p4tot[2][k],p4tot[3][k],evx,evy,evz); }//end loop on clusters return kTRUE; }//end major if on event cout<<"end of file reached!"<