-AliESDcascade& AliESDcascade::operator=(const AliESDcascade& cas) {
- //assignment operator
- if (this != &cas) {
- AliESDv0::operator=(cas);
- fPdgCode = cas.fPdgCode;
- fEffMass = cas.fEffMass;
- fChi2Xi = cas.fChi2Xi;
- fDcaXiDaughters = cas.fDcaXiDaughters;
- 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);