* provided "as is" without express or implied warranty. *
**************************************************************************/
-// $Id: AliCollider.cxx,v 1.8 2003/12/18 09:28:06 nick Exp $
+// $Id: AliCollider.cxx,v 1.9 2004/01/12 08:23:22 nick Exp $
///////////////////////////////////////////////////////////////////////////
// Class AliCollider
//
//
//--- Author: Nick van Eijndhoven 22-nov-2002 Utrecht University
-//- Modified: NvE $Date: 2003/12/18 09:28:06 $ Utrecht University
+//- Modified: NvE $Date: 2004/01/12 08:23:22 $ Utrecht University
///////////////////////////////////////////////////////////////////////////
#include "AliCollider.h"
Int_t kf=0;
Float_t charge=0,mass=0;
- char* name="";
+ TString name;
Int_t ntypes=4;
{
kf=GetK(jpart,2);
charge=Pychge(kf)/3.;
- Pyname(kf,name);
mass=GetP(jpart,5);
+ name=GetPyname(kf);
// 3-momentum in GeV/c
v[0]=GetP(jpart,1);
t.Reset();
t.SetId(ntk);
t.SetParticleCode(kf);
- t.SetName(name);
+ t.SetName(name.Data());
t.SetCharge(charge);
t.SetMass(mass);
t.Set3Momentum(p);
// Include the spectator tracks in the event structure.
if (fNucl && specmode)
{
- Float_t pmass=0.938272;
- Float_t nmass=0.93956533;
v[0]=0;
v[1]=0;
v[2]=0;
{
kf=2212; // Projectile spectator protons
charge=Pychge(kf)/3.;
- mass=pmass;
- Pyname(kf,name);
+ mass=GetPMAS(Pycomp(kf),1);
+ name=GetPyname(kf);
for (Int_t iprojp=1; iprojp<=zp; iprojp++)
{
nspec++;
t.Reset();
t.SetId(-nspec);
t.SetParticleCode(kf);
- t.SetName(name);
+ t.SetName(name.Data());
t.SetTitle("Projectile spectator proton");
t.SetCharge(charge);
t.SetMass(mass);
kf=2112; // Projectile spectator neutrons
charge=Pychge(kf)/3.;
- mass=nmass;
- Pyname(kf,name);
+ mass=GetPMAS(Pycomp(kf),1);
+ name=GetPyname(kf);
for (Int_t iprojn=1; iprojn<=(ap-zp); iprojn++)
{
nspec++;
t.Reset();
t.SetId(-nspec);
t.SetParticleCode(kf);
- t.SetName(name);
+ t.SetName(name.Data());
t.SetTitle("Projectile spectator neutron");
t.SetCharge(charge);
t.SetMass(mass);
{
kf=2212; // Target spectator protons
charge=Pychge(kf)/3.;
- mass=pmass;
- Pyname(kf,name);
+ mass=GetPMAS(Pycomp(kf),1);
+ name=GetPyname(kf);
for (Int_t itargp=1; itargp<=zt; itargp++)
{
nspec++;
t.Reset();
t.SetId(-nspec);
t.SetParticleCode(kf);
- t.SetName(name);
+ t.SetName(name.Data());
t.SetTitle("Target spectator proton");
t.SetCharge(charge);
t.SetMass(mass);
kf=2112; // Target spectator neutrons
charge=Pychge(kf)/3.;
- mass=nmass;
- Pyname(kf,name);
+ mass=GetPMAS(Pycomp(kf),1);
+ name=GetPyname(kf);
for (Int_t itargn=1; itargn<=(at-zt); itargn++)
{
nspec++;
t.Reset();
t.SetId(-nspec);
t.SetParticleCode(kf);
- t.SetName(name);
+ t.SetName(name.Data());
t.SetTitle("Target spectator neutron");
t.SetCharge(charge);
t.SetMass(mass);
return fSpecpmin;
}
///////////////////////////////////////////////////////////////////////////
+TString AliCollider::GetPyname(Int_t kf)
+{
+// Provide the correctly truncated Pythia particle name for PGD code kf
+//
+// The TPythia6::Pyname returned name is copied into a TString and truncated
+// at the first blank to prevent funny trailing characters due to incorrect
+// stripping of empty characters in TPythia6::Pyname.
+// The truncation at the first blank is allowed due to the Pythia convention
+// that particle names never contain blanks.
+ char name[16];
+ TString sname;
+ Pyname(kf,name);
+ sname=name[0];
+ for (Int_t i=1; i<16; i++)
+ {
+ if (name[i]==' ') break;
+ sname=sname+name[i];
+ }
+ return sname;
+}
+///////////////////////////////////////////////////////////////////////////