+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
#include "AliGenerator.h"
#include "AliGenPythia.h"
#include "AliRun.h"
if (fProcess != mb) {
for (Int_t i = 0; i<np; i++) {
TParticle * iparticle = (TParticle *) particles->At(i);
- kf = iparticle->GetPdgCode();
+ kf = CheckPDGCode(iparticle->GetPdgCode());
fChildWeight=(fPythia->GetBraPart(kf))*fParentWeight;
//
// Parent
{
TParticle * ichild =
(TParticle *) particles->At(j-1);
- kf = ichild->GetPdgCode();
+ kf = CheckPDGCode(ichild->GetPdgCode());
//
//
if (ChildSelected(TMath::Abs(kf))) {
} else {
for (Int_t i = 0; i<np; i++) {
TParticle * iparticle = (TParticle *) particles->At(i);
- kf = iparticle->GetPdgCode();
+ kf = CheckPDGCode(iparticle->GetPdgCode());
Int_t ks = iparticle->GetStatusCode();
if (ks==1 && kf!=0 && KinematicSelection(iparticle)) {
nc++;
}
}
+Int_t AliGenPythia::CheckPDGCode(Int_t pdgcode)
+{
+//
+// If the particle is in a diffractive state, then take action accordigly
+ switch (pdgcode) {
+ case 110:
+ //rho_diff0 -- difficult to translate, return rho0
+ return 113;
+ case 210:
+ //pi_diffr+ -- change to pi+
+ return 211;
+ case 220:
+ //omega_di0 -- change to omega0
+ return 223;
+ case 330:
+ //phi_diff0 -- return phi0
+ return 333;
+ case 440:
+ //J/psi_di0 -- return J/psi
+ return 443;
+ case 2110:
+ //n_diffr -- return neutron
+ return 2112;
+ case 2210:
+ //p_diffr+ -- return proton
+ return 2212;
+ }
+ //non diffractive state -- return code unchanged
+ return pdgcode;
+}
+