+AliESDcascade& AliESDcascade::operator=(const AliESDcascade& cas)
+{
+ //--------------------------------------------------------------------
+ // The assignment operator
+ //--------------------------------------------------------------------
+
+ if(this==&cas) return *this;
+ AliESDv0::operator=(cas);
+
+ fEffMassXi = cas.fEffMassXi;
+ fChi2Xi = cas.fChi2Xi;
+ fDcaXiDaughters = cas.fDcaXiDaughters;
+ fPdgCodeXi = cas.fPdgCodeXi;
+ fBachIdx = cas.fBachIdx;
+ for (int i=0; i<3; i++) {
+ fPosXi[i] = cas.fPosXi[i];
+ fBachMom[i] = cas.fBachMom[i];
+ }
+ for (int i=0; i<6; i++) {
+ fPosCovXi[i] = cas.fPosCovXi[i];
+ fBachMomCov[i] = cas.fBachMomCov[i];
+ }
+ return *this;
+}
+
+void AliESDcascade::Copy(TObject &obj) const {
+
+ // this overwrites the virtual TOBject::Copy()
+ // to allow run time copying without casting
+ // in AliESDEvent
+
+ if(this==&obj)return;
+ AliESDcascade *robj = dynamic_cast<AliESDcascade*>(&obj);
+ if(!robj)return; // not an AliESDcascade
+ *robj = *this;
+}
+
+AliESDcascade::~AliESDcascade() {
+ //--------------------------------------------------------------------
+ // Empty destructor
+ //--------------------------------------------------------------------
+}
+
+// Start with AliVParticle functions
+Double_t AliESDcascade::E() const {
+ //--------------------------------------------------------------------
+ // This gives the energy assuming the ChangeMassHypothesis was called
+ //--------------------------------------------------------------------
+ return E(fPdgCodeXi);
+}
+
+Double_t AliESDcascade::Y() const {
+ //--------------------------------------------------------------------
+ // This gives the energy assuming the ChangeMassHypothesis was called
+ //--------------------------------------------------------------------
+ return Y(fPdgCodeXi);
+}
+
+// Then extend AliVParticle functions
+Double_t AliESDcascade::E(Int_t pdg) const {
+ //--------------------------------------------------------------------
+ // This gives the energy with the particle hypothesis as argument
+ //--------------------------------------------------------------------
+ Double_t mass = TDatabasePDG::Instance()->GetParticle(pdg)->Mass();
+ return TMath::Sqrt(mass*mass+P()*P());
+}
+
+Double_t AliESDcascade::Y(Int_t pdg) const {
+ //--------------------------------------------------------------------
+ // This gives the rapidity with the particle hypothesis as argument
+ //--------------------------------------------------------------------
+ return 0.5*TMath::Log((E(pdg)+Pz())/(E(pdg)-Pz()+1.e-13));
+}
+
+// Now the functions for analysis consistency
+Double_t AliESDcascade::RapXi() const {
+ //--------------------------------------------------------------------
+ // This gives the pseudorapidity assuming a (Anti) Xi particle
+ //--------------------------------------------------------------------
+ return Y(kXiMinus);
+}
+
+Double_t AliESDcascade::RapOmega() const {
+ //--------------------------------------------------------------------
+ // This gives the pseudorapidity assuming a (Anti) Omega particle
+ //--------------------------------------------------------------------
+ return Y(kOmegaMinus);
+}
+
+Double_t AliESDcascade::AlphaXi() const {
+ //--------------------------------------------------------------------
+ // This gives the Armenteros-Podolanski alpha
+ //--------------------------------------------------------------------
+ TVector3 momBach(fBachMom[0],fBachMom[1],fBachMom[2]);
+ TVector3 momV0(fNmom[0]+fPmom[0],fNmom[1]+fPmom[1],fNmom[2]+fPmom[2]);
+ TVector3 momTot(Px(),Py(),Pz());
+
+ Double_t lQlBach = momBach.Dot(momTot)/momTot.Mag();
+ Double_t lQlV0 = momV0.Dot(momTot)/momTot.Mag();
+
+ return 1.-2./(1.+lQlBach/lQlV0);
+}
+
+Double_t AliESDcascade::PtArmXi() const {
+ //--------------------------------------------------------------------
+ // This gives the Armenteros-Podolanski ptarm
+ //--------------------------------------------------------------------
+ TVector3 momBach(fBachMom[0],fBachMom[1],fBachMom[2]);
+ TVector3 momTot(Px(),Py(),Pz());
+
+ return momBach.Perp(momTot);
+}
+
+// Then the older functions