+ fPythia8->Pythia8()->readString("SoftQCD:elastic = on");
+ fPythia8->Pythia8()->init();
+}
+
+//___________________________________________________________________________
+void AliDecayerPythia8::Decay(Int_t pdg, TLorentzVector* p)
+{
+ // Decay a single particle
+ ClearEvent();
+ AppendParticle(pdg, p);
+ Int_t idPart = fPythia8->Pythia8()->event[0].id();
+ fPythia8->Pythia8()->particleData.mayDecay(idPart,kTRUE);
+ fPythia8->Pythia8()->moreDecays();
+ if (fDebug > 0) fPythia8->EventListing();
+}
+
+//___________________________________________________________________________
+Int_t AliDecayerPythia8::ImportParticles(TClonesArray *particles)
+{
+ //import the decay products into particles array
+ const Float_t kconvT=0.001/2.999792458e8; // mm/c to seconds conversion
+ const Float_t kconvL=1./10; // mm to cm conversion
+ int np = fPythia8->ImportParticles(particles, "All");
+ // pythia assigns decay time in mm/c, convert to seconds
+ for (int ip=1;ip<np;ip++) {
+ TParticle* prod = (TParticle*)particles->At(ip);
+ if (!prod) continue;
+ prod->SetProductionVertex(prod->Vx()*kconvL,prod->Vy()*kconvL,prod->Vz()*kconvL,kconvT*prod->T());
+ }
+ return np;
+}
+
+
+void AliDecayerPythia8::Init()
+{
+// Initialisation
+//
+ if (!fgInit) {
+ fgInit = kTRUE;
+ // fPythia->SetDecayTable();
+ }
+
+// Switch on heavy flavor decays
+
+ Int_t j;
+ Int_t heavy[14] = {411, 421, 431, 4122, 4132, 4232, 4332, 511, 521, 531, 5122, 5132, 5232, 5332};
+// fPythia->ResetDecayTable();
+ for (j=0; j < 14; j++) {
+ if (fDecay == kNoDecayHeavy) {
+ fPythia8->ReadString(Form("%d:onMode = off", heavy[j]));
+ } else {
+ fPythia8->ReadString(Form("%d:onMode = on", heavy[j]));
+ }
+ }
+
+
+//...Switch off decay of pi0, K0S, Lambda, Sigma+-, Xi0-, Omega-.
+
+ if (fDecay != kNeutralPion) {
+ fPythia8->ReadString("111:onMode = off");
+ } else {
+ fPythia8->ReadString("111:onMode = on");
+ }
+
+ fPythia8->ReadString("310:onMode = off");
+ fPythia8->ReadString("3112:onMode = off");
+ fPythia8->ReadString("3212:onMode = off");
+ fPythia8->ReadString("3222:onMode = off");
+ fPythia8->ReadString("3312:onMode = off");
+ fPythia8->ReadString("3322:onMode = off");
+ fPythia8->ReadString("3334:onMode = off");
+// .. Force decay channels
+ ForceDecay();