* 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;
+}
+///////////////////////////////////////////////////////////////////////////
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-// $Id: AliCollider.h,v 1.6 2003/12/18 09:28:06 nick Exp $
+// $Id: AliCollider.h,v 1.7 2004/01/12 08:23:22 nick Exp $
#include "TPythia6.h"
#include "TString.h"
Int_t IsSelected(); // Check whether (sub)event passed the selection criteria
void GetFractions(Float_t zp,Float_t ap,Float_t zt,Float_t at); // Determine various N-N collision fractions
+ TString GetPyname(Int_t kf); // Provide the correctly truncated Pythia particle name for PDG code kf
- ClassDef(AliCollider,6) // Pythia based universal physics event generator
+ ClassDef(AliCollider,7) // Pythia based universal physics event generator
};
#endif
via the TTimeStamp constructor. This is only possible with ROOT version 3.10/02 or later,
since for earlier versions the TTimeStamp::Set memberfunctions were erroneously declared
private.
+11-feb-2004 NvE In script "gcclib" the option -Wno-long-long added to prevent warnings from the usage
+ of type "long long" in Rtypes.h
+12-feb-2004 NvE In AliCollider::MakeEvent the statement "char* name" was replaced by "char name[16]" to
+ comply with TPythia6 convention. Also the hardcoded values of the p and n masses have
+ been replaced by masses obtained from the Pythia system via a call to GetPMAS().
+ Because of a bug in TPythia6 the function Pymass() couldn't be used directly.
+13-feb-2004 NvE AliCollider::GetPyname introduced to provide a correctly stripped character string
+ for the particle names. The name returned by TPythia6::Pyname contains trailing
+ characters due to an incorrect stripping process.
+ AliCollider::MakeEvent was updated accordingly to make use of this new memberfunction.
+#!/bin/sh
### Shell script to create a ROOT loadable GCC shared lib out of .cxx source code
###
### NvE 23-may-2000 UU-SAP Utrecht
### The option string for GCC shared lib compilation and linking ***
### For the GCC ROOT loadable shared lib the strict requirements are ***
### dropped to avoid many warnings from the rootcint generated code ***
-gccroot="-shared -g0 -ansi -pedantic -Wall -I$ROOTSYS/include -o $lib"
+gccroot="-shared -g0 -ansi -pedantic -Wall -Wno-long-long -I$ROOTSYS/include -o $lib"
#
echo "lib = " $lib
echo "gccroot = " $gccroot