//
// Origin: Iouri Belikov, IReS, Strasbourg, Jouri.Belikov@cern.ch
//-------------------------------------------------------------------------
-#include <Riostream.h>
#include <TMath.h>
#include "AliV0vertex.h"
ClassImp(AliV0vertex)
-AliV0vertex::AliV0vertex() : TObject() {
- //--------------------------------------------------------------------
- // Default constructor (K0s)
- //--------------------------------------------------------------------
- fPdgCode=kK0Short;
- fEffMass=0.497672;
- fChi2=1.e+33;
- fPos[0]=fPos[1]=fPos[2]=0.;
- fPosCov[0]=fPosCov[1]=fPosCov[2]=fPosCov[3]=fPosCov[4]=fPosCov[5]=0.;
-}
-
AliV0vertex::AliV0vertex(const AliITStrackV2 &n, const AliITStrackV2 &p) {
//--------------------------------------------------------------------
// Main constructor
//--------------------------------------------------------------------
+ for (Int_t i=0; i<6; i++) {
+ fPosCov[i]= 0.;
+ fNmomCov[i] = 0.;
+ fPmomCov[i] = 0.;
+ }
fPdgCode=kK0Short;
- fNlab=n.GetLabel(); fPlab=p.GetLabel();
+ fNidx=n.GetLabel(); fPidx=p.GetLabel(); //indices in the array of ESD tracks
//Trivial estimation of the vertex parameters
Double_t pt, phi, x, par[5];
fChi2=7.;
}
-/*
-Double_t AliV0vertex::ChangeMassHypothesis(Int_t code) {
- //--------------------------------------------------------------------
- // This function changes the mass hypothesis for this V0
- // and returns the "kinematical quality" of this hypothesis
- //--------------------------------------------------------------------
- Double_t nmass=0.13957, pmass=0.13957, mass=0.49767, des=0;
-
- fPdgCode=code;
-
- switch (code) {
- case kLambda0:
- nmass=0.13957; pmass=0.93827; mass=1.1157; des=0.9437-0.1723; break;
- case kLambda0Bar:
- pmass=0.13957; nmass=0.93827; mass=1.1157; des=0.1723-0.9437; break;
- case kK0Short:
- break;
- default:
- cerr<<"AliV0vertex::ChangeMassHypothesis: ";
- cerr<<"invalide PDG code ! Assuming K0s...\n";
- fPdgCode=kK0Short;
- break;
- }
-
- Double_t pxn=fNmom[0], pyn=fNmom[1], pzn=fNmom[2];
- Double_t pxp=fPmom[0], pyp=fPmom[1], pzp=fPmom[2];
-
- Double_t en=TMath::Sqrt(nmass*nmass + pxn*pxn + pyn*pyn + pzn*pzn);
- Double_t ep=TMath::Sqrt(pmass*pmass + pxp*pxp + pyp*pyp + pzp*pzp);
- Double_t pxl=pxn+pxp, pyl=pyn+pyp, pzl=pzn+pzp;
- Double_t pl=TMath::Sqrt(pxl*pxl + pyl*pyl + pzl*pzl);
-
- fEffMass=TMath::Sqrt((en+ep)*(en+ep)-pl*pl);
-
- Double_t gamma=(en+ep)/mass, betagamma=pl/mass;
- Double_t pln=(pxn*pxl + pyn*pyl + pzn*pzl)/pl;
- Double_t plp=(pxp*pxl + pyp*pyl + pzp*pzl)/pl;
- Double_t plps=gamma*plp - betagamma*ep;
-
- Double_t diff=2*gamma*plps + betagamma*des;
-
- return (plp-pln-diff);
-
-}
-*/
-Double_t AliV0vertex::ChangeMassHypothesis(Int_t code) {
- //--------------------------------------------------------------------
- // This function changes the mass hypothesis for this V0
- // and returns the "kinematical quality" of this hypothesis
- //--------------------------------------------------------------------
- Double_t nmass=0.13957, pmass=0.13957, mass=0.49767, ps=0.206;
- fPdgCode=code;
-
- switch (code) {
- case kLambda0:
- nmass=0.13957; pmass=0.93827; mass=1.1157; ps=0.101; break;
- case kLambda0Bar:
- pmass=0.13957; nmass=0.93827; mass=1.1157; ps=0.101; break;
- case kK0Short:
- break;
- default:
- cerr<<"AliV0vertex::ChangeMassHypothesis: ";
- cerr<<"invalide PDG code ! Assuming K0s...\n";
- fPdgCode=kK0Short;
- break;
- }
-
- Double_t pxn=fNmom[0], pyn=fNmom[1], pzn=fNmom[2];
- Double_t pxp=fPmom[0], pyp=fPmom[1], pzp=fPmom[2];
-
- Double_t en=TMath::Sqrt(nmass*nmass + pxn*pxn + pyn*pyn + pzn*pzn);
- Double_t ep=TMath::Sqrt(pmass*pmass + pxp*pxp + pyp*pyp + pzp*pzp);
- Double_t pxl=pxn+pxp, pyl=pyn+pyp, pzl=pzn+pzp;
- Double_t pl=TMath::Sqrt(pxl*pxl + pyl*pyl + pzl*pzl);
-
- fEffMass=TMath::Sqrt((en+ep)*(en+ep)-pl*pl);
-
- Double_t beta=pl/(en+ep);
- Double_t pln=(pxn*pxl + pyn*pyl + pzn*pzl)/pl;
- Double_t plp=(pxp*pxl + pyp*pyl + pzp*pzl)/pl;
-
- Double_t pt2=pxp*pxp + pyp*pyp + pzp*pzp - plp*plp;
-
- Double_t a=(plp-pln)/(plp+pln);
- a -= (pmass*pmass-nmass*nmass)/(mass*mass);
- a = 0.25*beta*beta*mass*mass*a*a + pt2;
-
- return (a - ps*ps);
-
-}
-
-void AliV0vertex::GetPxPyPz(Double_t &px, Double_t &py, Double_t &pz) const {
- //--------------------------------------------------------------------
- // This function returns V0's momentum (global)
- //--------------------------------------------------------------------
- px=fNmom[0]+fPmom[0];
- py=fNmom[1]+fPmom[1];
- pz=fNmom[2]+fPmom[2];
-}
-
-void AliV0vertex::GetXYZ(Double_t &x, Double_t &y, Double_t &z) const {
- //--------------------------------------------------------------------
- // This function returns V0's position (global)
- //--------------------------------------------------------------------
- x=fPos[0];
- y=fPos[1];
- z=fPos[2];
-}
-
-Double_t AliV0vertex::GetD(Double_t x0, Double_t y0, Double_t z0) const {
- //--------------------------------------------------------------------
- // This function returns V0's impact parameter
- //--------------------------------------------------------------------
- Double_t x=fPos[0],y=fPos[1],z=fPos[2];
- Double_t px=fNmom[0]+fPmom[0];
- Double_t py=fNmom[1]+fPmom[1];
- Double_t pz=fNmom[2]+fPmom[2];
-
- Double_t dx=(y0-y)*pz - (z0-z)*py;
- Double_t dy=(x0-x)*pz - (z0-z)*px;
- Double_t dz=(x0-x)*py - (y0-y)*px;
- Double_t d=TMath::Sqrt((dx*dx+dy*dy+dz*dz)/(px*px+py*py+pz*pz));
- return d;
-}