TObject(),
fPdgCode(kK0Short),
fEffMass(TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass()),
- fDcaDaughters(0),
- fChi2(1.e+33),
+ fDcaV0Daughters(0),
+ fChi2V0(1.e+33),
fNidx(0),
fPidx(0)
{
}
}
+AliESDv0::AliESDv0(const AliESDv0& rAliESDv0) :
+ TObject(rAliESDv0),
+ fPdgCode(rAliESDv0.fPdgCode),
+ fEffMass(rAliESDv0.fEffMass),
+ fDcaV0Daughters(rAliESDv0.fDcaV0Daughters),
+ fChi2V0(rAliESDv0.fChi2V0),
+ fNidx(rAliESDv0.fNidx),
+ fPidx(rAliESDv0.fPidx)
+{
+
+ for (int i=0; i<3; i++) {
+ fPos[i] = rAliESDv0.fPos[i];
+ fNmom[i] = rAliESDv0.fNmom[i];
+ fPmom[i] = rAliESDv0.fPmom[i];
+ }
+ for (int i=0; i<6; i++) {
+ fPosCov[i] = rAliESDv0.fPosCov[i];
+ fNmomCov[i] = rAliESDv0.fNmomCov[i];
+ fPmomCov[i] = rAliESDv0.fPmomCov[i];
+ }
+}
+
+
+AliESDv0& AliESDv0::operator=(const AliESDv0& rAliESDv0)
+{
+ if (this!=&rAliESDv0) {
+ TObject::operator=(rAliESDv0);
+ fPdgCode = rAliESDv0.fPdgCode;
+ fEffMass = rAliESDv0.fEffMass;
+ fDcaV0Daughters = rAliESDv0.fDcaV0Daughters;
+ fChi2V0 = rAliESDv0.fChi2V0;
+ fNidx = rAliESDv0.fNidx;
+ fPidx = rAliESDv0.fPidx;
+
+ for (int i=0; i<3; i++) {
+ fPos[i] = rAliESDv0.fPos[i];
+ fNmom[i] = rAliESDv0.fNmom[i];
+ fPmom[i] = rAliESDv0.fPmom[i];
+ }
+ for (int i=0; i<6; i++) {
+ fPosCov[i] = rAliESDv0.fPosCov[i];
+ fNmomCov[i] = rAliESDv0.fNmomCov[i];
+ fPmomCov[i] = rAliESDv0.fPmomCov[i];
+ }
+ }
+ return *this;
+}
+
AliESDv0::AliESDv0(const AliExternalTrackParam &t1, Int_t i1,
const AliExternalTrackParam &t2, Int_t i2) :
TObject(),
fPdgCode(kK0Short),
fEffMass(TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass()),
- fDcaDaughters(0),
- fChi2(1.e+33),
+ fDcaV0Daughters(0),
+ fChi2V0(1.e+33),
fNidx(i1),
fPidx(i2)
{
Double_t x1=x*cs - par[0]*sn;
Double_t y1=x*sn + par[0]*cs;
Double_t z1=par[1];
- Double_t sx1=sn*sn*t1.GetSigmaY2(), sy1=cs*cs*t1.GetSigmaY2();
+ const Double_t ss=0.0005*0.0005;//a kind of a residual misalignment precision
+ Double_t sx1=sn*sn*t1.GetSigmaY2()+ss, sy1=cs*cs*t1.GetSigmaY2()+ss;
Double_t x2=x*cs - par[0]*sn;
Double_t y2=x*sn + par[0]*cs;
Double_t z2=par[1];
- Double_t sx2=sn*sn*t2.GetSigmaY2(), sy2=cs*cs*t2.GetSigmaY2();
+ Double_t sx2=sn*sn*t2.GetSigmaY2()+ss, sy2=cs*cs*t2.GetSigmaY2()+ss;
Double_t sz1=t1.GetSigmaZ2(), sz2=t2.GetSigmaZ2();
- const Double_t ss=0.0005*0.0005;//a kind of a residual misalignment precision
- Double_t wx1=sx2/(sx1+sx2+ss), wx2=1.- wx1;
- Double_t wy1=sy2/(sy1+sy2+ss), wy2=1.- wy1;
+ Double_t wx1=sx2/(sx1+sx2), wx2=1.- wx1;
+ Double_t wy1=sy2/(sy1+sy2), wy2=1.- wy1;
Double_t wz1=sz2/(sz1+sz2), wz2=1.- wz1;
fPos[0]=wx1*x1 + wx2*x2; fPos[1]=wy1*y1 + wy2*y2; fPos[2]=wz1*z1 + wz2*z2;
fEffMass=TMath::Sqrt((e1+e2)*(e1+e2)-
(px1+px2)*(px1+px2)-(py1+py2)*(py1+py2)-(pz1+pz2)*(pz1+pz2));
- fChi2=7.;
+ fChi2V0=7.;
}
+AliESDv0::~AliESDv0(){
+ //--------------------------------------------------------------------
+ // Empty destructor
+ //--------------------------------------------------------------------
+}
+
+
+
Double_t AliESDv0::ChangeMassHypothesis(Int_t code) {
//--------------------------------------------------------------------
// This function changes the mass hypothesis for this V0
Double_t d=TMath::Sqrt((dx*dx+dy*dy+dz*dz)/(px*px+py*py+pz*pz));
return d;
}
+
+
+Double_t AliESDv0::GetV0CosineOfPointingAngle(Double_t& refPointX, Double_t& refPointY, Double_t& refPointZ) const {
+ // calculates the pointing angle of the V0 wrt a reference point
+
+ Double_t momV0[3]; //momentum of the V0
+ GetPxPyPz(momV0[0],momV0[1],momV0[2]);
+
+ Double_t deltaPos[3]; //vector between the reference point and the V0 vertex
+ deltaPos[0] = fPos[0] - refPointX;
+ deltaPos[1] = fPos[1] - refPointY;
+ deltaPos[2] = fPos[2] - refPointZ;
+
+ Double_t momV02 = momV0[0]*momV0[0] + momV0[1]*momV0[1] + momV0[2]*momV0[2];
+ Double_t deltaPos2 = deltaPos[0]*deltaPos[0] + deltaPos[1]*deltaPos[1] + deltaPos[2]*deltaPos[2];
+
+ Double_t cosinePointingAngle = (deltaPos[0]*momV0[0] +
+ deltaPos[1]*momV0[1] +
+ deltaPos[2]*momV0[2] ) /
+ TMath::Sqrt(momV02 * deltaPos2);
+
+ return cosinePointingAngle;
+}