+ for (Int_t s = 0; s < ttrack->GetNumberOfPids(); s++)
+ {
+ if( pdgdb->GetParticle(ttrack->GetNthPid(s)) == 0x0 ) continue; //if particle has crazy PDG code (not known to our database)
+ if( Pass(ttrack->GetNthPid(s)) ) continue; //check if we are intersted with particles of this type
+ //if not take next partilce
+ AliHBTParticle* track = new AliHBTParticle(*ttrack);
+
+ //apart of setting PDG code of an incarnation
+ //it is necessary tu recalculate energy on the basis of
+ //new PDG code (mass) hypothesis
+ TParticlePDG* pdgp = pdgdb->GetParticle(ttrack->GetNthPid(s));
+ if (pdgp == 0x0)//PDG part corresponding to new incarnation
+ {
+ Error("ReadNext","Particle code unknown to PDG DB.");
+ continue;
+ }
+ Double_t mass = pdgp->Mass();//mass of new incarnation
+ Double_t tEtot = TMath::Sqrt( ttrack->Px()*ttrack->Px() +
+ ttrack->Py()*ttrack->Py() +
+ ttrack->Pz()*ttrack->Pz() +
+ mass*mass);//total energy of the new incarnation
+ //update Energy and Calc Mass
+ track->SetMomentum(ttrack->Px(),ttrack->Py(),ttrack->Pz(),tEtot);
+ track->SetCalcMass(mass);
+ track->SetPdgCode(ttrack->GetNthPid(s),ttrack->GetNthPidProb(s));
+
+ if( Pass(track) )